/* ==========================================================================
   Birthday Card Magic - Custom Design System & Stylesheet (Vanilla CSS)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Dancing+Script:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-color: #0b0709;
  --bg-gradient: linear-gradient(135deg, #0e080b 0%, #070405 100%);
  --primary-color: #e57c97;
  --primary-glow: rgba(229, 124, 151, 0.4);
  --accent-color: #ffd29d;
  --accent-glow: rgba(255, 210, 157, 0.3);
  --text-main: #f5ecef;
  --text-muted: #bda8af;
  --card-bg: rgba(25, 14, 18, 0.45);
  --card-border: rgba(229, 124, 151, 0.15);
  --glow-color: rgba(229, 124, 151, 0.6);
  --aurora-1: #e57c97;
  --aurora-2: #ffd29d;
  --aurora-3: #e879f9;
  --font-serif: 'Cormorant Garamond', serif;
  --font-script: 'Dancing Script', cursive;
  --font-sans: 'Inter', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.32, 1);
  --transition-fast: all 0.2s ease;
}

body.theme-midnight {
  --bg-color: #050811; --bg-gradient: linear-gradient(135deg,#050811 0%,#020308 100%);
  --primary-color: #6393f2; --primary-glow: rgba(99,147,242,0.4);
  --accent-color: #aae0ff; --accent-glow: rgba(170,224,255,0.3);
  --text-main: #ebf2fa; --text-muted: #9bb1cc;
  --card-bg: rgba(10,17,34,0.45); --card-border: rgba(99,147,242,0.15);
  --glow-color: rgba(99,147,242,0.6);
  --aurora-1: #6393f2; --aurora-2: #aae0ff; --aurora-3: #a78bfa;
}
body.theme-emerald {
  --bg-color: #040a08; --bg-gradient: linear-gradient(135deg,#040a08 0%,#010403 100%);
  --primary-color: #4da67f; --primary-glow: rgba(77,166,127,0.4);
  --accent-color: #f7e0a3; --accent-glow: rgba(247,224,163,0.3);
  --text-main: #ecf7f2; --text-muted: #a3c2b4;
  --card-bg: rgba(8,20,16,0.45); --card-border: rgba(77,166,127,0.15);
  --glow-color: rgba(77,166,127,0.6);
  --aurora-1: #4da67f; --aurora-2: #f7e0a3; --aurora-3: #6ee77a;
}
body.theme-lavender {
  --bg-color: #09060f; --bg-gradient: linear-gradient(135deg,#09060f 0%,#040207 100%);
  --primary-color: #ad7cee; --primary-glow: rgba(173,124,238,0.4);
  --accent-color: #fcaae5; --accent-glow: rgba(252,170,229,0.3);
  --text-main: #f5f0fa; --text-muted: #b9a9cb;
  --card-bg: rgba(18,12,28,0.45); --card-border: rgba(173,124,238,0.15);
  --glow-color: rgba(173,124,238,0.6);
  --aurora-1: #ad7cee; --aurora-2: #fcaae5; --aurora-3: #f472b6;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* =====================================================================
   AURORA BACKGROUND
   ===================================================================== */
.aurora-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.08;
  animation: auroraFloat 18s infinite ease-in-out;
}
.a1 {
  width: 600px; height: 600px;
  background: var(--aurora-1);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.a2 {
  width: 500px; height: 500px;
  background: var(--aurora-2);
  bottom: -100px; right: -80px;
  animation-delay: -6s;
}
.a3 {
  width: 400px; height: 400px;
  background: var(--aurora-3);
  top: 40%; left: 40%;
  animation-delay: -12s;
}
@keyframes auroraFloat {
  0%,100% { transform: translate(0,0) scale(1); opacity: 0.08; }
  33% { transform: translate(60px,-40px) scale(1.15); opacity: 0.12; }
  66% { transform: translate(-40px,60px) scale(0.9); opacity: 0.06; }
}

/* =====================================================================
   STARS & HEARTS
   ===================================================================== */
.star-container, .heart-container, .balloon-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.star {
  position: absolute; border-radius: 50%; background-color: var(--accent-color);
  opacity: 0; box-shadow: 0 0 6px var(--accent-glow);
  animation: twinkle var(--twinkle-duration,4s) infinite ease-in-out;
}
@keyframes twinkle {
  0%,100% { opacity: 0; transform: scale(0.6); }
  50% { opacity: 0.8; transform: scale(1.1); }
}
.floating-heart {
  position: absolute; color: var(--primary-color); opacity: 0;
  font-size: var(--heart-size,16px); pointer-events: none;
  filter: drop-shadow(0 0 6px var(--primary-glow));
  bottom: -50px;
  animation: floatUp var(--float-duration,12s) linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: var(--max-opacity,0.6); }
  90% { opacity: var(--max-opacity,0.6); }
  100% { transform: translateY(-110vh) translateX(var(--drift-x,80px)) rotate(var(--rotate-deg,45deg)); opacity: 0; }
}

/* Balloons */
.balloon {
  position: fixed;
  bottom: -100px;
  pointer-events: none;
  z-index: 5;
  animation: balloonRise var(--rise-duration,8s) ease-in forwards;
  transform-origin: center bottom;
}
.balloon-body {
  width: var(--bal-size,40px);
  height: calc(var(--bal-size,40px) * 1.2);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  background: var(--bal-color,#e57c97);
  box-shadow: inset -6px -4px 12px rgba(0,0,0,0.2), inset 4px 4px 8px rgba(255,255,255,0.25);
  position: relative;
}
.balloon-knot {
  width: 6px; height: 8px;
  background: var(--bal-color,#e57c97);
  border-radius: 0 0 4px 4px;
  margin: 0 auto;
  position: relative;
}
.balloon-string {
  width: 1px; height: 60px;
  background: rgba(255,255,255,0.3);
  margin: 0 auto;
  animation: balloonSway var(--sway-dur,3s) ease-in-out infinite;
}
@keyframes balloonRise {
  0% { bottom: -100px; opacity: 0; }
  10% { opacity: 0.9; }
  85% { opacity: 0.8; }
  100% { bottom: 110vh; opacity: 0; }
}
@keyframes balloonSway {
  0%,100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* =====================================================================
   CANVASES (confetti + sparkle trail)
   ===================================================================== */
#confetti-canvas, #sparkle-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 999;
}
#sparkle-canvas { z-index: 998; }

/* =====================================================================
   LIGHTBOX
   ===================================================================== */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  transition: var(--transition-fast);
}
.lightbox-close:hover { background: var(--primary-color); color: #000; }
.lightbox-inner { text-align: center; max-width: 85vw; }
.lightbox-inner img {
  max-width: 100%; max-height: 75vh;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: lightboxZoom 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes lightboxZoom {
  from { transform: scale(0.7); opacity:0; }
  to { transform: scale(1); opacity:1; }
}
.lightbox-caption {
  font-family: var(--font-script); font-size: 1.4rem;
  color: var(--accent-color); margin-top: 1rem;
}

/* =====================================================================
   APP LAYOUT
   ===================================================================== */
#app-container {
  display: flex; min-height: 100vh;
  position: relative; width: 100%;
}
#gift-mode-view {
  flex: 1; position: relative; z-index: 2;
  overflow-y: auto; scroll-behavior: smooth; width: 100%;
  transition: width 0.3s ease;
}

/* =====================================================================
   HERO SECTION
   ===================================================================== */
.hero-section {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem; text-align: center; position: relative;
}

/* Sparkle ring pulse */
.hero-sparkle-ring {
  position: absolute;
  width: 380px; height: 380px;
  border-radius: 50%;
  border: 1px solid var(--primary-glow);
  animation: ringPulse 3.5s ease-in-out infinite;
  pointer-events: none;
}
.hero-sparkle-ring::after {
  content: '';
  position: absolute; inset: 30px;
  border-radius: 50%;
  border: 1px dashed var(--accent-glow);
  animation: ringPulse 3.5s ease-in-out infinite reverse;
}
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.6; }
}

.hero-subtitle {
  font-family: var(--font-script); font-size: 1.8rem;
  color: var(--accent-color); text-shadow: 0 0 8px var(--accent-glow);
}
.text-gradient {
  background: linear-gradient(to right, var(--primary-color), var(--accent-color), var(--primary-color));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.hero-title {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(2.2rem, 6.5vw, 4.6rem);
  line-height: 1.15; letter-spacing: 0.05em;
  margin-top: 1rem; margin-bottom: 0.5rem;
  max-width: 90vw; word-wrap: break-word;
}

/* Typewriter cursor blink */
.typewriter-text::after {
  content: '|';
  -webkit-text-fill-color: var(--primary-color);
  animation: blink 0.9s step-end infinite;
  font-weight: 300; margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-date {
  font-family: var(--font-script); font-size: clamp(2.5rem,5vw,4rem);
  color: var(--primary-color); text-shadow: 0 0 10px var(--primary-glow);
}
.hero-paragraph {
  font-size: clamp(0.95rem,2vw,1.15rem); line-height: 1.7;
  max-width: 580px; color: var(--text-muted); margin-top: 2rem;
}
.scroll-indicator {
  margin-top: 3rem; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.35em; color: var(--accent-color); opacity: 0.7;
  animation: bounce 2s infinite ease-in-out;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Balloon Burst Button */
.btn-balloon-burst {
  margin-top: 2rem;
  background: transparent;
  border: 1.5px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.65rem 1.6rem;
  border-radius: 2rem;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  letter-spacing: 0.05em;
  transition: var(--transition-fast);
}
.btn-balloon-burst:hover {
  background: var(--primary-color); color: #000;
  box-shadow: 0 0 15px var(--primary-glow);
  transform: scale(1.05);
}

/* =====================================================================
   SCROLL REVEAL
   ===================================================================== */
.scroll-reveal-item {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.32,1), transform 0.7s cubic-bezier(0.16,1,0.32,1);
}
.scroll-reveal-item.revealed {
  opacity: 1; transform: translateY(0);
}
.scroll-reveal-item:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal-item:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal-item:nth-child(4) { transition-delay: 0.3s; }
.scroll-reveal-item:nth-child(5) { transition-delay: 0.4s; }

/* Hero items start invisible and animate on load */
.reveal-item {
  opacity: 0; transform: translateY(20px);
  animation: fadeSlideUp 1s cubic-bezier(0.16,1,0.32,1) forwards;
}
.reveal-item:nth-child(1) { animation-delay: 0.1s; }
.reveal-item:nth-child(2) { animation-delay: 0.3s; }
.reveal-item:nth-child(3) { animation-delay: 0.6s; }
.reveal-item:nth-child(4) { animation-delay: 0.9s; }
.reveal-item:nth-child(5) { animation-delay: 1.2s; }
@keyframes fadeSlideUp { to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { to { opacity:1; } }
@keyframes popIn { to { opacity:1; transform:scale(1); } }

/* =====================================================================
   MEMORIES SECTION
   ===================================================================== */
.memories-section {
  padding: 6rem 1rem; display: flex; flex-direction: column;
  align-items: center; position: relative;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem,5vw,3.5rem); font-weight: 600;
  text-align: center; margin-bottom: 0.5rem;
}
.section-subtitle {
  font-family: var(--font-script); font-size: 1.35rem;
  color: var(--text-muted); margin-bottom: 3.5rem; text-align: center;
}
.cards-container {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 2.2rem; max-width: 1200px; padding: 1rem;
  perspective: 1200px;
}

/* 3D FLIP CARD */
.flip-card {
  width: 280px;
  height: 390px;
  perspective: 1000px;
  cursor: pointer;
}
.flip-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4,0.2,0.2,1);
  border-radius: 1.25rem;
}
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--card-bg), rgba(229,124,151,0.08));
  justify-content: center; align-items: center;
}
.flip-card:hover .flip-card-front {
  box-shadow: 0 20px 40px -15px var(--glow-color);
}
.flip-card.pulse-glow .flip-card-front {
  animation: cardPulseGlow 2.5s infinite ease-in-out;
}
@keyframes cardPulseGlow {
  0%, 100% {
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    border-color: var(--card-border);
  }
  50% {
    box-shadow: 0 0 25px var(--glow-color);
    border-color: var(--primary-color);
  }
}
.card-img-wrapper {
  position: relative; height: 290px; width: 100%;
  overflow: hidden; flex-shrink: 0;
}
.card-img-wrapper img {
  height: 100%; width: 100%; object-fit: cover;
  object-position: center var(--img-pos-y, 50%);
  transform: scale(var(--img-zoom, 1));
  transition: transform 0.6s cubic-bezier(0.16,1,0.32,1);
}
.flip-card:hover .card-img-wrapper img { transform: scale(calc(var(--img-zoom, 1) * 1.06)); }
.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,7,9,0.85) 0%,transparent 60%);
  opacity: 0.95;
}
.card-caption {
  font-family: var(--font-script); font-size: 1.25rem;
  text-align: center; color: var(--text-main);
  padding: 0.85rem 0.75rem 0.2rem;
}
.card-hint-flip {
  font-size: 0.68rem; text-align: center;
  color: var(--text-muted); letter-spacing: 0.05em;
  padding-bottom: 0.75rem;
}
.flip-back-content {
  padding: 1.25rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; height: 100%;
}
.flip-back-image {
  width: 110px; height: 110px;
  object-fit: contain;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}
.flip-back-msg {
  font-family: var(--font-serif); font-size: 1.25rem;
  font-style: italic; line-height: 1.4;
  color: var(--text-main);
}
.flip-back-tap {
  font-size: 0.7rem; color: var(--text-muted);
  letter-spacing: 0.08em; margin-top: 0.25rem;
}

/* =====================================================================
   BIRTHDAY CAKE SECTION
   ===================================================================== */
.cake-section {
  padding: 5rem 1rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.5rem;
}
.cake-wrapper {
  display: flex; flex-direction: column;
  align-items: center; user-select: none;
}

/* CANDLES */
.candles-row {
  display: flex; gap: 18px;
  align-items: flex-end;
  margin-bottom: -2px;
  z-index: 2; position: relative;
}
.candle {
  display: flex; flex-direction: column;
  align-items: center; cursor: pointer;
}
.candle-flame {
  width: 18px; height: 30px;
  position: relative; margin-bottom: -2px;
  transition: opacity 0.5s ease;
}
.candle-flame::before {
  content: '';
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: 18px; height: 30px;
  background: radial-gradient(ellipse at 50% 80%, #fff8c0 0%, #fbbf24 35%, #f97316 65%, transparent 100%);
  border-radius: 50% 50% 30% 30%;
  animation: flicker 0.15s infinite alternate;
  filter: blur(1px);
}
.candle-flame::after {
  content: '';
  position: absolute; left: 50%; top: 8px;
  transform: translateX(-50%);
  width: 8px; height: 14px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.8) 0%, transparent 70%);
  border-radius: 50%;
  animation: flicker 0.12s infinite alternate-reverse;
}
.flame-inner {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px 4px rgba(251,191,36,0.5);
}
@keyframes flicker {
  0% { transform: translateX(-50%) scaleX(1) skewX(-3deg); }
  100% { transform: translateX(-50%) scaleX(0.92) skewX(3deg); }
}
.candle.blown .candle-flame {
  opacity: 0; pointer-events: none;
}
.candle.blown .candle-body::before {
  content: '';
  position: absolute; top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 20px;
  background: linear-gradient(to top, rgba(100,80,60,0.5), transparent);
  border-radius: 2px;
  animation: smokeRise 2s ease-out forwards;
}
@keyframes smokeRise {
  0% { transform: translateX(-50%) scaleY(0); opacity: 0.8; }
  100% { transform: translateX(-50%) scaleY(1) translateY(-15px); opacity: 0; }
}
.candle-body {
  width: 16px; height: 55px;
  background: linear-gradient(to bottom, #ffd1e8, #e57c97);
  border-radius: 3px 3px 0 0;
  position: relative;
}
.candle-stripe {
  position: absolute; top: 12px; left: 0; right: 0;
  height: 0;
  border-top: 2px dashed rgba(255,255,255,0.4);
}
.candle-base {
  width: 20px; height: 6px;
  background: #e57c97;
  border-radius: 0 0 4px 4px;
}

/* Cake body */
.cake-body {
  width: 280px;
  display: flex; flex-direction: column;
  align-items: center;
}
.cake-top-layer {
  width: 100%; height: 60px;
  background: linear-gradient(to bottom, #fff8f8, #fce4ec);
  border-radius: 12px 12px 0 0;
  border: 2px solid rgba(229,124,151,0.3);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cake-frosting-drip {
  position: absolute; top: -1px;
  width: 28px; height: 22px;
  background: white;
  border-radius: 0 0 50% 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.d1 { left: 10px; height: 18px; }
.d2 { left: 55px; height: 24px; }
.d3 { left: 110px; height: 19px; }
.d4 { left: 165px; height: 26px; }
.d5 { left: 220px; height: 20px; }
.cake-text {
  font-family: var(--font-script); font-size: 1.1rem;
  color: #c2185b; z-index: 1; position: relative;
}
.cake-bottom-layer {
  width: 100%; height: 75px;
  background: linear-gradient(to bottom, #e57c97, #c2185b);
  display: flex; align-items: center; justify-content: center;
  border-left: 2px solid rgba(255,255,255,0.1);
  border-right: 2px solid rgba(255,255,255,0.1);
}
.cake-decoration { font-size: 2rem; }
.cake-plate {
  width: 310px; height: 14px;
  background: linear-gradient(to bottom, #f5f5f5, #e0e0e0);
  border-radius: 0 0 60px 60px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.cake-all-blown-msg {
  font-family: var(--font-script); font-size: 1.5rem;
  color: var(--accent-color);
  text-align: center;
  animation: pulseText 1.5s ease-in-out infinite;
}
@keyframes pulseText {
  0%,100% { text-shadow: 0 0 10px var(--accent-glow); }
  50% { text-shadow: 0 0 25px var(--accent-color), 0 0 50px var(--accent-glow); }
}

/* =====================================================================
   WISHES SECTION
   ===================================================================== */
.wishes-section {
  padding: 5rem 1rem 8rem 1rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 3rem;
}
.wish-card {
  max-width: 650px; width: 90%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.8rem; padding: 3.5rem 2.5rem;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  text-align: center;
  box-shadow: 0 15px 35px -10px rgba(0,0,0,0.6);
  animation: pulseGlow 4s infinite ease-in-out;
}
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 15px 35px -10px rgba(0,0,0,0.6); }
  50% { box-shadow: 0 15px 45px -5px var(--primary-glow); border-color: rgba(229,124,151,0.35); }
}
.wish-tagline { font-family: var(--font-script); font-size: 1.8rem; color: var(--accent-color); margin-bottom: 1.5rem; }
.wish-message { font-family: var(--font-serif); font-size: clamp(1.2rem,3vw,1.65rem); line-height: 1.6; font-style: italic; color: var(--text-main); margin-bottom: 2rem; }
.wish-signature { font-family: var(--font-script); font-size: 1.8rem; color: var(--primary-color); font-weight: 600; }

/* Fun Element */
.fun-element-container { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 10; }
.joke-bubble {
  background: rgba(255,210,157,0.12); border: 1px solid var(--accent-glow);
  padding: 0.6rem 1.2rem; border-radius: 1rem;
  font-family: var(--font-script); font-size: 1.15rem; color: var(--accent-color);
  backdrop-filter: blur(8px); margin-bottom: 1rem;
  max-width: 320px; text-align: center;
}
.interactive-object {
  font-size: clamp(4.5rem,10vw,5.5rem); cursor: pointer; user-select: none;
  filter: drop-shadow(0 0 15px var(--accent-glow));
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}
.interactive-object:hover { transform: scale(1.12) rotate(5deg); }
.interactive-object:active { transform: scale(0.95); }
.object-sparks { position: relative; margin-top: 0.5rem; height: 20px; width: 100px; display: flex; justify-content: center; gap: 1rem; }
.spark-dot { font-size: 0.9rem; opacity: 0; animation: sparkFloat 1.5s infinite ease-out; }
.spark-dot:nth-child(1) { animation-delay: 0.2s; }
.spark-dot:nth-child(2) { animation-delay: 0.7s; }
.spark-dot:nth-child(3) { animation-delay: 0s; }
@keyframes sparkFloat {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-30px) scale(1.2); opacity: 0; }
}

/* Emoji Rain Button */
.btn-emoji-rain {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border: none; color: #000;
  padding: 0.85rem 2.2rem;
  border-radius: 2.5rem;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px var(--primary-glow);
  transition: var(--transition-fast);
  position: relative; overflow: hidden;
}
.btn-emoji-rain::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  border-radius: inherit;
}
.btn-emoji-rain:hover { transform: scale(1.06); box-shadow: 0 8px 30px var(--primary-glow); }
.btn-emoji-rain:active { transform: scale(0.97); }

/* =====================================================================
   FLOATING CONTROLS & BUTTONS
   ===================================================================== */
.floating-overlay-controls {
  position: fixed; top: 1.5rem; right: 1.5rem;
  z-index: 99; display: flex; gap: 0.75rem; pointer-events: none;
}
.btn-icon-floating {
  pointer-events: auto;
  height: 46px; width: 46px; border-radius: 50%;
  background: rgba(15,16,22,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; cursor: pointer;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.btn-icon-floating:hover {
  background: var(--primary-color); color: #000;
  transform: scale(1.08); border-color: var(--primary-color);
  box-shadow: 0 4px 20px var(--primary-glow);
}
/* Pulse ring animation for party button */
.pulse-ring {
  animation: pulseRing 2s ease-in-out infinite;
}
@keyframes pulseRing {
  0%,100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* =====================================================================
   CREATOR STUDIO PANEL
   ===================================================================== */
#creator-studio {
  width: 440px;
  background: #0f1016;
  border-left: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0; z-index: 100;
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(0.16,1,0.32,1), margin-right 0.4s cubic-bezier(0.16,1,0.32,1);
  overflow: hidden;
}
#creator-studio:not(.collapsed) {
  min-width: 440px;
}
#creator-studio.collapsed { transform: translateX(100%); margin-right: -440px; min-width: 0; }
.studio-header {
  padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  background: #141620;
}
.studio-logo { display: flex; align-items: center; gap: 0.5rem; }
.studio-logo span { font-size: 1.3rem; }
.studio-title { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.05em; color: #fff; }
.studio-btn-close {
  background: transparent; border: none; color: #a0aec0;
  cursor: pointer; font-size: 1.2rem; height: 32px; width: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: var(--transition-fast);
}
.studio-btn-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.studio-tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.06); background: #12131a;
}
.studio-tab {
  flex: 1; padding: 1rem; background: transparent;
  border: none; border-bottom: 2px solid transparent;
  color: #718096; font-size: 0.85rem; font-weight: 500; cursor: pointer;
  text-align: center; transition: var(--transition-fast);
}
.studio-tab:hover { color: #e2e8f0; }
.studio-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); background: rgba(255,255,255,0.02); }
.studio-content { flex: 1; overflow-y: auto; padding: 1.5rem; }
.studio-tab-panel { display: none; }
.studio-tab-panel.active { display: block; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: #a0aec0; margin-bottom: 0.5rem;
}
.form-control {
  width: 100%; background: #1a1c27; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.5rem; padding: 0.75rem 1rem; color: #f7fafc;
  font-size: 0.9rem; font-family: var(--font-sans); transition: var(--transition-fast);
}
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px var(--primary-glow); }
textarea.form-control { min-height: 90px; resize: vertical; }

/* Card Editor Items */
.editor-card-item {
  background: #151722; border: 1px solid rgba(255,255,255,0.05);
  border-radius: 0.65rem; padding: 1rem; margin-bottom: 1rem;
}
.editor-card-header {
  font-size: 0.85rem; font-weight: 600; color: #cbd5e0;
  margin-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: center;
}
.card-upload-preview {
  height: 60px; width: 60px; border-radius: 0.35rem; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1); background: #0f1016; margin-top: 0.5rem;
}
.card-upload-preview img { height: 100%; width: 100%; object-fit: cover; }
.card-upload-btn-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.file-input-wrapper { position: relative; overflow: hidden; display: inline-block; flex: 1; }
.btn-file-select {
  display: block; width: 100%;
  background: #252838; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.4rem; padding: 0.45rem; color: #e2e8f0;
  font-size: 0.8rem; text-align: center; cursor: pointer; transition: var(--transition-fast);
}
.btn-file-select:hover { background: #2e3247; color: #fff; }
.file-input-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; cursor: pointer; }
.presets-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.4rem; margin-top: 0.6rem; }
.preset-thumbnail {
  height: 45px; border-radius: 0.25rem; overflow: hidden;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition-fast);
}
.preset-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.preset-thumbnail:hover { border-color: rgba(255,255,255,0.4); }
.preset-thumbnail.active { border-color: var(--primary-color); }

/* Theme Grid */
.theme-selector-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0.75rem; }
.theme-option-card {
  border: 1px solid rgba(255,255,255,0.08); background: #161824;
  border-radius: 0.6rem; padding: 0.8rem; cursor: pointer;
  transition: var(--transition-fast); display: flex; flex-direction: column; gap: 0.4rem;
}
.theme-option-card:hover { border-color: rgba(255,255,255,0.2); background: #1c1f2e; }
.theme-option-card.active { border-color: var(--primary-color); background: rgba(229,124,151,0.05); }
.theme-color-dots { display: flex; gap: 0.35rem; }
.theme-dot { width: 12px; height: 12px; border-radius: 50%; }
.theme-option-name { font-size: 0.8rem; font-weight: 500; color: #cbd5e0; }

/* Studio Footer */
.studio-footer {
  padding: 1.5rem; border-top: 1px solid rgba(255,255,255,0.06);
  background: #141620; display: flex; flex-direction: column; gap: 0.75rem;
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.8rem 1.5rem; border-radius: 0.5rem;
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: var(--transition-fast);
}
.btn-primary { background: var(--primary-color); color: #000; }
.btn-primary:hover { background: #fff; color: #000; box-shadow: 0 0 15px var(--primary-glow); }
.btn-secondary { background: #252838; border: 1px solid rgba(255,255,255,0.1); color: #e2e8f0; }
.btn-secondary:hover { background: #2e3247; color: #fff; }

/* Badge */
#custom-badge {
  position: fixed; bottom: 12px; right: 12px; z-index: 998;
  background: rgba(15,16,22,0.85); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 12px; font-size: 11px;
  font-family: var(--font-sans); color: #a0aec0;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(6px); box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#custom-badge strong { color: var(--primary-color); }

/* Toast */
.toast-notification {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15,16,22,0.95); border: 1px solid var(--primary-color);
  color: #fff; padding: 0.8rem 1.8rem; border-radius: 2rem;
  font-size: 0.9rem; z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.3s ease;
  opacity: 0; display: flex; align-items: center; gap: 0.6rem;
}
.toast-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Floating emoji rain pieces */
.emoji-rain-piece {
  position: fixed; top: -40px; pointer-events: none;
  font-size: var(--piece-size,1.5rem); z-index: 990;
  animation: emojiRainFall var(--fall-dur,4s) linear forwards;
}
@keyframes emojiRainFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--spin,360deg)); opacity: 0; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  #app-container { flex-direction: column; }
  #creator-studio {
    width: 100%; min-width: 100%; height: 100vh;
    position: fixed; top: 0; right: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.32,1);
  }
  #creator-studio.collapsed { transform: translateY(100%); margin-right: 0; }
  #creator-studio:not(.collapsed) { transform: translateY(0); }
  .hero-sparkle-ring { width: 280px; height: 280px; }
}

/* =====================================================================
   WELCOMING PAGE (3D ENVELOPE)
   ===================================================================== */
.welcome-overlay {
  position: fixed; inset: 0;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.32, 1), transform 0.8s ease;
}
.welcome-overlay.fade-out {
  opacity: 0; pointer-events: none; transform: scale(1.05);
}
...
}
.welcome-card-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 2.5rem;
  perspective: 1000px;
}
.envelope-area {
  position: relative;
  width: 300px; height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.envelope-area:hover {
  transform: translateY(-8px) scale(1.03);
}
.welcome-envelope {
  position: absolute; inset: 0;
  background: #c2185b;
  border-radius: 0 0 12px 12px;
  cursor: pointer;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 40px rgba(194,24,91,0.15);
  transform-style: preserve-3d;
}

/* =====================================================================
   CUTE ANIMATED TEDDY BEARS (COVER PAGE)
   ===================================================================== */
.teddy-bear {
  position: absolute;
  width: 120px;
  height: 120px;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
  animation: bearBounce 3s infinite ease-in-out;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.teddy-bear:hover {
  transform: scale(1.15) rotate(5deg);
  z-index: 15;
}
.bear-right:hover {
  transform: scale(1.15) rotate(-5deg);
}
.teddy-bear .bear-img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}
.bear-left {
  left: -85px;
  bottom: -20px;
  animation-delay: 0s;
}
.bear-right {
  right: -85px;
  bottom: -20px;
  animation-delay: 0.5s;
}

.bear-img-interactive {
  width: 130px;
  height: 130px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

/* Bear Animations */
@keyframes bearBounce {
  0%, 100% { bottom: -15px; }
  50% { bottom: -9px; }
}
@keyframes bearBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}
@keyframes bearWave {
  0%, 100% { transform: rotate(-20deg) translateY(0); }
  50% { transform: rotate(-70deg) translateY(-2px); }
}
.envelope-top {
  position: absolute; top: 0; left: 0; width: 0; height: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 110px solid #d81b60;
  transform-origin: top;
  transition: transform 0.4s ease 0.2s, z-index 0.2s ease 0.2s;
  z-index: 4;
}
.welcome-envelope.open .envelope-top {
  transform: rotateX(180deg);
  z-index: 1;
}
.envelope-front {
  position: absolute; inset: 0;
  border-left: 150px solid #e91e63;
  border-right: 150px solid #e91e63;
  border-bottom: 100px solid #d81b60;
  border-top: 100px solid transparent;
  border-radius: 0 0 12px 12px;
  z-index: 3;
  pointer-events: none;
}
.envelope-back {
  position: absolute; inset: 0;
  background: #c2185b;
  border-radius: 0 0 12px 12px;
  z-index: 1;
}
.envelope-paper {
  position: absolute;
  width: 270px; height: 160px;
  background: #fffdf9;
  left: 15px; top: 15px;
  z-index: 2;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.32, 1) 0.4s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem; text-align: center;
  color: #1a1c27;
}
.welcome-envelope.open .envelope-paper {
  transform: translateY(-110px);
  z-index: 3;
}
.envelope-title {
  font-family: var(--font-serif); font-size: 1.1rem;
  color: #c2185b; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.25rem; font-weight: 700;
}
.envelope-name {
  font-family: var(--font-script); font-size: 2.2rem;
  color: #111; font-weight: 600; line-height: 1.2;
}
.envelope-sub {
  font-size: 0.75rem; color: #718096; margin-top: 0.75rem;
  font-family: var(--font-sans); letter-spacing: 0.05em;
}
.welcome-tip {
  font-family: var(--font-sans); font-size: 0.9rem;
  color: var(--text-muted); letter-spacing: 0.05em;
  text-align: center; max-width: 320px;
  animation: pulseTip 2s infinite ease-in-out;
}
@keyframes pulseTip {
  0%, 100% { opacity: 0.6; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 480px) {
  .envelope-area {
    transform: scale(0.8);
  }
  .envelope-area:hover {
    transform: translateY(-4px) scale(0.83);
  }
  .welcome-tip {
    font-size: 0.82rem;
    max-width: 280px;
    padding: 0 1rem;
  }
  .hero-section {
    padding: 1.5rem 1rem;
  }
  .hero-subtitle {
    font-size: 1.4rem;
  }
  .hero-paragraph {
    margin-top: 1rem;
    line-height: 1.5;
  }
  .wish-card {
    padding: 2.2rem 1.5rem;
    border-radius: 1.25rem;
  }
  .wish-tagline {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  .wish-message {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 360px) {
  .flip-card {
    width: 260px;
    height: 360px;
  }
  .card-img-wrapper {
    height: 260px;
  }
  .cake-plate {
    width: 280px;
  }
  .cake-body {
    width: 250px;
  }
}

/* =====================================================================
   LOCK SCREEN / COUNTDOWN OVERLAY
   ===================================================================== */
.lock-overlay {
  position: fixed; inset: 0;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.32, 1), transform 0.8s ease;
}
.lock-overlay.unlocking {
  opacity: 0; pointer-events: none; transform: scale(1.05);
}
.lock-content {
  text-align: center;
  max-width: 420px; width: 90%;
  padding: 3rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 2rem;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px var(--primary-glow);
  animation: pulseGlow 4s infinite ease-in-out;
}
.lock-heart-container {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: heartLockPulse 2s infinite ease-in-out;
}
@keyframes heartLockPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--primary-glow)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 20px var(--primary-color)); }
}
.lock-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}
.lock-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 2rem;
}
.countdown-timer {
  display: flex; justify-content: center; align-items: center; gap: 0.75rem;
  margin-bottom: 2rem;
}
.timer-segment {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  width: 75px; padding: 0.75rem 0.5rem;
}
.timer-num {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--primary-color);
  line-height: 1.2;
}
.timer-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.timer-colon {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  animation: timerBlink 1s infinite step-end;
}
@keyframes timerBlink {
  50% { opacity: 0; }
}
.lock-date {
  font-size: 0.8rem;
  color: var(--accent-color);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px var(--accent-glow);
}
