/* ============================================================
   A LITTLE SOMETHING FOR YOU — stylesheet
   Sections: Reset & vars → Global → Ambient canvas/progress →
   Buttons → Scene 1 Intro → Scene 2 Heart → Scene 3 Tree →
   Scene 4 Balloons → Scene 5 Gallery → Scene 6 Letter →
   Scene 7 Finale → Toast → Responsive
   ============================================================ */

/* ---------- Design tokens ---------- */
:root{
  --color-void:        #0a0512;   /* near-black edge of the sky */
  --color-night-a:     #1c0b24;   /* deep velvet purple */
  --color-night-b:     #3a1030;   /* warm plum */
  --color-night-c:     #59142f;   /* deep rose glow near horizon */
  --color-rose:        #c53a5c;   /* deep rose red */
  --color-rose-deep:   #8c1f3f;
  --color-blush:       #f5c9d6;   /* soft blush pink */
  --color-gold:        #e6b566;
  --color-gold-light:  #f8dfa8;
  --color-cream:       #fbf2e6;   /* letter paper */
  --color-cream-dim:   #efe3d1;
  --color-ink:         #3a2a2f;   /* handwriting ink on paper */
  --color-branch:      #6b4a44;
  --color-text:        #f8ecec;
  --color-text-dim:    rgba(248,236,236,0.72);

  --font-display: 'Playfair Display', serif;
  --font-serif:   'Cormorant Garamond', serif;
  --font-script:  'Dancing Script', cursive;
  --font-ui:      'Poppins', sans-serif;

  --vh: 1vh;
  --scene-h: calc(var(--vh, 1vh) * 100);

  --ease-soft: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after{ box-sizing: border-box; }
html, body{
  margin:0; padding:0; height:100%;
  overscroll-behavior: none;
}
body{
  background: var(--color-void);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-weight:300;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
h1,h2,h3,p{ margin:0; }
button{
  font-family: inherit;
  border:none;
  background:none;
  color:inherit;
  cursor:pointer;
}
svg{ display:block; }
img{ max-width:100%; display:block; }

::selection{ background: var(--color-rose); color: var(--color-text); }

/* ---------- Ambient sky canvas ---------- */
#sky-canvas{
  position: fixed;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  background:
    radial-gradient(120% 70% at 50% 12%, var(--color-night-c) 0%, var(--color-night-b) 42%, var(--color-night-a) 72%, var(--color-void) 100%);
}

/* ---------- App / scenes ---------- */
#app{
  position: relative;
  z-index: 1;
  width: 100%;
  height: var(--scene-h);
  overflow: hidden;
}

.scene{
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 8vh 6vw;
  opacity:0;
  visibility: hidden;
  pointer-events:none;
  will-change: opacity, transform;
}
.scene.active{
  opacity:1;
  visibility: visible;
  pointer-events:auto;
}
.scene-inner{
  width:100%;
  max-width: 560px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap: 1.6rem;
}

.scene-title{
  font-family: var(--font-display);
  font-weight:600;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height:1.25;
  color: var(--color-text);
}
.scene-subtitle{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 3.6vw, 1.2rem);
  color: var(--color-text-dim);
  margin-top:-1rem;
}

.hint-text{
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--color-text-dim);
  animation: hintPulse 2.2s ease-in-out infinite;
}
@keyframes hintPulse{
  0%,100%{ opacity:.55; transform:translateY(0); }
  50%{ opacity:1; transform:translateY(3px); }
}

/* ---------- Progress dots ---------- */
.progress-dots{
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left:50%;
  transform: translateX(-50%);
  display:flex;
  gap:8px;
  z-index: 20;
  opacity:0;
  transition: opacity .5s var(--ease-soft);
  pointer-events:none;
}
.progress-dots.visible{ opacity:1; }
.progress-dots .dot{
  width:6px; height:6px;
  border-radius:50%;
  background: rgba(248,236,236,0.25);
  transition: background .35s ease, transform .35s ease;
}
.progress-dots .dot.done{ background: var(--color-gold); }
.progress-dots .dot.current{
  background: var(--color-blush);
  transform: scale(1.5);
}

/* ---------- Back button ---------- */
.back-btn{
  position: fixed;
  left: max(10px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 1.3rem;
  line-height:1;
  color: var(--color-text);
  background: rgba(10,5,18,0.4);
  border: 1px solid rgba(248,236,236,0.25);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s ease, visibility .4s, background .2s ease;
}
.back-btn.visible{
  opacity: 0.85;
  visibility: visible;
  pointer-events: auto;
}
.back-btn:hover{ opacity:1; background: rgba(10,5,18,0.6); }
.back-btn:active{ transform: translateY(-50%) scale(0.92); }
/* the finale card is a bright background — give the button matching contrast there */
.back-btn.on-light{
  color: #6b3345;
  background: rgba(255,255,255,0.55);
  border-color: rgba(197,58,92,0.35);
}
.back-btn.on-light:hover{ background: rgba(255,255,255,0.8); }

/* ---------- Music toggle button ---------- */
.music-btn{
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 1.05rem;
  line-height:1;
  color: var(--color-text);
  background: rgba(10,5,18,0.4);
  border: 1px solid rgba(248,236,236,0.25);
  backdrop-filter: blur(4px);
  opacity: 0.85;
  transition: opacity .3s ease, background .2s ease, color .2s ease;
}
.music-btn:hover{ opacity:1; background: rgba(10,5,18,0.6); }
.music-btn:active{ transform: translateY(-50%) scale(0.92); }
.music-btn__icon{
  width: 19px;
  height: 19px;
  fill: currentColor;
}
.music-btn__wave{
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.music-btn__mute-x{
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  display: none;
}
.music-btn.muted .music-btn__wave{ display: none; }
.music-btn.muted .music-btn__mute-x{ display: block; }
.music-btn.on-light{
  color: #6b3345;
  background: rgba(255,255,255,0.55);
  border-color: rgba(197,58,92,0.35);
}
.music-btn.on-light:hover{ background: rgba(255,255,255,0.8); }

/* ---------- Buttons ---------- */
.btn{
  font-family: var(--font-ui);
  font-weight:500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.95em 2.1em;
  border-radius: 999px;
  transition: transform .25s var(--ease-soft), box-shadow .25s ease, opacity .3s ease;
}
.btn:active{ transform: scale(0.96); }

.btn--glow{
  background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-rose-deep) 100%);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(230,181,102,0.35), 0 8px 30px -6px rgba(197,58,92,0.65), 0 0 24px rgba(230,181,102,0.25);
  animation: glowPulse 2.6s ease-in-out infinite;
}
@keyframes glowPulse{
  0%,100%{ box-shadow: 0 0 0 1px rgba(230,181,102,0.35), 0 8px 30px -6px rgba(197,58,92,0.65), 0 0 18px rgba(230,181,102,0.18); }
  50%{ box-shadow: 0 0 0 1px rgba(230,181,102,0.55), 0 8px 34px -4px rgba(197,58,92,0.85), 0 0 34px rgba(230,181,102,0.42); }
}

.btn--outline{
  background: rgba(255,255,255,0.04);
  color: var(--color-gold-light);
  border: 1px solid rgba(230,181,102,0.55);
  backdrop-filter: blur(6px);
}
.btn--outline:hover{ background: rgba(230,181,102,0.1); }

.btn--small{
  font-size: 0.8rem;
  padding: 0.6em 1.6em;
  background: rgba(255,255,255,0.06);
  color: var(--color-text-dim);
  border: 1px solid rgba(255,255,255,0.18);
}

.scene-continue{
  margin-top: 0.4rem;
}
[hidden]{ display:none !important; }

/* ============================================================
   SCENE 1 — INTRO
   ============================================================ */
.intro__message{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 4.4vw, 1.5rem);
  color: var(--color-text-dim);
  max-width: 22ch;
}
.name-highlight{
  font-family: var(--font-script);
  font-style:normal;
  font-size: 1.5em;
  color: var(--color-gold-light);
  padding-left: 0.15em;
}

.envelope{
  position: relative;
  width: min(62vw, 220px);
  height: min(46vw, 160px);
  margin: 0.6rem 0 1rem;
  perspective: 900px;
}
.envelope__glow{
  position:absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(230,181,102,0.35) 0%, rgba(230,181,102,0) 70%);
  opacity:0.8;
  pointer-events:none;
}
.envelope__back{
  position:absolute; inset:0;
  background: linear-gradient(160deg, #d9c3a4, #c7a878);
  border-radius: 6px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.6);
}
.envelope__letter{
  position:absolute;
  left:50%; top: -8%;
  transform: translateX(-50%);
  width: 62%; height: 78%;
  background: var(--color-cream);
  border-radius: 3px;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.envelope__heart{
  width: 34%;
  fill: var(--color-rose);
}
.envelope__flap{
  position:absolute;
  top:0; left:0; right:0;
  height: 58%;
  background: linear-gradient(160deg, #e7d3b3, #cdab7d);
  clip-path: polygon(0 0, 100% 0, 50% 92%);
  transform-origin: top center;
  border-radius: 6px 6px 0 0;
  transition: transform .1s;
}

/* ============================================================
   SCENE 2 — HEART PULL & RELEASE
   ============================================================ */
.heart-pull{
  position: relative;
  width: 100%;
  height: 34vh;
  min-height: 220px;
  display:flex;
  justify-content:center;
  touch-action: none;
}
.heart-pull__string{
  position:absolute;
  top:0; left:50%;
  width:2px;
  height: 70px;
  background: linear-gradient(to bottom, rgba(230,181,102,0.1), rgba(230,181,102,0.85));
  transform-origin: top center;
}
.heart-pull__anchor{
  position:absolute;
  top: 70px; left:50%;
  width: 96px; height: 88px;
  transform: translate(-50%, 0);
  cursor: grab;
  filter: drop-shadow(0 8px 22px rgba(197,58,92,0.55));
}
.heart-pull__anchor:active{ cursor: grabbing; }
.heart-pull__svg{ width:100%; height:100%; }

/* ============================================================
   SCENE 3 — GROWING TREE OF HEARTS
   ============================================================ */
.tree-wrap{
  width: min(98vw, calc(62vh * 400 / 520), 460px);
  aspect-ratio: 400 / 520;
}
.tree-scene-inner{
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tree-scene-inner::-webkit-scrollbar{ display: none; width: 0; height: 0; }
.tree-svg{ width:100%; height:100%; overflow:visible; }
.leaf-heart{
  transform-box: fill-box;
  transform-origin: center;
}
.tree-title{
  font-family: var(--font-display);
  font-weight:600;
  font-size: clamp(1.3rem, 5.6vw, 2rem);
  line-height:1.4;
  color: var(--color-text);
  display:flex;
  flex-direction:column;
  gap: 0.2rem;
}
.tree-title__script{
  font-family: var(--font-script);
  color: var(--color-gold-light);
  font-size: 1.35em;
  font-weight:600;
}

/* ============================================================
   SCENE 4 — BALLOONS
   ============================================================ */
.balloons{
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 54vh;
  min-height: 340px;
}
.balloon{
  position: absolute;
  width: 19%;
  max-width: 78px;
  aspect-ratio: 5/6.4;
  display:flex;
  flex-direction:column;
  align-items:center;
  animation: balloonFloat 7s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.balloon__body{
  width:100%;
  height: 78%;
  border-radius: 50% 50% 50% 50% / 45% 45% 55% 55%;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--balloon-color) 60%, white 40%), var(--balloon-color) 65%);
  box-shadow: inset -6px -10px 16px rgba(0,0,0,0.18), 0 10px 22px -8px rgba(0,0,0,0.45);
}
.balloon__knot{
  width: 8%; height: 4%;
  background: var(--balloon-color);
  margin-top:-1px;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}
.balloon__string{
  width:1px; flex:1;
  min-height: 14px;
  background: rgba(255,255,255,0.35);
}
@keyframes balloonFloat{
  0%{ transform: translate(0,0) rotate(-3deg); }
  25%{ transform: translate(22px,-40px) rotate(3deg); }
  50%{ transform: translate(-16px,-68px) rotate(-4deg); }
  75%{ transform: translate(26px,-32px) rotate(4deg); }
  100%{ transform: translate(0,0) rotate(-3deg); }
}
.balloon.popped{ animation: none; opacity:0; pointer-events:none; transition: opacity .15s; }

.reason-overlay{
  position: fixed;
  inset:0;
  z-index: 30;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6vw;
  background: rgba(10,5,18,0.55);
  backdrop-filter: blur(4px);
  opacity:0;
  visibility:hidden;
  transition: opacity .3s ease, visibility .3s;
}
.reason-overlay.visible{ opacity:1; visibility:visible; }
.reason-card{
  width:100%;
  max-width: 360px;
  background: linear-gradient(165deg, rgba(58,16,48,0.92), rgba(28,11,36,0.96));
  border: 1px solid rgba(230,181,102,0.45);
  border-radius: 18px;
  padding: 2rem 1.6rem 1.6rem;
  text-align:center;
  box-shadow: 0 0 40px rgba(230,181,102,0.18), 0 20px 50px -12px rgba(0,0,0,0.6);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 0.9rem;
  transform: scale(0.85);
  transition: transform .35s var(--ease-soft);
}
.reason-overlay.visible .reason-card{ transform: scale(1); }
.reason-card__index{
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--color-gold);
  text-transform: uppercase;
}
.reason-card__text{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  line-height:1.45;
  color: var(--color-text);
}

/* ============================================================
   SCENE 5 — POLAROID GALLERY (Swiper "cards" effect)
   ============================================================ */
.gallery-swiper{
  width: min(72vw, 280px);
  height: min(58vh, 380px);
  overflow: visible;
}
.polaroid{
  background: #f7f2e9;
  border-radius: 4px;
  padding: 14px 14px 20px;
  display:flex;
  flex-direction:column;
  box-shadow: 0 20px 45px -10px rgba(0,0,0,0.55);
}
.polaroid__photo{
  width:100%;
  flex:1;
  border-radius: 2px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.polaroid__icon{
  width: 2.2rem;
  height: 2.2rem;
  fill: rgba(255,255,255,0.85);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}
.polaroid__caption{
  font-family: var(--font-script);
  font-size: 1.25rem;
  color: #3a2a2f;
  margin-top: 12px;
  text-align:center;
}
.polaroid__date{
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #8a7a6a;
  text-align:center;
  margin-top: 2px;
}

/* ============================================================
   SCENE 5.5 — CAKE + FAVORITE THINGS
   ============================================================ */
.cake-scene-inner{
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-block: 0.5rem 1.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cake-scene-inner::-webkit-scrollbar{ display: none; width: 0; height: 0; }

.cake{
  position: relative;
  width: min(66vw, 250px);
  margin: 0.4rem auto 0.8rem;
  display:flex;
  flex-direction: column;
  align-items:center;
}
.cake-glow{
  position:absolute;
  left:50%; bottom:10%;
  transform: translateX(-50%);
  width: 140%; height: 65%;
  background: radial-gradient(circle, rgba(230,181,102,0.32) 0%, rgba(230,181,102,0) 70%);
  z-index:0;
  pointer-events:none;
}

/* ---- topper banner ---- */
.cake-topper{
  position:relative;
  z-index:5;
  display:flex;
  justify-content:center;
  margin-bottom: 22px;
}
.cake-topper__flag{
  position:relative;
  display:inline-block;
  padding: 0.3em 1em;
  font-family: var(--font-script);
  font-weight:600;
  font-size: 1.05rem;
  color: #2a1a10;
  background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold));
  border-radius: 4px;
  box-shadow: 0 8px 16px -4px rgba(0,0,0,0.5);
  transform-origin: top center;
  white-space: nowrap;
}
.cake-topper__flag::before,
.cake-topper__flag::after{
  content:'';
  position:absolute;
  top:100%;
  width:2px; height:18px;
  background: var(--color-gold);
}
.cake-topper__flag::before{ left: 16%; }
.cake-topper__flag::after{ right: 16%; }

/* ---- butterflies ---- */
.cake-butterflies{
  position:absolute;
  inset: -10% -20%;
  pointer-events:none;
  z-index:6;
  overflow: visible;
}
.butterfly{
  position:absolute;
  width:16px; height:12px;
  opacity:0;
}
.butterfly--1{ top: 4%; left: 30%; animation: butterflyFly1 7s ease-in-out infinite; animation-delay: 2.6s; }
.butterfly--2{ top: 42%; left: 60%; animation: butterflyFly2 8s ease-in-out infinite; animation-delay: 3s; }
.butterfly__wing{
  position:absolute; top:0;
  width:8px; height:12px;
  background: radial-gradient(circle at 35% 30%, var(--color-gold-light), var(--color-gold) 75%);
  border-radius: 60% 40% 60% 40%;
}
.butterfly__wing--l{ left:0; transform-origin:right center; animation: wingFlap .45s ease-in-out infinite alternate; }
.butterfly__wing--r{ right:0; transform-origin:left center; animation: wingFlap .45s ease-in-out infinite alternate-reverse; }
@keyframes wingFlap{ from{ transform:scaleX(1); } to{ transform:scaleX(0.45); } }
@keyframes butterflyFly1{
  0%{ opacity:0; transform: translate(0,0) rotate(0deg); }
  8%,90%{ opacity:1; }
  25%{ transform: translate(46px,-16px) rotate(8deg); }
  50%{ transform: translate(84px,4px) rotate(-6deg); }
  75%{ transform: translate(50px,-12px) rotate(6deg); }
  100%{ opacity:0; transform: translate(14px,-2px) rotate(0deg); }
}
@keyframes butterflyFly2{
  0%{ opacity:0; transform: translate(0,0) rotate(0deg); }
  8%,90%{ opacity:1; }
  25%{ transform: translate(-40px,10px) rotate(-8deg); }
  50%{ transform: translate(-72px,-10px) rotate(6deg); }
  75%{ transform: translate(-44px,8px) rotate(-6deg); }
  100%{ opacity:0; transform: translate(-10px,2px) rotate(0deg); }
}

/* ---- candles ---- */
.cake-candles{
  position:relative;
  z-index:4;
  display:flex;
  gap: 13px;
  margin-bottom: -4px;
}
.candle{
  position:relative;
  width: 7px;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.candle__stick{
  display:block;
  width: 7px;
  height: 34px;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--color-gold-light) 0 4px, var(--color-rose) 4px 8px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.candle__flame{
  width: 11px;
  height: 17px;
  margin-bottom: -2px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 32%, #fff6d8, var(--color-gold) 55%, var(--color-rose) 100%);
  filter: drop-shadow(0 0 7px rgba(230,181,102,0.85));
  transform-origin: bottom center;
  animation: flameFlicker 1.3s ease-in-out infinite;
}
.candle:nth-child(2) .candle__flame{ animation-delay: 0.2s; }
.candle:nth-child(3) .candle__flame{ animation-delay: 0.4s; }
@keyframes flameFlicker{
  0%,100%{ transform: scaleY(1) scaleX(1) rotate(-3deg); }
  50%{ transform: scaleY(1.12) scaleX(0.94) rotate(4deg); }
}
.candle__flame.out{
  animation: none;
  transform: scale(0);
  opacity:0;
  transition: transform .4s ease, opacity .4s ease;
}

/* ---- tiers + glaze pour ---- */
.cake-tiers{
  position:relative;
  z-index:2;
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.cake-tier{
  position:relative;
  border-radius: 8px 8px 3px 3px;
  box-shadow: inset 0 3px 10px rgba(255,255,255,0.18), 0 10px 20px -8px rgba(0,0,0,0.5);
}
.cake-tier--top{
  width: 56%;
  height: 48px;
  background: linear-gradient(180deg, var(--color-blush), var(--color-rose));
  display:flex;
  align-items:flex-start;
  justify-content:center;
  overflow: visible;
}
.cake-tier--top::after{
  content:'';
  position:absolute; left:0; right:0; bottom:-8px; height:14px;
  background-image: radial-gradient(circle at 7px 0, transparent 6px, var(--color-blush) 6.5px);
  background-size: 14px 14px;
  background-repeat: repeat-x;
}
.cake-tier--mid{
  width: 78%;
  height: 52px;
  background: linear-gradient(180deg, #e2789a, var(--color-rose));
}
.cake-tier--mid::after{
  content:'';
  position:absolute; left:0; right:0; bottom:-9px; height:16px;
  background-image: radial-gradient(circle at 8px 0, transparent 7px, var(--color-rose) 7.5px);
  background-size: 16px 16px;
  background-repeat: repeat-x;
}
.cake-tier--bottom{
  width: 100%;
  height: 64px;
  background: linear-gradient(180deg, #d6486b, var(--color-rose-deep));
}
.cake-tier--bottom::after{
  content:'';
  position:absolute; left:0; right:0; bottom:-11px; height:20px;
  background-image: radial-gradient(circle at 10px 0, transparent 9px, var(--color-rose-deep) 9.5px);
  background-size: 20px 20px;
  background-repeat: repeat-x;
}
.cake-trim{
  width: 82%;
  height: 6px;
  margin: 10px 0;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light), var(--color-gold));
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transform-origin: center;
}
.cake-glaze{
  position:absolute;
  top: -9px; left:50%;
  width: 74%; height: 20px;
  transform: translateX(-50%) scale(0);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf6, #f2e8d6 75%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 3;
}

/* ---- decor: gold orbs + roses that fly onto the base ---- */
.cake-decor{
  position:absolute;
  left:0; right:0; bottom: 42px;
  height:0;
  z-index:5;
  pointer-events:none;
}
.decor-item{ position:absolute; opacity:0; }
.decor-orb{
  border-radius:50%;
  background: radial-gradient(circle at 32% 28%, #fff6d8, var(--color-gold) 55%, #8a6423 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
.decor-rose{
  width:22px; height:22px;
  border-radius:50%;
  background:
    radial-gradient(circle at 30% 30%, #ff8fa3, transparent 60%),
    radial-gradient(circle at 65% 40%, #d81e4f, transparent 55%),
    radial-gradient(circle at 45% 65%, #a8123a, transparent 60%),
    radial-gradient(circle at 50% 50%, #e63960, #7c0a2e 90%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}
.decor-rose::after{
  content:'';
  position:absolute;
  width:11px; height:7px;
  background:#4a7c4e;
  border-radius: 50% 10% 50% 10%;
  left:-6px; top:11px;
  transform:rotate(-20deg);
  z-index:-1;
}

/* ---- stand ---- */
.cake-stand{
  position:relative;
  z-index:1;
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-top: 14px;
}
.cake-stand__top{
  width: 112%;
  height: 10px;
  border-radius:50%;
  background: linear-gradient(180deg, #f0b9c9, #d68aa0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.cake-stand__pole{
  width: 20px;
  height: 15px;
  background: linear-gradient(180deg, #e9a0b4, #c96b86);
}
.cake-stand__base{
  width: 56%;
  height: 20px;
  border-radius:50%;
  background: linear-gradient(180deg, #d6486b, #a83355);
  box-shadow: 0 10px 18px -6px rgba(0,0,0,0.55);
}

.cake-sparkle{
  position: fixed;
  z-index: 25;
  pointer-events:none;
  border-radius:50%;
  background: var(--color-gold-light);
  box-shadow: 0 0 6px 1px rgba(230,181,102,0.8);
}

.cake-message{
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 5.6vw, 1.8rem);
  color: var(--color-gold-light);
  text-align:center;
  margin-top: 0.8rem;
}

/* ---------- Favorites filmstrip ---------- */
.favorites-section{
  width: 100%;
  margin-top: 2rem;
}
.favorites-title{
  font-family: var(--font-display);
  font-weight:600;
  font-size: clamp(1.1rem, 4.4vw, 1.4rem);
  text-align:center;
  color: var(--color-text);
  margin-bottom: 1.1rem;
}
.filmstrip-wrap{
  position: relative;
  overflow: hidden;
  padding: 6px 0 14px;
  border-top: 1px dashed rgba(230,181,102,0.28);
  border-bottom: 1px dashed rgba(230,181,102,0.28);
}
.filmstrip-wrap::before,
.filmstrip-wrap::after{
  content:'';
  position:absolute; top:0; bottom:0; width: 48px; z-index:2;
  pointer-events:none;
}
.filmstrip-wrap::before{ left:0; background: linear-gradient(90deg, var(--color-night-a), transparent); }
.filmstrip-wrap::after{ right:0; background: linear-gradient(270deg, var(--color-night-a), transparent); }

.filmstrip-track{
  display:flex;
  gap: 20px;
  width: max-content;
  padding: 10px 8px;
  animation: reelScroll 30s linear infinite;
}
.filmstrip-wrap:hover .filmstrip-track{ animation-play-state: paused; }
@keyframes reelScroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}

.fav-card{
  flex-shrink:0;
  width: 128px;
  background:none;
  display:flex;
  flex-direction:column;
  align-items:center;
  cursor:pointer;
}
.fav-card__heart{
  position:relative;
  width: 118px;
  aspect-ratio: 32 / 29;
  clip-path: url(#heartClip);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 22px -6px rgba(0,0,0,0.55);
}
.fav-card__icon{
  font-size: 2rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.fav-card__play{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(10,5,18,0.35);
  color: var(--color-gold-light);
  font-size: 0.66rem;
  font-weight:600;
  letter-spacing:0.03em;
  opacity:0;
  transition: opacity .25s ease;
}
.fav-card:hover .fav-card__play,
.fav-card:focus-visible .fav-card__play{ opacity:1; }
.fav-card__label{
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: var(--color-gold-light);
  margin-top: 8px;
  text-align:center;
}

/* ---------- Favorite-memory modal ---------- */
.fav-modal{
  position: fixed;
  inset:0;
  z-index: 60;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6vw;
  opacity:0;
  visibility:hidden;
  transition: opacity .3s ease, visibility .3s;
}
.fav-modal.visible{ opacity:1; visibility:visible; }
.fav-modal__backdrop{
  position:absolute; inset:0;
  background: rgba(8,4,14,0.78);
  backdrop-filter: blur(6px);
}
.fav-modal__panel{
  position:relative;
  width:100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: linear-gradient(165deg, rgba(58,16,48,0.95), rgba(20,9,26,0.98));
  border: 1px solid rgba(230,181,102,0.4);
  border-radius: 18px;
  padding: 1.6rem 1.4rem;
  text-align:center;
  box-shadow: 0 0 40px rgba(230,181,102,0.16), 0 20px 50px -12px rgba(0,0,0,0.65);
  transform: scale(0.9);
  transition: transform .35s var(--ease-soft);
}
.fav-modal.visible .fav-modal__panel{ transform: scale(1); }
.fav-modal__panel::-webkit-scrollbar{ display: none; width: 0; height: 0; }
.fav-modal__close{
  position:absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--color-text);
  font-size: 0.9rem;
  display:flex; align-items:center; justify-content:center;
}
.fav-modal__media{
  width: min(100%, calc(65vh * 9 / 16));
  aspect-ratio: 9 / 16;
  border-radius: 10px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  margin: 0 auto 1rem;
  background: rgba(0,0,0,0.35);
}
.fav-modal__media img{
  width:100%; height:100%;
  object-fit: cover;
}
.fav-modal__media video{
  width:100%; height:100%;
  object-fit: contain;
  background: #000;
}
.fav-modal__media .fav-modal__icon{
  font-size: 3rem;
}
.fav-modal__title{
  font-family: var(--font-display);
  font-weight:600;
  font-size: 1.2rem;
  color: var(--color-text);
}
.fav-modal__caption{
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-text-dim);
  margin-top: 0.3rem;
}

/* ============================================================
   SCENE 6 — LOVE LETTER
   ============================================================ */
.letter-scene{
  position: relative;
  width: 100%;
  max-width: 380px;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.envelope2{
  position: relative;
  width: min(64vw, 230px);
  height: min(46vw, 165px);
}
.envelope2__back{
  position:absolute; inset:0;
  background: linear-gradient(160deg, #e2c9a1, #caa06a);
  border-radius: 6px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.6);
}
.envelope2__flap{
  position:absolute;
  top:0; left:0; right:0;
  height: 58%;
  background: linear-gradient(160deg, #ecd7b4, #d1ac78);
  clip-path: polygon(0 0, 100% 0, 50% 92%);
  transform-origin: top center;
  border-radius: 6px 6px 0 0;
  transition: transform 1.3s var(--ease-soft);
  z-index:2;
}
.envelope2.open .envelope2__flap{
  transform: rotateX(178deg);
}
.envelope2__seal{
  position:absolute;
  left:50%; top: 46%;
  transform: translate(-50%,-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d84f68, var(--color-rose-deep) 70%);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.25);
  z-index:3;
  transition: transform .5s var(--ease-soft), opacity .4s ease;
}
.envelope2__seal svg{ width: 46%; fill: var(--color-blush); }
.envelope2.open .envelope2__seal{
  transform: translate(-50%,-50%) scale(0) rotate(35deg);
  opacity:0;
}
.letter-hint{
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-text-dim);
  margin-top: 0.9rem;
  animation: hintPulse 2.2s ease-in-out infinite;
}
.envelope2.open + .letter-hint{ display:none; }

.letter-paper{
  width: 100%;
  max-width: 340px;
  max-height: 0;
  overflow: hidden;
  background: var(--color-cream);
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 27px, rgba(58,42,47,0.08) 28px);
  border-radius: 3px;
  box-shadow: 0 24px 60px -14px rgba(0,0,0,0.65);
  padding: 0 1.6rem;
  opacity:0;
  transform: translateY(30px);
  transition: opacity 1.3s ease, transform 1.4s var(--ease-soft), max-height 1.5s var(--ease-soft), padding 1.3s ease, margin-top 1.3s ease;
}
.letter-paper.open{
  margin-top: -20px;
  max-height: 70vh;
  opacity:1;
  transform: translateY(0);
  padding: 1.8rem 1.6rem 1.6rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.letter-paper.open::-webkit-scrollbar{ display: none; width: 0; height: 0; }
.letter-paper__salutation{
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--color-ink);
  text-align:left;
  margin-bottom: 0.6rem;
}
.letter-paper__body{
  font-family: var(--font-script);
  font-size: 1.2rem;
  line-height: 1.9;
  color: var(--color-ink);
  text-align:left;
  white-space: pre-wrap;
  min-height: 3em;
}
.letter-paper__body .caret{
  display:inline-block;
  width: 2px;
  height: 1em;
  background: var(--color-ink);
  vertical-align: -0.15em;
  animation: caretBlink 0.9s steps(1) infinite;
}
@keyframes caretBlink{ 50%{ opacity:0; } }
.letter-paper__sign{
  font-family: var(--font-script);
  font-size: 1.25rem;
  color: var(--color-ink);
  text-align:right;
  white-space: pre-line;
  margin: 1rem 0 1.2rem;
}

/* ============================================================
   SCENE 6.5 — DO YOU LOVE ME? (BUNNY)
   ============================================================ */
.question-scene-inner{ gap: 1.1rem; }

.bunny {
  position: relative;
  width: min(60vw, 240px);
  aspect-ratio: 1;
}

.bunny-sprite {
  width: 100%; 
  height: 100%; 
  animation: floatBunny 4s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes floatBunny {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.bunny-svg { 
  width: 100%; 
  height: 100%; 
  overflow: visible; 
}

.bunny-glow {
  filter: drop-shadow(0 15px 25px rgba(255, 182, 193, 0.25));
}

/* Default hidden layers */
.bunny-eyes-sad,
.bunny-tears,
.bunny-mouth-sad,
.bunny-eyes-kiss,
.bunny-mouth-kiss {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Default visible layers */
.bunny-eyes-open,
.bunny-mouth-smile {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* --- SAD STATE (Dodging NO) --- */
.bunny.sad .bunny-sprite {
  animation: shiverBunny 0.4s ease-in-out infinite;
}
@keyframes shiverBunny {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 1px); }
  50% { transform: translate(3px, -1px); }
  75% { transform: translate(-3px, 2px); }
}

.bunny.sad .bunny-eyes-open { opacity: 0; }
.bunny.sad .bunny-mouth-smile { opacity: 0; }
.bunny.sad .bunny-eyes-sad { opacity: 1; }
.bunny.sad .bunny-tears { opacity: 1; }
.bunny.sad .bunny-mouth-sad { opacity: 1; }
.bunny.sad .bunny-puddle { rx: 50px; opacity: 0.7; }

.bunny-ear-l, .bunny-ear-r { transition: transform 0.5s var(--ease-soft); }
.bunny-ear-l { transform-origin: 70px 90px; }
.bunny-ear-r { transform-origin: 130px 90px; }
.bunny.sad .bunny-ear-l { transform: rotate(-35deg); }
.bunny.sad .bunny-ear-r { transform: rotate(35deg); }

.tear-stream {
  stroke-dasharray: 6 6;
  stroke-dashoffset: 0;
  animation: tearFlow 0.5s linear infinite;
}
@keyframes tearFlow { to { stroke-dashoffset: -12; } }

.bunny-puddle {
  transition: rx 2.5s ease-out, opacity 1s ease-in;
}

/* --- KISS / HAPPY STATE (YES Clicked) --- */
.bunny.kiss .bunny-sprite {
  animation: jumpBunny 0.6s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
}
@keyframes jumpBunny {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-30px) scaleY(1.05); }
}

.bunny.kiss .bunny-eyes-open { opacity: 0; }
.bunny.kiss .bunny-mouth-smile { opacity: 0; }
.bunny.kiss .bunny-eyes-sad { opacity: 0; }
.bunny.kiss .bunny-tears { opacity: 0; }
.bunny.kiss .bunny-mouth-sad { opacity: 0; }
.bunny.kiss .bunny-puddle { opacity: 0; transition: opacity 0.2s; }

.bunny.kiss .bunny-eyes-kiss { opacity: 1; }
.bunny.kiss .bunny-mouth-kiss { opacity: 1; }

.bunny.kiss .bunny-ear-l { transform: rotate(8deg); }
.bunny.kiss .bunny-ear-r { transform: rotate(-8deg); }

.bunny-paw-group {
  transition: transform 0.4s var(--ease-soft);
  transform-origin: top center;
}
.bunny.kiss #bunny-paw-left { transform: translate(-10px, -35px) rotate(135deg); }
.bunny.kiss #bunny-paw-right { transform: translate(10px, -35px) rotate(-135deg); }

.big-heart{
  position:absolute;
  left:50%; top:42%;
  width: 68px;
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
  pointer-events:none;
  filter: drop-shadow(0 0 18px rgba(197,58,92,0.65)) drop-shadow(0 0 34px rgba(230,181,102,0.35));
}

.question-text{
  font-family: var(--font-display);
  font-weight:600;
  font-size: clamp(1.4rem, 5.8vw, 2rem);
  color: var(--color-text);
  text-align:center;
  min-height: 2.6em;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform 0.3s ease;
}
.question-text__heart{
  width: 0.8em;
  height: 0.8em;
  fill: var(--color-rose);
  display: inline-block;
  vertical-align: -0.05em;
  margin-left: 0.2em;
  filter: drop-shadow(0 0 6px rgba(197,58,92,0.5));
}

.question-stage{
  position:relative;
  width: 100%;
  max-width: 340px;
  height: 190px;
}
.question-btn{
  position:absolute;
  min-width: 96px;
  text-align:center;
  will-change: transform;
}
.question-btn--yes{
  left: 32%; top: 50%;
  transform: translate(-50%,-50%) scale(1);
  z-index: 2;
}
.question-btn--no{
  left: 68%; top: 50%;
  transform: translate(-50%,-50%) scale(1);
  background: rgba(255,255,255,0.05);
  color: var(--color-text-dim);
  border: 1px solid rgba(197,58,92,0.5);
  z-index: 3;
}

/* ============================================================
   SCENE 6.6 — GALAXY OF HEARTS
   ============================================================ */
.scene--galaxy{
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}
.galaxy-viewport{
  position:absolute;
  inset:0;
  overflow:hidden;
  touch-action:none;
  cursor: grab;
  background: var(--color-void);
}
.galaxy-viewport.dragging{ cursor: grabbing; }
.galaxy-canvas{
  position:absolute;
  left:0; top:0;
  pointer-events:none;
  will-change: transform;
}
.galaxy-field{
  position:absolute;
  width: 220vw;
  height: 220vh;
  left: 0; top: 0;
  pointer-events:none;
}

/* ---------- 3D moon centerpiece ---------- */
.galaxy-moon-position{
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%,-50%);
  z-index: 3;
  pointer-events:none;
  width: min(34vw, 148px);
  height: min(34vw, 148px);
}
.galaxy-moon-glow{
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%,-50%);
  width: min(70vw, 300px);
  height: min(70vw, 300px);
  border-radius:50%;
  background: radial-gradient(circle, rgba(235,225,205,0.35) 0%, rgba(235,225,205,0) 70%);
  filter: blur(2px);
  animation: moonGlowPulse 5s ease-in-out infinite;
}
@keyframes moonGlowPulse{
  0%,100%{ opacity: 0.75; }
  50%{ opacity: 1; }
}
.galaxy-moon{
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.galaxy-moon-fallback{ z-index: 1; }
.galaxy-moon-3d{
  z-index: 2;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}

.galaxy-heart{
  position:absolute;
  line-height:1;
  transform: translate(-50%,-50%);
  animation: galaxyDrift 6s ease-in-out infinite;
  fill: currentColor;
}
.galaxy-heart--blue{
  color: #8fc7ff;
  filter: drop-shadow(0 0 4px rgba(143,199,255,0.8)) drop-shadow(0 0 8px rgba(143,199,255,0.4));
  pointer-events:none;
}
.galaxy-heart--rose{
  display:block;
  background:none;
  border:none;
  padding:0;
  color: var(--color-rose);
  filter: drop-shadow(0 0 5px rgba(230,181,102,0.7)) drop-shadow(0 0 10px rgba(197,58,92,0.6));
  cursor:pointer;
  pointer-events:auto;
  animation-name: galaxyDriftRose;
}
.galaxy-heart--rose svg{
  width:100%;
  height:100%;
  display:block;
  fill: currentColor;
}
@keyframes galaxyDrift{
  0%,100%{ transform: translate(-50%,-50%) translateY(0); opacity: var(--base-opacity, 0.8); }
  50%{ transform: translate(-50%,-50%) translateY(-10px); opacity: 1; }
}
@keyframes galaxyDriftRose{
  0%,100%{ transform: translate(-50%,-50%) translateY(0) scale(1); }
  50%{ transform: translate(-50%,-50%) translateY(-8px) scale(1.12); }
}

.galaxy-ui{
  position:relative;
  z-index: 5;
  height: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  gap: 0.6rem;
  padding: 8vh 6vw calc(6vh + env(safe-area-inset-bottom));
  pointer-events:none;
  text-align:center;
}
.galaxy-ui .scene-title,
.galaxy-ui .scene-subtitle{ text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.galaxy-ui .scene-continue{ pointer-events:auto; }

.galaxy-banner{
  position: absolute;
  top: max(56px, calc(env(safe-area-inset-top) + 46px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: 100%;
  max-width: min(86vw, 380px);
  background: linear-gradient(165deg, rgba(58,16,48,0.92), rgba(20,9,26,0.96));
  border: 1px solid rgba(230,181,102,0.4);
  border-radius: 16px;
  padding: 0.9rem 1.3rem;
  text-align:center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .4s ease, visibility .4s;
}
.galaxy-banner.visible{ opacity:1; visibility:visible; }
.galaxy-banner__heart{
  display:block;
  width: 1.05rem;
  height: 1.05rem;
  fill: var(--color-rose);
  margin: 0 auto 0.3rem;
  filter: drop-shadow(0 0 6px rgba(197,58,92,0.6));
}
.galaxy-banner__text{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(0.92rem, 3.6vw, 1.08rem);
  line-height: 1.45;
  color: var(--color-text);
  min-height: 1.5em;
}
.galaxy-banner__text .caret{
  display:inline-block;
  width:2px; height:1em;
  background: var(--color-text);
  vertical-align:-0.15em;
  animation: caretBlink 0.9s steps(1) infinite;
}
.galaxy-heart--rose.collected{
  opacity: 0.32;
  animation-play-state: paused;
  cursor: default;
}

/* ============================================================
   SCENE 6.7 — FLOWERS
   ============================================================ */
.scene--flowers {
  flex-direction: column;
}
.scene--flowers::before {
  content: '';
  position: absolute;
  width: 80vmin;
  height: 80vmin;
  background: radial-gradient(circle, rgba(160, 20, 60, 0.25) 0%, rgba(20, 10, 30, 0.1) 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}
.flower-scene-title {
  position: absolute;
  top: 8%;
  z-index: 10;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px #ff0055;
  letter-spacing: 1px;
}
#flower-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 800px;
  max-height: 800px;
  z-index: 1;
  margin-top: 10vh;
}
#flower-scene-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
  transition: opacity 0.5s ease-in-out;
}
.flower-stem {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: flowerGrowStem 2s ease-in-out forwards;
  animation-delay: var(--delay);
}
@keyframes flowerGrowStem {
  to { stroke-dashoffset: 0; }
}
.flower-leaf, .flower-head-group {
  transform: scale(0);
  animation: flowerPopOut 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: var(--delay);
}
@keyframes flowerPopOut {
  to { transform: scale(1); }
}
#flower-sparkles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.flower-sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.8), 0 0 20px 5px rgba(255, 215, 0, 0.6);
  opacity: 0;
  animation: flowerFloatUp 2.5s ease-in-out forwards;
}
@keyframes flowerFloatUp {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { opacity: 1; transform: translateY(-30px) scale(1.2); }
  80% { opacity: 0.8; transform: translateY(-120px) scale(0.8); }
  100% { transform: translateY(-150px) scale(0); opacity: 0; }
}
.flower-ui {
  position: absolute;
  bottom: 8%;
  z-index: 10;
}

/* ============================================================
   SCENE 7 — FINALE (bright birthday-card style)
   ============================================================ */
.scene--finale{
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.finale-card{
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 0.85rem;
  padding: 9vh 7vw;
  text-align:center;
  background:
    repeating-linear-gradient(0deg, rgba(58,42,47,0.05) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(58,42,47,0.05) 0 1px, transparent 1px 26px),
    linear-gradient(160deg, #fdf6ee, #fbeae2);
}
.finale-card::-webkit-scrollbar{ display: none; width: 0; height: 0; }

.finale-card__bunting{
  position:absolute;
  top: max(14px, env(safe-area-inset-top));
  display:flex;
  gap: 4px;
}
.finale-card__bunting--left{ left: 14px; }
.finale-card__bunting--right{ right: 14px; }
.finale-card__bunting span{
  width: 16px; height: 20px;
  background: linear-gradient(160deg, var(--color-rose), var(--color-rose-deep));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.finale-card__bunting--left span:nth-child(even),
.finale-card__bunting--right span:nth-child(even){
  background: linear-gradient(160deg, var(--color-gold-light), var(--color-gold));
  transform: translateY(3px);
}

.finale-card__sparkle{
  position:absolute;
  color: var(--color-gold);
  font-size: 1.1rem;
  opacity: 0.8;
  animation: sparkleTwinkle 2.2s ease-in-out infinite;
}
.finale-card__sparkle--1{ top: 14%; left: 12%; animation-delay: 0.3s; }
.finale-card__sparkle--2{ top: 20%; right: 14%; animation-delay: 1s; }
@keyframes sparkleTwinkle{
  0%,100%{ opacity:0.3; transform: scale(0.85) rotate(0deg); }
  50%{ opacity:1; transform: scale(1.15) rotate(15deg); }
}

.finale-card__title{
  font-family: 'Baloo 2', var(--font-display);
  line-height: 1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 0.1em;
}
.finale-card__title-line{
  font-weight: 800;
  font-size: clamp(2.2rem, 11vw, 3.2rem);
  -webkit-text-stroke: 2.5px #3a2a2f;
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 rgba(58,42,47,0.18);
}
.finale-card__title-line--light{ color: #fffaf3; }
.finale-card__title-line--bold{
  color: var(--color-rose);
  display:flex;
  align-items:center;
  gap: 0.15em;
}
.finale-card__hat{
  font-size: 0.5em;
  -webkit-text-stroke: 0;
  filter: none;
  text-shadow: none;
}

.finale-card__badge{
  display:inline-flex;
  align-items:center;
  gap: 0.5em;
  background: linear-gradient(135deg, var(--color-rose), var(--color-rose-deep));
  color: #fff8f0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.55em 1.4em;
  border-radius: 999px;
  box-shadow: 0 6px 16px -4px rgba(197,58,92,0.4);
}
.finale-card__star{ color: var(--color-gold-light); font-size: 0.85em; }

.finale-card__illustration{
  position: relative;
  width: min(56vw, 200px);
  aspect-ratio: 1;
  margin-top: 0.3rem;
}
.finale-card__circle{
  position:relative;
  width:100%;
  height:100%;
  border-radius:50%;
  border: 2px dashed rgba(197,58,92,0.4);
  background: rgba(255,255,255,0.5);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:visible;
}
.finale-bear-svg{ width: 66%; height: 66%; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.15)); }
.finale-card__dot{
  position:absolute;
  border-radius: 2px;
}
.finale-card__dot--1{ top: 8%; left: 4%; width:7px; height:7px; background: var(--color-gold); transform: rotate(20deg); }
.finale-card__dot--2{ bottom: 14%; left: 0%; width:6px; height:6px; background: var(--color-rose); border-radius:50%; }
.finale-card__dot--3{ top: 12%; right: 2%; width:6px; height:6px; background: var(--color-rose); border-radius:50%; }
.finale-card__dot--4{ bottom: 6%; right: 10%; width:7px; height:7px; background: var(--color-gold); transform: rotate(-15deg); }

.finale-card__balloon{
  position:absolute;
  top: 6%;
  width: 30px; height: 38px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  background: radial-gradient(circle at 32% 28%, #ffb0c2, var(--color-rose) 70%);
  box-shadow: inset -4px -6px 10px rgba(0,0,0,0.15);
}
.finale-card__balloon::after{
  content:'';
  position:absolute;
  left:50%; top:100%;
  width:1px; height: 26px;
  background: rgba(58,42,47,0.3);
}
.finale-card__balloon--left{ left: -8%; animation: finaleBalloonBob 4s ease-in-out infinite; }
.finale-card__balloon--right{ right: -10%; top: 18%; animation: finaleBalloonBob 4.6s ease-in-out infinite .4s; }
@keyframes finaleBalloonBob{
  0%,100%{ transform: translateY(0) rotate(-2deg); }
  50%{ transform: translateY(-14px) rotate(2deg); }
}

.finale-card__cutie{
  display:inline-block;
  background: var(--color-rose);
  color: #fff8f0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35em 1.3em;
  border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(197,58,92,0.4);
}

.finale-card__from{
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: #6b5650;
  margin-top: 0.2rem;
}
.finale-card__actions{
  display:flex;
  flex-wrap:wrap;
  gap: 0.9rem;
  justify-content:center;
  margin-top: 0.4rem;
}
.btn--finale-outline{
  background: rgba(255,255,255,0.6);
  color: #6b3345;
  border: 1px solid rgba(197,58,92,0.4);
}
.btn--finale-outline:hover{ background: rgba(255,255,255,0.85); }

/* ---------- Burst heart particles (JS-generated) ---------- */
.burst-heart{
  position: fixed;
  z-index: 40;
  pointer-events: none;
  line-height:1;
  will-change: transform, opacity;
}

/* ---------- Toast ---------- */
.toast{
  position: fixed;
  bottom: max(28px, env(safe-area-inset-bottom));
  left:50%;
  transform: translate(-50%, 12px);
  z-index: 50;
  background: rgba(20,10,24,0.92);
  border: 1px solid rgba(230,181,102,0.4);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.75em 1.4em;
  border-radius: 999px;
  opacity:0;
  pointer-events:none;
  transition: opacity .35s ease, transform .35s ease;
}
.toast.visible{ opacity:1; transform: translate(-50%, 0); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px){
  .scene{ padding: 6vh 4vw; }
  .scene-inner{ gap: 2rem; }
  .heart-pull{ height: 40vh; }
}

@media (min-width: 900px){
  .scene-inner{ max-width: 620px; }
  .gallery-swiper{ width: 300px; height: 400px; }
}

/* ---------- Laptop / desktop: scale everything up to use the space ---------- */
@media (min-width: 1024px) and (min-height: 600px){
  .scene-inner{ max-width: 920px; gap: 2.2rem; }
  .scene{ padding: 2.5vh 4vw; }
  .scene-title{ font-size: clamp(2.2rem, 3.6vw, 3.6rem); }
  .scene-subtitle{ font-size: clamp(1.25rem, 1.9vw, 1.7rem); }
  .hint-text{ font-size: 1.05rem; }
  .btn{ font-size: 1.15rem; padding: 1.05em 2.7em; }
  .btn--small{ font-size: 0.95rem; padding: 0.75em 1.9em; }

  /* Intro */
  .envelope{ width: min(28vw, 380px); height: min(20.5vw, 276px); }
  .intro__message{ font-size: clamp(1.4rem, 2.1vw, 1.9rem); max-width: 32ch; }
  .name-highlight{ font-size: 1.6em; }

  /* Heart pull */
  .heart-pull{ height: 66vh; }
  .heart-pull__string{ height: 100px; }
  .heart-pull__anchor{ top: 100px; width: 150px; height: 138px; }

  /* Tree */
  .tree-wrap{ width: min(56vw, calc(84vh * 400 / 520), 680px); }
  .tree-title{ font-size: clamp(1.9rem, 2.8vw, 2.8rem); }

  /* Balloons */
  .balloons{ max-width: 920px; height: 78vh; min-height: 560px; }

  /* Gallery */
  .gallery-swiper{ width: 400px; height: 500px; }
  .polaroid__caption{ font-size: 1.55rem; }

  /* Cake + favorites */
  .cake{ width: min(28vw, 380px); }
  .cake-message{ font-size: clamp(1.8rem, 2.4vw, 2.4rem); }
  .favorites-section{ max-width: 920px; }
  .fav-card{ width: 168px; }
  .fav-card__heart{ width: 156px; }

  /* Letter */
  .letter-scene{ max-width: 560px; }
  .envelope2{ width: min(26vw, 340px); height: min(18.6vw, 242px); }
  .letter-paper{ max-width: 540px; }
  .letter-paper__body{ font-size: 1.5rem; }
  .letter-paper__salutation{ font-size: 1.9rem; }
  .letter-paper__sign{ font-size: 1.5rem; }

  /* Question / bunny */
  .bunny{ width: min(26vw, 320px); }
  .question-stage{ max-width: 540px; height: 270px; }
  .question-text{ font-size: clamp(1.9rem, 2.6vw, 2.7rem); }

  /* Galaxy */
  .galaxy-moon-position{ width: min(26vw, 240px); height: min(26vw, 240px); }
  .galaxy-moon-glow{ width: min(46vw, 460px); height: min(46vw, 460px); }
  .galaxy-banner{ max-width: min(60vw, 520px); padding: 1.1rem 1.7rem; }
  .galaxy-banner__text{ font-size: 1.3rem; }
  .galaxy-ui .scene-title{ font-size: clamp(2.4rem, 3.6vw, 3.6rem); }

  /* Finale */
  .finale-card{ padding: 5vh 8vw; gap: 1.3rem; }
  .finale-card__title-line{ font-size: clamp(3.4rem, 6.2vw, 5.6rem); }
  .finale-card__badge{ font-size: 1.25rem; padding: 0.65em 1.8em; }
  .finale-card__illustration{ width: min(28vw, 310px); }
  .finale-card__from{ font-size: 1.05rem; }
  .finale-card__cutie{ font-size: 1.05rem; }
}

/* ---------- Very large / wide desktop screens ---------- */
@media (min-width: 1500px) and (min-height: 750px){
  .scene-inner{ max-width: 1080px; }
  .tree-wrap{ width: min(48vw, calc(78vh * 400 / 520), 700px); }
  .balloons{ max-width: 1080px; height: 70vh; min-height: 620px; }
  .favorites-section{ max-width: 1080px; }
  .gallery-swiper{ width: 440px; height: 540px; }
}

@media (max-height: 620px){
  .scene-inner{ gap: 1rem; }
  .envelope, .envelope2{ transform: scale(0.85); }
  .tree-wrap{ width: min(98vw, calc(40vh * 400 / 520), 460px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}