/* ==========================================================
   СТИЛИ ДЛЯ ДНЯ РОЖДЕНИЯ ЮЛИИ — PREMIUM EDITION
   Палитра: Белый, Нежно-розовый, Небесно-голубой, Серый, Тёмный шоколад
   ========================================================== */

:root {
  /* Основная палитра */
  --color-white: #ffffff;
  --color-cream: #faf7f5;
  --color-pink-soft: #fde8ef;
  --color-pink-accent: #f4a6bf;
  --color-pink-deep: #e27d9f;
  --color-blue-soft: #e3f2fd;
  --color-blue-accent: #a3cef1;
  --color-blue-deep: #6fb7e8;
  --color-gray-light: #f1f3f6;
  --color-gray-border: #dce1e7;
  --color-gray-text: #737c87;
  --color-chocolate: #2d1c17;
  --color-chocolate-light: #442d26;
  --color-gold: #e5a93c;
  --color-gold-light: #fde8b3;

  /* Тени и стеклянные эффекты (Glassmorphism) */
  --shadow-sm: 0 4px 16px rgba(45, 28, 23, 0.06);
  --shadow-md: 0 12px 32px rgba(45, 28, 23, 0.1);
  --shadow-lg: 0 24px 48px rgba(45, 28, 23, 0.14);
  --shadow-box: 0 28px 56px -14px rgba(45, 28, 23, 0.28);
  --shadow-glow-pink: 0 8px 32px rgba(244, 166, 191, 0.3);
  --shadow-glow-gold: 0 8px 32px rgba(229, 169, 60, 0.35);
  
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.6);
  
  /* Шрифты */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-hand: 'Caveat', cursive;
  
  /* Радиусы */
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --radius-xl: 40px;
  --radius-full: 9999px;
}

/* Сброс стилей */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--color-chocolate);
  font-family: var(--font-sans);
  position: fixed;
}

/* ==========================================================
   ЖИВОЙ АНИМИРОВАННЫЙ ГРАДИЕНТНЫЙ ФОН (MESH GRADIENT)
   ========================================================== */
body {
  background: linear-gradient(135deg, #fdf2f6 0%, #f7e8f0 15%, #eef3fc 35%, #faf7f5 55%, #fde8ef 75%, #e8f0fb 100%);
  background-size: 400% 400%;
  animation: meshGradientShift 18s ease infinite;
}

@keyframes meshGradientShift {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 50% 100%; }
  75% { background-position: 0% 50%; }
  100% { background-position: 0% 0%; }
}

/* ==========================================================
   ФОНОВЫЕ ЭФФЕКТЫ (AMBIENT ORB GLOW)
   ========================================================== */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.glow-pink {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(244, 166, 191, 0.6) 0%, rgba(253, 232, 239, 0) 70%);
  top: -80px;
  right: -80px;
  animation: orbFloat1 12s infinite ease-in-out;
}

.glow-blue {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(163, 206, 241, 0.5) 0%, rgba(227, 242, 253, 0) 70%);
  bottom: -60px;
  left: -100px;
  animation: orbFloat2 15s infinite ease-in-out;
}

.glow-gold {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.3) 0%, rgba(253, 232, 179, 0) 70%);
  top: 40%;
  left: 30%;
  animation: orbFloat3 10s infinite ease-in-out;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 50px) scale(1.15); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -30px) scale(1.1); }
  66% { transform: translate(30px, -50px) scale(1.2); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: scale(0.9); opacity: 0.2; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

/* ==========================================================
   ПАРЯЩИЕ ЧАСТИЦЫ БОКЕ (PERMANENT FLOATING BOKEH)
   ========================================================== */
.bokeh-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.bokeh-dot {
  position: absolute;
  border-radius: 50%;
  animation: bokehFloat var(--dur, 10s) linear infinite;
  opacity: 0;
}

@keyframes bokehFloat {
  0% {
    transform: translateY(110dvh) translateX(0) scale(0.4);
    opacity: 0;
  }
  10% { opacity: var(--opacity, 0.5); }
  90% { opacity: var(--opacity, 0.5); }
  100% {
    transform: translateY(-20dvh) translateX(var(--drift, 30px)) scale(1);
    opacity: 0;
  }
}

/* ==========================================================
   ИНТЕРАКТИВНЫЕ ЛЕТАЮЩИЕ ШАРИКИ (BALLOONS)
   ========================================================== */
.balloons-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.floating-balloon {
  position: absolute;
  bottom: -120px;
  width: 50px;
  height: 64px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    inset -8px -8px 16px rgba(0, 0, 0, 0.07),
    inset 10px 10px 18px rgba(255, 255, 255, 0.65),
    0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s ease;
  animation: balloonAscend var(--duration, 14s) linear forwards;
}

.floating-balloon::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 14px;
  width: 10px;
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transform: rotate(-30deg);
}

.floating-balloon::after {
  content: '';
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, rgba(120, 120, 120, 0.35), transparent);
}

.floating-balloon.pink {
  background: radial-gradient(circle at 35% 30%, #fff0f5 0%, #f9c2d5 50%, #f48fb1 100%);
}

.floating-balloon.blue {
  background: radial-gradient(circle at 35% 30%, #f0f8ff 0%, #c4e2f8 50%, #90caf9 100%);
}

.floating-balloon.gold {
  background: radial-gradient(circle at 35% 30%, #fffdf0 0%, #fde49e 50%, #f6c04f 100%);
}

.floating-balloon.popping {
  animation: balloonPop 0.25s forwards cubic-bezier(0.1, 0.9, 0.2, 1);
  pointer-events: none;
}

@keyframes balloonAscend {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  20% { transform: translateY(calc(-22dvh)) translateX(18px) rotate(5deg); }
  40% { transform: translateY(calc(-44dvh)) translateX(-16px) rotate(-4deg); }
  60% { transform: translateY(calc(-66dvh)) translateX(20px) rotate(3deg); }
  80% { transform: translateY(calc(-88dvh)) translateX(-10px) rotate(-2deg); }
  100% { transform: translateY(calc(-130dvh)) translateX(5px) rotate(0deg); }
}

@keyframes balloonPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
  100% { transform: scale(2.5); opacity: 0; }
}

.pop-toast {
  position: fixed;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-pink-deep);
  pointer-events: none;
  animation: floatUpFade 1.2s ease-out forwards;
  z-index: 1000;
  text-shadow: 0 1px 8px rgba(226, 125, 159, 0.3);
}

@keyframes floatUpFade {
  0% { transform: translateY(0) scale(0.7); opacity: 1; }
  100% { transform: translateY(-55px) scale(1.2); opacity: 0; }
}

/* ==========================================================
   ТАП-СЕРДЕЧКИ И БЛЁСТКИ (TOUCH SPARKS)
   ========================================================== */
.touch-sparks-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 999;
}

.touch-spark {
  position: absolute;
  font-size: 22px;
  transform: translate(-50%, -50%);
  animation: sparkBurst 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

@keyframes sparkBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, -50px))) scale(1.4) rotate(var(--rot, 20deg));
  }
}

/* Canvases */
#confetti-canvas, #fireworks-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 100;
}

#fireworks-canvas {
  z-index: 900;
}

/* ==========================================================
   ВЕРХНЯЯ ПАНЕЛЬ (TOP NAV & MINI MUSIC PLAYER)
   ========================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: calc(env(safe-area-inset-top, 12px) + 10px) 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(250, 247, 245, 0.9) 0%, rgba(250, 247, 245, 0) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.8);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-pink-deep);
  box-shadow: 0 0 10px var(--color-pink-deep), 0 0 20px rgba(226, 125, 159, 0.3);
  animation: blink 2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.badge-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--color-chocolate);
}

/* Мини-плеер */
.mini-music-player {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.sound-wave {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 16px;
}

.sound-wave .bar {
  width: 3px;
  height: 4px;
  background: linear-gradient(to top, var(--color-pink-deep), var(--color-pink-accent));
  border-radius: 2px;
  transition: height 0.2s ease;
}

.sound-wave.playing .bar-1 { animation: wave 0.7s infinite alternate ease-in-out; }
.sound-wave.playing .bar-2 { animation: wave 1.0s infinite alternate-reverse ease-in-out 0.15s; }
.sound-wave.playing .bar-3 { animation: wave 0.8s infinite alternate ease-in-out 0.3s; }
.sound-wave.playing .bar-4 { animation: wave 1.1s infinite alternate-reverse ease-in-out 0.05s; }

@keyframes wave {
  0% { height: 3px; }
  100% { height: 16px; }
}

.music-toggle-btn {
  background: none;
  border: none;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Кнопка звуков */
.sound-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-chocolate);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.sound-toggle-btn:active {
  transform: scale(0.9);
  background-color: var(--color-pink-soft);
}

.sound-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.hidden {
  display: none !important;
}

/* Step Progress Dots */
.step-progress-wrapper {
  position: fixed;
  top: calc(env(safe-area-inset-top, 12px) + 50px);
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 45;
  pointer-events: none;
}

.step-indicators {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.step-indicators .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(45, 28, 23, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicators .dot.active {
  width: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-pink-deep) 100%);
}

/* ==========================================================
   КОНТЕЙНЕР ЭТАПОВ
   ========================================================== */
.app-container {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  z-index: 10;
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: calc(env(safe-area-inset-top, 20px) + 72px) 18px calc(env(safe-area-inset-bottom, 20px) + 16px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(30px) scale(0.96);
  filter: blur(6px);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s ease,
    visibility 0.6s;
  overflow-y: auto;
}

.stage.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}

.stage-content {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100%;
  justify-content: space-between;
  gap: 12px;
}

/* ==========================================================
   ТИПОГРАФИКА
   ========================================================== */
.tagline, .stage-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-pink-deep);
  background: linear-gradient(135deg, rgba(244, 166, 191, 0.2) 0%, rgba(163, 206, 241, 0.15) 100%);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(244, 166, 191, 0.2);
  animation: fadeSlideUp 0.8s ease-out both;
}

.main-title {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--color-chocolate);
  animation: fadeSlideUp 0.8s ease-out 0.15s both;
}

.highlight-name {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-pink-deep) 60%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
  font-size: 38px;
  animation: shimmerText 3s ease-in-out infinite;
  background-size: 200% auto;
}

@keyframes shimmerText {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

.section-title {
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1.2;
  color: var(--color-chocolate);
  animation: fadeSlideUp 0.7s ease-out both;
}

.subtitle {
  font-size: 13px;
  color: var(--color-gray-text);
  line-height: 1.45;
  padding: 0 8px;
  animation: fadeSlideUp 0.7s ease-out 0.2s both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================
   КНОПКИ
   ========================================================== */
.primary-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-chocolate-light) 50%, #5a3a30 100%);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(45, 28, 23, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
  overflow: hidden;
}

.primary-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.primary-btn:active {
  transform: scale(0.96);
  box-shadow: 0 6px 16px rgba(45, 28, 23, 0.2);
}

.primary-btn:active::before {
  left: 100%;
}

.btn-icon {
  font-size: 16px;
}

/* ==========================================================
   STAGE 1: ПОДАРОЧНАЯ КОРОБКА & ВИДЖЕТ ТАЙМЕРА
   ========================================================== */
.welcome-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gift-box-wrapper {
  position: relative;
  margin: 8px 0;
  cursor: pointer;
  perspective: 900px;
  animation: giftEntrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

@keyframes giftEntrance {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(40px) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0deg);
  }
}

.gift-box {
  position: relative;
  width: 150px;
  height: 150px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: gentleBob 3s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}

.gift-box-wrapper:active .gift-box {
  transform: scale(0.94);
  animation: none;
}

/* Бантик */
.bow-wrap {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 38px;
  z-index: 10;
  transition: transform 0.6s ease, opacity 0.5s ease;
  filter: drop-shadow(0 4px 8px rgba(229, 169, 60, 0.3));
}

.bow {
  position: absolute;
  top: 5px;
  width: 32px;
  height: 24px;
  border: 3.5px solid var(--color-gold);
  border-radius: 50% 50% 20% 50%;
  background: linear-gradient(135deg, rgba(229, 169, 60, 0.35) 0%, rgba(253, 232, 179, 0.2) 100%);
}

.bow-left {
  left: 5px;
  transform: rotate(-25deg);
}

.bow-right {
  right: 5px;
  transform: rotate(25deg) scaleX(-1);
}

.bow-center {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--color-gold) 0%, #f7d36a 100%);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(229, 169, 60, 0.5);
}

/* Крышка коробки */
.box-lid {
  position: absolute;
  top: 0;
  left: -8px;
  width: 166px;
  height: 36px;
  background: linear-gradient(180deg, #fff5f8 0%, #ffdbe6 50%, #fcc8d8 100%);
  border-radius: 8px 8px 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(45, 28, 23, 0.08), inset 0 2px 0 rgba(255,255,255,0.9);
  z-index: 5;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.5s ease;
}

.ribbon-vertical-lid {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #daa520 0%, #f7d36a 40%, #ffd700 60%, #daa520 100%);
  box-shadow: 0 0 8px rgba(229, 169, 60, 0.3);
}

.ribbon-horizontal-lid {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 16px;
  background: linear-gradient(180deg, #daa520 0%, #f7d36a 40%, #ffd700 60%, #daa520 100%);
}

/* Тело коробки */
.box-body {
  position: absolute;
  top: 30px;
  left: 0;
  width: 150px;
  height: 122px;
  background: linear-gradient(180deg, #e8f4fd 0%, #cfe5f8 50%, #b8d9f4 100%);
  border-radius: 0 0 16px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-box), inset 0 -4px 8px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  z-index: 2;
}

.ribbon-vertical {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #daa520 0%, #f7d36a 40%, #ffd700 60%, #daa520 100%);
  box-shadow: 0 0 8px rgba(229, 169, 60, 0.2);
}

.ribbon-horizontal {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 100%;
  height: 16px;
  background: linear-gradient(180deg, #daa520 0%, #f7d36a 40%, #ffd700 60%, #daa520 100%);
}

/* Мерцание на коробке */
.box-body::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.25) 35%,
    transparent 50%
  );
  animation: boxShimmer 4s ease-in-out infinite;
}

@keyframes boxShimmer {
  0%, 100% { transform: translateX(-60%); }
  50% { transform: translateX(60%); }
}

/* Бирочка */
.box-gift-tag {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--color-white);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(45, 28, 23, 0.12);
  transform: rotate(-6deg);
  border: 1px dashed var(--color-pink-deep);
  z-index: 5;
}

.box-gift-tag span {
  font-family: var(--font-hand);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-chocolate);
}

.box-shadow {
  width: 130px;
  height: 16px;
  background: rgba(45, 28, 23, 0.1);
  border-radius: 50%;
  filter: blur(8px);
  margin: 10px auto 0;
  animation: shadowPulse 3s ease-in-out infinite;
}

@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1); opacity: 0.6; }
  50% { transform: scaleX(0.85); opacity: 0.3; }
}

/* ==========================================================
   АНИМАЦИИ ДВУХФАЗНОГО ОТКРЫТИЯ ПОДАРКА
   ========================================================== */
.box-inner-light {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255, 235, 150, 0.95) 0%, rgba(244, 143, 177, 0.7) 45%, transparent 75%);
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 8;
}

/* Фаза 1: Лента развязана */
.gift-box.ribbon-untied {
  animation: boxGentleHover 2s ease-in-out infinite alternate;
}

@keyframes boxGentleHover {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.02); }
}

.gift-box.ribbon-untied .bow-wrap {
  transform: translateX(-50%) translateY(30px) rotate(-18deg) scale(0.4);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.gift-box.ribbon-untied .ribbon-vertical,
.gift-box.ribbon-untied .ribbon-vertical-lid {
  transform: translateY(50px) scaleY(0.2);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.5s ease;
}

.gift-box.ribbon-untied .ribbon-horizontal,
.gift-box.ribbon-untied .ribbon-horizontal-lid {
  transform: translateX(-60px) scaleX(0.2);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.5s ease;
}

.gift-box.ribbon-untied .box-inner-light {
  opacity: 1;
  animation: innerPulse 1.6s ease-in-out infinite alternate;
}

@keyframes innerPulse {
  0% { transform: scale(0.98); opacity: 0.6; filter: blur(2px); }
  100% { transform: scale(1.05); opacity: 0.95; filter: blur(6px); }
}

/* Фаза 2: Крышка снята (полное открытие) */
.gift-box.opened {
  animation: boxBounceOpen 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.gift-box.opened .box-lid {
  transform: translateY(-130px) rotateX(45deg) rotateZ(-18deg) scale(1.08);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.6s ease;
}

.gift-box.opened .box-inner-light {
  opacity: 1;
  transform: translateY(-80px) scale(1.4);
  filter: blur(10px);
  transition: all 0.7s ease-out;
}

@keyframes boxBounceOpen {
  0% { transform: scale(1); }
  35% { transform: scale(1.12) translateY(-16px); }
  65% { transform: scale(0.96) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}

.action-prompt {
  margin: 6px 0 2px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.action-prompt.pulse {
  animation: promptPulse 0.6s ease;
}

@keyframes promptPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.tap-finger {
  font-size: 26px;
  animation: bounceTap 1.5s infinite ease-in-out;
}

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

.tap-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-chocolate);
  opacity: 0.85;
}

/* ==========================================================
   ВИДЖЕТ ОБРАТНОГО ОТСЧЕТА (COUNTDOWN)
   ========================================================== */
.countdown-widget {
  width: 100%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeSlideUp 0.8s ease-out 0.6s both;
}

.countdown-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-chocolate-light);
  margin-bottom: 8px;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.time-box {
  background: var(--color-white);
  border: 1px solid var(--color-gray-border);
  border-radius: 12px;
  padding: 6px 7px;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 3px 8px rgba(45, 28, 23, 0.04), inset 0 1px 0 rgba(255,255,255,0.9);
}

.time-val {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-chocolate);
  line-height: 1;
  background: linear-gradient(135deg, var(--color-chocolate), var(--color-pink-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.time-label {
  font-size: 9px;
  color: var(--color-gray-text);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-sep {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-pink-deep);
  margin-top: -10px;
  animation: colonBlink 1s infinite;
}

@keyframes colonBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Статистические плашки */
.stats-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-gray-border);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--color-chocolate);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.stat-pill strong {
  color: var(--color-pink-deep);
}

.love-ray-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, var(--color-pink-soft) 0%, #ffdbe6 100%);
  border: 1px solid rgba(244, 166, 191, 0.4);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-chocolate);
  cursor: pointer;
  box-shadow: var(--shadow-glow-pink);
  transition: transform 0.15s ease;
}

.love-ray-btn:active {
  transform: scale(0.92);
}

.ray-count {
  background: var(--color-white);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--color-pink-deep);
  font-size: 11px;
}

/* ==========================================================
   STAGE 2: ПРАЗДНИЧНЫЙ ТОРТ И СВЕЧИ
   ========================================================== */
.cake-container {
  position: relative;
  width: 240px;
  height: 210px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  animation: cakeEntrance 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cakeEntrance {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Свечи */
.candles-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 26px;
  margin-bottom: 2px;
  z-index: 5;
}

.candle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candle-stick {
  width: 12px;
  height: 40px;
  border-radius: 4px;
  box-shadow: inset -2px 0 4px rgba(0,0,0,0.1);
}

.candle-tall .candle-stick {
  height: 50px;
}

.stick-pink {
  background: repeating-linear-gradient(
    45deg,
    var(--color-pink-accent),
    var(--color-pink-accent) 6px,
    var(--color-white) 6px,
    var(--color-white) 12px
  );
}

.stick-blue {
  background: repeating-linear-gradient(
    45deg,
    var(--color-blue-accent),
    var(--color-blue-accent) 6px,
    var(--color-white) 6px,
    var(--color-white) 12px
  );
}

.wick {
  width: 2px;
  height: 7px;
  background-color: var(--color-chocolate);
}

/* Пламя */
.flame {
  width: 14px;
  height: 24px;
  background: radial-gradient(ellipse at bottom, #fff5cc 0%, #ffbb33 55%, #ff7700 85%, #ff4500 100%);
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 16px #ffbb33, 0 0 30px rgba(255, 187, 51, 0.5), 0 -6px 20px rgba(255, 119, 0, 0.3);
  transform-origin: center bottom;
  animation: candleFlicker 1.2s infinite alternate ease-in-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes candleFlicker {
  0% { transform: scaleY(1) scaleX(1) rotate(-2deg); }
  25% { transform: scaleY(1.06) scaleX(0.97) rotate(2deg); }
  50% { transform: scaleY(0.94) scaleX(1.03) rotate(-1deg); }
  75% { transform: scaleY(1.1) scaleX(0.95) rotate(1.5deg); }
  100% { transform: scaleY(1.02) scaleX(1) rotate(-2deg); }
}

/* Реакция пламени на ветерок при свайпе */
.cake-container.wind-blowing .flame {
  transform: rotate(34deg) skewX(26deg) scaleY(0.65) scaleX(1.18) !important;
  filter: blur(1.5px);
  opacity: 0.75;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Слой потоков ветра (Breeze Layer) */
.wind-breeze-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120%;
  pointer-events: none;
  z-index: 25;
  overflow: visible;
  opacity: 0;
}

.wind-breeze-layer.active {
  opacity: 1;
}

.breeze-gust {
  position: absolute;
  bottom: 10px;
  width: 44px;
  height: 95px;
  border-right: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  filter: blur(1px) drop-shadow(0 0 8px rgba(255,255,255,0.9));
  opacity: 0;
}

.wind-breeze-layer.active .breeze-gust.g1 {
  left: 22%;
  animation: gustFlow 0.7s ease-out forwards;
}

.wind-breeze-layer.active .breeze-gust.g2 {
  left: 48%;
  animation: gustFlow 0.7s ease-out 0.09s forwards;
}

.wind-breeze-layer.active .breeze-gust.g3 {
  left: 72%;
  animation: gustFlow 0.7s ease-out 0.16s forwards;
}

@keyframes gustFlow {
  0% { transform: translateY(30px) scale(0.6); opacity: 0; }
  40% { opacity: 0.95; transform: translateY(-30px) scale(1.1) rotate(-10deg); }
  100% { transform: translateY(-120px) scale(1.4) rotate(-22deg); opacity: 0; }
}

/* Дым */
.smoke {
  position: absolute;
  top: -14px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(160, 160, 160, 0.7) 0%, rgba(200, 200, 200, 0) 70%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.candle.blown-out .flame {
  opacity: 0;
  transform: scale(0);
}

.candle.blown-out .smoke {
  animation: smokeRise 1.8s ease-out forwards;
}

@keyframes smokeRise {
  0% { opacity: 0.8; transform: translateY(0) scale(0.5); }
  30% { opacity: 0.6; transform: translateY(-16px) translateX(5px) scale(1.2); }
  60% { opacity: 0.35; transform: translateY(-32px) translateX(-4px) scale(1.8); }
  100% { opacity: 0; transform: translateY(-50px) translateX(8px) scale(2.5); }
}

/* Ярусы торта */
.cake-tier {
  position: relative;
  background: linear-gradient(180deg, #fffdf9 0%, #f7efe7 50%, #f0e4d8 100%);
  border-radius: 14px 14px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(45, 28, 23, 0.06), inset 0 2px 0 rgba(255,255,255,0.9);
}

.tier-top {
  width: 140px;
  height: 50px;
  z-index: 3;
}

.cake-toppings {
  position: absolute;
  top: -16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  font-size: 16px;
  z-index: 6;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.tier-bottom {
  width: 190px;
  height: 58px;
  margin-top: -6px;
  z-index: 2;
}

.cream-frosting {
  position: absolute;
  top: -5px;
  left: 0;
  width: 100%;
  height: 16px;
  background: linear-gradient(180deg, var(--color-pink-soft) 0%, #fdd5e3 100%);
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-around;
}

.cream-drop {
  width: 14px;
  height: 14px;
  background: linear-gradient(180deg, var(--color-pink-soft) 0%, #fdd5e3 100%);
  border-radius: 50%;
  margin-top: 6px;
}

.cake-filling {
  position: absolute;
  bottom: 13px;
  left: 4px;
  right: 4px;
  height: 5px;
  background: linear-gradient(90deg, var(--color-chocolate-light), var(--color-gold), var(--color-chocolate-light));
  opacity: 0.25;
  border-radius: 3px;
}

.cake-plate {
  width: 220px;
  height: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #e8eaee 50%, var(--color-gray-border) 100%);
  border-radius: var(--radius-full);
  margin-top: -4px;
  box-shadow: 0 12px 24px rgba(45, 28, 23, 0.1);
  z-index: 1;
}

.cake-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ==========================================================
   STAGE 3: POLAROID КАРУСЕЛЬ
   ========================================================== */
.polaroid-carousel-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.polaroid-track {
  position: relative;
  width: 268px;
  height: 340px;
}

.polaroid-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-white);
  padding: 14px 14px 24px;
  border-radius: 6px;
  box-shadow: var(--shadow-lg), 0 2px 0 rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.82) rotate(-6deg);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.polaroid-card.active {
  opacity: 1;
  transform: scale(1) rotate(-1deg);
  pointer-events: auto;
  z-index: 5;
}

.polaroid-card.prev {
  opacity: 0.35;
  transform: translateX(-60px) scale(0.88) rotate(-9deg);
  z-index: 2;
}

.polaroid-card.next {
  opacity: 0.35;
  transform: translateX(60px) scale(0.88) rotate(7deg);
  z-index: 2;
}

.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 72px;
  height: 22px;
  opacity: 0.8;
  border-left: 2px dashed rgba(255,255,255,0.4);
  border-right: 2px dashed rgba(255,255,255,0.4);
  z-index: 10;
}

.tape-pink { background: rgba(244, 166, 191, 0.65); }
.tape-blue { background: rgba(163, 206, 241, 0.65); }
.tape-gold { background: rgba(229, 169, 60, 0.65); }

.polaroid-photo-frame {
  width: 100%;
  height: 230px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.polaroid-photo-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%, rgba(0,0,0,0.05) 100%);
  pointer-events: none;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 1.4s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.8s ease;
}

.polaroid-img.developing {
  animation: polaroidDevelop 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes polaroidDevelop {
  0% {
    filter: contrast(0.4) brightness(2.2) saturate(0.05) blur(2.5px);
    opacity: 0.82;
  }
  35% {
    filter: contrast(0.65) brightness(1.6) saturate(0.3) blur(1px);
    opacity: 0.94;
  }
  70% {
    filter: contrast(0.85) brightness(1.15) saturate(0.8) blur(0.5px);
    opacity: 0.98;
  }
  100% {
    filter: contrast(1) brightness(1) saturate(1) blur(0);
    opacity: 1;
  }
}

.polaroid-caption {
  margin-top: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.caption-text {
  font-family: var(--font-hand);
  font-size: 19px;
  line-height: 1.15;
  color: var(--color-chocolate);
  font-weight: 700;
}

.caption-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-gray-text);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 4px;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.nav-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  color: var(--color-chocolate);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-arrow:active {
  transform: scale(0.88);
  box-shadow: var(--shadow-glow-pink);
}

.carousel-dots {
  display: flex;
  gap: 6px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: rgba(45, 28, 23, 0.12);
  transition: all 0.35s ease;
}

.carousel-dot.active {
  width: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-pink-deep) 100%);
}

.polaroids-action {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ==========================================================
   STAGE 4: ПИСЬМО-ОТКРЫТКА
   ========================================================== */
.letter-wrapper {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: auto 0;
}

.letter-card {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.9);
  border: 1px solid rgba(220, 225, 231, 0.5);
  background-image:
    radial-gradient(circle, rgba(220, 225, 231, 0.25) 0.8px, transparent 0.8px);
  background-size: 18px 18px;
  text-align: left;
  overflow: hidden;
  animation: letterSlideIn 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes letterSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) rotate(-2deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

/* Градиентная полоска слева */
.letter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-pink-accent), var(--color-blue-accent), var(--color-gold));
  border-radius: 4px 0 0 4px;
}

.letter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--color-gray-border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.letter-stamp {
  border: 1.5px solid var(--color-pink-deep);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-pink-deep);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stamp-heart {
  font-size: 10px;
}

.letter-date {
  font-size: 12px;
  color: var(--color-gray-text);
  font-weight: 500;
}

.letter-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-chocolate);
  margin-bottom: 14px;
}

.letter-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--color-chocolate-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.letter-text p {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(2px);
  position: relative;
  transition: opacity 0.85s cubic-bezier(0.25, 1, 0.5, 1), transform 0.85s cubic-bezier(0.25, 1, 0.5, 1), filter 0.85s ease;
}

.stage#stage-letter.active .letter-text p:nth-child(1) {
  animation: inkStreamReveal 0.9s cubic-bezier(0.25, 1, 0.5, 1) 0.35s forwards;
}

.stage#stage-letter.active .letter-text p:nth-child(2) {
  animation: inkStreamReveal 0.9s cubic-bezier(0.25, 1, 0.5, 1) 1.2s forwards;
}

.stage#stage-letter.active .letter-text p:nth-child(3) {
  animation: inkStreamReveal 0.9s cubic-bezier(0.25, 1, 0.5, 1) 2.05s forwards;
}

@keyframes inkStreamReveal {
  0% {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
    text-shadow: 0 0 10px rgba(244, 143, 177, 0.6);
  }
  60% {
    text-shadow: 0 0 6px rgba(229, 169, 60, 0.5);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    text-shadow: none;
  }
}

.letter-signature {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
}

.stage#stage-letter.active .letter-signature {
  animation: inkStreamReveal 0.8s ease-out 2.8s forwards;
}

.signature-line {
  font-size: 12px;
  color: var(--color-gray-text);
}

.signature-handwritten {
  font-family: var(--font-hand);
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-pink-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: -4px;
}

.letter-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-fireworks {
  background: linear-gradient(135deg, #2d1c17 0%, #4a3228 40%, var(--color-gold) 100%);
  box-shadow: var(--shadow-glow-gold), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: pulseButton 2.2s infinite ease-in-out;
}

@keyframes pulseButton {
  0%, 100% { box-shadow: var(--shadow-glow-gold); transform: scale(1); }
  50% { box-shadow: 0 14px 40px rgba(229, 169, 60, 0.55); transform: scale(1.02); }
}

/* ==========================================================
   ФИНАЛЬНЫЙ МОДАЛ
   ========================================================== */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 28, 23, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.celebration-overlay.active {
  opacity: 1;
  visibility: visible;
}

.celebration-modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 36px 26px;
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(229, 169, 60, 0.2);
}

.celebration-overlay.active .celebration-modal {
  transform: scale(1) translateY(0);
}

.modal-sparkle {
  font-size: 44px;
  margin-bottom: 14px;
  animation: sparkleRotate 2s ease-in-out infinite;
}

@keyframes sparkleRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); }
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 26px;
  background: linear-gradient(135deg, var(--color-chocolate) 0%, var(--color-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 14px;
  color: var(--color-gray-text);
  line-height: 1.55;
  margin-bottom: 24px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--color-gray-light);
  color: var(--color-chocolate);
  border: 1px solid var(--color-gray-border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.secondary-btn:active {
  transform: scale(0.95);
  background-color: var(--color-pink-soft);
}

/* ==========================================================
   БАНКА ПРИЧИН И ТЁПЛЫХ СЛОВ (REASONS JAR)
   ========================================================== */
.reasons-jar-section {
  margin-top: 28px;
  width: 100%;
  max-width: 360px;
}

.jar-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--shadow-md), 0 10px 30px rgba(244, 143, 177, 0.15);
  position: relative;
  overflow: hidden;
}

.jar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(229, 169, 60, 0.6), rgba(244, 143, 177, 0.6), transparent);
}

.jar-header {
  margin-bottom: 18px;
}

.jar-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(244, 143, 177, 0.18);
  border: 1px solid rgba(244, 143, 177, 0.35);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-pink-deep);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.jar-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-chocolate);
  margin-bottom: 6px;
}

.jar-desc {
  font-size: 12.5px;
  color: var(--color-gray-text);
  line-height: 1.45;
  max-width: 280px;
  margin: 0 auto;
}

/* 3D Glass Jar Graphic */
.glass-jar-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0 10px;
}

.glass-jar {
  position: relative;
  width: 140px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-jar:hover {
  transform: translateY(-4px) scale(1.03);
}

.glass-jar:active {
  transform: scale(0.96);
}

.glass-jar.shaking {
  animation: jarShake 0.6s ease-in-out;
}

@keyframes jarShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-8deg) scale(1.05) translateY(-6px); }
  40% { transform: rotate(8deg) scale(1.05) translateY(-6px); }
  60% { transform: rotate(-5deg) scale(1.02); }
  80% { transform: rotate(4deg) scale(1.01); }
}

/* Jar Cork Lid */
.jar-lid {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jar-lid.popping {
  animation: lidPop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes lidPop {
  0% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-24px) rotate(-12deg); }
  70% { transform: translateY(-8px) rotate(4deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.lid-cork {
  width: 76px;
  height: 18px;
  background: linear-gradient(180deg, #D4A373 0%, #BC8A5F 100%);
  border-radius: 6px 6px 3px 3px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 3px 6px rgba(0,0,0,0.15);
  position: relative;
}

.lid-cork::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
}

.lid-band {
  width: 92px;
  height: 9px;
  background: linear-gradient(180deg, #B07D62 0%, #8F5D44 100%);
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  margin-top: -2px;
  position: relative;
}

.lid-band::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: #E5A93C;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lid-tag {
  position: absolute;
  top: 14px;
  right: -8px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(12deg);
  transform-origin: top left;
}

.tag-string {
  width: 1px;
  height: 12px;
  background: #E5A93C;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tag-label {
  background: #FFFDF9;
  border: 1px dashed #D4A373;
  color: var(--color-chocolate);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  white-space: nowrap;
}

/* Glass Vessel */
.jar-glass {
  position: relative;
  width: 120px;
  height: 150px;
  margin: -2px auto 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.55) 0%, rgba(225,245,254,0.3) 40%, rgba(252,228,236,0.35) 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top: none;
  border-radius: 12px 12px 28px 28px;
  box-shadow: 
    inset 0 0 18px rgba(255,255,255,0.6),
    inset -4px 0 12px rgba(179,229,252,0.35),
    inset 4px 0 12px rgba(244,143,177,0.3),
    0 12px 28px rgba(45, 28, 23, 0.12);
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.jar-shine {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 12px;
  height: 80%;
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.2) 70%, transparent 100%);
  border-radius: 10px;
  filter: blur(1px);
  pointer-events: none;
}

.jar-shine-secondary {
  position: absolute;
  bottom: 12px;
  right: 10px;
  width: 6px;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0.7) 100%);
  border-radius: 6px;
  pointer-events: none;
}

/* Floating Hearts inside Jar */
.jar-hearts-inside {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 100%;
  height: 90px;
  pointer-events: none;
}

.jar-heart {
  position: absolute;
  font-size: 17px;
  filter: drop-shadow(0 2px 4px rgba(244,143,177,0.4));
  animation: floatJarHearts 3.5s ease-in-out infinite alternate;
}

.jar-heart.h1 { left: 16px; bottom: 12px; animation-delay: 0s; font-size: 20px; }
.jar-heart.h2 { right: 20px; bottom: 18px; animation-delay: 0.6s; font-size: 15px; }
.jar-heart.h3 { left: 42px; bottom: 35px; animation-delay: 1.2s; font-size: 16px; }
.jar-heart.h4 { right: 38px; bottom: 48px; animation-delay: 1.8s; font-size: 14px; }
.jar-heart.h5 { left: 24px; bottom: 58px; animation-delay: 2.4s; font-size: 18px; }
.jar-heart.h6 { right: 18px; bottom: 62px; animation-delay: 0.9s; font-size: 13px; }

@keyframes floatJarHearts {
  0% { transform: translateY(0) rotate(-6deg) scale(0.95); }
  100% { transform: translateY(-10px) rotate(8deg) scale(1.08); }
}

/* Tap Hint */
.jar-tap-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: 1px solid rgba(244, 143, 177, 0.3);
  pointer-events: none;
  animation: bounceHint 2s infinite ease-in-out;
}

.jar-tap-hint .tap-icon {
  font-size: 12px;
}

.jar-tap-hint .tap-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-pink-deep);
  white-space: nowrap;
}

@keyframes bounceHint {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* Footer Counter */
.jar-footer-info {
  margin-top: 10px;
}

.jar-counter {
  font-size: 12px;
  color: var(--color-gray-text);
}

.jar-counter strong {
  color: var(--color-pink-deep);
  font-size: 13px;
}

/* ==========================================================
   МОДАЛЬНОЕ ОКНО РАЗВЕРНУВШЕЙСЯ ЗАПИСКИ (REASON MODAL)
   ========================================================== */
.reason-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 920;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.reason-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.reason-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 28, 23, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.reason-flying-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 330px;
  perspective: 1000px;
}

.reason-modal-card {
  background: #FFFDF9;
  border-radius: 20px;
  padding: 28px 22px 24px;
  position: relative;
  text-align: center;
  box-shadow: 
    0 16px 40px rgba(45, 28, 23, 0.2),
    0 0 0 1px rgba(229, 169, 60, 0.3),
    0 0 25px rgba(244, 143, 177, 0.25);
  transform: scale(0.6) translateY(40px) rotate(-6deg);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  overflow: hidden;
}

.reason-modal-overlay.active .reason-modal-card {
  transform: scale(1) translateY(0) rotate(0deg);
  opacity: 1;
}

/* Texture & Corner Accent */
.reason-modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--color-pink-soft), var(--color-gold), var(--color-blue-soft));
}

.reason-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  color: var(--color-chocolate);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.reason-close-btn:active {
  transform: scale(0.9);
  background: rgba(244, 143, 177, 0.2);
}

.reason-top-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--color-pink-soft);
  border: 1px solid rgba(244, 143, 177, 0.35);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.reason-heart-icon {
  font-size: 14px;
  animation: pulseBeat 1.2s infinite;
}

.reason-index-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-pink-deep);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.reason-content {
  margin-bottom: 24px;
  padding: 6px 4px;
}

.reason-text {
  font-family: var(--font-hand);
  font-size: 24px;
  line-height: 1.35;
  color: var(--color-chocolate);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.reason-actions {
  display: flex;
  justify-content: center;
}

.btn-another-reason {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
}
