/* =========================================================================
   for you, my love  ·  design system
   Coquette done the editorial way: muted, warm, hand-made. Not bubblegum.
   Five colours, two faces of type, real texture. That restraint is the whole
   point: it reads as considered, not generated.
   ========================================================================= */

:root {
  /* Palette: ballet pink, butter cream, dusty rose, deep cherry, warm ink.
     Named and restrained. No purple-to-pink gradient anywhere (the #1 AI tell). */
  --paper:    #FBF3EC;   /* warm off-white ground */
  --paper-2:  #FFFBF6;   /* card / polaroid surface */
  --blush:    #F6D5D9;   /* ballet pink */
  --rose:     #DCA0A8;   /* dusty rose */
  --cherry:   #A52A37;   /* deep cherry accent, used sparingly */
  --cherry-2: #C9485A;   /* brighter cherry for fills */
  --ink:      #43302E;   /* warm dark brown, never pure black */
  --ink-soft: #6E5856;
  --gold:     #C9A86A;   /* champagne hairline */

  --night:    #1B1830;   /* moon scene sky */
  --night-2:  #322B52;

  --shadow-soft: 0 18px 40px -22px rgba(67, 48, 46, 0.45);
  --shadow-card: 0 22px 50px -26px rgba(67, 48, 46, 0.55);

  /* Easing. Emil's rule: ease-out on enter, fast, intentional. These two
     curves do almost all the work. The "back" curve adds a little life. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.4, 0.5, 1);

  --serif: "Fraunces", Georgia, serif;
  --hand: "Caveat", "Segoe Script", cursive;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  height: -webkit-fill-available;   /* iOS Safari: area below the address bar */
  height: 100dvh;                   /* dynamic viewport, tracks the bar live */
  width: 100%;
  overflow: hidden;            /* the storybook owns the viewport */
  overscroll-behavior: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;   /* stop iOS auto-inflating our type */
  text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;      /* no long-press save/copy menu */
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;       /* no 300ms delay, no double-tap zoom */
}

/* ---- texture layers --------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 60;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 18%, transparent 55%, rgba(120, 80, 78, 0.10) 100%);
}

/* ---- stage + scenes --------------------------------------------------- */

.stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 2;
  display: grid;
  place-items: center;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* NOT justify-content:center. Tall content + forced centering is what made
     photos pile onto titles. The ::before/::after auto-margins below center
     the content when it fits, and let it scroll when it does not. */
  justify-content: flex-start;
  overflow-x: hidden;           /* the fanned 3D covers can spill; never scroll sideways */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(24px + var(--safe-top)) 26px calc(52px + var(--safe-bot));
  text-align: center;
  will-change: transform, opacity, filter;
}
.scene::before, .scene::after { content: ""; flex: 0 0 0; }
.scene::before { margin-top: auto; }
.scene::after { margin-bottom: auto; }
/* never let flex squash items into each other; tall scenes scroll instead */
.scene > * { flex-shrink: 0; }

/* Stagger targets start hidden; the engine animates them in. */
.scene [data-rise] { opacity: 0; }

.eyebrow {
  font-family: var(--hand);
  font-size: 1.55rem;
  color: var(--cherry-2);
  line-height: 1;
  margin-bottom: 0.4rem;
  transform: rotate(-3deg);
}

.scene h1 {
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 120;
}

.scene h2 {
  font-weight: 380;
  font-size: clamp(2rem, 8.5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.scene .body {
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 1rem auto 0;
  font-weight: 340;
}

.scene .caption {
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--ink);
  max-width: 22ch;
  line-height: 1.25;
  margin-top: 0.9rem;
}

.date-chip {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--rose);
}

/* cover dedication to her + your byline */
.dedication {
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--cherry-2);
  max-width: 22ch;
  margin: 1rem auto 0;
}
.credit {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  color: var(--rose);
  margin-top: 1.8rem;
}

/* ---- polaroid / taped photo ------------------------------------------ */

/* the rise wrapper owns the spacing so the tape (which overhangs the frame by
   14px) never touches the title above it */
.photo-rise {
  margin-top: 1.4rem;
  padding-top: 16px;
  flex-shrink: 0;
}

.photo {
  position: relative;
  background: var(--paper-2);
  padding: 12px 12px 46px;
  border-radius: 3px;
  box-shadow: var(--shadow-card);
  transform: rotate(-2.2deg);
  /* shrinks on short screens instead of colliding with the text */
  width: min(74vw, 320px, 40vh);
}
.photo:nth-of-type(even) { transform: rotate(1.8deg); }

.photo img,
.photo .ph {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  background: linear-gradient(145deg, var(--blush), var(--rose));
}

/* Placeholder face so empty slots still look intentional. */
.photo .ph {
  display: grid;
  place-items: center;
  color: var(--paper-2);
  font-family: var(--hand);
  font-size: 1.2rem;
  text-align: center;
  padding: 1rem;
}

.photo .tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(220, 160, 168, 0.42);
  border-left: 1px dashed rgba(255,255,255,0.5);
  border-right: 1px dashed rgba(255,255,255,0.5);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}

.photo .photo-cap {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink);
}

/* two photos, tossed down overlapping like a little scrapbook moment */
.photo-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.photo-pair .photo {
  width: min(48vw, 188px, 32vh);
  margin: 0 -16px;
  animation: none;                 /* replaced by the paired floats below */
}
.photo-pair .photo:first-child {
  transform: rotate(-5deg);
  z-index: 1;
  animation: pairfloatL 6.6s ease-in-out infinite;
}
.photo-pair .photo:last-child {
  transform: rotate(4deg) translateY(20px);
  z-index: 2;
  animation: pairfloatR 7.3s ease-in-out infinite;
}
@keyframes pairfloatL {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(-3.8deg) translateY(-8px); }
}
@keyframes pairfloatR {
  0%, 100% { transform: rotate(4deg) translateY(20px); }
  50% { transform: rotate(2.8deg) translateY(11px); }
}

/* ---- decorations (inline SVG bows / hearts / etc.) -------------------- */

.decor {
  display: inline-block;
  line-height: 0;
}
.decor svg { display: block; }
.decor.bow svg { width: 78px; color: var(--cherry-2); }
.decor.heart svg { width: 44px; color: var(--cherry); }
.decor.flower svg { width: 64px; color: var(--rose); }
.decor.cherry svg { width: 56px; color: var(--cherry); }

.scene-decor-top { margin-bottom: 1.1rem; }
.scene-decor-bottom { margin-top: 1.2rem; }

/* ---- buttons ---------------------------------------------------------- */

.btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 420;
  letter-spacing: 0.02em;
  color: var(--paper-2);
  background: var(--cherry);
  padding: 0.85rem 2.1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s var(--ease-out), background 0.2s ease;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.94); }       /* squish */
.btn.ghost {
  background: transparent;
  color: var(--cherry);
  box-shadow: inset 0 0 0 1.4px var(--rose);
}

/* The recurring "tap to continue" affordance: a tappable bow. */
.advance {
  margin-top: 1.6rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cherry-2);
}
.advance .hint {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.advance .decor svg { width: 60px; }

/* ---- progress dots ---------------------------------------------------- */

.progress {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(14px + var(--safe-bot));
  z-index: 40;
  display: flex;
  gap: 9px;
  justify-content: center;
  pointer-events: none;
}
.progress .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rose);
  opacity: 0.35;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-back);
}
.progress .dot.is-on { opacity: 1; transform: scale(1.5); background: var(--cherry); }
.progress.on-night .dot { background: rgba(255,255,255,0.5); }
.progress.on-night .dot.is-on { background: #fff; }

/* ---- heart iris transition -------------------------------------------- */

.wipe {
  position: fixed;
  inset: 0;
  z-index: 58;            /* above everything but the grain texture */
  pointer-events: none;
}
.wipe svg { width: 100%; height: 100%; display: block; }
.wipe-heart {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  /* a soft glow so the edge feathers instead of cutting hard */
  filter: drop-shadow(0 0 12px rgba(201, 72, 90, 0.45));
}

/* ---- falling decorative layer ---------------------------------------- */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}
.fx-layer .fx-bit {
  position: absolute;
  top: -8%;
  will-change: transform, opacity;
}
.fx-layer .fx-bit svg { display: block; }
.fx-layer .confetti {
  position: absolute;
  top: -8%;
  will-change: transform, opacity;
}

/* ---- music control ---------------------------------------------------- */

.music-toggle {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(34px + var(--safe-bot));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 14px 6px 6px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  color: var(--cherry);
  cursor: pointer;
  transition: opacity 0.4s var(--ease-out), transform 0.2s var(--ease-out);
}
.music-toggle.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }
.music-toggle:active { transform: scale(0.95); }
.music-disc { width: 26px; height: 26px; display: block; }
.music-disc svg { width: 100%; height: 100%; }
.music-toggle.is-playing .music-disc { animation: spin 3.6s linear infinite; }
.music-toggle.is-muted { color: var(--ink-soft); opacity: 0.7; }
.music-label {
  font-family: var(--hand);
  font-size: 1.05rem;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- night / moon scene ---------------------------------------------- */

.scene.night {
  background:
    radial-gradient(140% 100% at 70% 12%, var(--night-2) 0%, var(--night) 55%, #110f22 100%);
  color: #F3ECFF;
}
.scene.night h1, .scene.night h2 { color: #fff; }
.scene.night .body { color: rgba(243, 236, 255, 0.72); }
.scene.night .date-chip { color: var(--blush); }

.starfield { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: twinkle var(--tw, 4s) ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: 0.2; } 50% { opacity: 0.95; } }

.moon-wrap { position: relative; margin: 0.4rem 0 0.2rem; }
.moon-wrap svg { display: block; filter: drop-shadow(0 0 26px rgba(246, 213, 217, 0.35)); }
.moon-time {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.04rem;
  letter-spacing: 0.04em;
  color: var(--blush);
  margin-top: 0.6rem;
}
.moon-illum {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: rgba(243,236,255,0.65);
}

/* ---- games (shared) --------------------------------------------------- */

.game-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 360;
  font-size: clamp(1.5rem, 6vw, 2rem);
  margin-bottom: 0.3rem;
}
.game-sub {
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

/* memory match */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  width: min(86vw, 360px);
  perspective: 800px;
}
.mcard {
  position: relative;
  aspect-ratio: 3 / 4;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease-back);
  border-radius: 12px;
}
.mcard.flipped, .mcard.matched { transform: rotateY(180deg); }
.mcard.matched { opacity: 0.55; }
.mcard .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}
.mcard .back {
  background: linear-gradient(150deg, var(--cherry-2), var(--cherry));
  color: var(--paper-2);
}
.mcard .back .decor svg { width: 30px; }
.mcard .front {
  background: var(--paper-2);
  transform: rotateY(180deg);
  color: var(--cherry);
}
.mcard .front .decor svg { width: 42px; }
.mcard .front.photo-face { overflow: hidden; }
.mcard .front.photo-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  pointer-events: none;
}

/* scratch-off */
.scratch-stage {
  position: relative;
  width: min(80vw, 300px);
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--paper-2);
}
.scratch-reveal {
  position: absolute;
  inset: 0;
  z-index: 0;                 /* contain the photo/scrim/message layering */
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.4rem;
  background: linear-gradient(160deg, var(--blush), var(--rose));
}
.scratch-reveal .msg {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1.2;
}
.scratch-reveal img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* photo + message together: photo behind, a soft scrim, words on top */
.scratch-reveal.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40, 18, 24, 0.22) 0%, rgba(40, 18, 24, 0.62) 100%);
  z-index: 1;
}
.scratch-reveal.has-photo .msg {
  position: relative;
  z-index: 2;
  align-self: end;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.06rem;
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
/* the foil must sit ABOVE the photo/message (which carry their own z-index),
   so it actually covers them and receives the scratch touches */
.scratch-canvas { position: absolute; inset: 0; z-index: 5; touch-action: none; cursor: grab; }

/* quiz */
.quiz-card { width: min(86vw, 380px); }
.quiz-q {
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 380;
  margin-bottom: 1.1rem;
}
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  font-family: var(--serif);
  font-size: 1.02rem;
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  border: 1.4px solid var(--blush);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s var(--ease-out), border-color 0.2s, background 0.2s;
}
.quiz-opt:active { transform: scale(0.97); }
.quiz-opt.right { border-color: var(--cherry); background: #F7E7E3; }
.quiz-opt.wrong { border-color: var(--rose); animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.quiz-progress {
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--rose);
  margin-top: 1rem;
}

/* letter / note */
.letter-text {
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.42;
  color: var(--ink);
  max-width: 26ch;
  min-height: 8rem;
}
.scene.night .letter-text { color: #F3ECFF; }
.caret { color: var(--rose); font-family: var(--serif); }

/* ---- days counter ----------------------------------------------------- */
.counter-num {
  font-family: var(--serif);
  font-weight: 360;
  font-size: clamp(3.6rem, 19vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--cherry);
  font-variation-settings: "opsz" 120;
}
.counter-unit {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

/* ---- reasons card stack ----------------------------------------------- */
.reason-stack {
  position: relative;
  width: min(82vw, 330px);
  height: 250px;
  margin: 0.6rem auto 0.2rem;
}
.reason-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.6rem;
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 50% 0%, #fff 0%, var(--paper-2) 70%);
  box-shadow: var(--shadow-card);
  border: 1.4px solid var(--blush);
  cursor: pointer;
  will-change: transform, opacity;
}
.reason-card .rc-text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 360;
  font-size: 1.32rem;
  line-height: 1.35;
  color: var(--ink);
}
.reason-card .rc-bow {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
}
.reason-card .rc-bow svg { width: 50px; color: var(--cherry-2); }
.reason-card .reason-count {
  position: absolute;
  bottom: 14px; left: 0; right: 0;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--rose);
}

/* ---- star-connect constellation --------------------------------------- */
.constellation {
  position: relative;
  width: min(84vw, 320px);
  height: 300px;
  margin: 0.4rem auto;
}
.constellation .lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.constellation .line {
  stroke: #FFE9B0;
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(255, 224, 150, 0.9));
}
.cstar {
  position: absolute;
  width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  border: none; background: none; padding: 0; cursor: pointer;
}
.cstar::before {
  content: "";
  position: absolute; inset: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.7);
  transition: all 0.35s var(--ease-out);
}
.cstar.next::before {
  inset: 6px;
  background: var(--blush);
  box-shadow: 0 0 18px 5px rgba(246, 213, 217, 0.9);
  animation: starpulse 1.15s ease-in-out infinite;
}
.cstar.lit::before {
  inset: 7px;
  background: #FFF1C4;
  box-shadow: 0 0 16px 4px rgba(255, 226, 150, 0.95);
}
.constellation.complete { animation: heartglow 1.4s ease-in-out; }
@keyframes starpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.55); } }
@keyframes heartglow { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 22px rgba(255, 200, 140, 0.7)); } }

/* ---- now playing ------------------------------------------------------ */
.player {
  width: min(86vw, 366px);
  background: linear-gradient(160deg, #fff, var(--paper-2));
  border-radius: 24px;
  padding: 1rem 1.15rem 1.25rem;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "art meta play" "bar bar bar" "times times times";
  gap: 0.55rem 0.85rem;
  align-items: center;
  border: 1.4px solid rgba(246, 213, 217, 0.6);
}
.player-art {
  grid-area: art;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--blush), var(--rose));
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
}
.player-art svg { width: 30px; color: #fff; }
.player-art.spin { animation: artbeat 1.8s ease-in-out infinite; }
@keyframes artbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.player-meta { grid-area: meta; text-align: left; overflow: hidden; }
.player-title {
  font-family: var(--serif);
  font-size: 1.16rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-artist { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--ink-soft); }
.player-play {
  grid-area: play;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--cherry);
  color: var(--paper-2);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s var(--ease-out);
}
.player-play:active { transform: scale(0.9); }
.player-bar { grid-area: bar; height: 6px; border-radius: 99px; background: var(--blush); overflow: hidden; margin-top: 0.45rem; }
.player-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--rose), var(--cherry)); border-radius: 99px; transition: width 0.25s linear; }
.player-times { grid-area: times; display: flex; justify-content: space-between; font-family: var(--serif); font-size: 0.76rem; color: var(--ink-soft); }
.player-lyric {
  font-family: var(--hand);
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--ink);
  max-width: 24ch;
  margin: 1.2rem auto 0;
}

/* ---- now playing: 3D cover-flow --------------------------------------- */
.player-stage {
  position: relative;
  width: min(88vw, 360px);
  height: clamp(330px, 52vh, 400px);
  margin: 0.3rem auto 0;
  perspective: 1100px;
  perspective-origin: 50% 42%;
  transform-style: preserve-3d;
  touch-action: pan-y;            /* horizontal drags drive the spin, page still scrolls */
}
.song-card {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(58vw, 216px);
  box-sizing: border-box;
  padding: 1rem 1rem 1.2rem;
  background: linear-gradient(160deg, #fff, var(--paper-2));
  border: 1.4px solid rgba(246, 213, 217, 0.6);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.song-card.center { box-shadow: 0 26px 60px -24px rgba(165, 42, 55, 0.6); cursor: default; }
.song-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--blush), var(--rose));
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.song-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.song-art .eq { z-index: 1; }
.song-art img + .eq { display: none; }   /* if the cover loaded, hide the bars */
.song-art.spin { animation: artbeat 1.8s ease-in-out infinite; }
.song-title { margin-top: 0.7rem; font-family: var(--serif); font-size: 1.18rem; line-height: 1.1; text-align: center; }
.song-artist { font-family: var(--serif); font-style: italic; font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.08rem; text-align: center; }
.song-bar { width: 100%; height: 5px; border-radius: 99px; background: var(--blush); overflow: hidden; margin-top: 0.8rem; }
.song-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--rose), var(--cherry)); border-radius: 99px; }
.song-times { width: 100%; display: flex; justify-content: space-between; font-family: var(--serif); font-size: 0.72rem; color: var(--ink-soft); margin-top: 0.28rem; }
.song-play {
  margin-top: 0.85rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--cherry);
  color: var(--paper-2);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s var(--ease-out);
}
.song-play:active { transform: scale(0.9); }
.player-dots { display: flex; gap: 7px; justify-content: center; margin-top: 0.9rem; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); opacity: 0.38; transition: all 0.3s var(--ease-back); cursor: pointer; }
.pdot.on { opacity: 1; transform: scale(1.45); background: var(--cherry); box-shadow: 0 0 9px 1px rgba(201, 72, 90, 0.4); }
.player-hint { font-family: var(--hand); font-size: 1.15rem; color: var(--rose); margin-top: 0.55rem; }

/* ---- love meter ------------------------------------------------------- */
.love-heart { border: none; background: none; padding: 0; margin: 0.3rem 0; cursor: pointer; }
.love-heart svg { width: 124px; color: var(--cherry); display: block; filter: drop-shadow(0 10px 22px rgba(165, 42, 55, 0.35)); }
.love-meter {
  width: min(82vw, 320px);
  height: 18px;
  border-radius: 99px;
  background: var(--blush);
  overflow: hidden;
  box-shadow: inset 0 1px 5px rgba(67, 48, 46, 0.2);
  transition: box-shadow 0.4s ease;
}
.love-meter.maxed { box-shadow: 0 0 22px 3px rgba(201, 72, 90, 0.6), inset 0 1px 5px rgba(67, 48, 46, 0.2); }
.love-fill { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--rose), var(--cherry-2), var(--cherry)); transition: width 0.35s var(--ease-out); }
.love-num { font-family: var(--serif); font-weight: 380; font-size: clamp(2.2rem, 10vw, 3.2rem); color: var(--cherry); margin-top: 0.35rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.love-msg { font-family: var(--hand); font-size: 1.55rem; color: var(--ink); min-height: 1.4em; margin-top: 0.2rem; }

/* the heart begging for its one tap */
.love-heart.ready svg { animation: heartbeat 1s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.14); }
  56% { transform: scale(1); }
}

/* the whole scene rattles when the meter blows */
.scene.shake { animation: scene-shake 0.6s linear; }
@keyframes scene-shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 4px) rotate(-0.5deg); }
  30% { transform: translate(8px, -5px) rotate(0.6deg); }
  45% { transform: translate(-9px, -3px) rotate(-0.7deg); }
  60% { transform: translate(7px, 5px) rotate(0.5deg); }
  75% { transform: translate(-5px, 3px) rotate(-0.3deg); }
  90% { transform: translate(4px, -2px) rotate(0.2deg); }
}

/* ---- lock screen ------------------------------------------------------ */
.lock-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 0.9rem 0 1.3rem;
}
.lock-dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.6px solid var(--rose);
  background: transparent;
  transition: all 0.22s var(--ease-back);
}
.lock-dot.fill { background: var(--cherry-2); border-color: var(--cherry-2); transform: scale(1.12); }
.lock-dot.ok { background: var(--cherry); border-color: var(--cherry); box-shadow: 0 0 12px 2px rgba(201, 72, 90, 0.5); }
.lock-dots.nope { animation: shake 0.45s; }
.lock-dots.nope .lock-dot { border-color: var(--cherry); background: transparent; }

.lock-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  width: min(72vw, 264px);
}
.lock-key {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.4px solid var(--blush);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 380;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s var(--ease-out), background 0.15s ease;
  touch-action: manipulation;
}
.lock-key:active { transform: scale(0.88); background: var(--blush); }
.lock-key.soft { font-size: 1.15rem; color: var(--ink-soft); box-shadow: none; border-color: transparent; background: transparent; }
.lock-key.ghost { visibility: hidden; pointer-events: none; }

/* ---- photobooth gallery (clean, frameless) ----------------------------- */
.booth-row {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  padding: 18px 14vw 22px;
  scroll-snap-type: x mandatory;
  touch-action: pan-x;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.booth-row::-webkit-scrollbar { display: none; }
.booth-shot {
  flex: 0 0 auto;
  scroll-snap-align: center;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--paper-2);
}
.booth-shot img {
  display: block;
  height: clamp(280px, 46vh, 380px);   /* photos keep their own natural shape */
  width: auto;
  max-width: 78vw;
  object-fit: cover;
}
/* missing file: a soft blush card with a heart, same footprint */
.booth-shot.empty,
.booth-shot:empty {
  width: min(58vw, 230px);
  height: clamp(280px, 46vh, 380px);
  background: linear-gradient(150deg, var(--blush), var(--rose));
  display: grid;
  place-items: center;
}
.booth-shot.empty::after,
.booth-shot:empty::after {
  content: "\2661";
  font-size: 2.2rem;
  color: rgba(255, 251, 246, 0.85);
}
.booth-count {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--rose);
  margin-top: 0.5rem;
}

/* ---- the last question ------------------------------------------------ */
.forever-zone {
  position: relative;
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.7rem;
  min-height: 130px;
  width: min(86vw, 340px);
}
.forever-no { will-change: transform, opacity; }
.forever-msg {
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--ink);
  min-height: 1.5em;
  margin-top: 0.4rem;
}

/* ---- gratitude list --------------------------------------------------- */
.grateful-list {
  width: min(88vw, 430px);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin: 1.1rem auto 0;
  text-align: left;
}
.grateful-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.grateful-item.in { opacity: 1; transform: none; }
.grateful-item .gi-ico { flex: 0 0 auto; margin-top: 2px; }
.grateful-item .gi-ico svg { width: 22px; }
.grateful-item:nth-child(4n+1) .gi-ico svg { color: var(--cherry); }
.grateful-item:nth-child(4n+2) .gi-ico svg { color: var(--cherry-2); }
.grateful-item:nth-child(4n+3) .gi-ico svg { color: var(--rose); }
.grateful-item:nth-child(4n) .gi-ico svg { color: var(--gold); }
.grateful-item p {
  font-family: var(--serif);
  font-weight: 360;
  font-size: 1.06rem;
  line-height: 1.42;
  color: var(--ink);
}
.grateful-note {
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--ink-soft);
  max-width: 24ch;
  margin: 1.5rem auto 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.grateful-note.in { opacity: 1; transform: none; }

/* ---- ambient life ----------------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ambient .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  will-change: transform;
}
.ambient .blob.b1 {
  width: 64vw; height: 64vw;
  left: -16vw; top: -12vh;
  background: radial-gradient(circle, rgba(246, 213, 217, 0.6), transparent 70%);
  animation: drift1 19s ease-in-out infinite alternate;
}
.ambient .blob.b2 {
  width: 58vw; height: 58vw;
  right: -16vw; bottom: -12vh;
  background: radial-gradient(circle, rgba(220, 160, 168, 0.42), transparent 70%);
  animation: drift2 24s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vw, 6vh) scale(1.18); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1.12); } to { transform: translate(-7vw, -5vh) scale(1); } }

.ambient .amb-petal { position: absolute; opacity: 0.13; will-change: transform; }
.ambient .amb-petal svg { display: block; }
@keyframes ambfloat {
  0%, 100% { transform: translateY(10px) rotate(var(--r0, 0deg)); }
  50% { transform: translateY(-16px) rotate(calc(var(--r0, 0deg) + 9deg)); }
}

/* idle motion: nothing on this page should sit perfectly still */
.scene-decor-top .decor, .scene-decor-bottom .decor {
  display: inline-block;
  transform-origin: 50% 12%;
  animation: sway 4.6s ease-in-out infinite;
}
@keyframes sway { 0%, 100% { transform: rotate(-3.2deg); } 50% { transform: rotate(3.2deg); } }

.advance .decor { animation: bob 2.3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.photo { animation: photofloat 6.5s ease-in-out infinite; }
@keyframes photofloat {
  0%, 100% { transform: rotate(-2.2deg) translateY(0); }
  50% { transform: rotate(-1.3deg) translateY(-9px); }
}

/* depth on the type */
.scene h1, .scene h2 { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.scene.night h1, .scene.night h2 { text-shadow: 0 0 20px rgba(243, 236, 255, 0.3); }

/* a soft heartbeat glow on the main call to action */
.btn[data-open], .btn[data-restart] { animation: ctaGlow 2.6s ease-in-out infinite; }
@keyframes ctaGlow {
  0%, 100% { box-shadow: var(--shadow-soft), 0 0 0 0 rgba(201, 72, 90, 0); }
  50% { box-shadow: var(--shadow-soft), 0 0 24px 5px rgba(201, 72, 90, 0.3); }
}

/* progress: active dot gets a soft cherry halo */
.progress .dot.is-on { box-shadow: 0 0 10px 2px rgba(201, 72, 90, 0.45); }
.progress.on-night .dot.is-on { box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.6); }

/* ---- polish pass: micro-effects ---------------------------------------- */

/* letters of big titles enter one by one */
.tl { display: inline-block; will-change: transform, opacity; }
/* lyric words fade in one by one */
.lw { display: inline-block; will-change: transform, opacity; }

/* a shine sweeps once across each photo as it arrives */
.photo .shine {
  position: absolute;
  inset: 12px 12px 46px;
  overflow: hidden;
  border-radius: 2px;
  pointer-events: none;
}
.photo .shine::after {
  content: "";
  position: absolute;
  top: -25%; bottom: -25%;
  left: -60%;
  width: 42%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: shinesweep 1.15s ease-out 1.05s 1 both;
}
@keyframes shinesweep { from { left: -60%; } to { left: 135%; } }

/* the moon breathes */
.moon-wrap svg { animation: moonbreathe 6s ease-in-out infinite; }
@keyframes moonbreathe {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(246, 213, 217, 0.28)); }
  50% { filter: drop-shadow(0 0 38px rgba(246, 213, 217, 0.55)); }
}

/* shooting stars on the night scenes */
.shooting-star {
  position: absolute;
  width: 92px; height: 1.6px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255,255,255,0.95), transparent);
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.7));
  pointer-events: none;
  will-change: transform, opacity;
}

/* the song player's little dancing equalizer */
.eq { display: flex; gap: 3.5px; align-items: flex-end; height: 20px; }
.eq span { width: 3.5px; height: 30%; background: #fff; border-radius: 2px; }
.player-art.spin .eq span, .song-art.spin .eq span { animation: eqdance 0.85s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: 0.14s; height: 60%; }
.eq span:nth-child(3) { animation-delay: 0.28s; height: 45%; }
.eq span:nth-child(4) { animation-delay: 0.42s; height: 70%; }
@keyframes eqdance { 0%, 100% { height: 22%; } 50% { height: 95%; } }

/* the letter sits on stitched paper */
.letter-paper {
  position: relative;
  width: min(86vw, 360px);
  background:
    radial-gradient(120% 100% at 50% 0%, #fff 0%, var(--paper-2) 75%);
  border: 1.4px dashed var(--rose);
  border-radius: 18px;
  padding: 1.8rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-card);
}
.letter-paper .lp-bow {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
}
.letter-paper .lp-bow svg { width: 54px; color: var(--cherry-2); }

/* the top reasons card breathes while it waits */
.reason-card.top { animation: cardbreathe 4.4s ease-in-out infinite; }
@keyframes cardbreathe {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-5px) rotate(0.6deg); }
}

/* sparkle dots (scratch dust, counter finish, constellation) */
.sparkle {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #FFE9B0;
  box-shadow: 0 0 7px rgba(255, 233, 176, 0.95);
  pointer-events: none;
  will-change: transform, opacity;
}
.sparkle.pink { background: var(--blush); box-shadow: 0 0 7px rgba(246, 213, 217, 0.95); }

/* ---- utility ---------------------------------------------------------- */

[hidden] { display: none !important; }

/* Accessibility: if she prefers reduced motion, we still tell the story,
   we just stop moving things around. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .scene [data-rise] { opacity: 1 !important; }
}
