:root {
  --bg-primary: #0a0712;
  --bg-secondary: #130e22;
  --bg-card: rgba(26, 18, 44, 0.65);
  --card-bg: rgba(26, 18, 44, 0.65);
  --card-border: rgba(255, 182, 217, 0.22);
  --card-border-hover: rgba(255, 182, 217, 0.38);
  --nav-bg: rgba(14, 9, 26, 0.75);

  --accent-pink: #ff758c;
  --accent-rose: #ff7eb3;
  --accent-purple: #c77dff;
  --accent-lilac: #e0aaff;
  --accent-gold: #ffd166;
  --accent-peach: #ffbe0b;
  --accent-cyan: #2ec4b6;
  --accent-deep-purple: #7b2cbf;
  --accent-violet: #9d4edd;

  --gradient-primary: linear-gradient(135deg, #ff758c 0%, #ff7eb3 50%, #c77dff 100%);
  --gradient-secondary: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 100%);
  --gradient-gold: linear-gradient(135deg, #ffd166 0%, #ffbe0b 100%);
  --gradient-text: linear-gradient(135deg, #ff9a9e 0%, #fecfef 40%, #a1c4fd 100%);
  --gradient-gold-text: linear-gradient(180deg, #ffffff 30%, #ffd166 100%);
  --gradient-brand: linear-gradient(135deg, #ffffff 0%, #e0aaff 100%);

  --text-primary: #ffffff;
  --text-secondary: #f0e6f6;
  --text-muted: #b8a9c9;
  --text-dim: rgba(255, 255, 255, 0.45);

  --glow-pink: rgba(255, 117, 140, 0.45);
  --glow-purple: rgba(199, 125, 255, 0.35);
  --glow-gold: rgba(255, 209, 102, 0.4);
  --glow-cyan: rgba(46, 196, 182, 0.5);

  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-card-hover: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 35px rgba(255, 117, 140, 0.12);

  --font-main: 'Montserrat', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-script: 'Caveat', cursive;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  --glass-blur: blur(20px);
  --glass-blur-nav: blur(18px);
  --glass-blur-sm: blur(10px);

  --z-canvas: 0;
  --z-base: 1;
  --z-content: 2;
  --z-nav: 100;
  --z-modal: 500;
  --z-fx: 999;

  --transition-fast: all 0.2s ease;
  --transition-smooth: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 117, 140, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 10% 30%, rgba(199, 125, 255, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 90% 65%, rgba(255, 209, 102, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(114, 9, 183, 0.25) 0%, transparent 60%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--nav-bg);
  backdrop-filter: var(--glass-blur-nav);
  -webkit-backdrop-filter: var(--glass-blur-nav);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: var(--z-nav);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sparkle-icon {
  font-size: 1.25rem;
  animation: spinSlow 8s linear infinite;
  display: inline-block;
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent-pink);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--glow-pink);
}

.music-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.music-bars i {
  width: 3px;
  height: 4px;
  background: var(--accent-pink);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.playing .music-bars i:nth-child(1) {
  animation: barDance 0.8s infinite 0.1s;
}

.playing .music-bars i:nth-child(2) {
  animation: barDance 0.8s infinite 0.3s;
}

.playing .music-bars i:nth-child(3) {
  animation: barDance 0.8s infinite 0.15s;
}

.playing .music-bars i:nth-child(4) {
  animation: barDance 0.8s infinite 0.4s;
}

@keyframes barDance {

  0%,
  100% {
    height: 4px;
  }

  50% {
    height: 14px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 117, 140, 0.45);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(255, 117, 140, 0.65);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: var(--glass-blur-sm);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-lilac);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--glow-purple);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(157, 78, 221, 0.6);
}

.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 15px rgba(255, 117, 140, 0.45);
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 117, 140, 0.85);
  }
}

.main-container {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 100px 20px 60px 20px;
}

.section-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  margin-bottom: 50px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  transition: var(--transition-smooth);
}

.section-card:hover {
  border-color: rgba(255, 182, 217, 0.38);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 35px rgba(255, 117, 140, 0.12);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px auto;
}

.section-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 117, 140, 0.15);
  border: 1px solid rgba(255, 117, 140, 0.3);
  color: var(--accent-lilac);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-section {
  text-align: center;
  padding: 50px 15px 70px 15px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #2ec4b6;
  border-radius: 50%;
  box-shadow: 0 0 10px #2ec4b6;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.animate-float {
  animation: floatUpDown 4s ease-in-out infinite;
}

@keyframes floatUpDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 30px;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 40%, #a1c4fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  text-shadow: 0 0 35px rgba(255, 154, 158, 0.3);
}

.age-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.age-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 117, 140, 0.25) 0%, rgba(199, 125, 255, 0.1) 70%, transparent 100%);
  border: 2px solid rgba(255, 182, 217, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 45px rgba(255, 117, 140, 0.35), inset 0 0 25px rgba(199, 125, 255, 0.3);
  animation: pulseCircleGlow 4s ease-in-out infinite alternate;
}

@keyframes pulseCircleGlow {
  0% {
    box-shadow: 0 0 35px rgba(255, 117, 140, 0.3), inset 0 0 20px rgba(199, 125, 255, 0.25);
  }

  100% {
    box-shadow: 0 0 55px rgba(255, 117, 140, 0.55), inset 0 0 30px rgba(199, 125, 255, 0.45);
  }
}

.age-number {
  font-family: var(--font-serif);
  font-size: 4.8rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 0;
  transform: translate(-1px, -11px);
  background: linear-gradient(180deg, #ffffff 30%, #ffd166 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 15px rgba(255, 209, 102, 0.5));
}

.age-sparkle {
  position: absolute;
  color: var(--accent-gold);
  font-size: 1.2rem;
  animation: twinkle 2s infinite ease-in-out;
}

.age-sparkle.s1 {
  top: 8px;
  right: 18px;
  animation-delay: 0.2s;
}

.age-sparkle.s2 {
  bottom: 12px;
  left: 16px;
  animation-delay: 0.8s;
}

.age-sparkle.s3 {
  top: 40%;
  left: -6px;
  animation-delay: 1.4s;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.age-caption {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--accent-lilac);
  letter-spacing: 0.5px;
  font-weight: 500;
}

.hero-lead {
  max-width: 680px;
  margin: 0 auto 36px auto;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

.hero-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}

.cake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.candles-counter-box {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.candles-counter {
  color: var(--accent-gold);
  font-size: 1.3rem;
  font-weight: 800;
}

.cake-stage {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 370px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 15px;
  margin: 0 auto;
}

.candles-grid {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 320px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  z-index: 10;
}

.candle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease;
  user-select: none;
}

.candle-item:hover {
  transform: scale(1.15) translateY(-3px);
}

.flame {
  width: 11px;
  height: 18px;
  background: linear-gradient(to bottom, #fff 0%, #ffd166 40%, #ff5e00 80%, rgba(255, 0, 0, 0) 100%);
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  box-shadow: 0 0 10px 2px #ffbe0b, 0 0 20px 4px rgba(255, 117, 140, 0.8);
  animation: flicker 1.2s infinite ease-in-out alternate;
  transform-origin: center bottom;
  margin-bottom: 2px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.candle-item:nth-child(even) .flame {
  animation-duration: 0.9s;
  animation-delay: 0.2s;
}

.candle-item:nth-child(3n) .flame {
  animation-duration: 1.4s;
  animation-delay: 0.4s;
}

@keyframes flicker {
  0% {
    transform: rotate(-2deg) scale(1);
    opacity: 0.95;
  }

  50% {
    transform: rotate(3deg) scale(1.08, 0.95);
    opacity: 1;
  }

  100% {
    transform: rotate(-1deg) scale(0.96, 1.05);
    opacity: 0.9;
  }
}

.wick {
  width: 2px;
  height: 4px;
  background: #333;
}

.stick {
  width: 9px;
  height: 34px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ffd1dc 0%, #ff8fab 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
}

.candle-item:nth-child(3n+1) .stick {
  background: linear-gradient(135deg, #c77dff 0%, #9d4edd 100%);
}

.candle-item:nth-child(3n+2) .stick {
  background: linear-gradient(135deg, #ffd166 0%, #ffb703 100%);
}

.candle-item.extinguished .flame {
  opacity: 0;
  transform: scale(0.1) translateY(-10px);
  pointer-events: none;
}

.candle-item.extinguished .wick::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 12px;
  background: radial-gradient(circle, rgba(200, 200, 200, 0.7), transparent 70%);
  animation: smokePuff 1s forwards ease-out;
}

@keyframes smokePuff {
  0% {
    opacity: 0.9;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -24px) scale(2.5);
  }
}

.birthday-cake {
  position: relative;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 80px;
}

.cake-tier {
  border-radius: 14px 14px 6px 6px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.tier-top {
  width: min(210px, 72%);
  height: 56px;
  background: linear-gradient(180deg, #ffcbf2 0%, #f72585 100%);
  z-index: 3;
}

.cream-frosting {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: #ffffff;
  border-radius: 14px 14px 8px 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.berries-row {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  font-size: 1.1rem;
}

.tier-middle {
  width: min(250px, 86%);
  height: 65px;
  background: linear-gradient(180deg, #e0aaff 0%, #7209b7 100%);
  z-index: 2;
  margin-top: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cake-text-gold {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tier-bottom {
  width: min(290px, 98%);
  height: 75px;
  background: linear-gradient(180deg, #ffe5ec 0%, #ff4d6d 100%);
  z-index: 1;
  margin-top: -6px;
  border-radius: 12px 12px 16px 16px;
}

.bottom-cream {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0 0 16px 16px;
}

.cake-stand {
  width: min(320px, 100%);
  height: 16px;
  background: linear-gradient(90deg, #d4af37, #fff8dc, #aa7c11);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin-top: -2px;
}

.cake-controls {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.wish-success-box {
  margin-top: 32px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.25), rgba(199, 125, 255, 0.25));
  border: 1px solid rgba(255, 209, 102, 0.5);
  border-radius: var(--radius-md);
  padding: 24px 30px;
  max-width: 550px;
  box-shadow: 0 12px 35px rgba(255, 117, 140, 0.3);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wish-success-box.hidden {
  display: none;
}

.wish-success-box h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--accent-gold);
  margin-bottom: 10px;
}

.wish-success-box p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.success-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

@keyframes popIn {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.envelope-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 440px;
  perspective: 1200px;
  padding: 30px 10px;
  transition: min-height 0.5s ease;
}

.envelope {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 290px;
  background: #a36125;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform 0.4s ease, margin 0.5s ease;
  user-select: none;
}

.envelope:hover {
  transform: translateY(-4px);
}

.envelope-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #94531e;
  border-radius: 12px;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58%;
  background: linear-gradient(180deg, #c97a3e 0%, #b36329 100%);
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  border-radius: 10px 10px 0 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.envelope-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #dd9d6b 0%, #c97a3e 100%);
  clip-path: polygon(0% 38%, 50% 68%, 100% 38%, 100% 100%, 0% 100%);
  border-radius: 0 0 12px 12px;
  z-index: 4;
  filter: drop-shadow(0 -3px 6px rgba(0, 0, 0, 0.2));
}

.envelope-pocket::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.12) 0%, transparent 50%);
  clip-path: polygon(0% 0%, 0% 100%, 50% 68%);
  pointer-events: none;
}

.envelope-pocket::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(225deg, rgba(0, 0, 0, 0.12) 0%, transparent 50%);
  clip-path: polygon(100% 0%, 100% 100%, 50% 68%);
  pointer-events: none;
}

.wax-seal {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  background: radial-gradient(circle, #e63946 0%, #9b2226 100%);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.35s ease;
  border: 2px dashed rgba(255, 209, 102, 0.5);
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 25px rgba(230, 57, 70, 0.85);
}

.wax-inner {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffd166;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.envelope-letter {
  position: absolute;
  top: 12px;
  left: 4%;
  width: 92%;
  background: #fffdfa;
  color: #2b2024;
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(25px) scale(0.96);
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease, visibility 0.5s ease;
  max-height: 250px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.letter-date {
  font-size: 0.8rem;
  color: #8b6b61;
  font-weight: 600;
  text-transform: uppercase;
}

.letter-heart {
  font-size: 1.15rem;
}

.letter-greeting {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: #6a040f;
  margin-bottom: 12px;
}

.letter-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3d3436;
  margin-bottom: 10px;
}

.letter-signature {
  margin-top: 16px;
  text-align: right;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
  padding-top: 10px;
}

.handwriting {
  font-family: var(--font-script);
  font-size: 1.75rem;
  color: #9d0208;
  line-height: 1.2;
}

.envelope.opened {
  margin-top: 110px;
  margin-bottom: 30px;
}

.envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope.opened .wax-seal {
  opacity: 0;
  pointer-events: none;
}

.envelope.opened .envelope-letter {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-130px) scale(1);
  max-height: 480px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
}

@media (max-width: 600px) {
  .envelope-wrapper {
    min-height: 400px;
    padding: 15px 5px;
  }

  .envelope {
    max-width: 100%;
    height: 220px;
  }

  .wax-seal {
    width: 48px;
    height: 48px;
  }

  .wax-inner {
    font-size: 1.15rem;
  }

  .envelope.opened {
    margin-top: 140px;
    margin-bottom: 25px;
  }

  .envelope.opened .envelope-letter {
    transform: translateY(-130px);
    max-height: 400px;
    padding: 18px 14px;
    width: 94%;
    left: 3%;
  }

  .letter-greeting {
    font-size: 1.2rem;
  }

  .letter-content p {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .handwriting {
    font-size: 1.5rem;
  }
}

.reasons-progress-bar-wrap {
  max-width: 420px;
  margin: 18px auto 0 auto;
}

.reasons-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-lilac);
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-gold));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.reason-card {
  perspective: 1000px;
  height: 175px;
  cursor: pointer;
}

.reason-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  border-radius: var(--radius-md);
}

.reason-card.flipped .reason-card-inner {
  transform: rotateY(180deg);
}

.reason-card-front,
.reason-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.reason-card-front {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

.reason-card:hover .reason-card-front {
  border-color: var(--accent-pink);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--glow-pink);
}

.card-number-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.3);
}

.reason-card-front .reason-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.reason-card-front .reason-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-hint {
  font-size: 0.75rem;
  color: var(--accent-lilac);
  opacity: 0.8;
}

.reason-card-back {
  background: linear-gradient(135deg, rgba(255, 117, 140, 0.92) 0%, rgba(157, 78, 221, 0.95) 100%);
  color: #fff;
  transform: rotateY(180deg);
  border-color: rgba(255, 255, 255, 0.3);
}

.reason-card-back p {
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 500;
}

.polaroids-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  padding: 20px 10px;
}

.polaroid-card {
  background: #ffffff;
  padding: 14px 14px 22px 14px;
  border-radius: 4px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.tilt-left {
  transform: rotate(-3deg);
}

.tilt-right {
  transform: rotate(3.5deg);
}

.tilt-left-subtle {
  transform: rotate(-1.5deg);
}

.tilt-right-subtle {
  transform: rotate(2deg);
}

.polaroid-card:hover {
  transform: scale(1.06) rotate(0deg) !important;
  z-index: 10;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 25px rgba(255, 117, 140, 0.4);
}

.tape-strip {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 75px;
  height: 24px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  border: 1px dashed rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.polaroid-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  background: #f0f0f0;
}

.polaroid-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img-wrapper img {
  transform: scale(1.05);
}

.polaroid-caption {
  font-family: var(--font-script);
  font-size: 1.45rem;
  color: #2b2b2b;
  text-align: center;
  margin-top: 12px;
  font-weight: 700;
}

.gallery-upload-hint {
  text-align: center;
  margin-top: 30px;
}

.upload-btn {
  font-size: 0.9rem;
  padding: 10px 20px;
}

.crystal-ball-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.crystal-ball {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #c77dff 35%, #3c096c 80%, #10002b 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 50px rgba(199, 125, 255, 0.6), inset 0 0 35px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  user-select: none;
  animation: orbFloat 4s ease-in-out infinite;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.03);
  }
}

.crystal-ball:hover {
  transform: scale(1.1);
  box-shadow: 0 0 70px rgba(255, 117, 140, 0.8), inset 0 0 45px rgba(255, 255, 255, 0.8);
}

.crystal-stars {
  font-size: 1.3rem;
  color: #ffd166;
  text-shadow: 0 0 10px #ffd166;
  animation: twinkle 1.5s infinite alternate;
}

.crystal-prompt {
  font-size: 0.75rem;
  color: #ffffff;
  font-weight: 600;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.prediction-result {
  margin: 30px auto 20px auto;
  max-width: 600px;
  min-height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  backdrop-filter: blur(10px);
}

.prediction-result .quote-symbol {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--accent-gold);
  line-height: 0;
  margin: 0 8px;
}

#prediction-text {
  font-size: 1.08rem;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.55;
  transition: opacity 0.3s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-4px);
  border-color: var(--accent-lilac);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffd166, #ff758c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.site-footer {
  text-align: center;
  padding: 40px 20px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-heart-anim {
  font-size: 2.5rem;
  animation: heartPulse 1.2s infinite ease-in-out;
  margin-bottom: 12px;
}

@keyframes heartPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.25);
  }
}

.site-footer h3 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #fff;
}

.site-footer p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 24px auto;
  font-size: 0.95rem;
}

.footer-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.footer-copy {
  font-size: 0.8rem !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 7, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 6px;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.modal-body label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.modal-body input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 20px;
}

.modal-body input[type="text"]:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 10px var(--glow-pink);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.lightbox-content {
  position: relative;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: #fff;
  margin-top: 14px;
}

.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(20, 14, 32, 0.92);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  z-index: 2000;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .main-container {
    padding: 85px 18px 50px 18px;
  }

  .section-card {
    padding: 38px 24px;
    margin-bottom: 38px;
  }

  .reasons-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }

  .polaroids-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0 14px;
    height: 60px;
  }

  .nav-brand {
    font-size: 0.98rem;
  }

  .nav-btn {
    padding: 6px 11px;
    font-size: 0.8rem;
  }

  .section-card {
    padding: 32px 18px;
    margin-bottom: 32px;
    border-radius: 20px;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 0.98rem;
  }

  .hero-section {
    padding: 25px 6px 40px 6px;
  }

  .age-circle {
    width: 120px;
    height: 120px;
  }

  .age-number {
    font-size: 4rem;
    transform: translate(-1px, -9px);
  }

  .hero-lead {
    font-size: 1.05rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .stat-box {
    padding: 20px 14px;
  }

  .stat-number {
    font-size: 1.9rem;
  }
}

@media (max-width: 600px) {
  .main-container {
    padding: 72px 12px 35px 12px;
  }

  .section-card {
    padding: 26px 14px;
    margin-bottom: 24px;
    border-radius: 16px;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.7rem);
    margin-bottom: 22px;
  }

  .age-circle {
    width: 110px;
    height: 110px;
  }

  .age-number {
    font-size: 3.6rem;
    transform: translate(-1px, -8px);
  }

  .age-caption {
    font-size: 0.88rem;
  }

  .hero-lead {
    font-size: 0.96rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-group .btn {
    width: 100%;
    padding: 13px 18px;
    font-size: 0.92rem;
  }

  .hero-tags {
    gap: 6px;
  }

  .tag {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .cake-stage {
    min-height: 330px;
  }

  .cake-controls {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .cake-controls .btn {
    width: 100%;
  }

  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .reason-card {
    height: 155px;
  }

  .reason-card-front,
  .reason-card-back {
    padding: 12px 8px;
  }

  .reason-card-front .reason-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }

  .reason-card-front .reason-title {
    font-size: 0.85rem;
  }

  .card-hint {
    font-size: 0.68rem;
  }

  .reason-card-back p {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .polaroids-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 0;
  }

  .polaroid-card {
    padding: 8px 8px 16px 8px;
  }

  .polaroid-caption {
    font-size: 1.2rem;
    margin-top: 6px;
  }

  .tape-strip {
    width: 50px;
    height: 16px;
    top: -8px;
  }

  .crystal-ball {
    width: 125px;
    height: 125px;
  }

  .prediction-result {
    padding: 14px 16px;
  }

  #prediction-text {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-box {
    padding: 16px 8px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .footer-buttons {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .footer-buttons .btn {
    width: 100%;
  }

  .modal-dialog {
    padding: 24px 16px;
  }
}

@media (max-width: 400px) {
  .top-nav {
    padding: 0 8px;
  }

  .nav-brand {
    font-size: 0.85rem;
    gap: 3px;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
    gap: 3px;
  }

  .nav-btn .music-text {
    display: none;
  }

  .cake-stage {
    transform: scale(0.85);
    transform-origin: center bottom;
    margin-bottom: -15px;
  }

  .reasons-grid {
    grid-template-columns: 1fr;
  }

  .reason-card {
    height: 125px;
  }

  .polaroids-container {
    grid-template-columns: 1fr;
    max-width: 250px;
    margin: 0 auto;
  }
}