/* ============================================================
   HAPPY BIRTHDAY, TAHREEM TARA — STYLESHEET
   Mobile-first. Palette restricted to:
   #000000  #111111  #1b1b1b  #ff4d8d  #ff82b2  #ffffff
   All gradients derive from these six values only.
   ============================================================ */

/* ---------------- DESIGN TOKENS ---------------- */
:root {
  --black:        #000000;
  --black-2:       #111111;
  --black-3:       #1b1b1b;
  --pink:          #ff4d8d;
  --pink-light:    #ff82b2;
  --white:         #ffffff;

  /* derived translucent tones (same hues, alpha only) */
  --pink-glow-40:  rgba(255, 77, 141, 0.4);
  --pink-glow-25:  rgba(255, 77, 141, 0.25);
  --pink-glow-15:  rgba(255, 77, 141, 0.15);
  --white-10:      rgba(255, 255, 255, 0.08);
  --white-15:      rgba(255, 255, 255, 0.14);
  --white-60:      rgba(255, 255, 255, 0.6);
  --white-80:      rgba(255, 255, 255, 0.82);

  --grad-hero:     linear-gradient(160deg, var(--black) 0%, var(--black-3) 55%, #2a1420 100%);
  --grad-primary:  linear-gradient(135deg, var(--pink) 0%, var(--pink-light) 100%);
  --grad-primary-h:linear-gradient(135deg, var(--pink-light) 0%, var(--pink) 100%);
  --grad-text:     linear-gradient(135deg, var(--white) 10%, var(--pink-light) 100%);
  --grad-glass:    linear-gradient(160deg, var(--white-15), var(--white-10));

  --font-display:  'Playfair Display', Georgia, serif;
  --font-script:   'Dancing Script', cursive;
  --font-body:     'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm:  12px;
  --radius-md:  20px;
  --radius-lg:  32px;
  --radius-pill: 999px;

  --ease-out:    cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --vh: 1vh; /* set by JS for mobile viewport correctness */
}

/* ---------------- RESET & BASE ---------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; }

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

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

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--pink-light);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* ---------------- AMBIENT CANVASES ---------------- */
#particle-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}
#fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 60; pointer-events: none;
}

/* Base backdrop gradient behind everything */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: var(--grad-hero);
  z-index: 0;
}

/* ---------------- SOUND TOGGLE ---------------- */
.icon-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 100;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white-10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--white-15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: transform .25s var(--ease-spring), background .25s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn .icon-sound-off { display: none; }
.icon-btn[aria-pressed="true"] .icon-sound-on { display: none; }
.icon-btn[aria-pressed="true"] .icon-sound-off { display: inline; }

/* ============================================================
   SCREEN SYSTEM
   ============================================================ */
#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
}

.screen {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(24px) scale(0.98);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), visibility 0s linear .6s;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.screen.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), visibility 0s;
}

.screen.leaving {
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
}

.screen-inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

/* ---------------- TYPOGRAPHY ---------------- */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--pink-light);
  font-weight: 600;
  opacity: 0.9;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.25;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-subtitle {
  font-size: 15px;
  color: var(--white-80);
  font-weight: 400;
  line-height: 1.5;
}

.section-subtitle strong { color: var(--pink-light); font-weight: 600; }

.birthday-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 13vw, 68px);
  line-height: 1.05;
  color: var(--white);
  text-shadow: 0 0 30px var(--pink-glow-40);
}

.birthday-title-line { display: block; }

.birthday-title-script {
  font-family: var(--font-script);
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(52px, 16vw, 84px);
  line-height: 1.1;
}

.birthday-title-script.small {
  font-size: clamp(34px, 10vw, 48px);
  display: inline-block;
  margin-top: 4px;
}

.birthday-name {
  font-family: var(--font-script);
  font-size: clamp(30px, 9vw, 44px);
  color: var(--pink-light);
  text-shadow: 0 0 24px var(--pink-glow-40);
}

.birthday-tagline, .final-message, .final-signature {
  font-size: 15px;
  color: var(--white-80);
  line-height: 1.6;
  max-width: 340px;
}

.dots::after {
  content: '';
  display: inline-block;
  animation: dots-cycle 1.4s steps(4, end) infinite;
  width: 1.2em;
  text-align: left;
}
@keyframes dots-cycle {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ---------------- BUTTONS ---------------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 34px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform .2s var(--ease-spring), box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.94); }

.btn-primary {
  background: var(--grad-primary);
  color: var(--white);
  box-shadow: 0 10px 30px -8px var(--pink-glow-40);
}
.btn-primary:hover { background: var(--grad-primary-h); }

.btn-glow { animation: btn-pulse 2.6s ease-in-out infinite; }
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 10px 30px -8px var(--pink-glow-40); }
  50% { box-shadow: 0 10px 40px -4px var(--pink-glow-40), 0 0 0 6px var(--pink-glow-15); }
}

.btn-ghost {
  background: var(--white-10);
  border: 1px solid var(--white-15);
  color: var(--white);
  backdrop-filter: blur(8px);
}

.btn-yes {
  background: var(--grad-primary);
  color: var(--white);
  box-shadow: 0 10px 30px -8px var(--pink-glow-40);
  font-size: 16px;
  padding: 16px 40px;
}

.btn-no {
  background: transparent;
  border: 1.5px solid var(--white-15);
  color: var(--white-80);
  padding: 16px 34px;
  transition: transform .25s var(--ease-spring), padding .25s, font-size .25s, opacity .3s, border-color .25s;
}

.btn-arrow { transition: transform .25s; display: inline-block; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: var(--white-15);
  transform: scale(0);
  animation: ripple-anim .6s var(--ease-out);
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(3); opacity: 0; }
}

/* ---------------- GLASSMORPHISM CARD ---------------- */
.glass-card {
  background: var(--grad-glass);
  border: 1px solid var(--white-15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}

/* ---------------- SHARED GIF / EMOJI FALLBACK ---------------- */
.gif-img { border-radius: var(--radius-md); }
.emoji-fallback {
  font-size: 90px;
  line-height: 1;
  filter: drop-shadow(0 10px 24px var(--pink-glow-25));
}
/* When a gif image fails to load, JS adds .broken to hide it and reveal the emoji fallback */
.gif-img.broken { display: none; }
.gif-img:not(.broken) ~ .emoji-fallback { display: none; }

/* ============================================================
   SCREEN 1 — SCANNER
   ============================================================ */
.scanner-inner { gap: 22px; }

.scanner-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 8vw, 32px);
  font-weight: 700;
  color: var(--white);
}

.scan-orb {
  position: relative;
  width: 180px; height: 180px;
  display: flex; align-items: center; justify-content: center;
  margin: 6px 0;
}

.scan-orb-core {
  position: relative;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--pink-light), var(--pink) 55%, #b5265a 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 50px var(--pink-glow-40), inset 0 0 30px rgba(255,255,255,0.25);
  z-index: 2;
}
#scan-percent {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.scan-orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--pink-glow-40);
  animation: orb-ring-pulse 2.4s ease-out infinite;
}
.ring-1 { width: 150px; height: 150px; }
.ring-2 { width: 180px; height: 180px; animation-delay: .8s; }
@keyframes orb-ring-pulse {
  0% { transform: scale(0.75); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 0; }
}

.scan-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--pink-glow-40) 15%, transparent 30%);
  animation: sweep-rotate 1.8s linear infinite;
  z-index: 1;
}
@keyframes sweep-rotate { to { transform: rotate(360deg); } }

.progress-track {
  width: 100%;
  max-width: 280px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--white-10);
  overflow: hidden;
  border: 1px solid var(--white-15);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: var(--radius-pill);
  transition: width .25s var(--ease-out);
  box-shadow: 0 0 12px var(--pink-glow-40);
}

.scan-message {
  font-size: 14px;
  color: var(--white-60);
  min-height: 20px;
}

.scan-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  animation: pop-in .6s var(--ease-spring);
}
.result-label { font-size: 16px; font-weight: 600; color: var(--white); }
.crown { display: inline-block; animation: crown-bob 1.6s ease-in-out infinite; }
@keyframes crown-bob { 0%,100%{ transform: translateY(0) rotate(-4deg);} 50%{ transform: translateY(-5px) rotate(4deg);} }
.result-score {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-quote { font-style: italic; color: var(--pink-light); font-size: 15px; margin-bottom: 10px; }

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.85) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   SCREEN 2 — GIFT
   ============================================================ */
.gift-character { width: 130px; margin-bottom: -6px; }
.gift-character .emoji-fallback { animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

.gift-box {
  width: 170px;
  margin: 10px 0 6px;
  cursor: pointer;
}
.gift-box .emoji-fallback {
  font-size: 120px;
  animation: gift-float 2.6s ease-in-out infinite;
}
@keyframes gift-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.03); }
}

/* ============================================================
   SCREEN 3 — PASSWORD
   ============================================================ */
.lock-icon {
  font-size: 56px;
  filter: drop-shadow(0 10px 20px var(--pink-glow-40));
  animation: lock-swing 3s ease-in-out infinite;
}
@keyframes lock-swing {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.password-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.password-input-wrap {
  position: relative;
  width: 100%;
  max-width: 300px;
}

.password-input {
  width: 100%;
  padding: 16px 46px 16px 20px;
  border-radius: var(--radius-pill);
  background: var(--white-10);
  border: 1.5px solid var(--white-15);
  color: var(--white);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-align: center;
  transition: border-color .25s, box-shadow .25s;
}
.password-input::placeholder { color: var(--white-60); letter-spacing: normal; }
.password-input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-glow-15); outline: none; }

.reveal-btn {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.75;
}

.password-input-wrap.shake { animation: shake-x .5s; }
@keyframes shake-x {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.pw-error {
  color: var(--pink-light);
  font-size: 14px;
  font-weight: 500;
  animation: pop-in .4s var(--ease-spring);
}

.hint-card {
  margin-top: 6px;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  background: var(--white-10);
  border: 1px dashed var(--pink-glow-40);
  max-width: 300px;
}
.hint-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pink-light);
  margin-bottom: 4px;
}
.hint-text { font-size: 14px; color: var(--white-80); }

/* ============================================================
   SCREEN 4 — LOVE QUESTION
   ============================================================ */
.love-character { width: 140px; height: 140px; margin-bottom: -4px; }
.love-character .emoji-fallback { animation: bear-sway 2.2s ease-in-out infinite; }
@keyframes bear-sway {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(-4px); }
}

.love-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-no.shrink-1 { padding: 13px 26px; font-size: 14px; }
.btn-no.shrink-2 { padding: 9px 16px; font-size: 11px; opacity: 0.8; }
.btn-no.shrink-3 { padding: 5px 9px; font-size: 8px; opacity: 0.55; border-color: var(--white-10); }
.btn-no.vanish {
  animation: btn-vanish .5s var(--ease-out) forwards;
}
@keyframes btn-vanish {
  to { transform: scale(0); opacity: 0; width: 0; padding: 0; margin: 0; }
}

.btn-yes.grow-1 { transform: scale(1.05); }
.btn-yes.grow-2 { transform: scale(1.12); }
.btn-yes.grow-3 { transform: scale(1.22); box-shadow: 0 14px 40px -6px var(--pink-glow-40); }

.love-message {
  min-height: 24px;
  font-size: 15px;
  color: var(--pink-light);
  font-weight: 500;
}

/* ============================================================
   SCREEN 5 — CELEBRATION BANNER
   ============================================================ */
.celebration-eyebrow { font-size: 16px; letter-spacing: 0; animation: eyebrow-bounce 1.6s ease-in-out infinite; }
@keyframes eyebrow-bounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-4px);} }

/* ============================================================
   SCREEN 6 — INTERACTIVE CAKE
   ============================================================ */
.cake-scene {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding-top: 40px;
  margin: 10px 0;
}

.cake-plate {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 230px; height: 18px;
  border-radius: 50%;
  background: var(--white-10);
  box-shadow: 0 0 30px var(--pink-glow-25);
}

.cake {
  position: relative;
  width: 220px;
  margin: 0 auto;
  z-index: 2;
}

.candles-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 14px;
  height: 60px;
  margin-bottom: -4px;
  z-index: 3;
}

.candle {
  position: relative;
  width: 8px;
  height: 46px;
  border-radius: 4px;
  background: repeating-linear-gradient(180deg, var(--white) 0 6px, var(--pink-light) 6px 12px);
  align-self: flex-end;
  cursor: pointer;
  touch-action: manipulation;
}
.candle-flame {
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%) scale(0);
  width: 14px; height: 22px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff8e0, var(--pink-light) 55%, var(--pink) 100%);
  box-shadow: 0 0 14px 4px var(--pink-glow-40);
  transition: transform .35s var(--ease-spring);
  transform-origin: bottom center;
}
.candle.lit .candle-flame {
  transform: translateX(-50%) scale(1);
  animation: flame-flicker 1.4s ease-in-out infinite;
}
@keyframes flame-flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-2deg); }
  50% { transform: translateX(-50%) scale(1.08) rotate(3deg); }
}
.candle-glow {
  position: absolute;
  top: -20px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--pink-glow-40);
  filter: blur(8px);
  opacity: 0;
  transition: opacity .35s;
}
.candle.lit .candle-glow { opacity: 1; }

.cake-tier {
  position: relative;
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, var(--white) 0%, var(--pink-light) 100%);
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6), inset 0 -6px 10px rgba(0,0,0,0.08);
}
.cake-tier-top { height: 70px; margin: 0 14px; }
.cake-tier-bottom { height: 90px; background: linear-gradient(180deg, var(--pink-light) 0%, var(--pink) 100%); }

.frosting-drip {
  position: absolute; top: 0; left: 0; right: 0; height: 14px;
  background: repeating-linear-gradient(90deg, var(--white) 0 16px, transparent 16px 32px);
  border-radius: 40% 40% 0 0 / 100% 100% 0 0;
  opacity: 0.85;
}

.cake-hearts {
  position: absolute; bottom: 12px; left: 0; right: 0;
  text-align: center; font-size: 15px; letter-spacing: 6px;
}

.smoke-layer {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  pointer-events: none;
}
.smoke-puff {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--white-15);
  animation: smoke-rise 1.6s ease-out forwards;
}
@keyframes smoke-rise {
  0% { opacity: 0.7; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, 10px), -70px) scale(2.4); }
}

.cake-cta { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop-in .5s var(--ease-spring); }
.wish-text { font-family: var(--font-script); font-size: 30px; color: var(--pink-light); }

/* ============================================================
   SCREEN 7 — MEMORY GALLERY
   ============================================================ */
.gallery {
  position: relative;
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.gallery-track {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white-10);
  border: 1px solid var(--white-15);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.7);
  touch-action: pan-y;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
  pointer-events: none;
}
.gallery-slide.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center;
  color: var(--white-60); font-size: 13px;
}
.gallery-empty .emoji-fallback { font-size: 50px; }

.gallery-arrow {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--white-10);
  border: 1px solid var(--white-15);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s var(--ease-spring), background .2s;
}
.gallery-arrow:active { transform: scale(0.88); }

.gallery-dots {
  display: flex;
  gap: 7px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 300px;
}
.gallery-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white-15);
  transition: background .25s, transform .25s;
}
.gallery-dot.active { background: var(--pink); transform: scale(1.35); }

/* ============================================================
   SCREEN 8 — BIRTHDAY LETTER
   ============================================================ */
.letter-card {
  width: 100%;
  padding: 28px 22px;
  margin-top: 4px;
  min-height: 220px;
  text-align: left;
}
.letter-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--white-80);
  white-space: pre-wrap;
}
.typewriter-cursor {
  display: inline-block;
  color: var(--pink-light);
  animation: blink-cursor 1s steps(1) infinite;
}
.typewriter-cursor.hidden { display: none; }
@keyframes blink-cursor { 50% { opacity: 0; } }

/* ============================================================
   FINAL PAGE
   ============================================================ */
.final-balloons {
  font-size: 44px;
  animation: balloons-float 3.2s ease-in-out infinite;
  margin-bottom: -4px;
}
@keyframes balloons-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
.final-title { font-size: clamp(32px, 9vw, 46px); }
.final-signature { font-family: var(--font-script); font-size: 22px; color: var(--pink-light); margin-top: 6px; }

/* ============================================================
   AMBIENT FLOATING ELEMENTS (spawned by JS, generic classes)
   ============================================================ */
.float-item {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  will-change: transform, opacity;
  user-select: none;
}

/* ============================================================
   RESPONSIVE — TABLET & DESKTOP
   ============================================================ */
@media (min-width: 640px) {
  .screen-inner { max-width: 560px; gap: 18px; }
  .gallery, .gallery-track { max-width: 420px; }
  .cake-scene { max-width: 380px; }
  .cake { width: 260px; }
  .btn { padding: 17px 40px; font-size: 16px; }
}

@media (min-width: 1024px) {
  .screen-inner { max-width: 620px; gap: 22px; }
  .gallery, .gallery-track { max-width: 460px; }
  .scanner-title, .section-title { font-size: clamp(28px, 4vw, 38px); }
}

/* Landscape phones: shrink vertical rhythm so content fits without scroll */
@media (max-height: 480px) and (orientation: landscape) {
  .screen { padding-top: 16px; padding-bottom: 16px; }
  .screen-inner { gap: 8px; }
  .scan-orb { width: 120px; height: 120px; }
  .scan-orb-core { width: 90px; height: 90px; }
  .cake-scene { padding-top: 20px; transform: scale(0.85); }
  .birthday-title { font-size: clamp(28px, 8vw, 40px); }
}
