/* ============================================================
   BIRTHDAY WEBSITE — style.css
   A dreamy, pink, animated birthday experience
   ============================================================ */

/* ---------- CSS Variables / Themes ---------- */
:root {
  /* Rose Pink Theme (default) */
  --primary: #f472b6;
  --primary-light: #fce7f3;
  --primary-dark: #db2777;
  --secondary: #f9a8d4;
  --accent: #fbbf24;
  --accent-light: #fef3c7;
  --lavender: #e879f9;
  --pearl: #fdf4ff;
  --text-dark: #831843;
  --text-medium: #be185d;
  --text-light: #fbcfe8;
  --gold: #d4a017;
  --gold-light: #f7e7c1;
  --white: #ffffff;
  --shadow: rgba(219, 39, 119, 0.2);
  --shadow-strong: rgba(219, 39, 119, 0.4);
  --gradient-bg: linear-gradient(135deg, #fce7f3 0%, #fdf4ff 40%, #fce7f3 70%, #fff1f2 100%);
  --gradient-primary: linear-gradient(135deg, #f472b6, #e879f9, #f9a8d4);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(252,231,243,0.8));
  --confetti-colors: #f472b6, #e879f9, #fbbf24, #34d399, #60a5fa, #f87171, #a78bfa;
}

[data-theme="lavender"] {
  --primary: #a855f7;
  --primary-light: #f3e8ff;
  --primary-dark: #7e22ce;
  --secondary: #c084fc;
  --accent: #f9a8d4;
  --text-dark: #4c1d95;
  --text-medium: #7c3aed;
  --shadow: rgba(168, 85, 247, 0.2);
  --shadow-strong: rgba(168, 85, 247, 0.4);
  --gradient-bg: linear-gradient(135deg, #f3e8ff 0%, #fdf4ff 40%, #ede9fe 100%);
  --gradient-primary: linear-gradient(135deg, #a855f7, #c084fc, #e879f9);
}

[data-theme="peach"] {
  --primary: #f97316;
  --primary-light: #ffedd5;
  --primary-dark: #c2410c;
  --secondary: #fb923c;
  --accent: #fbbf24;
  --text-dark: #7c2d12;
  --text-medium: #c2410c;
  --shadow: rgba(249, 115, 22, 0.2);
  --gradient-bg: linear-gradient(135deg, #ffedd5 0%, #fff7ed 50%, #fce7f3 100%);
  --gradient-primary: linear-gradient(135deg, #f97316, #fb923c, #f472b6);
}

[data-theme="mint"] {
  --primary: #10b981;
  --primary-light: #d1fae5;
  --primary-dark: #059669;
  --secondary: #34d399;
  --accent: #f9a8d4;
  --text-dark: #064e3b;
  --text-medium: #059669;
  --shadow: rgba(16, 185, 129, 0.2);
  --gradient-bg: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 50%, #fce7f3 100%);
  --gradient-primary: linear-gradient(135deg, #10b981, #34d399, #f472b6);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--gradient-bg);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  cursor: none;
}

/* ---------- Canvas Layers ---------- */
#confetti-canvas,
#petal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

#confetti-canvas { z-index: 1000; }
#petal-canvas { z-index: 5; }

/* ---------- Custom Cursor ---------- */
#sparkle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.cursor-sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  pointer-events: none;
  animation: sparkle-fade 0.8s ease-out forwards;
  transform: translate(-50%, -50%);
}

@keyframes sparkle-fade {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0) translateY(-20px); }
}

.cursor-dot {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
  box-shadow: 0 0 8px var(--primary);
  mix-blend-mode: multiply;
}

/* ---------- App & Scene System ---------- */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0s;
  z-index: 10;
}

.scene.active {
  opacity: 1;
  pointer-events: all;
}

.scene.entering {
  animation: sceneEnter 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.scene.leaving {
  animation: sceneLeave 0.6s ease-in forwards;
}

@keyframes sceneEnter {
  0% { opacity: 0; transform: scale(0.92) translateY(30px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes sceneLeave {
  0% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1.05) translateY(-20px); }
}

/* ---------- Scene Backgrounds ---------- */
.scene-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.scene-bg-1 {
  background: radial-gradient(ellipse at center, #fce7f3 0%, #fdf4ff 50%, #f8e1f4 100%);
}
.scene-bg-2 {
  background: radial-gradient(ellipse at 30% 70%, #fce7f3 0%, #fff1f8 60%, #fdf4ff 100%);
}
.scene-bg-3 {
  background: radial-gradient(ellipse at 70% 30%, #fdf4ff 0%, #fce7f3 50%, #fff1f8 100%);
}
.scene-bg-4 {
  background: radial-gradient(ellipse at center, #fff1f8 0%, #fce7f3 40%, #fdf4ff 100%);
}
.scene-bg-5 {
  background: radial-gradient(ellipse at center, #fdf4ff 0%, #fce7f3 50%, #fff5f7 100%);
}
.scene-bg-6 {
  background: radial-gradient(ellipse at center, #831843 0%, #be185d 40%, #db2777 80%, #f472b6 100%);
}

.scene-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  max-width: 900px;
  width: 100%;
  z-index: 20;
  position: relative;
}

/* ---------- Floating Hearts (scene 1) ---------- */
.floating-hearts {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.heart {
  position: absolute;
  font-size: 1.5rem;
  color: var(--primary);
  opacity: 0.3;
  animation: heartFloat 6s ease-in-out infinite;
}

.h1 { top: 10%; left: 5%; font-size: 1.2rem; animation-delay: 0s; animation-duration: 5s; }
.h2 { top: 20%; right: 8%; font-size: 2rem; animation-delay: 1s; animation-duration: 7s; }
.h3 { top: 60%; left: 3%; font-size: 1rem; animation-delay: 2s; animation-duration: 6s; }
.h4 { top: 70%; right: 5%; font-size: 1.8rem; animation-delay: 0.5s; animation-duration: 8s; }
.h5 { top: 40%; left: 90%; font-size: 1.3rem; animation-delay: 1.5s; animation-duration: 5.5s; }
.h6 { top: 85%; left: 50%; font-size: 1rem; animation-delay: 3s; animation-duration: 6.5s; }

@keyframes heartFloat {
  0%, 100% { transform: translateY(0) rotate(-10deg); opacity: 0.2; }
  50% { transform: translateY(-25px) rotate(10deg); opacity: 0.5; }
}

/* ---------- Ribbon Top (Scene 1) ---------- */
.ribbon-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--gradient-primary);
}

/* ============================================================
   SCENE 1: GIFT BOX
   ============================================================ */
.gift-box {
  position: relative;
  width: 180px;
  height: 170px;
  cursor: pointer;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 20px 40px var(--shadow-strong));
}

.gift-box:hover {
  transform: scale(1.05) translateY(-5px);
}

.gift-box:hover .gift-lid {
  animation: giftWobble 0.5s ease;
}

@keyframes giftWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.gift-lid {
  position: absolute;
  top: -18px;
  left: -8px;
  width: calc(100% + 16px);
  height: 55px;
  background: var(--gradient-primary);
  border-radius: 10px 10px 0 0;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
  transform-origin: right center;
  z-index: 3;
}

.gift-lid.open {
  transform: translateY(-70px) rotate(-25deg);
  opacity: 0;
}

.gift-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 120px;
  background: var(--gradient-primary);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.gift-ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 18px;
  height: 100%;
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
}

.gift-ribbon-h {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 18px;
  background: rgba(255,255,255,0.4);
  border-radius: 4px;
}

.gift-ribbon-bow {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.bow-left, .bow-right {
  width: 34px;
  height: 28px;
  background: rgba(255,255,255,0.5);
  border-radius: 50% 0 50% 50%;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}

.bow-left { transform: rotate(-45deg) translateX(5px); }
.bow-right { transform: rotate(45deg) translateX(-5px); border-radius: 0 50% 50% 50%; }

.bow-center {
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.7);
  border-radius: 50%;
  position: absolute;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.hint-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  color: var(--text-medium);
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: pulse 2s ease-in-out infinite;
  text-align: center;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

/* ============================================================
   SCENE 2: ENVELOPE
   ============================================================ */
.envelope-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.envelope {
  position: relative;
  width: 320px;
  height: 220px;
  cursor: pointer;
  filter: drop-shadow(0 20px 40px var(--shadow));
}

.envelope-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(180deg, #fce7f3 0%, #f9a8d4 100%);
  border-radius: 0 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.envelope-body::before,
.envelope-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
}

.envelope-body::before {
  left: 0;
  border-style: solid;
  border-width: 200px 160px 0 0;
  border-color: rgba(244, 114, 182, 0.25) transparent transparent transparent;
}

.envelope-body::after {
  right: 0;
  border-style: solid;
  border-width: 200px 0 0 160px;
  border-color: rgba(244, 114, 182, 0.25) transparent transparent transparent;
}

.envelope-heart {
  font-size: 2.5rem;
  color: var(--primary);
  animation: pulse 2s ease-in-out infinite;
  z-index: 2;
}

.envelope-flap {
  position: absolute;
  top: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(180deg, #f9a8d4, #fce7f3);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

.envelope-flap.open {
  transform: perspective(300px) rotateX(-180deg);
}

.letter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: 260px;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s, opacity 0.5s ease 0.4s;
  opacity: 0;
  z-index: 6;
}

.letter.revealed {
  transform: translateX(-50%) translateY(-180px);
  opacity: 1;
}

.letter-content { text-align: center; }

.letter-header {
  font-family: 'Dancing Script', cursive;
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.letter-body {
  font-size: 0.85rem;
  color: var(--text-medium);
  line-height: 1.6;
  font-weight: 500;
}

.letter-decoration {
  margin-top: 0.8rem;
  color: var(--primary);
  letter-spacing: 0.5em;
  font-size: 0.9rem;
}

/* ============================================================
   SCENE 3: PHOTO GALLERY
   ============================================================ */
.gallery-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 0.5rem;
}

.polaroid-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.polaroid {
  background: white;
  padding: 12px 12px 40px;
  width: 150px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  animation: polaroidEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.polaroid:hover {
  transform: translateY(-12px) scale(1.05) !important;
  box-shadow: 0 25px 50px rgba(0,0,0,0.18), 0 5px 15px rgba(0,0,0,0.1);
  z-index: 10;
}

.polaroid-1 { transform: rotate(-6deg); animation-delay: 0.1s; }
.polaroid-2 { transform: rotate(4deg); animation-delay: 0.2s; }
.polaroid-3 { transform: rotate(-2deg); animation-delay: 0.3s; }
.polaroid-4 { transform: rotate(7deg); animation-delay: 0.4s; }
.polaroid-5 { transform: rotate(-5deg); animation-delay: 0.5s; }

@keyframes polaroidEntrance {
  0% { opacity: 0; transform: rotate(0deg) translateY(40px) scale(0.8); }
  100% { opacity: 1; }
}

.polaroid-frame {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--primary-light);
  position: relative;
}

.polaroid-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  width: 100%;
  height: 100%;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.3s ease;
}

.upload-label:hover { background: rgba(244, 114, 182, 0.1); }

.upload-icon { font-size: 1.8rem; }

.photo-input {
  display: none;
}

.polaroid-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 0.85rem;
  color: var(--text-medium);
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
}

/* Photo placeholder (tampil saat foto belum diset di CONFIG) */
.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce7f3, #fdf4ff);
  font-size: 2.5rem;
  animation: pulse 2.5s ease-in-out infinite;
}

/* ============================================================
   SCENE 4: MESSAGE
   ============================================================ */
.message-card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(244, 114, 182, 0.3);
  border-radius: 24px;
  padding: 2.5rem 3rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px var(--shadow), 0 4px 20px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.message-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 5px;
  background: var(--gradient-primary);
  border-radius: 24px 24px 0 0;
}

.message-decoration {
  color: var(--primary);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
  margin: 0.5rem 0;
}

.message-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-style: italic;
  color: var(--text-dark);
  margin: 0.5rem 0;
}

.message-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  color: var(--text-medium);
  line-height: 1.9;
  font-weight: 500;
  min-height: 100px;
  margin: 1rem 0;
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--primary);
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

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

.message-signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-top: 1rem;
}

/* ============================================================
   SCENE 5: CAKE
   ============================================================ */
.cake-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--text-dark);
  text-align: center;
}

.cake-subtitle {
  font-size: 0.95rem;
  color: var(--text-medium);
  font-weight: 500;
  text-align: center;
  margin-top: 1rem;
  order: 1; /* pastikan berada setelah cake-wrapper di flex column */
}

.cake-wrapper {
  perspective: 1000px;
}

.cake {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  animation: cakeFloat 4s ease-in-out infinite;
}

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

.cake-candles {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  z-index: 10;
  margin-bottom: -2px;
}

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

.candle-body {
  width: 12px;
  height: 50px;
  background: linear-gradient(135deg, #f9a8d4, #f472b6, #ec4899);
  border-radius: 6px 6px 2px 2px;
  position: relative;
  box-shadow: inset -2px 0 4px rgba(0,0,0,0.1);
}

.candle-body::after {
  content: '';
  position: absolute;
  top: 0;
  right: 2px;
  width: 3px;
  height: 100%;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.candle-wick {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 6px;
  background: #4a4a4a;
  border-radius: 1px;
}

.flame {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 28px;
  background: radial-gradient(ellipse at 50% 80%, #fff 0%, #fbbf24 30%, #f97316 65%, #ef4444 90%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  animation: flicker 0.2s ease-in-out infinite alternate;
  filter: blur(0.5px);
}

.flame-inner {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 12px;
  background: radial-gradient(ellipse at center, #fff 0%, rgba(251,191,36,0.5) 100%);
  border-radius: 50%;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scaleX(1) scaleY(1) rotate(-1deg); }
  100% { transform: translateX(-50%) scaleX(0.92) scaleY(1.05) rotate(1deg); }
}

.candle.blown .flame { display: none; }
.candle.blown .smoke { display: block !important; }

.smoke {
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 20px;
  background: rgba(150,150,150,0.5);
  border-radius: 50%;
  animation: smokeRise 1.5s ease-out forwards;
}

@keyframes smokeRise {
  0% { opacity: 0.7; transform: translateX(-50%) translateY(0) scaleX(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scaleX(3); }
}

/* Cake Tiers */
.cake-top-layer {
  width: 200px;
  height: 70px;
  background: linear-gradient(180deg, #fce7f3, #f9a8d4);
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 -4px 0 rgba(255,255,255,0.5) inset;
  border: 2px solid rgba(244,114,182,0.3);
}

.cake-top-layer::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: var(--gradient-primary);
  border-radius: 50%;
}

.cake-decoration {
  font-family: 'Dancing Script', cursive;
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 700;
}

.cake-middle-layer {
  width: 250px;
  height: 75px;
  background: linear-gradient(180deg, #f9a8d4, #f472b6);
  position: relative;
  border-left: 2px solid rgba(219,39,119,0.2);
  border-right: 2px solid rgba(219,39,119,0.2);
}

.cake-middle-layer::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
  background: #fbbf24;
  border-radius: 50%;
}

.cake-bottom-layer {
  width: 300px;
  height: 80px;
  background: linear-gradient(180deg, #f472b6, #db2777);
  border-radius: 0 0 20px 20px;
  position: relative;
  border-left: 2px solid rgba(219,39,119,0.2);
  border-right: 2px solid rgba(219,39,119,0.2);
  border-bottom: 2px solid rgba(219,39,119,0.2);
}

.cake-bottom-layer::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 12px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
}

.cake-plate {
  width: 340px;
  height: 20px;
  background: linear-gradient(180deg, #e2e8f0, #cbd5e1);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  margin-top: -5px;
}

.candle-hint {
  font-size: 0.9rem;
  color: var(--text-medium);
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}

/* ============================================================
   SCENE 6: FINALE
   ============================================================ */
.scene-bg-6 * { color: white; }

.finale-stars {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  font-size: 2rem;
  opacity: 0;
  animation: starTwinkle 3s ease-in-out infinite;
}

.s1 { top: 10%; left: 8%; animation-delay: 0s; font-size: 1rem; }
.s2 { top: 15%; right: 10%; animation-delay: 0.5s; }
.s3 { top: 50%; left: 3%; animation-delay: 1s; font-size: 1.2rem; }
.s4 { top: 60%; right: 4%; animation-delay: 1.5s; font-size: 0.9rem; }
.s5 { top: 80%; left: 15%; animation-delay: 0.7s; font-size: 1.5rem; }
.s6 { top: 85%; right: 12%; animation-delay: 1.2s; font-size: 1rem; }
.s7 { top: 30%; left: 92%; animation-delay: 0.3s; font-size: 0.8rem; }
.s8 { top: 5%; left: 50%; animation-delay: 2s; font-size: 1.3rem; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(20deg); }
}

.finale-content { text-align: center; }

.finale-badge {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: badgeBounce 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
}

@keyframes badgeBounce {
  0% { opacity: 0; transform: scale(0) rotate(-180deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.finale-title {
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: 0 auto;
}

.finale-line-1 {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: slideInUp 0.8s ease 0.6s forwards;
}

.finale-line-2 {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  animation: slideInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s forwards;
}

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

.finale-name {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 0 30px rgba(251,191,36,0.5);
  opacity: 0;
  animation: slideInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s forwards;
  margin: 0.2rem 0;
}

.finale-wish {
  font-size: 1.05rem;
  line-height: 1.8;
  font-weight: 400;
  opacity: 0;
  animation: slideInUp 0.8s ease 1.5s forwards;
  max-width: 400px;
}

.finale-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  opacity: 0;
  animation: slideInUp 0.8s ease 1.8s forwards;
}

/* ---------- Shared Buttons ---------- */
.btn-next {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px var(--shadow-strong);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  letter-spacing: 0.05em;
}

.btn-next:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px var(--shadow-strong);
}

.btn-next:active { transform: scale(0.97); }

.btn-confetti {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 2rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(251,191,36,0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.btn-confetti:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px rgba(251,191,36,0.5);
}

.btn-restart {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  padding: 0.85rem 2rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-restart:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-3px);
}

/* Music Player */
.music-player {
  margin-top: 1rem;
  opacity: 0;
  animation: slideInUp 0.8s ease 2.1s forwards;
}

.music-btn {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 30px;
  padding: 0.6rem 1.5rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.music-btn:hover { background: rgba(255,255,255,0.25); }
.music-btn.playing { background: rgba(251,191,36,0.3); border-color: #fbbf24; }

/* ============================================================
   SETTINGS PANEL
   ============================================================ */
#settings-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 500;
  box-shadow: 0 4px 15px var(--shadow-strong);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#settings-toggle:hover { transform: scale(1.1) rotate(90deg); }

.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  z-index: 600;
  box-shadow: -10px 0 40px var(--shadow);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-panel.hidden { transform: translateX(100%); }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(244,114,182,0.2);
  background: var(--gradient-primary);
  color: white;
}

.settings-header h3 { color: white; font-size: 1.1rem; font-weight: 700; }

#settings-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

#settings-close:hover { background: rgba(255,255,255,0.3); }

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.05em;
}

.setting-group input,
.setting-group textarea {
  border: 2px solid rgba(244,114,182,0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  color: var(--text-dark);
  transition: border-color 0.3s ease;
  outline: none;
  resize: none;
  background: white;
}

.setting-group input:focus,
.setting-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--shadow);
}

.theme-options {
  display: flex;
  gap: 0.75rem;
}

.theme-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  font-size: 1.4rem;
  cursor: pointer;
  background: white;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.theme-btn:hover { transform: scale(1.15); }
.theme-btn.active { border-color: var(--primary); box-shadow: 0 4px 15px var(--shadow-strong); }

.btn-apply {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.9rem;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px var(--shadow-strong);
  margin-top: 0.5rem;
}

.btn-apply:hover { transform: translateY(-3px); box-shadow: 0 10px 30px var(--shadow-strong); }

/* ============================================================
   SCENE INDICATOR
   ============================================================ */
.scene-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 500;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(244,114,182,0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
  box-shadow: 0 2px 8px var(--shadow);
}

/* ============================================================
   TRANSITION OVERLAY
   ============================================================ */
.transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, var(--primary) 0%, var(--primary-dark) 100%);
  z-index: 900;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  border-radius: 50%;
  transition: none;
}

.transition-overlay.animating {
  animation: rippleTransition 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes rippleTransition {
  0% { opacity: 1; transform: scale(0); border-radius: 50%; }
  50% { opacity: 1; transform: scale(2); border-radius: 10%; }
  100% { opacity: 0; transform: scale(3); border-radius: 0%; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .finale-line-2 { font-size: 2.5rem; }
  .finale-name { font-size: 2.2rem; }
  .polaroid { width: 120px; }
  .polaroid-gallery { gap: 1rem; }
  .message-card { padding: 1.5rem; }
  .cake-top-layer { width: 160px; }
  .cake-middle-layer { width: 200px; }
  .cake-bottom-layer { width: 240px; }
  .cake-plate { width: 270px; }
  .gallery-title { font-size: 1.4rem; }
  .message-name { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .polaroid-gallery { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; padding: 1.5rem 1rem; }
  .polaroid { min-width: 110px; }
  .finale-line-2 { font-size: 2rem; }
  .finale-actions { flex-direction: column; align-items: center; }
}

/* ============================================================
   UTILITY ANIMATIONS
   ============================================================ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Particle burst on click */
.particle {
  position: fixed;
  pointer-events: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 9998;
  animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: var(--tx) var(--ty) scale(0); }
}

/* Entrance for scene-specific elements */
.animate-in {
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
