/* ============================================================
   Birthday Surprise — Anees Fatima
   Romantic glassmorphism theme with smooth animations
   ============================================================ */

/* --- CSS Variables — permanent dark magical theme (mobile-first) --- */
:root {
  --pink-soft: #2d1b2e;
  --pink-main: #f48fb1;
  --pink-deep: #ff80ab;
  --rose-gold: #e8b4b8;
  --rose-gold-light: #f5d0c5;
  --purple-soft: #3e2749;
  --purple-main: #ce93d8;
  --purple-deep: #e040fb;
  --white-glass: rgba(255, 255, 255, 0.08);
  --white-glass-strong: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-primary: #fce4ec;
  --text-secondary: #e1bee7;
  --text-light: #fff;
  --glow-pink: rgba(244, 143, 177, 0.35);
  --glow-purple: rgba(206, 147, 216, 0.3);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(244, 143, 177, 0.25);
  --bg-gradient: linear-gradient(135deg, #1a0a1e 0%, #2d1b3d 40%, #1a1025 70%, #2a1535 100%);
  --font-display: 'Lora', Georgia, serif;
  --font-script: 'Lora', Georgia, serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-elegant: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition-smooth: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.65s cubic-bezier(0.34, 1.2, 0.64, 1);
  --step-pad-x: 1rem;
  --step-pad-y: 1rem;
  --inner-pad: 1.25rem;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

.hidden {
  display: none !important;
}

.name-highlight {
  font-family: var(--font-script);
  font-size: 1.3em;
  color: var(--pink-deep);
}

/* --- Cursor Glow --- */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-pink) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  transition: opacity 0.3s;
  opacity: 0.5;
  mix-blend-mode: screen;
  contain: strict;
}

@media (hover: none) {
  .cursor-glow { display: none; }
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  transition: opacity 1s ease, visibility 1s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  padding: 2rem;
  max-width: 90vw;
}

.loading-heart {
  font-size: 4rem;
  animation: heartbeat 1.2s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.loading-bar {
  width: min(320px, 80vw);
  height: 6px;
  background: var(--white-glass);
  border-radius: 10px;
  margin: 0 auto 2rem;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.loading-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--pink-main), var(--purple-main), var(--rose-gold));
  border-radius: 10px;
  transform: scaleX(var(--load-progress, 0));
  transform-origin: left center;
  will-change: transform;
  box-shadow: 0 0 15px var(--glow-pink);
}

.loading-sparkles span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--pink-main);
  border-radius: 50%;
  margin: 0 6px;
  animation: sparkle 1.5s ease-in-out infinite;
}

.loading-sparkles span:nth-child(2) { animation-delay: 0.2s; background: var(--purple-main); }
.loading-sparkles span:nth-child(3) { animation-delay: 0.4s; }
.loading-sparkles span:nth-child(4) { animation-delay: 0.6s; background: var(--rose-gold); }
.loading-sparkles span:nth-child(5) { animation-delay: 0.8s; }

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* --- Background Layers --- */
.bg-layer,
.particles-canvas,
.confetti-canvas,
.fireworks-canvas,
.petals-container,
.flowers-bg,
.balloons-bg,
.floating-elements,
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  contain: strict;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.particles-canvas,
.confetti-canvas,
.fireworks-canvas {
  z-index: 1;
}

.petals-container { z-index: 2; }
.flowers-bg { z-index: 3; }
.balloons-bg { display: none; }
.floating-elements { z-index: 4; }
.hearts-container { z-index: 5; }

/* Stars */
.stars-layer {
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.7), transparent);
  background-size: 200px 200px;
  opacity: 0.75;
}

/* Magical lights */
.magical-light {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink-main);
  box-shadow: 0 0 10px var(--glow-pink), 0 0 20px var(--glow-purple);
  animation: floatLight 6s ease-in-out infinite;
  will-change: transform, opacity;
  transform: translateZ(0);
}

@keyframes floatLight {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.6; }
  50% { transform: translate3d(0, -30px, 0) scale(1.3); opacity: 1; }
}

/* Rose, cherry blossom & white flower petals */
.petal {
  position: absolute;
  width: 12px;
  height: 16px;
  border-radius: 50% 0 50% 50%;
  opacity: 0.7;
  animation: fallPetal linear infinite;
  transform-origin: center;
  will-change: transform, opacity;
  transform: translateZ(0);
  pointer-events: none;
}

.petal--rose {
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

.petal--cherry {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
  border-radius: 50% 0 50% 0;
}

.petal--white {
  background: linear-gradient(135deg, #ffffff, #f3e5f5);
  opacity: 0.55;
}

@keyframes fallPetal {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.6; }
  100% { transform: translate3d(30px, 110vh, 0) rotate(720deg); opacity: 0; }
}

/* Floating flowers */
.floating-flower {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0.45;
  animation: floatFlower 12s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
  filter: drop-shadow(0 2px 6px rgba(244, 143, 177, 0.25));
  pointer-events: none;
}

.floating-flower--rose { font-size: 1.6rem; opacity: 0.5; }
.floating-flower--white { font-size: 1.2rem; opacity: 0.35; filter: brightness(1.2); }
.floating-flower--blossom { font-size: 1.3rem; opacity: 0.4; }

@keyframes floatFlower {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33% { transform: translate3d(12px, -22px, 0) rotate(8deg); }
  66% { transform: translate3d(-8px, -38px, 0) rotate(-6deg); }
}

/* Balloons — minimal accent only */
.balloon {
  position: absolute;
  width: 36px;
  height: 44px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  cursor: pointer;
  pointer-events: auto;
  animation: floatBalloon 10s ease-in-out infinite;
  transition: transform 0.2s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  will-change: transform;
  transform: translateZ(0);
  touch-action: manipulation;
}

.balloon::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  width: 2px;
  height: 25px;
  background: rgba(0,0,0,0.2);
  transform: translateX(-50%);
}

.balloon:hover { transform: scale(1.1); }
.balloon.popped { animation: popBalloon 0.4s ease forwards; pointer-events: none; }

@keyframes floatBalloon {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
  50% { transform: translate3d(0, -20px, 0) rotate(2deg); }
}

@keyframes popBalloon {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  50% { transform: translate3d(0, 0, 0) scale(1.3); opacity: 0.8; }
  100% { transform: translate3d(0, 0, 0) scale(0); opacity: 0; }
}

/* Floating decorative elements */
.float-item {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.45;
  animation: floatDecor 12s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
  pointer-events: none;
}

@keyframes floatDecor {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(15px, -20px, 0) rotate(10deg); }
  50% { transform: translate3d(-10px, -35px, 0) rotate(-5deg); }
  75% { transform: translate3d(20px, -15px, 0) rotate(8deg); }
}

/* Floating hearts */
.floating-heart {
  position: absolute;
  font-size: 1.2rem;
  animation: riseHeart 4s ease-out forwards;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateZ(0);
}

@keyframes riseHeart {
  0% { transform: translate3d(0, 0, 0) scale(0.5); opacity: 1; }
  100% { transform: translate3d(0, -120px, 0) scale(1.2); opacity: 0; }
}

/* --- Controls — icon only --- */
.controls {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 9000;
}

.control-btn--music.is-playing {
  box-shadow: 0 0 16px var(--glow-pink);
}

.control-btn--music.is-playing .icon-music,
.control-btn--music.is-playing .icon-pause {
  animation: musicIconPulse 1.4s ease-in-out infinite;
}

@keyframes musicIconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

.control-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--white-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow-soft);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.control-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

/* Easter egg */
.easter-egg {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9000;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--purple-main);
  font-size: 0.7rem;
  opacity: 0.15;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.easter-egg:hover {
  opacity: 0.8;
  transform: rotate(180deg) scale(1.3);
}

/* Surprise popup */
.surprise-popup {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  padding: 1rem;
  animation: fadeIn 0.4s ease;
}

.popup-content {
  position: relative;
  max-width: 420px;
  padding: 2.5rem 2rem;
  text-align: center;
  animation: scaleIn 0.5s var(--transition-bounce);
}

.popup-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.popup-heart {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: heartbeat 1.2s ease-in-out infinite;
}

.popup-content h3 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--pink-deep);
}

.popup-content p {
  font-family: var(--font-elegant);
  font-size: 1.15rem;
  line-height: 1.7;
}

/* --- Glassmorphism --- */
.glass {
  background: var(--white-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,0.08);
  transform: translateZ(0);
}

/* --- Journey Steps --- */
.journey {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

.step {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(var(--step-pad-y), env(safe-area-inset-top))
    max(var(--step-pad-x), env(safe-area-inset-right))
    max(var(--step-pad-y), env(safe-area-inset-bottom))
    max(var(--step-pad-x), env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth), transform var(--transition-smooth);
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  contain: layout style;
}

.step.active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.step.exit {
  opacity: 0;
  transform: translate3d(0, -12px, 0);
}

.step-inner {
  width: 100%;
  max-width: 100%;
  padding: var(--inner-pad);
  text-align: center;
  animation: stepEnter 0.65s ease;
  margin: auto 0;
}

@keyframes stepEnter {
  from { opacity: 0; transform: translate3d(0, 30px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Typography --- */
.step-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--pink-deep), var(--purple-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-subtitle {
  font-family: var(--font-elegant);
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.step-question {
  font-family: var(--font-elegant);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin: 1.5rem 0 2rem;
  line-height: 1.6;
}

/* --- Buttons --- */
.btn-primary {
  margin-top: 2rem;
  padding: 0.9rem 2.2rem;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-main), var(--purple-main));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--glow-pink);
  transition: transform 0.3s, box-shadow 0.3s;
  animation: fadeIn 0.6s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 30px var(--glow-pink);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn-choice {
  padding: 1rem 2rem;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--white-glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s, background 0.4s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-choice:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, var(--pink-soft), var(--purple-soft));
  box-shadow: var(--shadow-glow);
}

.btn-choice-alt {
  background: linear-gradient(135deg, var(--pink-main), var(--purple-main));
  color: #fff;
  border-color: transparent;
}

/* --- Welcome / Gift Box --- */
.welcome-intro {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-shadow: 0 0 24px rgba(244, 143, 177, 0.2);
  margin-bottom: 2rem;
  animation: fadeIn 1.2s ease;
}

.fade-in {
  animation: fadeIn 1.5s ease;
}

.gift-box-wrapper {
  position: relative;
  perspective: 900px;
  margin: 1.75rem auto 1.25rem;
  width: min(200px, 52vw);
  height: min(200px, 52vw);
  animation: giftFloat 4s ease-in-out infinite;
}

@keyframes giftFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}

.gift-sparkles {
  position: absolute;
  inset: -12px;
  pointer-events: none;
}

.gift-sparkles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink-main);
  box-shadow: 0 0 10px var(--glow-pink);
  animation: giftSparkle 2.4s ease-in-out infinite;
}

.gift-sparkles span:nth-child(1) { top: 8%; left: 12%; animation-delay: 0s; }
.gift-sparkles span:nth-child(2) { top: 18%; right: 10%; animation-delay: 0.4s; background: var(--purple-main); }
.gift-sparkles span:nth-child(3) { bottom: 22%; left: 6%; animation-delay: 0.8s; }
.gift-sparkles span:nth-child(4) { bottom: 12%; right: 14%; animation-delay: 1.2s; }
.gift-sparkles span:nth-child(5) { top: 42%; left: 0; animation-delay: 1.6s; width: 4px; height: 4px; }
.gift-sparkles span:nth-child(6) { top: 38%; right: 2%; animation-delay: 2s; width: 4px; height: 4px; }

@keyframes giftSparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.2); }
}

.gift-box {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
  transform-style: preserve-3d;
}

.gift-aura {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 143, 177, 0.45) 0%, rgba(206, 147, 216, 0.2) 45%, transparent 72%);
  animation: giftAuraPulse 2.8s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes giftAuraPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

.gift-present {
  position: absolute;
  inset: 12% 8% 8%;
  transform-style: preserve-3d;
  z-index: 1;
  transition: transform 0.35s ease;
}

.gift-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    inset 0 -2px 0 rgba(255, 255, 255, 0.08);
}

.gift-body-face {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #d81b60 0%, #ad1457 40%, #7b1fa2 100%);
}

.gift-ribbon-v,
.gift-ribbon-h {
  position: absolute;
  background: linear-gradient(180deg, #fff5f8, #f8bbd0 50%, #f48fb1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.gift-ribbon-v {
  width: 22%;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.gift-ribbon-h {
  width: 100%;
  height: 22%;
  top: 50%;
  transform: translateY(-50%);
}

.gift-lid {
  position: absolute;
  top: 18%;
  left: -4%;
  right: -4%;
  height: 28%;
  transform-origin: top center;
  transition: transform 0.85s cubic-bezier(0.34, 1.4, 0.64, 1);
  z-index: 4;
}

.gift-lid-top {
  position: absolute;
  inset: 0;
  border-radius: 10px 10px 6px 6px;
  background: linear-gradient(145deg, #f06292 0%, #ec407a 45%, #ab47bc 100%);
  box-shadow:
    0 -6px 20px rgba(244, 143, 177, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.gift-bow {
  position: absolute;
  top: -38%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 55%;
  pointer-events: none;
}

.gift-bow-knot {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 22%;
  height: 30%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff0f5, #f48fb1 55%, #ec407a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 3;
}

.gift-bow-loop {
  position: absolute;
  top: 8%;
  width: 38%;
  height: 55%;
  border: 5px solid transparent;
  border-radius: 50% 50% 45% 45%;
  background: transparent;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.15);
}

.gift-bow-loop--left {
  left: 2%;
  border-color: #f48fb1;
  border-right-color: #ec407a;
  transform: rotate(-18deg);
  background: linear-gradient(135deg, rgba(244, 143, 177, 0.9), rgba(236, 64, 122, 0.85));
}

.gift-bow-loop--right {
  right: 2%;
  border-color: #f48fb1;
  border-left-color: #ec407a;
  transform: rotate(18deg);
  background: linear-gradient(225deg, rgba(244, 143, 177, 0.9), rgba(236, 64, 122, 0.85));
}

.gift-bow-tail {
  position: absolute;
  bottom: 0;
  width: 14%;
  height: 38%;
  background: linear-gradient(180deg, #f48fb1, #ce93d8);
  border-radius: 0 0 50% 50%;
}

.gift-bow-tail--left {
  left: 32%;
  transform: rotate(12deg);
}

.gift-bow-tail--right {
  right: 32%;
  transform: rotate(-12deg);
}

.gift-box.open .gift-lid {
  transform: rotateX(-115deg) translate3d(0, -8px, 0);
}

.gift-box:active .gift-present {
  transform: scale(0.97);
}

.gift-hint {
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  animation: giftHintPulse 2.2s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(244, 143, 177, 0.25);
}

@keyframes giftHintPulse {
  0%, 100% { opacity: 0.65; transform: translate3d(0, 0, 0); }
  50% { opacity: 1; transform: translate3d(0, -2px, 0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Choice animation */
.choice-animation {
  margin-top: 2rem;
  animation: fadeIn 0.6s ease;
}

.magic-burst {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pink-main), transparent);
  animation: burst 1s ease-out;
}

@keyframes burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

.choice-text {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--pink-deep);
}

/* --- Typewriter / Memories --- */
.memories-section {
  position: relative;
  overflow: hidden;
}

.memories-section .step-inner {
  max-width: 100%;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.memories-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 0;
}

.memories-section .step-title,
.memories-section .typewriter-container,
.memories-section .btn-primary {
  position: relative;
  z-index: 1;
}

.memories-sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink-main);
  box-shadow: 0 0 8px var(--glow-pink);
  animation: memoriesSparkle 3s ease-in-out infinite;
}

.memories-sparkle:nth-child(1) { top: 12%; left: 8%; animation-delay: 0s; }
.memories-sparkle:nth-child(2) { top: 22%; right: 10%; animation-delay: 0.7s; background: var(--purple-main); }
.memories-sparkle:nth-child(3) { bottom: 28%; left: 12%; animation-delay: 1.4s; }
.memories-sparkle:nth-child(4) { bottom: 14%; right: 8%; animation-delay: 2.1s; }

@keyframes memoriesSparkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50% { opacity: 0.85; transform: scale(1.15); }
}

.memories-petal {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 50% 0 50% 50%;
  background: linear-gradient(135deg, rgba(248, 187, 208, 0.5), rgba(244, 143, 177, 0.35));
  opacity: 0.45;
  animation: memoriesPetalDrift 9s ease-in-out infinite;
}

.memories-petal:nth-child(5) { top: 8%; left: 20%; animation-delay: 0s; }
.memories-petal:nth-child(6) { top: 55%; right: 15%; animation-delay: -3s; transform: rotate(40deg); }
.memories-petal:nth-child(7) { bottom: 18%; left: 18%; animation-delay: -6s; transform: rotate(-25deg); }

@keyframes memoriesPetalDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.3; }
  50% { transform: translate3d(8px, -18px, 0) rotate(20deg); opacity: 0.55; }
}

.typewriter-container {
  min-height: 200px;
  text-align: left;
  padding: 1.25rem 0.5rem 0.5rem;
  margin-top: 0.5rem;
}

.typewriter-line {
  font-family: var(--font-elegant);
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  font-weight: 500;
  line-height: 1.75;
  color: var(--text-primary);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
  min-height: 2.5rem;
  margin-bottom: 0.65rem;
  padding: 0.2rem 0;
  will-change: opacity, transform;
}

.typewriter-line.is-active,
.typewriter-line.is-done {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.typewriter-text {
  display: inline;
}

.typewriter-cursor {
  display: none;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--pink-main);
  box-shadow: 0 0 8px var(--glow-pink);
  animation: typeCursorBlink 0.9s step-end infinite;
}

.typewriter-line.is-active .typewriter-cursor {
  display: inline-block;
}

@keyframes typeCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Memory clips */
.memory-clip {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--white-glass-strong);
  box-shadow: var(--shadow-soft);
  transform: translateZ(0);
}

.memory-clip--inline.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.memory-clip--gallery {
  width: 100%;
}

.memory-clip-media {
  display: block;
  width: 100%;
  max-height: min(42vw, 220px);
  object-fit: cover;
  background: #1a1025;
}

.memory-clip--gallery .memory-clip-media {
  max-height: min(50vw, 260px);
  padding: 12px 12px 0;
  border-radius: 4px 4px 0 0;
}

.polaroid--clip .memory-clip-media {
  padding: 12px 12px 40px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.memory-clip-label {
  display: block;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--pink-deep);
  text-align: center;
}

.typewriter-line.typing::after {
  content: '|';
  animation: blink 0.8s step-end infinite;
  color: var(--pink-deep);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Precious Moments — Memory Collage --- */
.gallery-section .step-inner {
  max-width: 100%;
}

.memory-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
  padding: 0.25rem;
}

.memory-card {
  transform: translateZ(0);
  transition: transform 0.35s ease;
}

.memory-card:nth-child(1) { transform: rotate(-1.2deg); }
.memory-card:nth-child(2) { transform: rotate(0.9deg); }
.memory-card:nth-child(3) { transform: rotate(0.7deg); }
.memory-card:nth-child(4) { transform: rotate(-0.8deg); }

.memory-card-btn {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.memory-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 10px 10px 28px;
  background: linear-gradient(180deg, #fffef9 0%, #fff8fb 100%);
  border-radius: 6px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.memory-frame::after {
  content: '';
  position: absolute;
  inset: 10px 10px 28px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(244, 143, 177, 0.12);
  pointer-events: none;
}

.memory-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  background: #1a1025;
}

.memory-caption {
  margin-top: 0.55rem;
  padding: 0 0.25rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.4;
  color: var(--pink-deep);
}

.memory-caption:empty {
  display: none;
}

.memory-card-btn:active .memory-frame,
.memory-card-btn:focus-visible .memory-frame {
  transform: scale(0.97);
  box-shadow: 0 6px 18px rgba(244, 143, 177, 0.25);
}

/* Memory lightbox */
.memory-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.memory-lightbox.is-open {
  animation: lightboxFadeIn 0.35s ease;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 5, 15, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-stage {
  position: relative;
  z-index: 2;
  width: min(92vw, 520px);
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightboxZoomIn 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: 72dvh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  background: #1a1025;
}

.lightbox-caption {
  margin-top: 1rem;
  padding: 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  color: var(--text-primary);
  line-height: 1.5;
}

.lightbox-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--white-glass-strong);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--white-glass-strong);
  color: var(--text-primary);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, background 0.25s ease;
}

.lightbox-prev { left: max(0.5rem, env(safe-area-inset-left)); }
.lightbox-next { right: max(0.5rem, env(safe-area-inset-right)); }

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.94);
}

@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lightboxZoomIn {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Reason Cards --- */
.reasons-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.reason-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--white-glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  text-align: left;
  opacity: 0;
  transform: translate3d(0, 30px, 0) scale(0.95);
  transition: opacity 0.6s var(--transition-bounce), transform 0.6s var(--transition-bounce), box-shadow 0.3s;
  will-change: opacity, transform;
}

.reason-card.show {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.reason-card:hover {
  transform: translate3d(8px, 0, 0) scale(1.02);
  box-shadow: var(--shadow-glow);
}

.reason-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.reason-card p {
  font-family: var(--font-elegant);
  font-size: 1.15rem;
  line-height: 1.5;
}

/* --- Romance Scene (flowers) — premium redesign --- */
.romance-section .step-inner {
  max-width: min(100%, 520px);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.romance-header {
  margin-bottom: 0.75rem;
}

.romance-title {
  margin-bottom: 0.65rem;
}

.romance-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--font-elegant);
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-style: italic;
  color: var(--rose-gold-light);
  letter-spacing: 0.02em;
}

.romance-subtitle-line {
  flex: 1;
  max-width: 3.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 143, 177, 0.55), transparent);
}

.romance-subtitle-text {
  text-shadow: 0 0 24px rgba(244, 143, 177, 0.35);
  white-space: nowrap;
}

.romance-stage {
  position: relative;
  width: 100%;
  margin: 0.5rem auto 0.25rem;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  min-height: 200px;
  max-height: min(52vh, 340px);
  border: 1px solid rgba(244, 143, 177, 0.22);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 60px rgba(244, 143, 177, 0.12);
  background: #1a0f22;
  isolation: isolate;
}

.romance-stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.romance-aurora {
  position: absolute;
  inset: -20% -10%;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(206, 147, 216, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 75% 30%, rgba(244, 143, 177, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(148, 80, 160, 0.15) 0%, transparent 60%);
  animation: romanceAurora 12s ease-in-out infinite alternate;
}

@keyframes romanceAurora {
  0% { transform: translate3d(-2%, 0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate3d(2%, -1%, 0) scale(1.04); opacity: 1; }
}

.romance-moon {
  position: absolute;
  top: 10%;
  right: 12%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8fb, #f8bbd0 45%, rgba(248, 187, 208, 0.2) 70%);
  box-shadow: 0 0 30px rgba(248, 187, 208, 0.45), 0 0 60px rgba(244, 143, 177, 0.2);
  animation: romanceMoonPulse 5s ease-in-out infinite;
}

@keyframes romanceMoonPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

.romance-bokeh span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
  animation: romanceBokeh 8s ease-in-out infinite;
}

.romance-bokeh span:nth-child(1) { width: 6px; height: 6px; top: 18%; left: 15%; animation-delay: 0s; }
.romance-bokeh span:nth-child(2) { width: 4px; height: 4px; top: 35%; left: 28%; animation-delay: 1.2s; }
.romance-bokeh span:nth-child(3) { width: 8px; height: 8px; top: 22%; left: 55%; animation-delay: 2.4s; }
.romance-bokeh span:nth-child(4) { width: 5px; height: 5px; top: 45%; left: 72%; animation-delay: 0.8s; }
.romance-bokeh span:nth-child(5) { width: 7px; height: 7px; top: 60%; left: 20%; animation-delay: 3s; }
.romance-bokeh span:nth-child(6) { width: 4px; height: 4px; top: 70%; left: 85%; animation-delay: 1.8s; }

@keyframes romanceBokeh {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.3); }
}

.romance-particles,
.romance-petals,
.romance-hearts {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.romance-particles { z-index: 1; }

.romance-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 220, 230, 0.9);
  box-shadow: 0 0 8px rgba(244, 143, 177, 0.8);
  opacity: 0;
  animation: romanceParticleDrift var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes romanceParticleDrift {
  0% { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.5); }
  20% { opacity: 0.85; }
  80% { opacity: 0.4; }
  100% { opacity: 0; transform: translate3d(var(--dx, 20px), -120px, 0) scale(1); }
}

.romance-petal {
  position: absolute;
  top: -14px;
  width: var(--size, 10px);
  height: calc(var(--size, 10px) * 1.15);
  border-radius: 50% 0 50% 50%;
  background: var(--color, #f48fb1);
  opacity: 0;
  box-shadow: 0 0 6px rgba(244, 143, 177, 0.25);
  will-change: transform;
  animation: romancePetalRain var(--dur, 7s) linear infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes romancePetalRain {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg) scale(0.8);
  }
  8% { opacity: var(--peak, 0.75); }
  92% { opacity: calc(var(--peak, 0.75) * 0.5); }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 30px), 115%, 0) rotate(540deg) scale(1);
  }
}

.romance-heart-float {
  position: absolute;
  color: var(--pink-main);
  opacity: 0;
  text-shadow: 0 0 10px var(--glow-pink), 0 0 20px var(--glow-purple);
  filter: blur(0.2px);
  animation: romanceHeartFloat var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes romanceHeartFloat {
  0% { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.5); }
  15% { opacity: 0.75; }
  85% { opacity: 0.35; }
  100% { opacity: 0; transform: translate3d(var(--drift, 0), -140px, 0) scale(1.05); }
}

.romance-scene-frame {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.romance-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.romance-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(10, 5, 15, 0.45) 100%);
}

/* Character base positions */
.rom-boy {
  transform: translate3d(-175px, 0, 0);
  will-change: transform;
}

.rom-bouquet {
  transform: translate3d(-175px, 0, 0);
  will-change: transform;
  opacity: 0.95;
}

.rom-girl {
  transform: translate3d(0, 0, 0);
}

.rom-girl-float,
.rom-boy-float {
  transform-origin: center bottom;
}

/* Phase: approach */
.romance-stage[data-phase="approach"] .rom-boy,
.romance-stage[data-phase="offer"] .rom-boy,
.romance-stage[data-phase="gift"] .rom-boy,
.romance-stage[data-phase="moment"] .rom-boy {
  transform: translate3d(82px, 0, 0);
}

.romance-stage[data-phase="approach"] .rom-bouquet {
  transform: translate3d(82px, 0, 0);
}

.romance-stage[data-phase="approach"] .rom-boy {
  animation: romBoyApproach 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.romance-stage[data-phase="approach"] .rom-bouquet {
  animation: romBoyApproach 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes romBoyApproach {
  from { transform: translate3d(-175px, 0, 0); }
  to { transform: translate3d(82px, 0, 0); }
}

.romance-stage[data-phase="approach"] .rom-leg--L {
  transform-origin: 118px 238px;
  transform-box: fill-box;
  animation: romLegL 0.5s ease-in-out infinite;
}

.romance-stage[data-phase="approach"] .rom-leg--R {
  transform-origin: 138px 238px;
  transform-box: fill-box;
  animation: romLegR 0.5s ease-in-out infinite;
}

@keyframes romLegL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(12deg); }
}

@keyframes romLegR {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-12deg); }
}

/* Phase: offer */
.romance-stage[data-phase="offer"] .rom-boy-arm--front {
  transform-origin: 150px 192px;
  transform-box: fill-box;
  animation: romBoyOfferArm 1s cubic-bezier(0.34, 1.15, 0.64, 1) forwards;
}

@keyframes romBoyOfferArm {
  to { transform: rotate(-35deg) translate3d(4px, -2px, 0); }
}

.romance-stage[data-phase="offer"] .rom-bouquet {
  animation: romBouquetOffer 1s cubic-bezier(0.34, 1.15, 0.64, 1) forwards;
}

@keyframes romBouquetOffer {
  from { transform: translate3d(82px, 0, 0); }
  to { transform: translate3d(108px, -8px, 0) scale(1.05); }
}

.romance-stage[data-phase="offer"] .rom-boy-float {
  animation: romBoyLean 1s ease forwards;
}

@keyframes romBoyLean {
  to { transform: translate3d(0, 2px, 0) rotate(-1deg); }
}

/* Phase: gift */
.romance-stage[data-phase="gift"] .rom-bouquet {
  animation: romBouquetGift 1.2s cubic-bezier(0.34, 1.15, 0.64, 1) forwards;
}

@keyframes romBouquetGift {
  from { transform: translate3d(108px, -8px, 0) scale(1.05); }
  to { transform: translate3d(168px, -12px, 0) scale(1.1); }
}

.romance-stage[data-phase="moment"] .rom-bouquet {
  transform: translate3d(168px, -12px, 0) scale(1.1);
}

.romance-stage[data-phase="gift"] .rom-girl-arm--R {
  transform-origin: 358px 188px;
  transform-box: fill-box;
  animation: romGirlReachR 0.9s ease 0.4s forwards;
}

.romance-stage[data-phase="gift"] .rom-girl-arm--L {
  transform-origin: 322px 188px;
  transform-box: fill-box;
  animation: romGirlReachL 0.9s ease 0.5s forwards;
}

.romance-stage[data-phase="moment"] .rom-girl-arm--R {
  transform: rotate(-38deg);
  transform-origin: 358px 188px;
  transform-box: fill-box;
}

.romance-stage[data-phase="moment"] .rom-girl-arm--L {
  transform: rotate(22deg);
  transform-origin: 322px 188px;
  transform-box: fill-box;
}

@keyframes romGirlReachR {
  to { transform: rotate(-38deg); }
}

@keyframes romGirlReachL {
  to { transform: rotate(22deg); }
}

@keyframes romGirlJoy {
  0% { transform: translate3d(0, 0, 0); }
  30% { transform: translate3d(0, -10px, 0) scale(1.03); }
  60% { transform: translate3d(0, -5px, 0) scale(1.01); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes romSmileGlow {
  to { stroke-width: 2.5; }
}

.romance-stage[data-phase="gift"] .rom-girl-float {
  animation: romGirlJoy 1.1s cubic-bezier(0.34, 1.2, 0.64, 1) 0.55s forwards;
}

.romance-stage[data-phase="gift"] .rom-girl-smile {
  stroke: #e91e63;
  animation: romSmileGlow 0.6s ease 0.7s forwards;
}

.romance-stage[data-phase="gift"] .rom-boy-smile {
  animation: romSmileGlow 0.6s ease 0.5s forwards;
}

/* Phase: moment — gentle idle float */
.romance-stage[data-phase="moment"] .rom-girl-smile {
  stroke: #e91e63;
  stroke-width: 2.5;
}

.romance-stage[data-phase="moment"] .rom-girl-float {
  animation: romIdleFloat 4s ease-in-out infinite;
}

.romance-stage[data-phase="moment"] .rom-boy-float {
  animation: romIdleFloat 4.5s ease-in-out infinite;
}

@keyframes romIdleFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5px, 0); }
}

.romance-message {
  position: absolute;
  left: 50%;
  bottom: clamp(0.5rem, 2.5vw, 0.85rem);
  transform: translateX(-50%);
  z-index: 5;
  margin: 0;
  padding: 0.45rem 1rem;
  font-family: var(--font-script);
  font-size: clamp(0.82rem, 2.5vw, 1rem);
  font-style: italic;
  color: #fff5f8;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(74, 25, 66, 0.55);
  border: 1px solid rgba(244, 143, 177, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(244, 143, 177, 0.25);
  opacity: 0;
}

.romance-message:not(.hidden) {
  animation: romanceMessageIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes romanceMessageIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.romance-message-glow {
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(244, 143, 177, 0.2), transparent 70%);
  z-index: -1;
  animation: romanceMsgGlow 3s ease-in-out infinite;
}

@keyframes romanceMsgGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@media (min-width: 769px) {
  .romance-stage {
    max-height: 360px;
  }

  .romance-moon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .romance-subtitle-line {
    max-width: 2rem;
  }

  .romance-message {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .romance-aurora,
  .romance-moon,
  .romance-bokeh span,
  .romance-petal,
  .romance-heart-float,
  .romance-particle,
  .rom-boy,
  .rom-bouquet,
  .rom-leg--L,
  .rom-leg--R,
  .rom-boy-arm--front,
  .rom-girl-arm--R,
  .rom-girl-arm--L,
  .rom-girl-float,
  .rom-boy-float {
    animation: none !important;
  }

  .romance-stage[data-phase="approach"] .rom-boy,
  .romance-stage[data-phase="offer"] .rom-boy,
  .romance-stage[data-phase="gift"] .rom-boy,
  .romance-stage[data-phase="moment"] .rom-boy,
  .romance-stage[data-phase="approach"] .rom-bouquet,
  .romance-stage[data-phase="offer"] .rom-bouquet,
  .romance-stage[data-phase="gift"] .rom-bouquet,
  .romance-stage[data-phase="moment"] .rom-bouquet {
    transform: translate3d(82px, 0, 0);
  }

  .romance-stage[data-phase="gift"] .rom-bouquet,
  .romance-stage[data-phase="moment"] .rom-bouquet {
    transform: translate3d(168px, -12px, 0) scale(1.1);
  }
}

/* --- Envelope & Letter --- */
.letter-section .step-inner {
  max-width: 650px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.envelope-wrapper {
  margin: 1.5rem auto;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: margin 0.5s ease;
}

.envelope {
  position: relative;
  width: min(88vw, 280px);
  height: 155px;
  margin: 0 auto;
  cursor: pointer;
  touch-action: manipulation;
  transform-style: preserve-3d;
  transition: width 0.5s ease, height 0.5s ease;
}

.envelope.open {
  width: 100%;
  max-width: 100%;
  height: auto;
  cursor: default;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f8bbd0, #e1bee7);
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  transition: opacity 0.45s ease;
}

.envelope.open .envelope-back {
  opacity: 0;
  pointer-events: none;
}

.envelope-front {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, #f48fb1, #f8bbd0);
  clip-path: polygon(0 100%, 50% 30%, 100% 100%);
  border-radius: 0 0 4px 4px;
  z-index: 3;
  transition: opacity 0.45s ease;
}

.envelope.open .envelope-front {
  opacity: 0;
  pointer-events: none;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(to bottom, #ec407a, #f48fb1);
  clip-path: polygon(0 0, 50% 70%, 100% 0);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease 0.3s;
  z-index: 4;
  backface-visibility: hidden;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
  opacity: 0;
  z-index: 1;
}

.envelope-letter {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 160px;
  background: #fffef8;
  border-radius: 8px;
  z-index: 2;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition:
    transform 0.7s 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.5s 0.15s ease,
    width 0.5s ease,
    top 0.5s ease,
    left 0.5s ease,
    right 0.5s ease;
}

.envelope.open .envelope-letter {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transform: translate3d(0, 0, 0);
  height: auto;
  min-height: 0;
  overflow: visible;
  z-index: 5;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.letter-content {
  padding: 1.25rem 1rem;
  text-align: left;
  max-height: min(58dvh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  color: #9450a0;
}

.letter-greeting {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: #9450a0;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.letter-greeting.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.letter-line {
  font-family: var(--font-elegant);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 0.85rem;
  color: #9450a0;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.letter-line.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.letter-signoff {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  font-style: italic;
  color: #9450a0;
  margin-top: 1.25rem;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.letter-signoff.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.envelope-hint {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--text-secondary);
  animation: pulse 2s ease-in-out infinite;
}

.envelope.open .envelope-hint { display: none; }

/* --- Age Reveal --- */
.age-section .step-inner {
  max-width: 500px;
}

.age-intro {
  font-family: var(--font-elegant);
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  line-height: 1.6;
  animation: fadeIn 1s ease;
}

.age-label {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin-top: 2rem;
  animation: fadeIn 0.8s ease;
}

.age-number {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.age-digit {
  font-family: var(--font-display);
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-deep), var(--purple-deep), var(--rose-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px var(--glow-pink));
  animation: agePop 1s var(--transition-bounce) forwards;
  opacity: 0;
  transform: scale(0);
}

.age-digit:nth-child(1) { animation-delay: 0.1s; }
.age-digit:nth-child(2) { animation-delay: 0.3s; }

@keyframes agePop {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* --- Countdown --- */
.countdown-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.countdown-label {
  font-family: var(--font-elegant);
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.countdown-number {
  font-family: var(--font-display);
  font-size: clamp(6rem, 25vw, 12rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--pink-main), var(--purple-main));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px var(--glow-pink));
  animation: countdownPulse 0.8s ease;
}

@keyframes countdownPulse {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Final Reveal --- */
.final-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  max-width: 800px;
}

.final-title {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--pink-deep);
  text-shadow: 0 0 30px var(--glow-pink);
  margin-bottom: 1.5rem;
  animation: titleReveal 1.2s ease;
  line-height: 1.4;
}

.cake-emoji {
  display: inline-block;
  animation: bounce 1s ease infinite;
}

.cake-emoji:last-child { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes titleReveal {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.final-wish,
.final-thanks {
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.8;
  max-width: 550px;
  margin: 0 auto 1.5rem;
  color: var(--text-secondary);
  animation: fadeIn 1s ease 0.5s both;
}

.final-thanks {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--pink-deep);
}

/* Birthday Cake */
.birthday-cake {
  position: relative;
  width: 180px;
  height: 160px;
  margin: 2rem auto 1rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.birthday-cake:hover { transform: scale(1.05); }

.cake-plate {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 12px;
  background: linear-gradient(to bottom, #e0e0e0, #bdbdbd);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cake-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 8px;
}

.cake-layer-1 {
  bottom: 12px;
  width: 160px;
  height: 45px;
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

.cake-layer-2 {
  bottom: 52px;
  width: 130px;
  height: 40px;
  background: linear-gradient(135deg, #e1bee7, #ce93d8);
}

.cake-layer-3 {
  bottom: 87px;
  width: 100px;
  height: 35px;
  background: linear-gradient(135deg, #fff9c4, #fff59d);
}

.cake-frosting {
  position: absolute;
  bottom: 117px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 -2px 0 #fce4ec;
}

.candles {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}

.candle {
  width: 8px;
  height: 30px;
  background: linear-gradient(to right, #fff, #fce4ec);
  border-radius: 2px;
  position: relative;
}

.flame {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 18px;
  background: radial-gradient(ellipse, #ffeb3b 0%, #ff9800 50%, transparent 70%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.3s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-3deg); }
  100% { transform: translateX(-50%) scale(1.1) rotate(3deg); }
}

.birthday-cake.candles-out .flame {
  animation: blowOut 0.5s ease forwards;
}

@keyframes blowOut {
  to { opacity: 0; transform: translateX(-50%) scale(0); }
}

.cake-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  animation: pulse 2s ease-in-out infinite;
}

.wish-message {
  font-family: var(--font-script);
  font-size: 2.5rem;
  color: var(--pink-deep);
  margin-top: 1rem;
  animation: wishAppear 1s var(--transition-bounce);
  text-shadow: 0 0 20px var(--glow-pink);
}

@keyframes wishAppear {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Responsive — desktop enhancements --- */
@media (min-width: 769px) {
  :root {
    --step-pad-x: 1.5rem;
    --step-pad-y: 1.5rem;
    --inner-pad: 2.5rem;
  }

  .step-inner {
    max-width: 700px;
  }

  .gallery-section .step-inner {
    max-width: 620px;
  }

  .memory-collage {
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
  }

  .memory-frame {
    aspect-ratio: 1 / 1;
    padding: 12px 12px 32px;
  }

  .memory-card-btn:hover .memory-frame {
    transform: translateY(-4px);
    box-shadow:
      0 16px 36px rgba(171, 71, 188, 0.22),
      0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .memory-caption {
    font-size: 0.9rem;
  }

  .glass {
    border-radius: 24px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .stars-layer {
    animation: twinkleStars 10s ease-in-out infinite alternate;
    will-change: opacity;
  }

  @keyframes twinkleStars {
    0% { opacity: 0.55; }
    100% { opacity: 0.85; }
  }

  .gift-box:hover .gift-present {
    transform: scale(1.04);
  }
}

@media (max-width: 768px) {
  .memory-collage {
    gap: 0.55rem;
  }

  .memory-frame {
    aspect-ratio: 3 / 4;
    padding: 8px 8px 22px;
  }

  .memory-caption {
    font-size: 0.75rem;
    margin-top: 0.4rem;
  }

  .floating-flower,
  .float-item {
    animation-duration: 18s;
  }

  .cursor-glow {
    display: none;
  }
}

@media (max-width: 380px) {
  .btn-group { flex-direction: column; align-items: stretch; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
