/* ==========================================================================
   Masha's 16th Birthday Greeting Card - Aesthetic & Responsive Stylesheet
   ========================================================================== */

:root {
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Caveat', cursive, sans-serif;

  --bg-gradient: linear-gradient(135deg, #fff0f5 0%, #fdf2f8 25%, #f5f3ff 50%, #fff7ed 75%, #ffe4e6 100%);
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(255, 215, 0, 0.45);
  --card-shadow: 0 24px 60px rgba(180, 60, 100, 0.12), 0 8px 24px rgba(255, 140, 180, 0.15);

  --primary: #ff4d8d;
  --primary-hover: #ff2a75;
  --primary-light: #ffe5ec;
  --secondary: #9333ea;
  --accent-gold: #ffd166;
  --accent-gold-dark: #d4a318;
  --text-dark: #2d1829;
  --text-muted: #6e5267;
  --text-light: #9a7d94;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Canvas Sparkles Layer */
#sparkles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Ambient Floating Blur Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: floatOrb 14s ease-in-out infinite alternate;
}

.glow-1 {
  top: -5%;
  left: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, #ffb3c6, #ff758c);
}

.glow-2 {
  bottom: 10%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, #cfbaf0, #b388ff);
  animation-delay: -5s;
}

.glow-3 {
  top: 45%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, #ffeaa7, #ffd166);
  animation-delay: -9s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -35px) scale(1.08); }
  100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* App Shell */
.app-container {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 20px 80px;
}

/* Header & Floating Audio Pill */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 8px 0;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 182, 193, 0.4);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.12);
  letter-spacing: 0.5px;
}

.brand-badge span {
  background: linear-gradient(135deg, #ff4d8d, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 0, 0.5);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  user-select: none;
}

.music-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 107, 157, 0.25);
  border-color: var(--primary);
}

.music-btn.playing {
  background: linear-gradient(135deg, #ffe5ec, #fff0f5);
  border-color: var(--primary);
  color: var(--primary);
}

.sound-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.sound-bars span {
  display: block;
  width: 2.5px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.music-btn.playing .sound-bars span {
  animation: barBounce 0.8s ease-in-out infinite alternate;
}
.music-btn.playing .sound-bars span:nth-child(2) { animation-delay: 0.2s; }
.music-btn.playing .sound-bars span:nth-child(3) { animation-delay: 0.4s; }

@keyframes barBounce {
  0% { height: 4px; }
  100% { height: 14px; }
}

/* Card Reveal States */
.card-inner-hidden {
  display: none !important;
}

.card-inner-visible {
  display: block !important;
  animation: revealCardContent 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes revealCardContent {
  0% {
    opacity: 0;
    transform: translateY(35px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Screen 1: Envelope & Hero Card Cover
   ========================================================================== */
.hero-screen {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 0 30px;
}

.envelope-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
  perspective: 1000px;
  margin: 0 auto;
}

.envelope {
  position: relative;
  background: linear-gradient(145deg, #fff9fb, #fff0f5);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 30px 80px rgba(180, 50, 100, 0.16), 0 10px 25px rgba(255, 180, 200, 0.3);
  padding: 44px 32px;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.envelope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #ff8eb3, #ffd166, #cfbaf0, #ff8eb3);
  background-size: 300% 100%;
  animation: shimmerBorder 6s linear infinite;
}

@keyframes shimmerBorder {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.envelope-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 14px;
}

.hero-age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  background: linear-gradient(135deg, #ffeef4, #ffffff);
  border-radius: 50%;
  border: 2.5px solid var(--accent-gold);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.35), inset 0 2px 8px rgba(255, 255, 255, 0.9);
  margin: 0 auto 18px;
  position: relative;
}

.hero-age-number {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff3377, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.hero-title span.masha-glow {
  background: linear-gradient(135deg, #ff2a75, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

/* Wax Seal Interaction */
.wax-seal-container {
  margin: 20px auto 28px;
  cursor: pointer;
  display: inline-block;
}

.wax-seal {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd97d, #e5a922 65%, #b27a07 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(212, 163, 24, 0.45), inset 0 3px 6px rgba(255, 255, 255, 0.6);
  border: 3px dashed #fff4c2;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  user-select: none;
}

.wax-seal:hover {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 14px 30px rgba(212, 163, 24, 0.6);
}

.wax-seal-num {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 900;
  color: #573a00;
  line-height: 1;
}

.wax-seal-sub {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #6d4a04;
  text-transform: uppercase;
}

.seal-pulse {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  animation: sealRipples 2s infinite ease-out;
  pointer-events: none;
}

@keyframes sealRipples {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.3); opacity: 0; }
}

.wax-seal-tip {
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: #9c6c0c;
  margin-top: 8px;
}

/* Open Card CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #ff4d8d, #ff2a75);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 77, 141, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
  width: 100%;
  max-width: 340px;
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 40px rgba(255, 77, 141, 0.55);
}

.cta-button.opened {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

/* ==========================================================================
   Screen 2: The Main Greeting Letter & Cake Section
   ========================================================================== */
.greeting-section {
  padding: 40px 0 60px;
  scroll-margin-top: 30px;
}

.card-paper {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: var(--card-shadow);
  padding: clamp(32px, 6vw, 64px) clamp(24px, 5vw, 56px);
  position: relative;
  overflow: hidden;
}

/* Decorative Gold Filigree Corners */
.filigree-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  pointer-events: none;
  opacity: 0.65;
}
.corner-tl { top: 16px; left: 16px; border-top: 2px solid var(--accent-gold); border-left: 2px solid var(--accent-gold); border-top-left-radius: 12px; }
.corner-tr { top: 16px; right: 16px; border-top: 2px solid var(--accent-gold); border-right: 2px solid var(--accent-gold); border-top-right-radius: 12px; }
.corner-bl { bottom: 16px; left: 16px; border-bottom: 2px solid var(--accent-gold); border-left: 2px solid var(--accent-gold); border-bottom-left-radius: 12px; }
.corner-br { bottom: 16px; right: 16px; border-bottom: 2px solid var(--accent-gold); border-right: 2px solid var(--accent-gold); border-bottom-right-radius: 12px; }

.card-inner-header {
  text-align: center;
  margin-bottom: 36px;
}

.card-date-badge {
  display: inline-block;
  background: #fff4f8;
  color: var(--primary);
  border: 1px solid rgba(255, 107, 157, 0.3);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.main-birthday-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.15;
  margin-bottom: 14px;
}

.main-birthday-title .highlight {
  background: linear-gradient(135deg, #ff2a75, #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* The Heart of the Greeting */
.quote-highlight-card {
  position: relative;
  background: linear-gradient(135deg, #fff5f8, #fdf4ff);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin: 32px 0;
  box-shadow: 0 8px 24px rgba(255, 77, 141, 0.08);
}

.quote-mark {
  font-family: var(--font-serif);
  font-size: 4rem;
  line-height: 0.5;
  color: #ff9bb2;
  opacity: 0.45;
  display: block;
  margin-bottom: 12px;
}

.quote-text-primary {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.8vw, 1.7rem);
  font-weight: 700;
  color: #2b1126;
  line-height: 1.45;
  font-style: italic;
  margin-bottom: 16px;
}

.quote-text-secondary {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.7;
}

.handwritten-sign {
  text-align: right;
  margin-top: 24px;
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--primary);
}

/* Birthday Cake & Candles Component */
.interactive-cake-box {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px dashed rgba(255, 180, 200, 0.6);
  text-align: center;
}

.cake-box-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.cake-box-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.cake-illustration {
  position: relative;
  width: 220px;
  margin: 0 auto 24px;
}

/* Candles Row */
.candles-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: -4px;
  position: relative;
  z-index: 3;
}

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

.flame {
  width: 14px;
  height: 24px;
  background: radial-gradient(circle at 50% 80%, #fff7b2, #ff9900 60%, #ff3700 100%);
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  box-shadow: 0 0 14px #ffaa00, 0 0 24px #ff5500;
  animation: flicker 1.2s infinite ease-in-out alternate;
  transform-origin: 50% 90%;
  transition: all 0.4s ease;
}

.candle-unit:nth-child(2) .flame { animation-delay: 0.3s; }
.candle-unit:nth-child(3) .flame { animation-delay: 0.6s; }

.flame.out {
  transform: scale(0);
  opacity: 0;
  box-shadow: none;
}

@keyframes flicker {
  0% { transform: rotate(-2deg) scale(0.98); }
  50% { transform: rotate(3deg) scale(1.06); }
  100% { transform: rotate(-1deg) scale(1.02); }
}

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

.candle-stick {
  width: 12px;
  height: 42px;
  background: repeating-linear-gradient(45deg, #ffd166, #ffd166 6px, #ff4d8d 6px, #ff4d8d 12px);
  border-radius: 3px 3px 0 0;
  box-shadow: inset 1px 0 2px rgba(255, 255, 255, 0.7);
}

.candle-number-badge {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  background: #ff4d8d;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -14px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Cake Tier Structure */
.cake-tier {
  position: relative;
  margin: 0 auto;
  border-radius: 14px 14px 6px 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.tier-top {
  width: 150px;
  height: 52px;
  background: linear-gradient(180deg, #fff0f5 0%, #ffccd5 100%);
  border: 2px solid #ffb3c1;
  z-index: 2;
}

.tier-frosting-drips {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: #ffffff;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-around;
}

.tier-bottom {
  width: 200px;
  height: 64px;
  background: linear-gradient(180deg, #ffccd5 0%, #ff9bb2 100%);
  border: 2px solid #ff809b;
  margin-top: -6px;
  z-index: 1;
}

.cake-plate {
  width: 236px;
  height: 12px;
  background: linear-gradient(90deg, #ffd700, #fff7b2, #ffd700);
  border-radius: 12px;
  margin: -2px auto 0;
  box-shadow: 0 6px 18px rgba(212, 163, 24, 0.3);
}

.cake-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 77, 141, 0.18);
  transition: all 0.3s ease;
  user-select: none;
}

.cake-action-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 77, 141, 0.35);
}

.cake-action-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #059669;
  color: #fff;
}

.cake-wish-banner {
  max-width: 480px;
  margin: 18px auto 0;
  padding: 14px 22px;
  background: linear-gradient(135deg, #fff0f6, #f3e8ff);
  border-radius: var(--radius-md);
  border: 1.5px solid #ff758c;
  color: #701a75;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.2);
  display: none;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cake-wish-banner.visible {
  display: block;
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Screen 3: Aesthetic Polaroid Wall & Photo Moments
   ========================================================================== */
.polaroid-section {
  padding: 50px 0 70px;
}

.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 107, 157, 0.3);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 8px auto 0;
}

.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 680px;
  margin: 0 auto;
  gap: 26px;
  padding: 10px;
}

.polaroid-card {
  background: #ffffff;
  padding: 14px 14px 22px;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.polaroid-card:hover {
  transform: scale(1.04) rotate(0deg) !important;
  box-shadow: 0 20px 40px rgba(180, 50, 100, 0.22);
  z-index: 10;
}

/* Washi tape on top */
.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: rgba(255, 230, 160, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 2px dashed rgba(200, 170, 100, 0.3);
  border-right: 2px dashed rgba(200, 170, 100, 0.3);
  z-index: 2;
}

.polaroid-card:nth-child(2) .washi-tape { background: rgba(255, 182, 193, 0.7); }
.polaroid-card:nth-child(3) .washi-tape { background: rgba(207, 186, 240, 0.7); }
.polaroid-card:nth-child(4) .washi-tape { background: rgba(162, 210, 255, 0.7); }
.polaroid-card:nth-child(5) .washi-tape { background: rgba(255, 218, 193, 0.7); }
.polaroid-card:nth-child(6) .washi-tape { background: rgba(255, 200, 221, 0.7); }

.polaroid-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #f8f6f8;
}

.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.06);
}

.polaroid-caption {
  font-family: var(--font-hand);
  font-size: 1.45rem;
  text-align: center;
  color: #3b2135;
  margin-top: 14px;
  line-height: 1.2;
}

/* Custom upload polaroid */
.custom-upload-card {
  border: 2px dashed #ff9bb2;
  background: #fffbfe;
  display: flex;
  flex-direction: column;
}

.upload-placeholder-zone {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff0f5;
  border-radius: 4px;
  cursor: pointer;
  padding: 16px;
  text-align: center;
  transition: background 0.3s ease;
}

.upload-placeholder-zone:hover {
  background: #ffe3ec;
}

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

.upload-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tilt variations for playful look */
.tilt-left { transform: rotate(-2.5deg); }
.tilt-right { transform: rotate(2deg); }
.tilt-slight-left { transform: rotate(-1deg); }
.tilt-slight-right { transform: rotate(3deg); }

/* ==========================================================================
   Screen 4: Fun Infographics & Interactive Charts (Маша в 16: Статистика)
   ========================================================================== */
.stats-section {
  padding: 50px 0 70px;
}

.stat-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}

.stat-tile {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 10px 25px rgba(255, 107, 157, 0.08);
  transition: transform 0.3s ease;
}

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

.tile-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.tile-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

.tile-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 28px;
}

.chart-card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  border: 1.5px solid rgba(255, 215, 0, 0.35);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  margin-bottom: 18px;
}

.chart-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-container-box {
  position: relative;
  width: 100%;
  height: 270px;
}

/* ==========================================================================
   Screen 5: Fortune Cookie on Sweet 16
   ========================================================================== */
.fortune-section {
  padding: 50px 0 70px;
}

.fortune-wrapper {
  background: linear-gradient(135deg, #fff7ed, #fff0f5);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: var(--card-shadow);
  padding: 44px 28px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.fortune-cookie-graphic {
  position: relative;
  width: 220px;
  height: 165px;
  margin: 24px auto 14px;
  cursor: pointer;
  user-select: none;
  display: block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fortune-cookie-graphic:hover {
  transform: scale(1.05);
}

.real-cookie-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.real-cookie-part {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(160, 90, 10, 0.28));
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.real-cookie-left {
  transform-origin: 20% 90%;
}

.real-cookie-right {
  transform-origin: 80% 90%;
}

/* Cracked state: photorealistic halves separate cleanly */
.fortune-cookie-graphic.cracked .real-cookie-left {
  transform: translate(-26px, -4px) rotate(-16deg);
}

.fortune-cookie-graphic.cracked .real-cookie-right {
  transform: translate(26px, -4px) rotate(16deg);
}

.fortune-cookie-graphic.cracked #cookieFoldLine {
  opacity: 0;
}

/* The fortune paper note slipping out */
.fortune-paper-note {
  max-width: 480px;
  margin: 20px auto 24px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 22px 26px;
  border-left: 4px solid var(--accent-gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  font-family: var(--font-hand);
  font-size: 1.55rem;
  color: #3f1a35;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.fortune-paper-note.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fortune-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ffd166, #ff9900);
  color: #4a2800;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 180, 0, 0.35);
  transition: all 0.3s ease;
}

.fortune-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 180, 0, 0.5);
}

/* ==========================================================================
   Screen 6: Guest Wish Wall & Grand Finale
   ========================================================================== */
.wish-wall-section {
  padding: 50px 0 60px;
}

.wall-card-box {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  box-shadow: var(--card-shadow);
  padding: clamp(28px, 5vw, 48px);
}

/* Sticker Input Form */
.sticker-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 580px;
  margin: 0 auto 40px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.custom-input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 107, 157, 0.3);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.custom-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.15);
}

.sticker-submit-btn {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.sticker-submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Stickers Grid on Cork/Pastel Board */
.stickers-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.sticker-note {
  position: relative;
  padding: 24px 18px 18px;
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.sticker-note:hover {
  transform: scale(1.05) rotate(0deg) !important;
  z-index: 5;
}

.sticker-pink { background: #ffe4ec; }
.sticker-yellow { background: #fef9c3; }
.sticker-purple { background: #f3e8ff; }
.sticker-blue { background: #e0f2fe; }

.sticker-pin {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  line-height: 1;
}

.sticker-text {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  color: #2b1424;
  line-height: 1.35;
  margin-bottom: 12px;
}

.sticker-author {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: #7a506d;
}

/* Finale Section */
.finale-section {
  padding: 30px 0 10px;
  text-align: center;
}

.finale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.salute-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff4d8d, #9333ea);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px 36px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 77, 141, 0.4);
  transition: all 0.3s ease;
}

.salute-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 36px rgba(255, 77, 141, 0.55);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: #fff0f5;
  transform: translateY(-2px);
}

/* Footer Note */
.site-footer {
  text-align: center;
  margin-top: 60px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.footer-heart {
  color: var(--primary);
  display: inline-block;
  animation: pulseHeart 1.4s infinite;
}

@keyframes pulseHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Animation on Scroll Helper */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.animate-on-scroll.visible-fade {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px 60px;
  }

  .envelope {
    padding: 32px 18px;
  }

  .hero-age-badge {
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
  }

  .hero-age-number {
    font-size: 2.2rem;
  }

  .quote-highlight-card {
    padding: 20px 18px;
  }

  .form-row {
    flex-direction: column;
  }

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

  .stat-tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .polaroid-caption {
    font-size: 1.2rem;
  }

  .salute-btn, .share-btn, .cta-button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stat-tiles-grid {
    grid-template-columns: 1fr;
  }

  .polaroid-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px;
    max-width: 100%;
  }

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

  .polaroid-caption {
    font-size: 1.05rem;
    margin-top: 8px;
  }

  .washi-tape {
    width: 55px;
    height: 18px;
    top: -9px;
  }
}
