/* ==========================================================================
   Birthday site for Darsh  -  styles.css
   Sections: 1 tokens · 2 base · 3 background + decorations · 4 intro + gifts
             5 screens · 6 love question · 7 letter · 8 cake · 9 hearts · 10 final
             11 reduced motion
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --dark-amethyst: #320743;
  --vintage-grape: #5a3b5e;
  --periwinkle: #d4bff3;
  --eggshell: #e6e4ce;
  --tea-green: #ccdfb6;

  /* extra shades (gold / cream / chocolate / darker lilac for backgrounds) */
  --gold: #c9a24d;
  --champagne: #e8d3a0;
  --cream: #f3ead2;
  --bg-centre: #ab96cd;
  --bg-edge: #86709f;
  --letter-ink: #1b1320;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-hand: 'Gaegu', 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-snap-type: y proximity; -webkit-text-size-adjust: 100%; }
html.in-screen { overflow: hidden; scroll-snap-type: none; }

body {
  min-height: 100vh;
  background: var(--bg-edge);
  color: var(--dark-amethyst);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px dashed var(--dark-amethyst); outline-offset: 4px; }

/* 3. BACKGROUND + DECORATIONS ---------------------------------------------- */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(55% 45% at 18% 14%, rgba(204, 223, 182, .26), transparent 70%),
    radial-gradient(60% 50% at 88% 84%, rgba(90, 59, 94, .45), transparent 70%),
    radial-gradient(100% 90% at 50% 45%, var(--bg-centre) 0%, #9a84bc 55%, var(--bg-edge) 100%);
}
.tw {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  animation: twinkle 3.6s ease-in-out infinite; animation-delay: var(--d);
}
.gold { color: var(--champagne); } .peri { color: var(--periwinkle); }
.cream { color: var(--cream); }    .tea  { color: var(--tea-green); }
.heart-d.gold { color: #d9b866; }

main { position: relative; z-index: 1; }
html.in-screen main { visibility: hidden; }

.deco {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: auto;
  aspect-ratio: 1; transform: rotate(var(--r, 0deg)); opacity: .9; pointer-events: none;
  animation: bob 6s ease-in-out infinite; animation-delay: var(--d, 0s);
  filter: drop-shadow(0 3px 4px rgba(50, 7, 67, .25));
}
.deco.bow { aspect-ratio: 100 / 70; }
.deco.ribbon { aspect-ratio: 400 / 260; opacity: .85; animation: sway 9s ease-in-out infinite; }

@keyframes twinkle { 0%, 100% { opacity: .25; scale: .7; } 50% { opacity: .95; scale: 1.1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes sway { 0%, 100% { translate: 0 0; } 50% { translate: 6px -6px; } }

/* 4. INTRO + GIFTS --------------------------------------------------------- */
.hero, .gifts {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: grid; place-items: center; padding: 56px 22px; scroll-snap-align: start;
}
.hero-inner, .gifts-inner { position: relative; z-index: 2; text-align: center; max-width: 980px; }

.hero-title .hand {
  display: block; font-family: var(--font-hand); font-weight: 700;
  font-size: clamp(2rem, 6.4vw, 3.6rem); transform: rotate(-2deg); margin-bottom: .25em;
  animation: rise .9s .1s backwards;
}
.hero-title .big {
  display: block; font-family: var(--font-display); font-weight: 800; text-wrap: balance;
  font-size: clamp(2.3rem, 9.4vw, 6rem); line-height: 1.04; letter-spacing: -.01em;
  text-shadow: 0 .035em 0 rgba(243, 234, 210, .5), 0 .1em .3em rgba(50, 7, 67, .28);
  animation: rise 1s .3s backwards;
}
.hero-sub {
  margin-top: 1.1em; font-family: var(--font-hand); font-weight: 700;
  font-size: clamp(1.5rem, 4.4vw, 2.2rem); animation: rise 1s .7s backwards;
}
@keyframes rise { from { opacity: 0; translate: 0 22px; } }

.scroll-cue {
  position: absolute; z-index: 3; left: 50%; bottom: max(18px, 3vh); translate: -50% 0;
  width: 52px; height: 56px; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; color: var(--dark-amethyst);
  animation: nudge 1.6s ease-in-out infinite;
}
.scroll-cue svg { width: 30px; height: 26px; margin-top: -8px; opacity: .85; }
.scroll-cue svg:first-child { margin-top: 0; opacity: .5; }
@keyframes nudge { 0%, 100% { translate: -50% 0; } 50% { translate: -50% 9px; } }

.gifts-title {
  font-family: var(--font-hand); font-weight: 700; font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: 1; margin-bottom: clamp(24px, 5vh, 52px); transform: rotate(-1.5deg);
  text-shadow: 0 .04em 0 rgba(243, 234, 210, .45);
}
.reveal { opacity: 0; translate: 0 26px; transition: opacity .9s ease, translate .9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; translate: 0 0; }
.gift-row.reveal { transition-delay: .15s; }

.gift-row { display: flex; justify-content: center; gap: clamp(16px, 6vw, 72px); }
.gift {
  width: clamp(150px, min(42vw, 44vh), 400px); width: clamp(150px, min(42vw, 44svh), 400px); padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 18px; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), filter .35s ease;
  animation: bob 5.5s ease-in-out infinite;
}
.gift:nth-child(2) { animation-delay: -2.7s; }
.gift-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gift-svg .g-lid, .gift-svg .g-bow { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.2, 1.3, .4, 1); }
.gift:focus-visible .g-lid, .gift.opening .g-lid { transform: translateY(-16px) rotate(-3deg); }
.gift:focus-visible .g-bow, .gift.opening .g-bow { transform: scale(1.06); }
@media (hover: hover) {
  .gift:hover .g-lid { transform: translateY(-16px) rotate(-3deg); }
  .gift:hover .g-bow { transform: scale(1.06) rotate(2deg); }
}
.gift-svg .g-bow { animation: wiggle 3.2s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 50% { rotate: 1.8deg; } }
.gift:focus-visible { outline-offset: 8px; }
@media (hover: hover) {
  .gift:hover { transform: translateY(-10px) rotate(-1.5deg) scale(1.03);
    filter: drop-shadow(0 0 22px rgba(232, 211, 160, .7)); }
}
.gift:active { transform: scale(.97); }
.gift.opening { transform: scale(1.12) rotate(2deg); filter: drop-shadow(0 0 28px rgba(232, 211, 160, .95)); }

@media (max-width: 600px) { .hide-sm { display: none; } }

/* 5. SCREENS (the pages that open over home) -------------------------------- */
.screen {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center;
  padding: max(66px, calc(env(safe-area-inset-top) + 56px)) 20px max(26px, env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s;
}
.screen.active { opacity: 1; visibility: visible; transition: opacity .5s ease; }
.stage { margin: auto; width: 100%; display: flex; flex-direction: column; align-items: center; }
.screen.active .stage { animation: rise .7s .12s backwards; }

.back {
  position: fixed; z-index: 30; top: max(14px, env(safe-area-inset-top)); left: 14px;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(230, 228, 206, .88); color: var(--dark-amethyst);
  box-shadow: 0 4px 10px rgba(50, 7, 67, .3); transition: transform .2s ease;
}
.back svg { width: 24px; height: 24px; }
.back:hover { transform: translateX(-3px); }
.screen:not(.active) .back { display: none; }

.btn {
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; line-height: 1.1;
  padding: .6em 1.5em; border-radius: 999px; border: 2px solid var(--dark-amethyst); cursor: pointer;
  color: var(--dark-amethyst); box-shadow: 0 5px 0 var(--vintage-grape); touch-action: manipulation;
  transition: transform .15s ease, box-shadow .15s ease, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--vintage-grape); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--vintage-grape); }
.btn-soft { background: var(--eggshell); }
.btn-yes { background: var(--tea-green); }
.btn-no { background: var(--eggshell); }
.btn-gold { background: linear-gradient(180deg, #f1dfae, #d9b866); }

/* 6. GIFT ONE: LOVE QUESTION ------------------------------------------------ */
.love-q {
  font-family: var(--font-display); font-weight: 800; text-align: center; line-height: 1.05;
  font-size: clamp(2.5rem, 10vw, 5.8rem); text-shadow: 0 .04em 0 rgba(243, 234, 210, .5);
}
.love-btns { display: flex; justify-content: center; align-items: center; gap: clamp(18px, 6vw, 44px); margin-top: 2rem; flex-wrap: wrap; }
.btn-yes { font-size: 1.7rem; transition: font-size .6s cubic-bezier(.2, 1.2, .3, 1), padding .6s ease, transform .15s, box-shadow .15s; }
.btn-yes.mega {
  font-size: clamp(3.4rem, 17vw, 9rem); padding: .4em 1.05em; box-shadow: 0 9px 0 var(--vintage-grape);
  animation: yespulse 1.1s ease-in-out infinite alternate;
}
@keyframes yespulse { to { scale: 1.05; } }
.btn-no {
  --s: 1; font-size: calc(1.35rem * var(--s)); padding: .6em 1.5em;
  transition: left .45s cubic-bezier(.3, 1.5, .5, 1), top .45s cubic-bezier(.3, 1.5, .5, 1),
              font-size .35s ease, opacity .3s ease, scale .3s ease, transform .15s, box-shadow .15s;
}
.btn-no.free { position: fixed; z-index: 40; margin: 0; }
.btn-no.gone { opacity: 0; scale: .2; pointer-events: none; }

.love-result { text-align: center; }
.cat-card {
  position: relative; width: min(78vw, 380px); padding: 14px; margin: 0 auto 1.3rem;
  background: var(--eggshell); border-radius: 26px; rotate: -2.5deg;
  box-shadow: 0 18px 30px rgba(50, 7, 67, .35), 0 2px 0 rgba(255, 255, 255, .3) inset;
  animation: popin .75s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
.cat-card::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 96px; height: 28px; translate: -50% 0; rotate: 3deg;
  background: rgba(204, 223, 182, .85); box-shadow: 0 2px 4px rgba(50, 7, 67, .2);
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 88% 0, 92% 10%, 96% 0, 100% 8%, 100% 92%, 96% 100%, 92% 90%, 88% 100%, 12% 100%, 8% 90%, 4% 100%, 0 92%);
}
.cat-card img { display: block; width: 100%; height: auto; border-radius: 14px; mix-blend-mode: multiply; }
.yay {
  font-family: var(--font-hand); font-weight: 700; font-size: clamp(2rem, 6.4vw, 3.2rem); line-height: 1.1;
  margin-bottom: 1.4rem; animation: rise .8s .5s backwards;
}
.love-result .btn { animation: rise .8s .8s backwards; }
@keyframes popin { from { opacity: 0; scale: .5; rotate: 8deg; } }

/* 7. THE LETTER -------------------------------------------------------------- */
.letter-stage { width: min(900px, 100%); }
.letter-title {
  font-family: var(--font-hand); font-weight: 700; font-size: clamp(2.3rem, 7.4vw, 3.8rem); text-align: center;
  margin-bottom: .3em; rotate: -1.5deg; text-shadow: 0 .04em 0 rgba(243, 234, 210, .5);
}
.paper-wrap { position: relative; width: 100%; padding: 14px; }
.ld { position: absolute; width: var(--w); height: auto; aspect-ratio: 1; rotate: var(--r, 0deg); z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(50, 7, 67, .3)); }
.ld.bow { aspect-ratio: 100 / 70; }
.frog { position: absolute; z-index: 3; width: clamp(54px, 11vw, 92px); height: auto; pointer-events: none; filter: drop-shadow(0 4px 5px rgba(50, 7, 67, .3)); }
.frog.f1 { left: -10px; top: 56px; rotate: -10deg; }
.frog.f2 { right: -8px; bottom: -14px; rotate: 8deg; }
.frog.f3 { left: 6%; bottom: -22px; rotate: 6deg; }
.frog.f4 { right: 6%; top: -26px; rotate: -6deg; }

.paper {
  position: relative; padding: clamp(28px, 5.6vw, 58px); border-radius: 6px;
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .35), transparent 60%),
    linear-gradient(180deg, #ebe9d4, #e3e0c8);
  border: 1px solid rgba(90, 59, 94, .38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 22px 44px rgba(30, 6, 42, .38), 0 3px 8px rgba(30, 6, 42, .25);
}
.paper::before { content: ""; position: absolute; inset: 9px; border: 1px dashed rgba(90, 59, 94, .35); border-radius: 3px; pointer-events: none; }
.letter-body { display: flow-root; position: relative; }
.letter-text { color: var(--letter-ink); font-size: clamp(1.02rem, 2.3vw, 1.2rem); line-height: 1.8; }
.letter-text p + p { margin-top: 1em; }

.photo { float: right; width: min(42%, 310px); margin: 4px 0 18px clamp(18px, 3.5vw, 34px); shape-outside: margin-box; rotate: 2deg; }
.photo-frame {
  position: relative; padding: 11px; background: #f7f3e3; border-radius: 14px;
  border: 2px dashed var(--periwinkle); outline: 1px solid rgba(90, 59, 94, .3); outline-offset: -1px;
  box-shadow: 0 10px 20px rgba(30, 6, 42, .28);
}
.photo-frame::before { /* washi tape */
  content: ""; position: absolute; top: -13px; left: 50%; width: 84px; height: 26px; translate: -50% 0; rotate: -4deg;
  background: rgba(204, 223, 182, .85); box-shadow: 0 2px 4px rgba(30, 6, 42, .18);
}
.photo-frame img { display: block; width: 100%; height: auto; border-radius: 8px; }
.photo-placeholder {
  aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 12px; text-align: center; border-radius: 8px;
  font-family: var(--font-hand); font-size: 1.4rem; font-weight: 700; color: var(--vintage-grape);
  background: repeating-linear-gradient(45deg, rgba(212, 191, 243, .45) 0 12px, rgba(204, 223, 182, .45) 12px 24px);
}
/* Optional frame shapes. These crop the photo, so only add one once you have chosen. */
.photo.shape-circle .photo-frame { border-radius: 50%; padding: 12px; }
.photo.shape-circle .photo-frame img, .photo.shape-circle .photo-placeholder { aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.photo.shape-arch .photo-frame { border-radius: 999px 999px 14px 14px; }
.photo.shape-arch .photo-frame img, .photo.shape-arch .photo-placeholder { border-radius: 999px 999px 8px 8px; }
.letter-actions { text-align: center; margin-top: 26px; }

@media (max-width: 640px) {
  .photo { float: none; width: min(78%, 320px); margin: 4px auto 26px; }
}

/* 8. GIFT TWO: THE CAKE (pure CSS/HTML) ------------------------------------- */
.cake {
  --choc-d: #2a130b; --choc-m: #4a2616; --choc-l: #7b4a2f;
  position: relative; width: 20em; height: 21.5em; font-size: clamp(13px, 4vw, 26px); margin: 0 auto;
}
.cake-glow {
  position: absolute; left: 50%; top: -3em; width: 30em; height: 24em; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 120, .5), transparent);
  opacity: calc(var(--lit, 1) * .9); transition: opacity 1s ease; pointer-events: none;
}
.plate {
  position: absolute; left: -1.5em; bottom: 0; width: 23em; height: 3em; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #f3e3b8, #d2b068 60%, #a98238);
  box-shadow: 0 .8em 1.4em rgba(30, 6, 42, .45), inset 0 -.3em .4em rgba(120, 84, 24, .5);
}
.tier { position: absolute; }
.t1 { left: 0; bottom: 1.4em; width: 20em; height: 6.4em; }
.t2 { left: 3.5em; bottom: 7.8em; width: 13em; height: 4.8em; }
.tier .body {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(90deg, #4a2616, var(--choc-l) 30%, #5d321e 62%, #3d1e12);
  border-radius: 0 0 50% 50% / 0 0 1.1em 1.1em; box-shadow: 0 .5em .8em rgba(30, 6, 42, .35);
}
.t2 .body { border-radius: 0 0 50% 50% / 0 0 .95em .95em; }
.tier .drip {
  position: absolute; top: .5em; left: var(--l); width: 1.05em; height: var(--h); border-radius: 0 0 1em 1em;
  background: linear-gradient(90deg, #3b1c10, var(--choc-d) 55%, #1f0d07); box-shadow: inset .18em 0 .2em rgba(255, 220, 180, .12);
}
.tier .pearls {
  position: absolute; left: 0; right: 0; bottom: .55em; height: .5em;
  background: radial-gradient(circle at 50% 50%, var(--champagne) 0 .2em, transparent .24em) 0 0 / .9em .5em repeat-x;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3));
}
.tier .face {
  position: absolute; left: 0; width: 100%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 36% 32%, rgba(255, 220, 180, .35), transparent 45%),
    radial-gradient(ellipse at 50% 50%, #5b2f1e 0%, #351a0f 70%, var(--choc-d) 100%);
  box-shadow: inset 0 -.18em .3em rgba(0, 0, 0, .45), 0 0 0 .2em var(--choc-d);
}
.t1 .face { top: -1.1em; height: 2.2em; }
.t2 .face { top: -.95em; height: 1.9em; }
.tier .face::after { /* glossy swirl on the ganache */
  content: ""; position: absolute; inset: 22% 26%; border-radius: 50%;
  border: .16em solid rgba(255, 220, 180, .22); border-bottom-color: transparent; border-left-color: transparent; rotate: -18deg;
}
.pipe, .topdeco { position: absolute; left: 0; top: 0; width: 100%; height: 0; pointer-events: none; }
.rose {
  position: absolute; width: 1.45em; height: 1.45em; margin: -.72em 0 0 -.72em; border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #a9744f, #5a2f1d 55%, #2a130b);
  box-shadow: 0 .15em .25em rgba(0, 0, 0, .4), inset 0 0 0 .18em rgba(255, 220, 180, .1);
}
.rose::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; border: .12em solid rgba(255, 220, 180, .35); border-right-color: transparent; }
.sprinkle { position: absolute; width: .7em; height: .2em; border-radius: .2em; margin: -.1em 0 0 -.35em; }
.topdeco .gold-star { position: absolute; width: .95em; height: .95em; margin: -.48em 0 0 -.48em; color: var(--champagne); filter: drop-shadow(0 0 .2em rgba(255, 220, 120, .7)); }

.candle {
  position: absolute; z-index: 20; left: calc(var(--x) - 1.5em); bottom: var(--b); width: 3em; height: 7em;
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 1em;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.candle:focus-visible { outline: 3px dashed var(--cream); outline-offset: 2px; }
.stick {
  position: absolute; bottom: 0; left: 50%; width: 1em; height: 4.4em; translate: -50% 0; border-radius: .3em .3em .12em .12em;
  background: repeating-linear-gradient(-55deg, var(--c2) 0 .45em, var(--c1) .45em .9em);
  box-shadow: inset -.22em 0 rgba(50, 7, 67, .2), 0 .12em .25em rgba(0, 0, 0, .35); transition: filter .5s ease;
}
.wick { position: absolute; bottom: 4.4em; left: 50%; width: .13em; height: .7em; translate: -50% 0; background: #2a1a1a; border-radius: .1em; transition: background .4s; }
.flame {
  position: absolute; bottom: 4.95em; left: 50%; width: 1.15em; height: 1.8em; translate: -50% 0; transform-origin: 50% 100%;
  border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%;
  background: radial-gradient(ellipse at 50% 78%, #fffbe0 0 16%, #ffd36b 42%, #f39a3d 76%, rgba(243, 154, 61, 0) 100%);
  box-shadow: 0 0 1em .35em rgba(255, 200, 90, .55);
  animation: flicker 1.3s ease-in-out infinite alternate;
  transition: scale .35s ease, opacity .3s ease;
}
.candle:nth-of-type(2) .flame { animation-delay: -.4s; } .candle:nth-of-type(3) .flame { animation-delay: -.8s; } .candle:nth-of-type(4) .flame { animation-delay: -.2s; }
@keyframes flicker { 0% { rotate: -3deg; scale: 1 1; } 50% { rotate: 2deg; scale: .94 1.06; } 100% { rotate: -1deg; scale: 1.03 .96; } }
@media (hover: hover) { .candle:not(.out):hover .stick { filter: brightness(1.12); } }
.smoke {
  position: absolute; bottom: 5em; left: 50%; width: .55em; height: 1.8em; translate: -50% 0; border-radius: 50%; opacity: 0;
  background: linear-gradient(to top, rgba(230, 228, 206, .75), transparent); filter: blur(.12em);
}
.candle.out .flame { animation: none; scale: 0; opacity: 0; }
.candle.out .smoke { animation: smoke 1.5s ease-out forwards; }
.candle.out .wick { background: #0e0708; }
.candle.out .stick { filter: saturate(.75) brightness(.88); }
@keyframes smoke { 0% { opacity: .85; translate: -50% 0; scale: .7 .6; } 100% { opacity: 0; translate: -20% -2.6em; scale: 1.6 1.8; } }

/* 9. HEART CELEBRATION ------------------------------------------------------- */
#screen-hearts {
  z-index: 12; transition: opacity .3s ease, visibility 0s linear .3s; justify-content: flex-start; color: var(--eggshell); padding-top: max(64px, calc(env(safe-area-inset-top) + 56px));
  background: rgba(50, 7, 67, .42);
}
html.hearts-on #screen-cake .stage, html.hearts-on #screen-cake .fr-screen { filter: blur(12px); }
.hearts-title { position: relative; z-index: 3; pointer-events: none;
  font-family: var(--font-hand); font-weight: 700; text-align: center; text-wrap: balance; max-width: 20em;
  font-size: clamp(1.8rem, 5.4vw, 3.1rem); line-height: 1.1; text-shadow: 0 2px 14px rgba(30, 6, 42, .7);
  animation: rise .8s .2s backwards;
}
.heart-field { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.heart-field .heart { pointer-events: auto; }
.heart {
  position: absolute; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  animation: heartbob var(--dur, 4s) ease-in-out var(--del, 0s) infinite; will-change: transform; contain: layout;
}
.heart img {
  display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none;
  transition: transform .15s ease;
}
@media (hover: hover) { .heart:hover img { transform: scale(1.1); } }
.heart.tap img { animation: squish .35s ease; }
.heart:focus-visible { outline: 3px dashed var(--cream); outline-offset: 2px; }
@keyframes heartbob { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-8px) rotate(calc(var(--rot, 0deg) * -1)); } }
@keyframes squish { 0% { transform: scale(1); } 30% { transform: scale(1.22, .86); } 60% { transform: scale(.92, 1.12); } 100% { transform: scale(1); } }
.pop {
  position: absolute; z-index: 6; translate: -50% 0; pointer-events: none; white-space: nowrap;
  font-family: var(--font-hand); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.2rem); color: var(--cream);
  text-shadow: 0 0 10px rgba(201, 162, 77, .95), 0 2px 0 rgba(50, 7, 67, .7);
  animation: pop 1.15s ease-out forwards;
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(8px) rotate(var(--pr, 0deg)) scale(.6); }
  22% { opacity: 1; transform: translateY(-8px) rotate(var(--pr, 0deg)) scale(1.18); }
  100% { opacity: 0; transform: translateY(-58px) rotate(var(--pr, 0deg)) scale(1); }
}
.hearts-foot { text-align: center; padding-top: 8px; margin-top: auto; position: relative; z-index: 3; }
.signoff { font-family: var(--font-hand); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.5rem); color: var(--cream); margin-bottom: .6rem; text-shadow: 0 2px 10px rgba(30, 6, 42, .6); }

/* 10. FINAL MESSAGE ------------------------------------------------------------ */
.final-stage { max-width: 640px; }
.final-card {
  position: relative; width: 100%; padding: clamp(30px, 6vw, 56px); text-align: center; border-radius: 28px;
  background: linear-gradient(180deg, #ebe9d4, #e3e0c8); border: 1px solid rgba(90, 59, 94, .35);
  box-shadow: 0 22px 44px rgba(30, 6, 42, .38), 0 1px 0 rgba(255, 255, 255, .6) inset;
}
.final-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; margin-bottom: .6em; }
.final-text { color: var(--letter-ink); font-size: clamp(1.05rem, 2.6vw, 1.25rem); line-height: 1.75; margin-bottom: 1.6em; }
.final-text p + p { margin-top: 1em; }

/* 11. REDUCED MOTION ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .tw { opacity: .6; }
  .pop { animation: popfade 1.4s linear forwards !important; animation-duration: 1.4s !important; }
  @keyframes popfade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* FROG STICKERS ---------------------------------------------------------------- */
.fr {
  position: absolute; z-index: 1; left: var(--x); top: var(--y); width: var(--w); height: auto; rotate: var(--r, 0deg);
  pointer-events: none; user-select: none; animation: bob 6s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.fr-screen { position: fixed; z-index: 0; }
.cake-hint {
  font-family: var(--font-hand); font-weight: 700; text-align: center; text-wrap: balance; max-width: 22em; margin: 0 auto 1.2rem;
  font-size: clamp(1.7rem, 5.4vw, 2.8rem); line-height: 1.1; text-shadow: 0 .04em 0 rgba(243, 234, 210, .5);
}
@media (max-width: 600px) { .fr-screen.hide-sm { display: none; } }

/* PERFORMANCE: freeze everything that is not on screen or is behind the hearts */
html.in-screen main * { animation-play-state: paused !important; }
html.hearts-on .bg *, html.hearts-on #screen-cake * { animation-play-state: paused !important; }

#screen-hearts.active { transition: opacity .3s ease; }
