/* ==========================================================================
   Birthday Surprise Web Experience - Stylesheet
   Faithful, ultra-aesthetic reproduction of the viral TikTok birthday surprise
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Outfit:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --bg-gradient: radial-gradient(circle at 10% 15%, #ffd6e7 0%, transparent 40%),
                 radial-gradient(circle at 90% 15%, #fff2cf 0%, transparent 40%),
                 radial-gradient(circle at 15% 85%, #d2f7ea 0%, transparent 40%),
                 radial-gradient(circle at 85% 85%, #d9e7ff 0%, transparent 45%),
                 linear-gradient(135deg, #fef5f7 0%, #f4f6fc 100%);
  --btn-gradient: linear-gradient(90deg, #ffe17d 0%, #c88bfd 100%);
  --btn-gradient-hover: linear-gradient(90deg, #ffd866 0%, #bc77fd 100%);
  --primary-purple: #9d5cf6;
  --primary-pink: #f472b6;
  --primary-gold: #f59e0b;
  --text-dark: #2b1f3d;
  --text-muted: #6b637b;
  --card-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow-soft: 0 10px 30px rgba(157, 92, 246, 0.15);
  --shadow-card: 0 16px 36px rgba(100, 60, 160, 0.12);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  background: #110d1a;
}

/* Background floating ambient canvas */
#bg-canvas, #fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

#fx-canvas {
  z-index: 99;
}

/* Flash overlay for polaroid camera shutter */
#camera-flash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.08s ease-out;
}
#camera-flash-overlay.flashing {
  opacity: 0.95;
  transition: none;
}

/* Main App Wrapper (Centered mobile frame on desktop, full-width on mobile) */
.app-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* Phone screen container */
.phone-viewport {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 900px;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border-radius: 0;
}

@media (min-width: 480px) {
  .phone-viewport {
    height: 94vh;
    border-radius: 40px;
    border: 8px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

/* Top control bar: Music toggle, Customize gear, Progress dots */
.top-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  pointer-events: auto;
}

.music-btn, .settings-btn {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, background 0.2s;
}

.music-btn:hover, .settings-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.98);
}

.music-btn:active, .settings-btn:active {
  transform: scale(0.96);
}

/* Audio waves animation */
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}
.audio-waves span {
  width: 3px;
  height: 4px;
  background: var(--primary-purple);
  border-radius: 3px;
  transition: height 0.2s;
}
.music-btn.playing .audio-waves span:nth-child(1) {
  animation: wave 0.8s ease-in-out infinite alternate;
}
.music-btn.playing .audio-waves span:nth-child(2) {
  animation: wave 0.8s ease-in-out 0.2s infinite alternate;
}
.music-btn.playing .audio-waves span:nth-child(3) {
  animation: wave 0.8s ease-in-out 0.4s infinite alternate;
}

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

/* Progress track dots */
.progress-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
}
.dot.active {
  width: 18px;
  border-radius: 6px;
  background: var(--primary-purple);
}

/* Scenes container */
.scene-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Individual Scene */
.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 56px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.4s;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
}

.scene::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

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

/* Typography */
.scene-header {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 6px;
  z-index: 5;
}

.scene-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #1f1a2e;
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin-bottom: 3px;
}

.scene-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.35;
}

/* Primary Action Button (Gradient Yellow-Purple) */
.action-btn {
  position: relative;
  width: 90%;
  max-width: 320px;
  height: 48px;
  min-height: 48px;
  background: var(--btn-gradient);
  border: none;
  outline: none;
  border-radius: 9999px;
  color: #2b1f3d;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(180, 130, 245, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease,
              opacity 0.3s;
  z-index: 25;
}

.action-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 30px rgba(180, 130, 245, 0.45);
}

.action-btn:active {
  transform: translateY(1px) scale(0.97);
}

.action-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
}

.action-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ==========================================================================
   SCENE 1: COUNTDOWN CLOCK
   ========================================================================== */
.clock-display-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.analog-clock {
  position: relative;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  border: 7px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 16px 40px rgba(180, 140, 220, 0.25),
              inset 0 2px 6px rgba(255, 255, 255, 0.8);
}

.analog-clock::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7e9e 0%, #ffc06a 30%, #5ce4c6 65%, #a855f7 100%);
  z-index: -1;
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
}

.clock-number {
  position: absolute;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  color: #3f3950;
  width: 24px;
  height: 24px;
  text-align: center;
  line-height: 24px;
  transform: translate(-50%, -50%);
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 6px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hour-hand {
  width: 5px;
  height: 60px;
  background: linear-gradient(to top, #ff6b8b, #ffa07a);
  margin-left: -2.5px;
  z-index: 5;
}

.minute-hand {
  width: 3.5px;
  height: 85px;
  background: linear-gradient(to top, #9333ea, #c084fc);
  margin-left: -1.75px;
  z-index: 6;
}

.clock-center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #a855f7;
  border: 3px solid #ffffff;
  transform: translate(-50%, -50%);
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.digital-time {
  margin-top: 24px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #2b1f3d;
  font-family: 'Outfit', sans-serif;
}

.clock-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.pulse-btn {
  animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(180, 130, 245, 0.35); transform: scale(1); }
  50% { box-shadow: 0 12px 36px rgba(180, 130, 245, 0.6); transform: scale(1.02); }
}

/* ==========================================================================
   SCENE 2: CELEBRATION & YEARS COLLECTED
   ========================================================================== */
.celebrate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  width: 100%;
}

.celebrate-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #e11d48, #c026d3, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 20px;
  animation: popIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebrate-mascot-wrap {
  position: relative;
  width: 260px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.celebrate-mascot-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(168, 85, 247, 0.2));
  animation: floatBounce 2.5s ease-in-out infinite alternate;
}

.years-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 10px;
  animation: fadeIn 0.8s ease;
}

.years-question {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  color: #1f1a2e;
  line-height: 1.35;
  margin-bottom: 24px;
  padding: 0 10px;
}

.age-flip-cards {
  position: relative;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}

.flip-card {
  width: 78px;
  height: 94px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(140, 100, 200, 0.18),
              0 2px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: #9333ea;
  border: 1px solid rgba(255, 255, 255, 0.9);
  animation: cardFlip 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-side-balloon {
  position: absolute;
  width: 44px;
  height: 56px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  box-shadow: inset -4px -4px 10px rgba(0,0,0,0.1), inset 4px 4px 10px rgba(255,255,255,0.6);
  opacity: 0.85;
}
.floating-side-balloon.left {
  left: -50px;
  top: -10px;
  background: radial-gradient(circle at 35% 30%, #fcd34d, #f59e0b);
  animation: floatSlow 3s ease-in-out infinite alternate;
}
.floating-side-balloon.right {
  right: -50px;
  top: 15px;
  background: radial-gradient(circle at 35% 30%, #c084fc, #9333ea);
  animation: floatSlow 3.4s ease-in-out 0.5s infinite alternate;
}

.years-highlight {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #9333ea;
  margin-bottom: 4px;
}

.years-subtext {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   SCENE 3: POLAROID CAMERA & MEMORIES
   ========================================================================== */
.polaroid-gallery-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  gap: 8px;
}

.polaroid-deck {
  position: relative;
  width: 220px;
  height: 250px;
  perspective: 1000px;
  margin-bottom: 6px;
}

.polaroid-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  padding: 10px 10px 20px 10px;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(50, 20, 80, 0.14),
              0 3px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
  transform-origin: center bottom;
}

.polaroid-tape {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 55px;
  height: 16px;
  background: rgba(255, 230, 160, 0.7);
  backdrop-filter: blur(2px);
  border-radius: 2px;
  z-index: 5;
}

.polaroid-img-box {
  width: 100%;
  height: 175px;
  background: #f0f0f5;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

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

.polaroid-caption {
  font-family: 'Caveat', cursive;
  font-size: 15.5px;
  font-weight: 700;
  color: #3b2d4a;
  text-align: center;
  margin-top: 6px;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

/* Kawaii Retro Camera Component */
.retro-camera-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 2px;
}

.retro-camera-box:hover {
  transform: scale(1.05);
}

.retro-camera-box:active {
  transform: scale(0.95);
}

.camera-img-wrap {
  width: 110px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.camera-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(160, 110, 220, 0.25));
}

.camera-hint {
  font-size: 12px;
  color: var(--primary-purple);
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.photo-counter {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ==========================================================================
   SCENE 4: GIFT BOX SURPRISE
   ========================================================================== */
.gift-scene-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  cursor: pointer;
}

.gift-box-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-box-wrapper:hover {
  transform: scale(1.05);
}

.gift-box-wrapper:active {
  transform: scale(0.95);
}

.gift-box-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(147, 51, 234, 0.28));
  animation: giftBounce 2s ease-in-out infinite alternate;
}

@keyframes giftBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.gift-tap-cue {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #7c3aed;
  font-weight: 600;
  margin-top: 14px;
  animation: pulseOpacity 1.5s infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ==========================================================================
   SCENE 5: POP THE BALLOONS
   ========================================================================== */
.balloon-field {
  position: relative;
  width: 100%;
  height: 380px;
  margin: auto 0;
}

.floating-balloon {
  position: absolute;
  width: 78px;
  height: 98px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s, opacity 0.3s;
  box-shadow: inset -6px -6px 14px rgba(0,0,0,0.12),
              inset 6px 6px 14px rgba(255,255,255,0.7),
              0 14px 26px rgba(0,0,0,0.12);
}

.floating-balloon::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 8px;
  height: 6px;
  background: inherit;
  border-radius: 2px 2px 4px 4px;
  filter: brightness(0.85);
}

.floating-balloon .balloon-string {
  position: absolute;
  top: 100%;
  width: 1.5px;
  height: 52px;
  background: rgba(120, 110, 140, 0.4);
  transform-origin: top center;
  animation: stringWave 2s ease-in-out infinite alternate;
}

@keyframes stringWave {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* Balloon 1: Blue */
.balloon-blue {
  top: 60px;
  left: 20px;
  background: radial-gradient(circle at 35% 30%, #60a5fa, #2563eb);
  animation: balloonBob 3.2s ease-in-out infinite alternate;
}

/* Balloon 2: Pink */
.balloon-pink {
  top: 15px;
  left: 145px;
  background: radial-gradient(circle at 35% 30%, #f472b6, #db2777);
  animation: balloonBob 3.8s ease-in-out 0.4s infinite alternate;
}

/* Balloon 3: Yellow */
.balloon-yellow {
  top: 80px;
  right: 25px;
  background: radial-gradient(circle at 35% 30%, #fde047, #eab308);
  animation: balloonBob 3.5s ease-in-out 0.8s infinite alternate;
}

/* Balloon 4: Purple */
.balloon-purple {
  top: 175px;
  left: 145px;
  background: radial-gradient(circle at 35% 30%, #c084fc, #9333ea);
  animation: balloonBob 3.1s ease-in-out 0.2s infinite alternate;
}

@keyframes balloonBob {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-16px) rotate(3deg); }
}

/* Revealed Compliment Badge */
.compliment-badge {
  position: absolute;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #7c3aed;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18),
              0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: scale(0);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
}

.compliment-badge.revealed {
  transform: scale(1);
  opacity: 1;
  animation: badgeFloat 2.5s ease-in-out infinite alternate;
}

@keyframes badgeFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* ==========================================================================
   SCENE 6: BLOW OUT THE CANDLES
   ========================================================================== */
.candle-stage {
  display: flex;
  gap: 36px;
  align-items: flex-end;
  justify-content: center;
  height: 280px;
  margin: auto 0;
}

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

.candle-item:hover {
  transform: scale(1.05);
}

.candle-flame {
  position: relative;
  width: 14px;
  height: 28px;
  background: radial-gradient(ellipse at bottom, #fff7ed 15%, #fbbf24 60%, #ea580c 95%);
  border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
  margin-bottom: 2px;
  box-shadow: 0 0 16px #fbbf24, 0 0 30px #f97316;
  transform-origin: bottom center;
  animation: flameFlicker 1.5s ease-in-out infinite alternate;
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes flameFlicker {
  0% { transform: scale(1) rotate(-1.5deg); }
  25% { transform: scale(1.08, 0.95) rotate(1deg); }
  50% { transform: scale(0.96, 1.05) rotate(-2deg); }
  75% { transform: scale(1.04, 0.98) rotate(2deg); }
  100% { transform: scale(1) rotate(-1deg); }
}

.candle-wick {
  width: 2.5px;
  height: 7px;
  background: #3f3950;
  border-radius: 1px;
}

.candle-body {
  position: relative;
  width: 38px;
  border-radius: 12px 12px 6px 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1),
              inset -4px 0 8px rgba(0,0,0,0.08),
              inset 4px 0 8px rgba(255,255,255,0.4);
}

/* Candle 1: Striped mint / cyan */
.candle-cyan .candle-body {
  height: 140px;
  background: repeating-linear-gradient(
    135deg,
    #a7f3d0,
    #a7f3d0 12px,
    #bae6fd 12px,
    #bae6fd 24px
  );
}

/* Candle 2: Yellow */
.candle-yellow .candle-body {
  height: 130px;
  background: linear-gradient(to right, #fef08a, #facc15);
}

/* Candle 3: Pink */
.candle-pink .candle-body {
  height: 155px;
  background: linear-gradient(to right, #fbcfe8, #f472b6);
}

/* Blown out state */
.candle-item.blown-out .candle-flame {
  opacity: 0;
  transform: scale(0.2) translateY(-10px);
  pointer-events: none;
}

.candle-smoke {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  background: rgba(180, 180, 200, 0.6);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

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

@keyframes smokeRise {
  0% { opacity: 0.8; transform: translate(0, 0) scale(1); filter: blur(1px); }
  50% { opacity: 0.5; transform: translate(8px, -25px) scale(2.5); filter: blur(3px); }
  100% { opacity: 0; transform: translate(-6px, -55px) scale(4); filter: blur(6px); }
}

/* ==========================================================================
   SCENE 7: PICK THE CAKE
   ========================================================================== */
.cake-showcase-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  width: 100%;
}

.cake-centerpiece {
  position: relative;
  width: 220px;
  height: 220px;
  max-height: 30vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.cake-plate {
  position: absolute;
  bottom: 0px;
  width: 210px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d8b4fe 0%, #c084fc 100%);
  box-shadow: 0 14px 26px rgba(147, 51, 234, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.cake-img {
  position: relative;
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 12px 22px rgba(100, 40, 160, 0.2));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
}

.cake-img.changing {
  transform: scale(0.85);
  opacity: 0.5;
}

/* Cake Carousel / Selection Row */
.cake-thumbnails-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 4px;
}

.cake-thumb-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  padding: 3px;
}

.cake-thumb-btn:hover {
  transform: translateY(-2px);
}

.cake-thumb-btn.selected {
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3), 0 6px 14px rgba(147, 51, 234, 0.25);
  transform: scale(1.1);
}

.cake-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   SCENE 8: CUT THE CAKE!
   ========================================================================== */
.cake-cutting-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.cutting-board {
  position: relative;
  width: 230px;
  height: 230px;
  max-height: 32vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutting-cake-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cutting-cake-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(100, 40, 160, 0.22));
  transition: transform 0.4s ease;
}

/* Interactive Knife */
.knife-actor {
  position: absolute;
  top: 55px;
  left: 20px;
  width: 140px;
  height: 140px;
  z-index: 20;
  cursor: grab;
  touch-action: none;
  transition: transform 0.1s ease;
}

.knife-actor:active {
  cursor: grabbing;
}

.knife-actor img, .knife-actor svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
}

.drag-knife-guide {
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: dragGuideAnim 1.4s ease-in-out infinite alternate;
  white-space: nowrap;
}

@keyframes dragGuideAnim {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(-35%); }
}

.cut-status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 15px;
  transition: all 0.3s;
}

.cut-status-text.celebrate {
  font-size: 22px;
  font-weight: 800;
  color: #e11d48;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   SCENE 9: HEARTFELT BIRTHDAY LETTER
   ========================================================================== */
.letter-scene-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.letter-parchment {
  position: relative;
  width: 100%;
  max-width: 345px;
  min-height: 420px;
  background: #fdfaf4;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(80, 50, 110, 0.16),
              0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 30px 24px 24px 24px;
  border: 1px solid rgba(240, 225, 205, 0.8);
  display: flex;
  flex-direction: column;
}

/* Kitty Mascot Pin at Top */
.letter-top-sticker {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 65px;
  height: 65px;
  z-index: 10;
}

.letter-top-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Floral Corner Accents */
.letter-flower {
  position: absolute;
  width: 24px;
  height: 24px;
  opacity: 0.85;
}
.flower-tl { top: 8px; left: 8px; }
.flower-tr { top: 8px; right: 8px; }
.flower-bl { bottom: 8px; left: 8px; }
.flower-br { bottom: 8px; right: 8px; }

.letter-body {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: #382c44;
  letter-spacing: 0.1px;
}

.letter-salutation {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
  color: #2b1f3d;
}

.letter-text {
  min-height: 180px;
  white-space: pre-line;
}

.letter-closing {
  margin-top: 18px;
  font-weight: 600;
}

.letter-heart {
  color: #e11d48;
  font-size: 20px;
  margin-top: 4px;
  display: inline-block;
  animation: heartPulse 1.2s infinite;
}

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

/* Typewriter typing pen */
.typewriter-pen {
  display: inline-block;
  margin-left: 4px;
  animation: penBob 0.6s infinite alternate;
}

@keyframes penBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.letter-actions-row {
  display: flex;
  gap: 10px;
  width: 90%;
  max-width: 320px;
  justify-content: center;
  margin-top: 14px;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 9999px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #4b3e60;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, background 0.2s;
}

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

.secondary-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   CUSTOMIZE / SETTINGS MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 12, 30, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0edf5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #2b1f3d;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #8b8398;
  cursor: pointer;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #4c425e;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e0ed;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: #2b1f3d;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
  border-color: #9333ea;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.photo-uploader-box {
  border: 2px dashed #d8b4fe;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  background: #faf5ff;
  cursor: pointer;
  transition: background 0.2s;
}

.photo-uploader-box:hover {
  background: #f3e8ff;
}

.photo-uploader-box input[type="file"] {
  display: none;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #f0edf5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-save-btn {
  background: var(--btn-gradient);
  border: none;
  border-radius: 9999px;
  padding: 10px 24px;
  font-weight: 600;
  color: #2b1f3d;
  cursor: pointer;
}

/* Animations */
@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes floatBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

@keyframes floatSlow {
  0% { transform: translateY(0) rotate(-3deg); }
  100% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes cardFlip {
  0% { transform: rotateY(90deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
