/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --cream:        #FFF6F0;
  --blush:        #FFD3E0;
  --rose:         #E85D8A;
  --rose-deep:    #C4436B;
  --plum:         #6C3B72;
  --gold:         #F5C56B;
  --wine:         #3C1832;

  --font-display: 'Playfair Display', serif;
  --font-hand:    'Dancing Script', cursive;
  --font-body:    'Nunito', sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 20px 60px rgba(108, 59, 114, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background: linear-gradient(160deg, var(--cream) 0%, #FFEAF1 45%, #FBE4E9 100%);
  font-family: var(--font-body);
  color: var(--wine);
  -webkit-text-size-adjust: 100%;
}

html {
  touch-action: pan-y;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body {
  overflow-y: visible;
  overscroll-behavior-y: auto;
}

/* Keep the long story, gallery, and letter screens visibly scrollable. */
html {
  scrollbar-color: var(--rose) rgba(255, 211, 224, 0.45);
  scrollbar-width: thin;
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: rgba(255, 211, 224, 0.45); }
html::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--rose), var(--plum));
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

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

h1, h2 { font-family: var(--font-display); font-weight: 600; margin: 0; }
p { margin: 0; }

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

/* ============================================================
   BACKGROUND LAYERS
   ============================================================ */
#bg-particles {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
#fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 60; pointer-events: none;
}
#cursor-heart-layer {
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
}
.cursor-heart {
  position: absolute; font-size: 16px; color: var(--rose);
  animation: cursorHeartRise 900ms var(--ease) forwards;
  transform: translate(-50%, -50%);
}
@keyframes cursorHeartRise {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(0.6); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 46px)) scale(1.2); }
}

/* ============================================================
   LAYOUT / SCREENS
   ============================================================ */
#app {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(104px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(76px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  position: relative;
  text-align: center;
  overflow-x: hidden;
}
.screen.active {
  display: flex;
  overflow-y: visible;
}
.screen.leaving { animation: screenOut 480ms var(--ease) forwards; }
.screen.entering { animation: screenIn 620ms var(--ease) both; }

@keyframes screenOut {
  to { opacity: 0; transform: translateY(-18px) scale(0.99); }
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 700;
  margin-bottom: 20px;
}
.eyebrow.center { text-align: center; }
.serif { font-family: var(--font-display); }
.serif.center { text-align: center; }
.screen > h2 { margin-bottom: 34px; }
.screen p { line-height: 1.65; }

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 46px 38px;
  max-width: 520px;
  width: 100%;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.glow-btn {
  margin-top: 36px;
  border: none;
  cursor: pointer;
  padding: 16px 34px;
  min-height: 48px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.02rem;
  color: white;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--rose) 0%, var(--rose-deep) 60%, var(--plum) 100%);
  box-shadow: 0 10px 30px rgba(200, 60, 100, 0.35), 0 0 0 rgba(245,197,107,0);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.glow-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px rgba(200, 60, 100, 0.45), 0 0 26px rgba(245,197,107,0.55);
}
.glow-btn:active { transform: translateY(-1px) scale(0.99); }
.glow-btn.small { padding: 12px 26px; font-size: 0.92rem; margin: 8px; min-height: 44px; }
.glow-btn .spark { display: inline-block; animation: sparkPulse 1.6s ease-in-out infinite; }
@keyframes sparkPulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.25) rotate(10deg); } }

.floating-btn {
  position: fixed;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  right: calc(22px + env(safe-area-inset-right, 0px));
  z-index: 70;
  width: 52px; height: 52px;
  min-width: 44px; min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(10px);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms var(--ease);
}
.floating-btn:hover { transform: scale(1.08); }

.hidden { display: none !important; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
#progress-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 65;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
}
#progress-bar {
  width: 100%; max-width: 480px; margin: 0 auto;
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.5);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transition: width 600ms var(--ease);
  border-radius: 999px;
}

/* ============================================================
   SCREEN 1 — WELCOME
   ============================================================ */
.welcome-inner { max-width: 640px; }
.type-line {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.2rem);
  min-height: 1.3em;
  line-height: 1.25;
}
#typed-line1 { color: var(--wine); }
#typed-line2 { color: var(--rose-deep); font-style: italic; font-weight: 500; font-size: clamp(1.3rem, 4vw, 1.9rem); }
.type-line::after {
  content: '';
}
.typing-cursor::after {
  content: '|';
  animation: blink 900ms steps(1) infinite;
  color: var(--rose);
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   DATE BADGE ("Your Day")
   ============================================================ */
.date-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 20px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(200,60,100,0.18);
}
.date-badge-num {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: var(--rose-deep);
}
.date-badge-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--plum);
}

/* ============================================================
   SCREEN 2B — BIRTHDAY INTRO
   ============================================================ */
.intro-card { max-width: 480px; }
.intro-lines { display: flex; flex-direction: column; gap: 22px; }
.intro-line {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4.4vw, 1.5rem);
  color: var(--wine);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
}
.intro-line.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   SCREEN 2C — GIFT STORY
   ============================================================ */
.gift-card-stage {
  position: relative;
  width: min(92vw, 460px);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
.gift-card {
  width: 100%;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 44px 32px;
}
.gift-card.pop { animation: giftPop 420ms var(--ease); }
@keyframes giftPop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gift-card-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  line-height: 1.5;
  color: var(--wine);
  margin-bottom: 6px;
}
/* ============================================================
   PHOTO FRAME BASE (shared by all photo slots + graceful fallback)
   ============================================================ */
.photo-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blush), var(--rose));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-frame.img-fallback {
  background: linear-gradient(135deg, var(--blush), var(--rose) 55%, var(--plum));
}
.photo-frame.img-fallback::after {
  content: '🤍';
  font-size: 1.8rem;
  opacity: 0.85;
}
.photo-frame.img-fallback img { display: none; }

/* Opening photo, welcome screen */
.opening-photo {
  width: 108px; height: 108px;
  border-radius: 50%;
  margin: 0 auto 18px;
  box-shadow: 0 10px 30px rgba(200,60,100,0.28), 0 0 0 4px rgba(255,255,255,0.6);
}

/* After-game photo, quiz result */
.after-game-photo {
  width: 160px; height: 160px;
  border-radius: 20px;
  margin: 16px auto 4px;
  box-shadow: var(--shadow-soft);
}
.after-game-caption { margin-top: 6px; font-family: var(--font-display); font-style: italic; color: var(--rose-deep); }

/* Letter side photo */
.letter-side-photo {
  width: 96px; height: 96px;
  border-radius: 16px;
  margin: 14px auto 0;
  box-shadow: var(--shadow-soft);
}

/* Final best photo */
.final-best-photo {
  width: 200px; height: 200px;
  border-radius: 50%;
  margin: 0 auto 18px;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.5), 0 12px 34px rgba(0,0,0,0.35);
}

/* ============================================================
   SCREEN 4B — PHOTO GALLERY ("Little Pieces of You")
   ============================================================ */
.gallery-subtitle {
  margin-top: -18px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--plum);
  font-size: 1rem;
  max-width: 380px;
}

.featured-photo-wrap {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.featured-photo {
  width: min(84vw, 300px);
  height: min(84vw, 500px);
  cursor: pointer;
  animation: featuredGlow 3.2s ease-in-out infinite;
  transition: transform 300ms var(--ease);
}
.featured-photo:active { transform: scale(0.97); }
@keyframes featuredGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(245,197,107,0.0), var(--shadow-soft); }
  50% { box-shadow: 0 0 40px rgba(245,197,107,0.55), var(--shadow-soft); }
}
.featured-caption {
  margin-top: 18px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--rose-deep);
}

.memory-wall {
  margin-top: 42px;
  width: 100%;
  max-width: 640px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 4px;
}
.wall-photo {
  position: relative;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 260ms var(--ease);
}
.wall-photo:active { transform: scale(0.96); }
.wall-photo .photo-frame { width: 100%; height: 100%; border-radius: 16px; overflow: hidden; }
.wall-photo img { aspect-ratio: 4 / 5; }

/* Scroll-triggered blur → sharp reveal. Uses filter/opacity only (never
   `transform` on the card itself) so it doesn't fight the polaroid rotate
   set by the nth-child rules below; the "slight zoom" settle happens on
   the inner <img> instead. */
.wall-photo.reveal-on-scroll {
  opacity: 0;
  filter: blur(18px);
  transition: opacity 900ms var(--ease), filter 900ms var(--ease);
}
.wall-photo.reveal-on-scroll.revealed { opacity: 1; filter: blur(0); }
.wall-photo.reveal-on-scroll .photo-frame img {
  transform: scale(1.14);
  transition: transform 1200ms var(--ease);
}
.wall-photo.reveal-on-scroll.revealed .photo-frame img { transform: scale(1); }
.wall-photo-caption {
  margin-top: 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--rose-deep);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 700ms var(--ease) 450ms, transform 700ms var(--ease) 450ms;
}
.wall-photo.revealed .wall-photo-caption { opacity: 1; transform: translateY(0); }

/* Varied "imperfect" placement — every 5th item spans full width,
   every 4th is rotated like a polaroid, a few are stacked taller */
.wall-photo:nth-child(5n) { grid-column: 1 / -1; }
.wall-photo:nth-child(5n) .photo-frame,
.wall-photo:nth-child(5n) img { aspect-ratio: 16 / 9; }
.wall-photo:nth-child(4n+1) { transform: rotate(-2.2deg); }
.wall-photo:nth-child(4n+3) { transform: rotate(2deg); }
.wall-photo:nth-child(6n+2) .photo-frame,
.wall-photo:nth-child(6n+2) img { aspect-ratio: 3 / 4; }
.wall-photo:nth-child(7n) {
  border: 6px solid white;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

/* ============================================================
   SCREEN 4C — PHOTO PUZZLE
   ============================================================ */
.puzzle-hint { margin-top: 6px; color: var(--plum); font-size: 0.88rem; }
.puzzle-board {
  margin-top: 22px;
  width: min(84vw, 300px);
  height: min(84vw, 300px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.puzzle-piece {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--blush);
  background-size: 300% 300%;
  transition: outline 150ms var(--ease);
  outline: 3px solid transparent;
  outline-offset: -3px;
}
.puzzle-piece.selected { outline-color: var(--gold); }
.puzzle-piece.correct { outline-color: var(--rose); }
.puzzle-piece-num {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 0.65rem; font-weight: 800; color: white;
  background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 999px;
  pointer-events: none;
}
.puzzle-piece.img-fallback {
  background-image: none !important;
  background: linear-gradient(135deg, var(--blush), var(--rose), var(--plum));
}
.puzzle-result { margin-top: 18px; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--rose-deep); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 92;
  background: rgba(20, 8, 18, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top,0px)) 16px max(20px, env(safe-area-inset-bottom,0px));
  opacity: 0;
  transition: opacity 300ms var(--ease);
}
.lightbox.show { opacity: 1; }
.lightbox-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 62vh;
  display: flex; align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lightbox-img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-fallback {
  width: min(80vw, 340px); height: min(80vw, 340px);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blush), var(--rose), var(--plum));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.lightbox-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top,0px)); right: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: white; border: none;
  font-size: 1.6rem; cursor: pointer; z-index: 4;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: white; border: none;
  font-size: 1.8rem; cursor: pointer; z-index: 4;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-prev { left: 6px; }
.lightbox-next { right: 6px; }
.lightbox-info { margin-top: 18px; text-align: center; max-width: 440px; }
.lightbox-title { color: white; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.lightbox-caption { color: var(--blush); font-family: var(--font-display); font-style: italic; margin-top: 4px; }
.lightbox-counter { color: rgba(255,255,255,0.6); font-size: 0.78rem; margin-top: 8px; letter-spacing: 0.06em; }
.lightbox-heart {
  margin-top: 18px;
  width: 54px; height: 54px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.15);
  font-size: 1.5rem; cursor: pointer;
  transition: transform 200ms var(--ease);
}
.lightbox-heart:active { transform: scale(0.85); }

/* ============================================================
   SCREEN 7B — FINAL PHOTO REVEAL (dark)
   ============================================================ */
#screen-photo-reveal {
  background: radial-gradient(ellipse at 50% 25%, #4a2242 0%, var(--wine) 75%);
  color: white;
}
.reveal-stage { max-width: 460px; width: 100%; }
.reveal-lines { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.reveal-line {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4.4vw, 1.4rem);
  opacity: 0; transform: translateY(10px);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
}
.reveal-line.show { opacity: 1; transform: translateY(0); }
.reveal-photo {
  width: min(78vw, 300px); height: min(78vw, 300px);
  margin: 22px auto 16px;
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(245,197,107,0.35), var(--shadow-soft);
  opacity: 0; transform: scale(0.9);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.reveal-photo.show { opacity: 1; transform: scale(1); }
.reveal-caption {
  font-family: var(--font-display); font-style: italic; color: var(--blush);
  opacity: 0; transition: opacity 700ms var(--ease);
}
.reveal-caption.show { opacity: 1; }
#btn-celebrate.show { display: inline-flex; }

/* ============================================================
   SCREEN 2 — LOCK
   ============================================================ */
.lock-card { }
.lock-question { margin: 18px 0 10px; font-weight: 700; }
.date-input {
  font-family: var(--font-body);
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  padding: 14px 18px;
  min-height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--blush);
  background: white;
  color: var(--wine);
  outline: none;
  width: 100%;
  max-width: 280px;
  text-align: center;
}
.date-input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(232,93,138,0.18); }
.lock-message { margin-top: 14px; font-weight: 700; min-height: 1.4em; color: var(--rose-deep); }
.lock-reveal {
  margin-top: 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--rose-deep);
  white-space: pre-wrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.lock-reveal.show { opacity: 1; transform: translateY(0); }
.lock-card.glow-reveal {
  box-shadow: var(--shadow-soft), 0 0 50px rgba(245,197,107,0.55);
  transition: box-shadow 600ms var(--ease);
}
.shake { animation: shakeX 420ms; }
@keyframes shakeX {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-8px); }
  40%,60% { transform: translateX(8px); }
}

/* ============================================================
   SCREEN 3 — MINI GAME
   ============================================================ */
.game-card { max-width: 560px; }
.game-progress {
  display: flex; gap: 8px; justify-content: center; margin: 22px 0 30px;
}
.game-progress .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(108,59,114,0.2);
  transition: background 250ms var(--ease), transform 250ms var(--ease);
}
.game-progress .dot.done { background: var(--rose); transform: scale(1.15); }
.game-progress .dot.current { background: var(--gold); }

.quiz-question { font-weight: 800; font-size: 1.15rem; margin-bottom: 26px; }
.quiz-options { display: flex; flex-direction: column; gap: 16px; }
.quiz-option {
  border: 1.5px solid var(--blush);
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 15px 18px;
  min-height: 52px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
  color: var(--wine);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:hover { transform: translateY(-2px); border-color: var(--rose); }
.quiz-option.picked {
  background: linear-gradient(120deg, var(--rose), var(--plum));
  color: white; border-color: transparent;
  transform: scale(1.02);
}
.quiz-reaction {
  margin-top: 14px; font-weight: 700; color: var(--rose-deep);
  min-height: 1.4em; opacity: 0; transform: translateY(6px);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.quiz-reaction.show { opacity: 1; transform: translateY(0); }
.quiz-result-text { font-size: 1.15rem; font-weight: 800; }

/* ============================================================
   SCREEN 4 — MEMORY LANE
   ============================================================ */
.swipe-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--plum);
  opacity: 0.7;
}
.memory-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 24px 6vw 20px;
  scroll-snap-type: x mandatory;
  max-width: 100%;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.memory-track::-webkit-scrollbar { height: 8px; }
.memory-track::-webkit-scrollbar-thumb { background: var(--blush); border-radius: 999px; }

.memory-card {
  scroll-snap-align: center;
  flex: 0 0 min(72vw, 260px);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
  position: relative;
}
.memory-card:hover { transform: translateY(-8px) rotate(-1deg) scale(1.02); }
.memory-photo {
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.memory-photo .heart-burst { position: absolute; }
.memory-body { padding: 16px 18px 20px; text-align: left; }
.memory-date { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose-deep); font-weight: 800; }
.memory-caption { font-family: var(--font-display); font-style: italic; font-size: 1.02rem; margin-top: 6px; }

.memory-card.expanded {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 480px);
  height: min(80vh, 560px);
  z-index: 80;
  transform: none !important;
}
.memory-card.expanded .memory-photo { height: 55%; font-size: 4rem; }
.memory-overlay {
  position: fixed; inset: 0; background: rgba(60, 24, 50, 0.55);
  backdrop-filter: blur(4px); z-index: 79; opacity: 0;
  transition: opacity 300ms var(--ease);
}
.memory-overlay.show { opacity: 1; }

/* ============================================================
   SCREEN 5 — REASONS I LOVE YOU
   ============================================================ */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(1); }
  45% { transform: scale(1.08); }
}
.reason-text {
  max-width: 480px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  min-height: 2.6em;
  color: var(--wine);
}
.reason-counter {
  margin-top: 10px;
  font-weight: 800;
  color: var(--rose-deep);
  letter-spacing: 0.04em;
}

/* ============================================================
   SCREEN 6 — SCRATCH CARD
   ============================================================ */
.scratch-wrap {
  position: relative;
  width: min(92vw, 600px);
  height: 260px;
  margin-top: 26px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.scratch-secret {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3.4vw, 1.5rem);
  font-weight: 600;
  text-align: center;
  background: linear-gradient(135deg, #fff0f5, #ffe4ec);
  color: var(--rose-deep);
}
#scratch-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: grab;
}
.scratch-more { margin-top: 20px; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--plum); }
.scratch-secret { white-space: pre-wrap; }
.quiz-result-text { white-space: pre-wrap; }

/* ============================================================
   THE FIRST MEETING — empty polaroid frame
   ============================================================ */
.empty-frame {
  width: min(70vw, 240px);
  min-height: min(84vw, 280px);
  margin: 38px auto 12px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--rose);
  background: rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.empty-frame-heart {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--rose-deep);
  filter: drop-shadow(0 6px 16px rgba(232,93,138,0.35));
}
.empty-frame-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--rose-deep);
  font-size: 1.02rem;
}
.empty-frame-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--plum);
  letter-spacing: 0.03em;
}

/* ============================================================
   SCREEN 7 — LOVE LETTER
   ============================================================ */
.letter-stage { max-width: 560px; width: 100%; }
.envelope {
  position: relative;
  width: min(84vw, 320px);
  height: 200px;
  margin: 40px auto 0;
  cursor: pointer;
  perspective: 800px;
}
.envelope-body {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--blush), #ffc2d6);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}
.envelope-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  clip-path: polygon(0 0, 100% 0, 50% 85%);
  transform-origin: top center;
  transition: transform 700ms var(--ease);
  border-radius: 10px 10px 0 0;
  z-index: 3;
}
.envelope.open .envelope-flap { transform: rotateX(180deg); }
.envelope-hint { margin-top: 12px; color: var(--plum); font-size: .86rem; }
.envelope-seal {
  position: absolute;
  top: 78px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 6px 16px rgba(245,197,107,0.5);
  z-index: 4;
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.envelope.open .envelope-seal { opacity: 0; transform: translateX(-50%) scale(0.4); }

.letter-paper {
  margin: 26px auto 0;
  max-width: 480px;
  background: #fffdf8;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 34px 30px;
  text-align: left;
  position: relative;
  background-image: repeating-linear-gradient(transparent, transparent 37px, rgba(108,59,114,0.08) 38px);
}
.handwritten { font-family: var(--font-hand); }
.letter-text {
  font-size: clamp(1.15rem, 3.2vw, 1.4rem);
  line-height: 1.65;
  color: var(--wine);
  white-space: pre-wrap;
}
.letter-sign {
  margin-top: 18px;
  font-size: 1.3rem;
  color: var(--rose-deep);
  text-align: right;
}

/* ============================================================
   SCREEN 8 — FINAL SURPRISE
   ============================================================ */
#screen-final { transition: background 900ms var(--ease); }
#screen-final.dark {
  background: radial-gradient(ellipse at 50% 20%, #5a2a52 0%, var(--wine) 70%);
  color: white;
}
.countdown-number {
  font-family: var(--font-display);
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 800;
  margin-top: 16px;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(245,197,107,0.7);
}
.celebration-stage { width: 100%; }
.birthday-title {
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  color: white;
  text-shadow: 0 0 30px rgba(245,197,107,0.6), 0 0 60px rgba(232,93,138,0.4);
  letter-spacing: 0.02em;
}
.birthday-title span { display: inline-block; animation: heartbeat 1.6s ease-in-out infinite; }
.birthday-date {
  margin-top: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-size: 0.95rem;
}
.birthday-sub {
  margin-top: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  color: var(--blush);
  max-width: 480px;
  margin-left: auto; margin-right: auto;
}
.birthday-sub-2 { margin-top: 18px; color: white; font-weight: 600; }
.beat { display: inline-block; animation: heartbeat 1.6s ease-in-out infinite; }

.cake-wrap { margin-top: 52px; display: flex; justify-content: center; }
.cake { position: relative; width: 220px; }
.candle-row {
  position: absolute; top: -34px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 14px;
}
.candle {
  width: 6px; height: 30px;
  background: linear-gradient(var(--gold), #fff);
  border-radius: 3px;
  position: relative;
}
.flame {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 16px;
  background: radial-gradient(circle at 50% 30%, #fff6c8, var(--gold) 60%, #e8894b 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 500ms ease-in-out infinite alternate;
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.flame.out { opacity: 0; transform: translateX(-50%) scale(0.2); }
@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-3deg); }
  100% { transform: translateX(-50%) scale(1.12) rotate(3deg); }
}
.cake-top { height: 34px; background: #fff0f6; border-radius: 10px 10px 0 0; box-shadow: inset 0 -6px 0 rgba(232,93,138,0.25); }
.cake-mid { height: 46px; background: var(--blush); box-shadow: inset 0 -8px 0 rgba(232,93,138,0.3); }
.cake-base { height: 30px; background: var(--rose); border-radius: 0 0 12px 12px; }
.cake { cursor: pointer; }

.blow-instructions { margin-top: 30px; color: var(--blush); font-weight: 700; }
.wish-text { margin-top: 24px; font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--gold); }

.final-buttons { margin-top: 42px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }

/* ============================================================
   MODAL — dark romantic full-screen secret message
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #4a2242 0%, var(--wine) 75%);
  padding: max(28px, env(safe-area-inset-top, 0px)) 24px max(28px, env(safe-area-inset-bottom, 0px));
  opacity: 0;
  transition: opacity 500ms var(--ease);
  overflow-y: auto;
}
.modal.show { opacity: 1; }
.modal-inner { max-width: 480px; width: 100%; text-align: center; margin: auto; }
.final-call-kicker { color: var(--blush); font-size: 1rem; }
.final-call-title { margin-top: 12px; color: white; font-size: clamp(2.8rem, 12vw, 5rem); }
.final-call-copy {
  max-width: 390px;
  margin: 18px auto 26px;
  color: rgba(255, 211, 224, .82);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  line-height: 1.6;
}
.call-suraj { display: inline-flex; text-decoration: none; }
.call-config-message { margin-top: 14px; color: var(--gold); font-size: .85rem; }
#final-modal-close { display: block; margin: 14px auto 0; background: transparent; box-shadow: none; }
.final-modal-text {
  white-space: pre-wrap;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 4vw, 1.3rem);
  line-height: 1.8;
  color: var(--blush);
  min-height: 1.4em;
}

/* ============================================================
   FLOATING HEARTS / CONFETTI DOM ELEMENTS
   ============================================================ */
.floating-heart {
  position: fixed;
  bottom: -40px;
  font-size: 1.4rem;
  z-index: 58;
  pointer-events: none;
  animation: floatUp linear forwards;
  color: var(--rose);
}
@keyframes floatUp {
  to { transform: translateY(-110vh) translateX(var(--drift, 0px)) rotate(360deg); opacity: 0; }
}

/* ============================================================
   REUSABLE ANIMATION SYSTEM
   A small vocabulary of scroll/entrance effects. Elements start in their
   hidden state and pick up `.revealed` — added either immediately by JS
   (for scripted sequences like revealLines) or by the IntersectionObserver
   in initScrollReveal() below (for anything tagged `.reveal-on-scroll`).
   Keep this romantic and slow — these are not template micro-interactions.
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}
.fade-up.revealed { opacity: 1; transform: translateY(0); }

.fade-in {
  opacity: 0;
  transition: opacity 1000ms var(--ease);
}
.fade-in.revealed { opacity: 1; }

.blur-reveal {
  opacity: 0;
  filter: blur(16px);
  transform: scale(0.94);
  transition: opacity 1000ms var(--ease), filter 1000ms var(--ease), transform 1000ms var(--ease);
}
.blur-reveal.revealed { opacity: 1; filter: blur(0); transform: scale(1); }

.float-in {
  opacity: 0;
  transform: translateY(46px);
  transition: opacity 1100ms var(--ease), transform 1100ms var(--ease);
}
.float-in.revealed { opacity: 1; transform: translateY(0); }

.scale-in {
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.scale-in.revealed { opacity: 1; transform: scale(1); }

.slide-left {
  opacity: 0;
  transform: translateX(-42px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.slide-left.revealed { opacity: 1; transform: translateX(0); }

.slide-right {
  opacity: 0;
  transform: translateX(42px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.slide-right.revealed { opacity: 1; transform: translateX(0); }

.romantic-glow {
  text-shadow: 0 0 20px rgba(245,197,107,0.55), 0 0 46px rgba(232,93,138,0.25);
}

.gradient-text {
  background: linear-gradient(120deg, var(--gold) 0%, var(--rose) 45%, var(--plum) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 7s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.heartbeat-loop { animation: heartbeat 1.9s ease-in-out infinite; }

.letter-spread {
  letter-spacing: 0.4em;
  opacity: 0;
  transition: letter-spacing 1400ms var(--ease), opacity 1400ms var(--ease);
}
.letter-spread.revealed { letter-spacing: 0.03em; opacity: 1; }

/* ============================================================
   DARK CINEMATIC SCREENS (welcome, strange, don't-say, give-one-thing,
   constellation) — same dark palette as the final celebration screen,
   used for the more vulnerable/intimate beats of the story.
   ============================================================ */
.screen-dark {
  background: radial-gradient(ellipse at 50% 25%, #4a2242 0%, var(--wine) 75%);
  color: white;
}
.screen-dark > .eyebrow { color: var(--gold); }
.screen-dark > h2.serif { color: var(--blush); }

/* Every scripted line on a dark screen needs its own light foreground;
   otherwise `.intro-line` falls back to the dark `--wine` text color. */
.screen-dark .intro-line {
  color: #ffe8f0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

.welcome-lines { margin-bottom: 6px; }
.welcome-reveal-line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 4.6vw, 1.8rem);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(245,197,107,0.35);
}

/* ============================================================
   THINGS I DON'T ALWAYS SAY — secret note, one message at a time
   ============================================================ */
.dontsay-card {
  max-width: 480px;
  min-height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dontsay-text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 3.8vw, 1.35rem);
  color: var(--wine);
  min-height: 2.6em;
}

/* ============================================================
   THE LITTLE THINGS — automatic compact notes, no tap sequence
   ============================================================ */
.little-things-intro {
  max-width: 480px;
  margin: -14px auto 34px;
  color: rgba(255, 211, 224, .76);
  font-size: .92rem;
}
.little-things-outro {
  margin-top: 32px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
}
.little-things-grid {
  width: min(100%, 720px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.little-note {
  flex: 1 1 190px;
  max-width: 224px;
  min-height: 250px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  text-align: left;
  border: 1px solid rgba(245, 197, 107, .18);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: 0 16px 38px rgba(20, 5, 17, .2);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .75s var(--ease), transform .75s var(--ease), border-color .35s ease;
  overflow: hidden;
}
.little-note.show { opacity: 1; transform: translateY(0); }
.little-note:hover { border-color: rgba(245, 197, 107, .4); }
.little-note-image { width: 100%; height: 112px; object-fit: cover; display: block; }
.little-note > div { padding: 14px 15px 16px; }
.little-note h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--gold);
}
.little-note p {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: .86rem;
  line-height: 1.42;
  color: rgba(255, 232, 240, .82);
}
@media (max-width: 430px) {
  .little-things-grid { gap: 14px; }
  .little-note {
    flex-basis: 100%;
    max-width: 100%;
    min-height: 142px;
    display: grid;
    grid-template-columns: 108px 1fr;
  }
  .little-note-image { width: 108px; height: 100%; min-height: 142px; }
  .little-note > div { padding: 14px 13px; }
  .little-note h3 { font-size: .98rem; }
  .little-note p { font-size: .84rem; line-height: 1.46; }
}

.gift-card-kicker {
  margin-bottom: 12px;
  color: var(--rose-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.effort-score {
  margin: 18px auto 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--plum);
  font-size: .84rem;
  font-weight: 700;
}
.quiz-option.wrong { border-color: #b86a76; background: rgba(184, 106, 118, .12); }
.reason-card { margin-top: 4px; min-height: 168px; display: grid; place-items: center; }
.landing-lock-joke { margin-top: 10px; color: var(--landing-muted); font-size: .88rem; line-height: 1.55; }
.intro-lines-lead {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--blush);
  margin-bottom: 18px;
  opacity: 0.85;
}
/* ============================================================
   THE FUTURE BIRTHDAY PHOTO — glowing heart inside the empty frame
   ============================================================ */
.empty-frame-heart.glow-heart {
  transition: opacity 900ms ease, filter 900ms ease, transform 900ms ease;
}
#firstmeet-frame.show-heart .empty-frame-heart.glow-heart {
  opacity: 1;
  filter: drop-shadow(0 0 20px rgba(245,197,107,0.85));
  transform: scale(1.04);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .glass-card { padding: 34px 22px; }
  .screen {
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .memory-card { flex-basis: min(78vw, 220px); }
  .quiz-option { padding: 15px 16px; }
  .cake { width: 190px; }
  .memory-wall { gap: 16px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.5rem; }
  .lightbox-prev { left: 2px; }
  .lightbox-next { right: 2px; }
  .featured-photo { width: 88vw; height: 88vw; }
  .puzzle-board { width: 88vw; height: 88vw; }
}

@media (max-width: 360px) {
  .glass-card { padding: 28px 18px; }
  .glow-btn { padding: 14px 24px; font-size: 0.95rem; }
  .date-badge { padding: 8px 16px; }
  .scratch-wrap { height: 220px; }
}

/* Landscape phones: shrink vertical rhythm so content still fits */
@media (max-height: 480px) and (orientation: landscape) {
  .screen {
    min-height: auto;
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  }
  .cake-wrap { margin-top: 20px; }
  .birthday-title { font-size: clamp(1.8rem, 7vw, 3rem); }
}

/* Avoid layout shift / overflow from long words on very narrow screens */
h1, h2, p { overflow-wrap: break-word; word-break: break-word; }
.memory-track, .quiz-options, .final-buttons { max-width: 100%; }

/* ============================================================
   CINEMATIC LANDING — midnight, distance, and a slow warm dawn
   ============================================================ */
#screen-welcome {
  --landing-ink: #080608;
  --landing-burgundy: #2a0d1a;
  --landing-plum: #1c1020;
  --landing-champagne: #f3d7a2;
  --landing-blush: #f4dce3;
  --landing-muted: rgba(244, 220, 227, 0.68);
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100dvh;
  min-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: max(22px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(22px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(circle at 50% 44%, rgba(90, 35, 55, 0.18), transparent 31%),
    linear-gradient(145deg, var(--landing-ink) 0%, #120a12 46%, var(--landing-burgundy) 100%);
  color: var(--landing-blush);
  font-family: 'Poppins', sans-serif;
  transition: background 2.4s var(--ease), filter 1.2s ease;
}
#screen-welcome.is-warming {
  background:
    radial-gradient(circle at 50% 40%, rgba(226, 159, 103, 0.18), transparent 35%),
    radial-gradient(circle at 75% 90%, rgba(105, 38, 52, 0.28), transparent 46%),
    linear-gradient(145deg, #0b080b 0%, #1d0d18 48%, #421727 100%);
}
#screen-welcome.is-gold-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(circle at 50% 52%, rgba(248, 218, 155, 0.42), rgba(130, 66, 45, 0.08) 48%, transparent 76%);
  animation: landingGoldFlash 1.35s ease-out forwards;
}
@keyframes landingGoldFlash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.landing-atmosphere,
.landing-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.landing-atmosphere { z-index: -1; overflow: hidden; transition: transform .55s ease-out; }
.landing-atmosphere::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255,255,255,.16) 0 1px, transparent 1.7px),
    radial-gradient(circle at 72% 63%, rgba(243,215,162,.13) 0 1px, transparent 1.8px),
    radial-gradient(circle at 46% 84%, rgba(255,255,255,.1) 0 1px, transparent 1.6px);
  background-size: 91px 87px, 127px 119px, 73px 101px;
  opacity: .55;
  animation: landingStarDrift 24s linear infinite;
}
.landing-noise {
  opacity: .035;
  background-image: repeating-radial-gradient(circle at 20% 30%, #fff 0 .45px, transparent .8px 3px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
}
.landing-aurora,
.landing-bokeh {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: .2;
  will-change: transform;
}
.landing-aurora-one {
  width: 54vw; height: 54vw; min-width: 270px; min-height: 270px;
  left: -20%; top: 8%;
  background: rgba(96, 26, 55, .48);
  animation: landingAuroraOne 18s ease-in-out infinite alternate;
}
.landing-aurora-two {
  width: 46vw; height: 46vw; min-width: 240px; min-height: 240px;
  right: -17%; bottom: -10%;
  background: rgba(172, 91, 60, .34);
  animation: landingAuroraTwo 22s ease-in-out infinite alternate;
}
.landing-bokeh { filter: blur(20px); opacity: .18; }
.landing-bokeh-one { width: 42px; height: 42px; left: 12%; top: 70%; background: #e5ad77; animation: landingFloat 10s ease-in-out infinite; }
.landing-bokeh-two { width: 28px; height: 28px; right: 14%; top: 18%; background: #e7caa1; animation: landingFloat 13s ease-in-out -4s infinite; }
@keyframes landingStarDrift { to { transform: translate3d(4%, -5%, 0); } }
@keyframes landingAuroraOne { to { transform: translate3d(22%, 8%, 0) scale(1.12); } }
@keyframes landingAuroraTwo { to { transform: translate3d(-18%, -10%, 0) scale(.94); } }
@keyframes landingFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-28px); } }

.landing-scene {
  position: relative;
  width: min(100%, 760px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  z-index: 3;
}
.landing-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  animation: landingStageIn 1.25s var(--ease) both;
}
@keyframes landingStageIn {
  from { opacity: 0; filter: blur(12px); transform: translateY(12px) scale(.985); }
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
.landing-stage.is-leaving { animation: landingStageOut .9s ease forwards; }
@keyframes landingStageOut { to { opacity: 0; filter: blur(9px); transform: translateY(-9px) scale(.99); } }

.landing-name {
  min-height: 1.2em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3.1rem, 15vw, 6.8rem);
  letter-spacing: -.045em;
  color: #fff4ed;
  text-shadow: 0 0 34px rgba(242, 205, 157, .08);
  transition: text-shadow 1.6s ease;
}
.landing-name.has-glow { text-shadow: 0 0 30px rgba(243, 215, 162, .28), 0 0 80px rgba(142, 61, 69, .24); }
.landing-line,
.landing-emotion-line,
.landing-connection-line {
  max-width: 650px;
  min-height: 3.4em;
  margin-top: 22px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 5.2vw, 2.15rem);
  line-height: 1.48;
  color: var(--landing-muted);
  transition: opacity .75s ease, filter .75s ease, transform .75s var(--ease), color 1.2s ease;
}
.landing-line.is-changing,
.landing-emotion-line.is-changing,
.landing-connection-line.is-changing { opacity: 0; filter: blur(8px); transform: translateY(8px); }
.landing-line.is-emphasis,
.landing-emotion-line.is-emphasis,
.landing-connection-line.is-emphasis { color: #fff1ea; font-size: clamp(1.52rem, 6.4vw, 2.8rem); }
.landing-line .heart,
.landing-emotion-line .heart,
.landing-connection-line .heart { color: #dca1aa; font-size: .72em; }

.landing-tap-next {
  min-width: 112px;
  min-height: 48px;
  margin-top: 24px;
  padding: 10px 18px;
  border: 1px solid rgba(243, 215, 162, .22);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: rgba(243, 215, 162, .8);
  font: 400 .86rem 'Poppins', sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  touch-action: manipulation;
  animation: landingNextIn .7s var(--ease) both;
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .3s var(--ease), opacity .3s ease;
}
.landing-tap-next span { display: inline-block; margin-left: 7px; transition: transform .3s var(--ease); }
.landing-tap-next:hover { color: #fff1ea; border-color: rgba(243, 215, 162, .48); background: rgba(255,255,255,.065); }
.landing-tap-next:hover span { transform: translateX(3px); }
.landing-tap-next:active { transform: scale(.97); }
.landing-tap-next:disabled { opacity: .38; pointer-events: none; }
.landing-tap-next:focus-visible { outline: 2px solid var(--landing-champagne); outline-offset: 4px; }
@keyframes landingNextIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.landing-portal {
  position: relative;
  width: min(66vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 215, 162, .28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 198, 150, .12) 0%, rgba(104, 44, 54, .12) 42%, transparent 70%);
  box-shadow: inset 0 0 42px rgba(243, 215, 162,.06), 0 0 65px rgba(199, 124, 84,.12);
  animation: portalBreathe 5.5s ease-in-out infinite;
}
.landing-portal::before,
.landing-portal::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(244, 220, 227, .09);
  border-radius: inherit;
}
.landing-portal::before { inset: 9%; }
.landing-portal::after { inset: -8%; }
@keyframes portalBreathe { 0%,100% { transform: scale(1); opacity: .88; } 50% { transform: scale(1.025); opacity: 1; } }
.landing-portal-core { display: grid; place-items: center; min-height: 90px; }
.landing-date { font-size: clamp(.76rem, 3vw, .94rem); font-weight: 500; letter-spacing: .24em; color: var(--landing-champagne); }
.landing-day { margin-top: 10px; font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--landing-muted); }
.landing-world { font-family: var(--font-display); font-size: clamp(1.25rem, 5vw, 1.8rem); line-height: 1.35; color: #fff1e8; }

.landing-overline {
  max-width: 560px;
  margin-bottom: 22px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 4.4vw, 1.38rem);
  font-style: italic;
  color: var(--landing-muted);
}
.landing-photo-shell {
  position: relative;
  width: min(66vw, 280px);
  aspect-ratio: 4 / 5.35;
  border: 1px solid rgba(243, 215, 162, .25);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.025);
  box-shadow: 0 28px 70px rgba(0,0,0,.52), inset 0 0 0 1px rgba(255,255,255,.025);
  transform: perspective(900px) rotateX(1.2deg) rotateY(-1.4deg);
  transition: box-shadow 1.6s ease, transform 1.6s var(--ease);
}
.landing-photo-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 40px rgba(25,6,12,.3);
  pointer-events: none;
}
.landing-photo-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(112,48,62,.08));
  backdrop-filter: blur(12px);
  transition: opacity 1.1s ease;
}
.landing-photo-empty span {
  width: 44px; height: 1px;
  background: rgba(243,215,162,.25);
  box-shadow: 0 0 18px rgba(243,215,162,.2);
}
.landing-photo-shell img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  filter: blur(24px) saturate(.7);
  transform: scale(1.09);
  transition: opacity 1.2s ease, filter 2.4s ease, transform 3s var(--ease);
}
#landing-photo-stage.photo-is-open .landing-photo-shell {
  box-shadow: 0 28px 80px rgba(0,0,0,.56), 0 0 52px rgba(224,165,105,.19), inset 0 0 0 1px rgba(255,255,255,.05);
  transform: perspective(900px) rotateX(0) rotateY(0) translateY(-4px);
}
#landing-photo-stage.photo-is-open .landing-photo-empty { opacity: 0; }
#landing-photo-stage.photo-is-open .landing-photo-shell img {
  opacity: 1;
  filter: blur(0) saturate(.96);
  transform: scale(1);
  animation: landingPhotoBreathe 8s ease-in-out 3s infinite;
}
@keyframes landingPhotoBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.landing-photo-caption { margin-top: 15px; animation: landingStageIn 1.2s var(--ease) both; }
.landing-photo-caption h2 { font-size: clamp(1.7rem, 7vw, 2.35rem); font-weight: 500; color: #fff1e9; }
.landing-photo-caption p { margin-top: 4px; font-family: var(--font-display); font-style: italic; font-size: .95rem; color: var(--landing-muted); }

.landing-btn {
  min-width: min(100%, 228px);
  min-height: 52px;
  margin-top: 22px;
  padding: 13px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid rgba(243, 215, 162, .32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,.025));
  color: #fff3eb;
  box-shadow: 0 12px 38px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.08), 0 0 24px rgba(218,157,100,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font: 500 .92rem 'Poppins', sans-serif;
  letter-spacing: .025em;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .35s var(--ease), border-color .35s ease, box-shadow .35s ease, background .35s ease;
}
.landing-btn:hover { transform: translateY(-3px); border-color: rgba(243,215,162,.62); box-shadow: 0 16px 46px rgba(0,0,0,.3), 0 0 30px rgba(218,157,100,.13); }
.landing-btn:active { transform: translateY(0) scale(.985); }
.landing-btn:focus-visible,
.landing-input:focus-visible { outline: 2px solid var(--landing-champagne); outline-offset: 4px; }
.landing-btn-mark { color: #e3acb4; font-size: .78rem; animation: subtleHeartbeat 2.8s ease-in-out infinite; }
@keyframes subtleHeartbeat { 0%,82%,100% { transform: scale(1); } 88% { transform: scale(1.16); } 94% { transform: scale(.98); } }

.landing-lock {
  width: min(88vw, 470px);
  padding: clamp(24px, 7vw, 40px);
  border: 1px solid rgba(243,215,162,.18);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
  box-shadow: 0 28px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.landing-lock .landing-overline { margin-bottom: 10px; font-size: clamp(.92rem, 3.8vw, 1.08rem); }
.landing-lock h2 { font-weight: 500; font-size: clamp(1.72rem, 7vw, 2.4rem); color: #fff1ea; }
#landing-lock-form { width: 100%; margin-top: 25px; }
.landing-input {
  width: 100%;
  min-height: 54px;
  padding: 14px 19px;
  border: 1px solid rgba(244,220,227,.18);
  border-radius: 16px;
  background: rgba(4,3,5,.34);
  box-shadow: inset 0 1px 12px rgba(0,0,0,.2);
  color: #fff6f1;
  font: 400 1rem 'Poppins', sans-serif;
  text-align: center;
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.landing-input::placeholder { color: rgba(244,220,227,.38); }
.landing-input:focus { border-color: rgba(243,215,162,.5); background: rgba(8,5,8,.48); box-shadow: inset 0 1px 12px rgba(0,0,0,.2), 0 0 26px rgba(218,157,100,.09); }
.landing-unlock-btn { width: 100%; margin-top: 12px; }
.landing-lock .lock-message { min-height: 1.5em; margin-top: 12px; color: #e6aeb7; font-size: .82rem; }
.landing-lock.shake { animation: landingShake .45s ease; }
@keyframes landingShake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.landing-lock-reveal { margin-top: 22px; animation: landingStageIn 1.15s var(--ease) both; }
.landing-lock-reveal p { font-family: var(--font-display); color: var(--landing-champagne); }
.landing-lock-reveal p span { color: #dfa3ad; }
.landing-lock-reveal h2 { margin-top: 3px; font-size: clamp(2.25rem, 10vw, 3.45rem); }
.landing-lock-reveal small { display: block; margin-top: 8px; color: var(--landing-muted); font-weight: 300; }

.landing-final-kicker { font-family: var(--font-display); font-style: italic; font-size: clamp(1.15rem, 4.8vw, 1.55rem); color: var(--landing-champagne); }
.landing-final-kicker span { color: #e3a7b0; }
#landing-final h2 { max-width: 650px; margin-top: 14px; font-size: clamp(2.2rem, 10vw, 4.7rem); line-height: 1.1; font-weight: 500; color: #fff2ea; }
.landing-ready { margin-top: 28px; font-family: var(--font-display); font-style: italic; color: var(--landing-muted); font-size: 1.12rem; }
.landing-enter-btn { min-width: min(88vw, 300px); }
.landing-transition {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #050405;
  animation: landingCurtain 1.1s ease both;
}
.landing-transition span { color: #e0a2ad; font-size: 1.2rem; animation: landingLastHeart 1.5s ease both; }
@keyframes landingCurtain { from { opacity: 0; } to { opacity: 1; } }
@keyframes landingLastHeart { 0% { opacity: 0; transform: scale(.6); } 35%,70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.75); } }

.landing-music {
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: auto;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-color: rgba(243,215,162,.16);
  background: rgba(8,6,8,.34);
  color: rgba(243,215,162,.7);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  font-size: 1rem;
}
#landing-cursor-glow {
  position: fixed;
  z-index: 54;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,215,162,.11), transparent 68%);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
#landing-cursor-glow.is-visible { opacity: 1; }
.landing-cursor-heart,
.landing-touch-particle {
  position: fixed;
  z-index: 56;
  pointer-events: none;
  color: rgba(226, 166, 176, .62);
  font: 10px var(--font-body);
  transform: translate(-50%, -50%);
  animation: landingParticleFade 1.35s var(--ease) forwards;
}
.landing-touch-particle { color: rgba(243, 215, 162, .52); font-size: 8px; }
@keyframes landingParticleFade {
  from { opacity: 0; transform: translate(-50%, -35%) scale(.6); }
  24% { opacity: .75; }
  to { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Reusable cinematic motion vocabulary. */
.fade-down { opacity: 0; transform: translateY(-20px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.fade-down.revealed { opacity: 1; transform: translateY(0); }
.typewriter { position: relative; }
.typewriter.typing-cursor::after { content: ''; width: 1px; height: .78em; margin-left: .08em; display: inline-block; background: var(--landing-champagne); animation: blink 1s steps(1) infinite; }
.letter-reveal { animation: landingStageIn 1.2s var(--ease) both; }
.soft-glow { filter: drop-shadow(0 0 26px rgba(243,215,162,.08)); }
.heartbeat { animation: subtleHeartbeat 2.8s ease-in-out infinite; }
.float { animation: landingFloat 10s ease-in-out infinite; }
.photo-reveal { animation: landingPhotoReveal 2.4s var(--ease) both; }
.text-reveal { animation: landingTextReveal 1.2s var(--ease) both; }
@keyframes landingPhotoReveal { from { opacity: 0; filter: blur(24px); transform: scale(1.08); } to { opacity: 1; filter: blur(0); transform: scale(1); } }
@keyframes landingTextReveal { from { opacity: 0; filter: blur(9px); transform: translateY(8px); } to { opacity: 1; filter: blur(0); transform: translateY(0); } }

@media (max-width: 480px) {
  #screen-welcome { min-height: 500px; }
  .landing-scene { width: min(100%, 410px); }
  .landing-stage { padding: 44px 0 22px; }
  .landing-name { font-size: clamp(3rem, 17vw, 4.4rem); }
  .landing-line,
  .landing-emotion-line,
  .landing-connection-line { max-width: 92%; margin-top: 18px; font-size: clamp(1.17rem, 5.7vw, 1.55rem); line-height: 1.48; }
  .landing-line.is-emphasis,
  .landing-emotion-line.is-emphasis,
  .landing-connection-line.is-emphasis { font-size: clamp(1.42rem, 7vw, 1.9rem); }
  .landing-portal { width: min(68vw, 260px); }
  .landing-photo-shell { width: min(62vw, 248px); }
  .landing-overline { margin-bottom: 16px; }
  .landing-photo-caption { margin-top: 11px; }
  .landing-btn { margin-top: 16px; min-height: 50px; }
  .landing-lock { width: min(90vw, 410px); }
}

@media (max-width: 350px) {
  .landing-stage { padding-top: 48px; }
  .landing-photo-shell { width: min(59vw, 210px); }
  .landing-overline { font-size: .98rem; margin-bottom: 12px; }
  .landing-photo-caption h2 { font-size: 1.55rem; }
  .landing-photo-caption p { font-size: .82rem; }
  .landing-lock { padding: 21px 18px; }
  .landing-lock h2 { font-size: 1.55rem; }
}

@media (hover: none), (pointer: coarse) {
  #landing-cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-aurora, .landing-bokeh, .landing-atmosphere::before,
  #landing-photo-stage.photo-is-open .landing-photo-shell img { animation: none !important; }
}
