/* =========================================================
   MOBILE FIRST: everything up top is for phones.
   The @media (min-width: ...) blocks at the bottom adjust
   the layout for bigger screens.
   ========================================================= */

/* ---------- Colors & font (change these to restyle everything) ---------- */
:root {
  --sky-top: #2f8fdc;
  --sky-bottom: #c9ecff;
  --grass: #7ccc4f;
  --ink: #1b2b3a;
  --link: #fb6f92;
  --muted: #5b6b7a;
  --glass: rgba(255, 255, 255, 0.72);

  /* Windows 7-era system fonts, with fallbacks for Mac/Linux/Android */
  --font: "Segoe UI", "Trebuchet MS", Tahoma, Verdana, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.5;
}

/* The sky + green hill. A fixed layer behind everything
   (more reliable on phones than background-attachment: fixed). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
      url("images/heart.svg") center / min(90vw, 80svh) no-repeat,
    linear-gradient(180deg, #ffd6e7, #fff0f6);
}

img, video { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid #ffb400;
  outline-offset: 3px;
}

/* ---------- Background bubbles ---------- */
.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bubbles span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: radial-gradient(circle at 30% 30%,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.05) 70%);
}

.bubbles span:nth-child(1) { width: 90px;  height: 90px;  left: 5%;  top: 12%; }
.bubbles span:nth-child(2) { width: 40px;  height: 40px;  left: 80%; top: 8%;  }
.bubbles span:nth-child(3) { width: 140px; height: 140px; left: 70%; top: 45%; }
.bubbles span:nth-child(4) { width: 60px;  height: 60px;  left: 12%; top: 60%; }
.bubbles span:nth-child(5) { width: 30px;  height: 30px;  left: 45%; top: 25%; }
.bubbles span:nth-child(6) { width: 70px;  height: 70px;  left: 30%; top: 82%; }

/* ---------- Page layout ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 0.75rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- Glass "windows" (every section) ---------- */
.window {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(10, 60, 110, 0.25);
  overflow: hidden;
}

/* The glossy title bar: the hard color stop at 50%/51% is
   what creates that classic "shiny plastic" look */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  background: linear-gradient(180deg,
    #ffe5ec 0%, #ffb3c6 50%, #ffb3c6 51%, #ffe5ec 100%);
  border-bottom: 1px solid rgba(214, 70, 120, 0.35);
}

.titlebar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.window-body { padding: 1rem; }

/* ---------- Glossy buttons ---------- */
.btn {
  --top: #ffc2d1;       /* gradient top */
  --bottom: #ffb3c6;    /* gradient bottom */
  --border: #FF5c89;
  --text: #fff;
  --glow: rgba(0, 149, 255, 0.18);

  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  min-height: 44px;
  padding: 10px 26px;
  border: 1px solid var(--border);
  border-radius: 999px;   /* fully rounded ends; try 14px for softer corners */
  background: linear-gradient(180deg, var(--top), var(--bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),   /* thin shine along the top edge */
    0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

/* Hover (mouse only): lift slightly and glow */
@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 0 0 4px var(--glow),
      0 4px 10px rgba(0, 0, 0, 0.1);
  }
}

/* Tap / click: press in */
.btn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* Keyboard focus: same soft glow ring */
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--glow);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  filter: none;
}

.btn-small {
  font-size: 0.85rem;
  min-height: 34px;
  padding: 0.3rem 0.9rem;
}
/* ---------- Profile ---------- */
.profile .window-body { text-align: center; }

.avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  object-fit: cover;
  border: 4px solid #fff;
  border-radius: 12px;
  background: #dff3ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile h1 {
  margin: 0.6rem 0 0.25rem;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  line-height: 1.1;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  max-width: 24rem;
  margin: 1rem auto;
  text-align: left;
  font-size: 0.95rem;
}

.details dt { color: var(--muted); }
.details dd { margin: 0; }

.counter { margin: 1rem 0; }

.counter strong {
  color: var(--link);
  font-variant-numeric: tabular-nums; /* stops numbers jiggling as they change */
}

/* ---------- Wall posts ---------- */
.post {
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.post:first-child { border-top: 0; padding-top: 0; }
.post:last-child { padding-bottom: 0; }
.post p { margin: 0 0 0.5rem; }

.post-author {
  font-weight: 700;
  color: var(--link);
}

.post-photo {
  width: 100%;
  margin: 0.25rem 0 0.5rem;
  border-radius: 6px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.post .post-meta { margin-bottom: 0; }

.like {
  font: inherit;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0.5rem 0;
  cursor: pointer;
}

.like:hover { text-decoration: underline; }

/* ---------- Photo grid ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.photo {
  position: relative;
  padding: 4px;
  background: #fff;
  border: 0;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.photo img {
  width: 100%;
  aspect-ratio: 1;       /* square, like early Instagram */
  object-fit: cover;     /* crops instead of squishing */
}

/* Vignette (dark corners) over each photo */
.photo::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  background: radial-gradient(circle, transparent 55%, rgba(40, 20, 0, 0.3));
}

/* Old-school filter looks. Mix and match! */
.f-warm { filter: sepia(0.25) saturate(1.3) contrast(1.05); }
.f-fade { filter: contrast(0.9) brightness(1.08) saturate(0.8); }
.f-cool { filter: hue-rotate(-10deg) saturate(1.1) contrast(1.1); }

/* ---------- Vines ---------- */
.vine-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.vine {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.vine video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.vine .sound {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
}

/* ---------- Chat ---------- */
.chat .window-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.chat-log {
  list-style: none;
  margin: 0;
  padding: 0.75rem;
  min-height: 7rem;
  max-height: 22rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: #fff;
  border: 1px solid #c8dcec;
  border-radius: 6px;
}

.chat-empty,
.chat-system {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-system { font-style: italic; }



.msg-name {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.msg-text {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  background: #eaf5fd;
  border: 1px solid #cfe3f2;
  border-radius: 10px;
}

.typing {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* The nudge shake. JS adds this class, then removes it. */
.nudging { animation: nudge 0.5s; }

@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 3px); }
  40% { transform: translate(8px, -3px); }
  60% { transform: translate(-6px, -2px); }
  80% { transform: translate(6px, 2px); }
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  font-size: 0.85rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.footer p {margin: 0;}
/* ---------- Photo viewer ---------- */
.lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}

.lightbox::backdrop { background: rgba(0, 20, 50, 0.85); }

.lightbox img {
  max-width: 92vw;
  max-height: 80vh;
  border: 6px solid #fff;
  border-radius: 4px;
}

.lightbox .btn { margin-top: 0.75rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bubbles span { animation: bob 6s ease-in-out infinite alternate; }
  .bubbles span:nth-child(even) { animation-duration: 8s; }
  .bubbles span:nth-child(3n) { animation-delay: -3s; }
}

@keyframes bob {
  to { transform: translateY(-24px); }
}

/* =========================================================
   BIGGER SCREENS
   ========================================================= */

/* Tablets / small laptops: more columns */
@media (min-width: 700px) {
  .page {
    max-width: 760px;
    padding: 2rem 1.5rem 4rem;
    gap: 1.75rem;
  }
  .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
  .vine-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Desktop: profile becomes a sticky sidebar, like old profile pages */
@media (min-width: 1000px) {
  .page {
    max-width: 1100px;
    display: grid;
    grid-template-columns: 340px 1fr;
    align-items: start;
  }
  .page > * { grid-column: 2; }
  .profile {
    grid-column: 1;
    grid-row: 1 / span 5;
    position: sticky;
    top: 1.5rem;
  }
}

.chat{
    position: relative;
    overflow: visible;
}

.chat .titlebar{
    border-radius: 12px 12px 0 0;
}
.bg-character {
  position:absolute;
  right: -30px;
  bottom: -44px;
  width: clamp(70px, 22vw, 160px);
}

/* Gentle floating, skipped for people with "reduce motion" on */
@media (prefers-reduced-motion: no-preference) {
  .bg-character { animation: float 4s ease-in-out infinite alternate; }
}

@keyframes float {
  to { transform: translateY(-16px) rotate(-3deg); }
}