/* =============================================================
   CelebrationStudio — Luxury 3D Birthday Experience Stylesheet
   ============================================================= */

/* -------------------------------------------------------------
   THEMES & CSS DESIGN TOKENS
   ------------------------------------------------------------- */
:root,
[data-theme="rosegold"],
[data-theme="rose"] {
  /* Default: Rose Gold Dreams */
  --bg-0: #3a1523;
  --bg-1: #1a0810;
  --bg-2: #0d0407;
  --accent: #ffd77a;
  --accent-2: #ff8da6;
  --accent-primary: #e58c9e;
  --accent-glow: rgba(229, 140, 158, 0.45);
  --card-bg-front: linear-gradient(135deg, #fcecee 0%, #f7d3da 40%, #e8aab8 100%);
  --card-bg-inside: #fff9fa;
  --ribbon-color: #d15671;
  --ribbon-shadow: rgba(147, 33, 58, 0.45);
  --text-dark: #3a1922;
  --text-muted: #8b5d69;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-glow: 0 8px 32px 0 rgba(229, 140, 158, 0.22);
  --candle-flame-1: #ffffff;
  --candle-flame-2: #ffdf78;
  --candle-flame-3: #ff6e26;
}

[data-theme="luxe-gold"],
[data-theme="luxe"] {
  --bg-0: #2c2112;
  --bg-1: #161007;
  --bg-2: #080602;
  --accent: #ffd978;
  --accent-2: #e5be6b;
  --accent-primary: #e5be6b;
  --accent-glow: rgba(229, 190, 107, 0.4);
  --card-bg-front: linear-gradient(135deg, #2b2318 0%, #1c150c 50%, #120e06 100%);
  --card-bg-inside: #faf7f2;
  --ribbon-color: #c99839;
  --ribbon-shadow: rgba(125, 90, 22, 0.5);
  --text-dark: #231c12;
  --text-muted: #7d6b53;
  --glass-bg: rgba(255, 225, 160, 0.06);
  --glass-border: rgba(255, 220, 140, 0.2);
  --glass-glow: 0 8px 32px 0 rgba(229, 190, 107, 0.25);
}

[data-theme="cosmic"] {
  --bg-0: #28124d;
  --bg-1: #140829;
  --bg-2: #070212;
  --accent: #f2afff;
  --accent-2: #bd8bfb;
  --accent-primary: #bd8bfb;
  --accent-glow: rgba(189, 139, 251, 0.45);
  --card-bg-front: linear-gradient(135deg, #1d123d 0%, #2b1754 50%, #100726 100%);
  --card-bg-inside: #fbf9ff;
  --ribbon-color: #9d54f0;
  --ribbon-shadow: rgba(118, 41, 207, 0.5);
  --text-dark: #20133b;
  --text-muted: #6f588c;
  --glass-bg: rgba(210, 180, 255, 0.08);
  --glass-border: rgba(210, 180, 255, 0.2);
  --glass-glow: 0 8px 32px 0 rgba(189, 139, 251, 0.25);
}

[data-theme="cyberpunk"],
[data-theme="cyber"] {
  --bg-0: #101c38;
  --bg-1: #060d1f;
  --bg-2: #02060f;
  --accent: #ff007b;
  --accent-2: #00f3ff;
  --accent-primary: #00f3ff;
  --accent-glow: rgba(0, 243, 255, 0.4);
  --card-bg-front: linear-gradient(135deg, #0e1a38 0%, #192754 50%, #0b1126 100%);
  --card-bg-inside: #f0fbff;
  --ribbon-color: #ff007b;
  --ribbon-shadow: rgba(255, 0, 123, 0.5);
  --text-dark: #0a1733;
  --text-muted: #4b678f;
  --glass-bg: rgba(0, 243, 255, 0.06);
  --glass-border: rgba(0, 243, 255, 0.25);
  --glass-glow: 0 8px 32px 0 rgba(0, 243, 255, 0.25);
}

[data-theme="fairy"] {
  --bg-0: #143329;
  --bg-1: #0a1f18;
  --bg-2: #040d0a;
  --accent: #ffe7a0;
  --accent-2: #85e8ba;
  --accent-primary: #85e8ba;
  --accent-glow: rgba(133, 232, 186, 0.4);
  --card-bg-front: linear-gradient(135deg, #e3faf0 0%, #c9f5e1 50%, #a2ebd0 100%);
  --card-bg-inside: #f6fdfa;
  --ribbon-color: #279e70;
  --ribbon-shadow: rgba(28, 128, 89, 0.45);
  --text-dark: #0f2b20;
  --text-muted: #4e7d6b;
  --glass-bg: rgba(133, 232, 186, 0.07);
  --glass-border: rgba(133, 232, 186, 0.22);
  --glass-glow: 0 8px 32px 0 rgba(133, 232, 186, 0.25);
}

[data-theme="midnight"] {
  --bg-0: #1c0a24;
  --bg-1: #0e0513;
  --bg-2: #040107;
  --accent: #e2b4f8;
  --accent-2: #ff7ebb;
  --accent-primary: #d47aff;
  --accent-glow: rgba(212, 122, 255, 0.4);
  --card-bg-front: linear-gradient(135deg, #281433 0%, #3a1c4a 50%, #15091c 100%);
  --card-bg-inside: #faf4fc;
  --ribbon-color: #b339d6;
  --ribbon-shadow: rgba(179, 57, 214, 0.45);
  --text-dark: #240e2e;
  --text-muted: #6e4c7d;
  --glass-bg: rgba(212, 122, 255, 0.07);
  --glass-border: rgba(212, 122, 255, 0.2);
  --glass-glow: 0 8px 32px 0 rgba(212, 122, 255, 0.25);
}

/* -------------------------------------------------------------
   GLOBAL BASE & RESET
   ------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 20%, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-2) 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -------------------------------------------------------------
   AMBIENT LUXURY TEXTURE, CANVASES & BOKEH SPHERES
   ------------------------------------------------------------- */
.noise {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#ambient-canvas,
#sparkle-trail-canvas,
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#ambient-canvas { z-index: 0; }
#sparkle-trail-canvas { z-index: 90; }
#confetti-canvas { z-index: 120; }

.bokeh-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: floatSmooth 22s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
.bokeh-1 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
  top: -10%;
  left: 5%;
  opacity: 0.35;
  animation-duration: 20s;
}
.bokeh-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: 5%;
  right: -5%;
  opacity: 0.28;
  animation-duration: 26s;
}
.bokeh-3 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--ribbon-color) 0%, transparent 70%);
  top: 45%;
  left: 60%;
  opacity: 0.2;
  animation-duration: 24s;
}

@keyframes floatSmooth {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.28; }
  50% { transform: translate3d(60px, 45px, 0) scale(1.15); opacity: 0.42; }
  100% { transform: translate3d(-45px, 70px, 0) scale(0.92); opacity: 0.25; }
}

/* -------------------------------------------------------------
   NAVBAR & HEADER CONTROLS
   ------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3), var(--glass-glow);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  color: #1a080f;
  font-size: 1.25rem;
  box-shadow: 0 4px 18px var(--accent-glow);
  animation: pulseBrand 3.2s infinite ease-in-out;
  transition: transform 0.3s cubic-bezier(0.34, 1.5, 0.64, 1);
}
.brand-group:hover .brand-icon {
  transform: scale(1.12) rotate(8deg);
}
@keyframes pulseBrand {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08) rotate(3deg); }
}
.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff, var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  opacity: 0.85;
  display: block;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-quick-links {
  display: flex;
  gap: 8px;
}

/* Glass Tactile Button */
.glass-btn {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.25s ease, background 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  user-select: none;
}
.glass-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-25deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.glass-btn:hover::before {
  left: 150%;
}
.glass-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-2);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 22px var(--accent-glow);
}
.glass-btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.glass-btn.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #1a0810;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.glass-btn.active:hover {
  box-shadow: 0 8px 30px var(--accent-glow);
}
.glass-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.blast-btn {
  background: linear-gradient(135deg, #ff4d6d, #ffbf00);
  border: none;
  color: #1a0810;
  font-weight: 700;
}

.theme-select {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.theme-select:focus, .theme-select:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 16px var(--accent-glow);
}
.theme-select option {
  background: #1a0810;
  color: #fff;
}

/* -------------------------------------------------------------
   STEP FLOW STICKY DOCK
   ------------------------------------------------------------- */
.step-dock-wrap {
  position: sticky;
  top: 64px;
  z-index: 75;
  max-width: 900px;
  margin: 12px auto 0 auto;
  padding: 0 16px;
}
.step-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(18, 7, 13, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 40px;
  padding: 6px 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), var(--glass-glow);
}
.step-list {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.step-list::-webkit-scrollbar { display: none; }

.step-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 25px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  font-family: inherit;
}
.step-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.step-tab.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #1a080f;
  font-weight: 700;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.step-tab-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
}
.step-tab.active .step-tab-num {
  background: #1a080f;
  color: var(--accent);
}

.step-dock-controls {
  display: flex;
  align-items: center;
}
.view-toggle-btn {
  padding: 6px 12px;
  font-size: 0.76rem;
}

/* -------------------------------------------------------------
   MAIN CONTAINER & HERO
   ------------------------------------------------------------- */
main {
  position: relative;
  z-index: 10;
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 20px 100px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.hero-banner {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 5px 16px;
  border-radius: 30px;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  animation: floatBadge 4s ease-in-out infinite;
}
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.shimmer-headline {
  font-family: 'Caveat', cursive;
  font-size: 1.35em;
  position: relative;
  display: inline-block;
  background: linear-gradient(90deg, var(--accent-2) 0%, #fff6d9 45%, var(--accent) 55%, var(--accent-2) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 4.5s linear infinite;
  text-shadow: 0 0 25px var(--accent-glow);
}
@keyframes textShimmer {
  to { background-position: 200% center; }
}

.hero-banner h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.18;
  margin-bottom: 12px;
  font-weight: 700;
}
.hero-banner p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 300;
  line-height: 1.6;
}
.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}
.pulse-glow {
  animation: pulseGlow 2.5s infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); }
  50% { box-shadow: 0 8px 32px var(--accent-glow), 0 0 20px var(--accent); }
}

/* Stage Progress Tracker */
.hero-stage-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}
.stage-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  opacity: 0.6;
}
.stage-dot:hover {
  opacity: 0.9;
  transform: scale(1.15) translateY(-3px);
  border-color: var(--accent-2);
}
.stage-dot.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
  box-shadow: 0 4px 20px var(--accent-glow);
  opacity: 1;
  transform: scale(1.15);
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--accent-glow); transform: scale(1.15); }
  50% { box-shadow: 0 6px 28px var(--accent-glow), 0 0 16px var(--accent); transform: scale(1.22); }
}
.stage-dot.visited {
  opacity: 0.85;
  border-color: var(--accent);
  background: rgba(255, 215, 100, 0.1);
}

/* Keyboard shortcut hint */
.hero-keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}
kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}


/* -------------------------------------------------------------
   STEP VIEWS & PANORAMA MODE
   ------------------------------------------------------------- */
.step-view {
  display: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.step-view.active {
  display: flex;
  animation: stepReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes stepReveal {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body.panorama-mode .step-view {
  display: flex !important;
  opacity: 1 !important;
  transform: none !important;
  margin-bottom: 70px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 36px;
}
body.panorama-mode .step-view:first-of-type {
  border-top: none;
  padding-top: 0;
}

.step-header {
  text-align: center;
  margin-bottom: 22px;
  max-width: 600px;
}
.step-counter {
  font-size: 0.74rem;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}
.step-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.step-header p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.stage-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

/* -------------------------------------------------------------
   STAGE 1: 3D FOLDING CARD
   ------------------------------------------------------------- */
.card-experience-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1600px;
}

.card-instruction-tag {
  font-size: 0.84rem;
  color: var(--accent-2);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  background: var(--glass-bg);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  animation: bounceHint 2.4s infinite ease-in-out;
}
@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.card-stage {
  position: relative;
  width: min(92vw, 410px);
  height: 550px;
  transform-style: preserve-3d;
  transition: width 0.75s cubic-bezier(0.34, 1.25, 0.64, 1), transform 0.15s ease-out;
  cursor: pointer;
  outline: none;
}
.card-stage.is-open {
  width: min(94vw, 780px);
}

.card-container {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(0, 0, 0, 0.2);
}

/* Golden Ring Shockwave */
.card-burst-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}
.card-burst-ring.trigger {
  animation: ringExpand 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes ringExpand {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0.9; }
  80% { opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(45); opacity: 0; }
}

/* Base Inside Right Face */
.card-inside-right {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--card-bg-inside);
  border-radius: 24px;
  color: var(--text-dark);
  padding: 38px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.08);
  transition: width 0.7s cubic-bezier(0.34, 1.25, 0.64, 1);
}
.card-stage.is-open .card-inside-right {
  width: 50%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.card-inside-right::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.letter-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed var(--accent-primary);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.letter-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: inline-block;
  transition: transform 0.3s ease;
}
.stamp-animated {
  animation: stampImpact 0.6s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@keyframes stampImpact {
  0% { transform: scale(2.5) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.letter-stamp {
  font-size: 1.2rem;
  color: var(--accent-primary);
  animation: spinSlow 14s linear infinite;
}
@keyframes spinSlow {
  100% { transform: rotate(360deg); }
}

.letter-salutation {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease 0.3s;
}
.card-stage.is-open .letter-salutation {
  opacity: 1;
  transform: translateY(0);
}

.letter-body {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  line-height: 1.5;
  color: #3b2229;
  flex-grow: 1;
  padding: 6px 0;
  text-shadow: 0 0 1px rgba(0,0,0,0.05);
  position: relative;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.6s ease 0.45s;
}
.card-stage.is-open .letter-body {
  opacity: 1;
  transform: translateY(0);
}

.letter-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 14px;
  border-top: 1px dashed rgba(229, 140, 158, 0.4);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.5s ease 0.6s;
}
.card-stage.is-open .letter-footer {
  opacity: 1;
  transform: translateY(0);
}

.letter-signature-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}
.letter-signature {
  font-family: 'Caveat', cursive;
  font-size: 1.65rem;
  color: var(--ribbon-color);
  font-weight: 700;
}

.wax-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f25575, #9c1d35);
  box-shadow: 0 4px 14px rgba(156, 29, 53, 0.5), inset 0 2px 5px rgba(255,255,255,0.4);
  display: grid;
  place-items: center;
  color: #ffdae2;
  font-size: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.6, 0.64, 1);
}
.wax-seal:hover {
  transform: scale(1.16) rotate(10deg);
}

/* Folding Flap */
.card-flap {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 5;
}
.card-stage.is-open .card-flap {
  transform: rotateY(-180deg);
}

/* Front Cover Face */
.card-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--card-bg-front);
  border-radius: 24px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.floating-card-badge {
  position: absolute;
  z-index: 8;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  animation: floatBadgeSlow 3.8s ease-in-out infinite alternate;
  pointer-events: none;
}
.badge-b1 { top: 18px; left: 20px; animation-delay: 0s; }
.badge-b2 { top: 22px; right: 20px; animation-delay: 1.2s; }
.badge-b3 { bottom: 24px; left: 22px; animation-delay: 0.6s; }
@keyframes floatBadgeSlow {
  0% { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-7px) rotate(3deg); }
}

.card-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 48px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--ribbon-color) 0%, #ffa2b5 50%, var(--ribbon-color) 100%);
  box-shadow: 0 0 20px var(--ribbon-shadow), inset 0 0 8px rgba(255,255,255,0.4);
  z-index: 2;
}
.card-ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  height: 48px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, var(--ribbon-color) 0%, #ffa2b5 50%, var(--ribbon-color) 100%);
  box-shadow: 0 0 20px var(--ribbon-shadow), inset 0 0 8px rgba(255,255,255,0.4);
  z-index: 2;
}
.card-bow-center {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 35%, #ffe1e8, var(--ribbon-color));
  border-radius: 50%;
  box-shadow: 0 8px 28px var(--ribbon-shadow), inset 0 2px 8px rgba(255,255,255,0.8);
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #fff;
  animation: pulseBow 2.8s ease-in-out infinite;
}
@keyframes pulseBow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

.front-badge {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 6px 20px;
  border-radius: 30px;
  color: var(--text-dark);
  font-size: 0.78rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  margin-top: 14px;
}

.front-title-box {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 24px 26px;
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.95);
  margin-top: 110px;
  overflow: hidden;
}
.front-title-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 220, 140, 0.4), transparent);
  transform: skewX(-25deg);
  animation: foilShimmer 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes foilShimmer {
  0%, 70% { left: -150%; }
  100% { left: 180%; }
}
.front-title-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}
.front-title-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

.front-tap-prompt {
  position: relative;
  z-index: 5;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.9);
  padding: 9px 20px;
  border-radius: 25px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
  animation: pulseTap 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pulseTap {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Inside Left Face */
.card-inside-left {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  background: var(--card-bg-inside);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.04);
}
.card-stage.is-open .card-inside-left {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.polaroid-wrapper {
  perspective: 600px;
}
.polaroid-frame {
  background: #ffffff;
  padding: 10px 10px 16px 10px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.04);
  transform: rotate(-2.5deg);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.35s ease;
  cursor: pointer;
  position: relative;
}
.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}
.washi-tape-strip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 74px;
  height: 20px;
  background: rgba(255, 235, 180, 0.75);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border-left: 2px dashed rgba(200, 160, 80, 0.4);
  border-right: 2px dashed rgba(200, 160, 80, 0.4);
  z-index: 5;
  pointer-events: none;
}
.polaroid-photo {
  width: 100%;
  height: 205px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  display: block;
}
.polaroid-caption {
  font-family: 'Caveat', cursive;
  font-size: 1.35rem;
  text-align: center;
  margin-top: 8px;
  color: #4a2c35;
  font-weight: 700;
}

/* Stickers Zone */
.stickers-zone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
.draggable-sticker {
  position: absolute;
  font-size: 2.2rem;
  cursor: grab;
  user-select: none;
  pointer-events: auto;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
  transition: transform 0.18s cubic-bezier(0.34, 1.5, 0.64, 1);
  animation: stickerPop 0.4s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@keyframes stickerPop {
  0% { transform: scale(0) rotate(-20deg); }
  80% { transform: scale(1.25) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.draggable-sticker:active {
  cursor: grabbing;
  transform: scale(1.3) rotate(8deg);
}

.sticker-tray {
  background: rgba(229, 140, 158, 0.14);
  border: 1px dashed var(--accent-primary);
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 10px;
}
.sticker-tray-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sticker-options {
  display: flex;
  justify-content: space-around;
  font-size: 1.45rem;
}
.sticker-opt-btn {
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.6, 0.64, 1);
  user-select: none;
}
.sticker-opt-btn:hover {
  transform: scale(1.35) translateY(-4px);
}
.sticker-opt-btn:active {
  transform: scale(1.1);
}

/* -------------------------------------------------------------
   STAGE 2: 3D CELEBRATION CAKE & BLOWABLE CANDLES
   ------------------------------------------------------------- */
.celebration-cake-section {
  width: 100%;
  max-width: 720px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 38px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 15px 45px rgba(0,0,0,0.35), var(--glass-glow);
  position: relative;
}

.cake-stage {
  position: relative;
  width: 320px;
  height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
  perspective: 600px;
}

.cake-candle-bloom {
  position: absolute;
  top: 0;
  width: 280px;
  height: 120px;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 190, 60, 0.32) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 2;
}
.cake-stage.all-extinguished .cake-candle-bloom {
  opacity: 0;
}

.candles-row {
  position: absolute;
  top: 14px;
  display: flex;
  gap: 22px;
  z-index: 10;
}

.candle {
  position: relative;
  width: 14px;
  height: 60px;
  background: repeating-linear-gradient(
    45deg,
    #ffffff,
    #ffffff 6px,
    var(--accent-2) 6px,
    var(--accent-2) 12px
  );
  border-radius: 6px 6px 3px 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.candle:hover {
  transform: scale(1.12);
}
.candle-wick {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: #2b2b2b;
  transition: background 0.3s ease;
}
.candle.extinguished .candle-wick {
  background: #111;
}

.candle-flame {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 26px;
  background: radial-gradient(circle at 50% 80%, var(--candle-flame-1) 0%, var(--candle-flame-2) 35%, var(--candle-flame-3) 75%, transparent 100%);
  border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
  filter: drop-shadow(0 0 10px #ff9e2c) drop-shadow(0 0 20px #ff6e26);
  animation: flameMotion 1.1s infinite alternate ease-in-out;
  transform-origin: center bottom;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes flameMotion {
  0% { transform: translateX(-50%) rotate(-3deg) scale(1, 1); }
  30% { transform: translateX(-48%) rotate(2deg) scale(1.08, 0.94); }
  70% { transform: translateX(-53%) rotate(-2deg) scale(0.94, 1.06); }
  100% { transform: translateX(-50%) rotate(4deg) scale(1.04, 0.97); }
}

.candle.extinguished .candle-flame {
  opacity: 0;
  transform: translateX(-50%) scale(0);
  pointer-events: none;
}
.candle.extinguished .candle-wick::after {
  content: '';
  position: absolute;
  top: -16px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, rgba(180, 180, 180, 0.75) 0%, transparent 80%);
  border-radius: 50%;
  animation: smokeRise 1.4s forwards ease-out;
}
@keyframes smokeRise {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0.9; }
  50% { transform: translate(-65%, -20px) scale(1.6); opacity: 0.5; }
  100% { transform: translate(-40%, -45px) scale(2.8); opacity: 0; }
}

/* Cake Tiers */
.cake-tier {
  position: relative;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  transition: filter 0.4s ease;
}
.cake-stage.all-extinguished .cake-tier {
  filter: grayscale(0.18);
}
.tier-mini {
  width: 145px;
  height: 50px;
  background: linear-gradient(180deg, #ffffff 0%, #ffe4eb 100%);
  z-index: 4;
  border-top: 4px solid #ffffff;
  border-radius: 14px 14px 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  margin-bottom: -4px;
}
.tier-mini::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(90deg, #ff8ba7, #ff8ba7 12px, #ffe4eb 12px, #ffe4eb 24px);
  border-radius: 0 0 10px 10px;
}

.tier-top {
  width: 200px;
  height: 66px;
  background: linear-gradient(180deg, #fff0f3 0%, #ffd4de 100%);
  z-index: 3;
  border-top: 4px solid #ffffff;
}
.tier-top::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 14px;
  background: repeating-linear-gradient(90deg, #ff8ba7, #ff8ba7 16px, #ffd4de 16px, #ffd4de 32px);
  border-radius: 0 0 12px 12px;
}

.tier-bottom {
  width: 280px;
  height: 86px;
  background: linear-gradient(180deg, #ffc2d1 0%, #fb9fb6 100%);
  z-index: 2;
  border-top: 4px solid #ffffff;
}
.tier-bottom::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 18px;
  background: repeating-linear-gradient(90deg, #ffffff, #ffffff 20px, #ff8ba7 20px, #ff8ba7 40px);
  border-radius: 0 0 16px 16px;
}

.cake-plate {
  width: 330px;
  height: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #e2e2e2 50%, #afafaf 100%);
  border-radius: 50px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.cake-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.mic-detector-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 18px;
  padding: 14px 20px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}
.mic-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}
.mic-icon-pulse {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-2);
  display: grid;
  place-items: center;
  color: #1a0810;
  font-size: 0.9rem;
  animation: pulseMic 1.2s infinite;
}
@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 14px var(--accent-glow); }
}
.mic-meter-bar-wrap {
  flex-grow: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #facc15, #f87171);
  border-radius: 20px;
  transition: width 0.08s ease;
}
#mic-status-label {
  font-size: 0.78rem;
  color: var(--accent);
}

/* -------------------------------------------------------------
   STAGE 3: THE MEMORY VAULT & POLAROID WALL
   ------------------------------------------------------------- */
.memory-vault-section {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  width: 100%;
  margin-bottom: 24px;
}

.vault-card {
  height: 360px;
  perspective: 1000px;
  cursor: pointer;
}
.vault-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
  transform-style: preserve-3d;
}
.vault-card.flipped .vault-inner {
  transform: rotateY(180deg);
}

.vault-front, .vault-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  padding: 16px;
}
.vault-front {
  background: #ffffff;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(0deg);
  transition: box-shadow 0.3s ease;
}
.vault-card:hover .vault-front {
  box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 30px var(--accent-glow);
}
.vault-card:nth-child(2) .vault-front { transform: rotate(1.8deg); }
.vault-card:nth-child(3) .vault-front { transform: rotate(-2deg); }

.vault-img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 8px;
}
.vault-caption {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: #3a1922;
  font-weight: 700;
  margin-top: 6px;
}
.vault-hint {
  font-size: 0.72rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.vault-back {
  background: linear-gradient(135deg, #fffaf6 0%, #fbedef 100%);
  color: var(--text-dark);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 28px 24px;
  border: 1px dashed var(--accent-primary);
}
.vault-back h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--ribbon-color);
}
.vault-back p {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  line-height: 1.45;
  color: #4a2c35;
  flex-grow: 1;
}
.vault-date {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
}

.memory-vault-actions {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

/* -------------------------------------------------------------
   STAGE 4: 3D MYSTERY GIFT BOX UNBOXING
   ------------------------------------------------------------- */
.gift-unboxing-section {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px 30px;
  box-shadow: 0 15px 45px rgba(0,0,0,0.35), var(--glass-glow);
}

.gift-stage {
  width: 100%;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  margin: 10px 0 20px 0;
}
.gift-box-3d {
  position: relative;
  width: 120px;
  height: 120px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
  outline: none;
}
.gift-box-3d:hover {
  transform: scale(1.1) rotateY(18deg) rotateX(-5deg);
}
.gift-box-3d:not(.opened) {
  animation: giftFloat 3.5s ease-in-out infinite;
}
@keyframes giftFloat {
  0%, 100% { transform: translateY(0) rotateY(0deg); }
  30% { transform: translateY(-12px) rotateY(8deg); }
  60% { transform: translateY(-6px) rotateY(-5deg); }
  80% { transform: translateY(-14px) rotateY(3deg); }
}
.gift-box-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e63960, #a81c3b);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
}
.gift-box-body::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 22px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd700, #fff2a3, #ffd700);
}
.gift-box-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 22px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, #ffd700, #fff2a3, #ffd700);
}

.gift-box-lid {
  position: absolute;
  top: -12px;
  left: -8px;
  right: -8px;
  height: 32px;
  background: linear-gradient(135deg, #f0486f, #b82243);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.34, 1.5, 0.64, 1);
  z-index: 5;
}
.gift-box-lid::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 22px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #ffd700, #fff2a3, #ffd700);
}
.gift-bow-tie {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.gift-box-3d.opened .gift-box-lid {
  transform: translateY(-65px) rotateX(-55deg) rotateZ(18deg);
}

.gift-instruction-prompt {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.gift-voucher-card {
  display: none;
  background: linear-gradient(135deg, #fffcf2 0%, #fae6b9 100%);
  border-radius: 20px;
  padding: 24px 28px;
  color: #2b1f09;
  text-align: center;
  margin-top: 10px;
  width: 100%;
  box-shadow: 0 14px 40px rgba(0,0,0,0.4);
  animation: popIn 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.7) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.voucher-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #9c1d35;
  font-weight: 700;
  margin-bottom: 6px;
}
.gift-voucher-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  margin: 6px 0;
  color: #2b1722;
}
#gift-display-subtext {
  font-size: 0.84rem;
  color: #5c4722;
  margin-bottom: 12px;
}
.voucher-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.gift-voucher-code {
  display: inline-block;
  border: 1px dashed #b58d2a;
  padding: 8px 18px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 8px;
  font-size: 1.15rem;
  background: #ffffff;
  color: #a81c3b;
}

/* -------------------------------------------------------------
   STAGE 5: STARLIGHT WISHES & GUESTBOOK
   ------------------------------------------------------------- */
.guestbook-section {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.guestbook-composer {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wishes-wall {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wish-item {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px 22px;
  backdrop-filter: blur(14px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeInWish 0.5s ease-out;
}
@keyframes fadeInWish {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.wish-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.wish-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wish-author {
  font-weight: 700;
  font-size: 0.96rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wish-badge {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 12px;
  color: var(--accent);
}
.wish-content {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
  font-style: italic;
}
.wish-timestamp {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-top: 8px;
}

.export-banner {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}
.export-banner h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.export-banner p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.75);
}

/* -------------------------------------------------------------
   ENHANCED INTERACTIONS & MICRO-ANIMATIONS
   ------------------------------------------------------------- */
/* Shimmering border effect on active glass cards */
.celebration-cake-section,
.gift-unboxing-section {
  position: relative;
  overflow: hidden;
}
.celebration-cake-section::before,
.gift-unboxing-section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, var(--accent-glow) 60deg, transparent 120deg);
  animation: borderSpin 8s linear infinite;
  pointer-events: none;
  opacity: 0.4;
  z-index: -1;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}
@keyframes borderSpin {
  to { transform: rotate(360deg); }
}

/* Hover lift effect for memory vault cards */
.vault-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.vault-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Glowing progress dots for step tabs */
.step-tab.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.step-tab {
  position: relative;
}

/* Wish item staggered entry */
.wishes-wall .wish-item:nth-child(1) { animation-delay: 0.05s; }
.wishes-wall .wish-item:nth-child(2) { animation-delay: 0.12s; }
.wishes-wall .wish-item:nth-child(3) { animation-delay: 0.19s; }
.wishes-wall .wish-item:nth-child(4) { animation-delay: 0.26s; }

/* Premium shimmer on hero h1 */
h1 {
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-banner h1 {
  background: none;
  -webkit-text-fill-color: inherit;
  background-clip: unset;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* Focus ring for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------
   FLOATING AUDIO DOCK
   ------------------------------------------------------------- */
.floating-audio-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 7, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 40px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), var(--glass-glow);
  transition: transform 0.25s ease;
}
.floating-audio-dock:hover {
  transform: translateY(-2px);
}

.sound-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.wave-bar {
  width: 3px;
  height: 5px;
  background: var(--accent-2);
  border-radius: 4px;
  transition: height 0.1s ease;
}
.is-playing .wave-bar:nth-child(1) { animation: wave 0.8s infinite ease-in-out; }
.is-playing .wave-bar:nth-child(2) { animation: wave 1.1s infinite 0.2s ease-in-out; }
.is-playing .wave-bar:nth-child(3) { animation: wave 0.9s infinite 0.4s ease-in-out; }
.is-playing .wave-bar:nth-child(4) { animation: wave 1.2s infinite 0.1s ease-in-out; }

@keyframes wave {
  0%, 100% { height: 4px; }
  50% { height: 20px; }
}

.sound-fx-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 6px;
  transition: color 0.2s;
}
.sound-fx-toggle:hover {
  color: #fff;
}

/* -------------------------------------------------------------
   MODALS (AI WISH, CUSTOMIZER, SHARE)
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 3, 6, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: linear-gradient(145deg, rgba(38, 18, 27, 0.96), rgba(20, 9, 14, 0.98));
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  width: 100%;
  max-width: 530px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 0 45px var(--accent-glow);
  transform: scale(0.9) translateY(25px);
  transition: transform 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1) rotate(90deg);
}

.modal-header {
  margin-bottom: 22px;
}
.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  margin-bottom: 4px;
}
.modal-header p {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.75);
}

.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 14px var(--accent-glow);
}
.form-select option {
  background: #24111a;
  color: #fff;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.generated-wish-preview {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(229, 140, 158, 0.3);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 18px 0;
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  line-height: 1.5;
  color: #ffd6df;
  min-height: 75px;
  display: flex;
  align-items: center;
  position: relative;
}

/* Toast Pill */
.toast-pill {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-28px) scale(0.9);
  background: linear-gradient(135deg, rgba(22, 10, 16, 0.96), rgba(30, 14, 22, 0.98));
  border: 1px solid var(--accent-2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 30px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  padding: 11px 26px;
  border-radius: 32px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.38s cubic-bezier(0.34, 1.35, 0.64, 1);
  white-space: nowrap;
  max-width: 90vw;
}
.toast-pill.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* -------------------------------------------------------------
   ADMIN PANEL & PASSWORD LOCK ("1914@") STYLES
   ------------------------------------------------------------- */
.admin-badge-btn {
  border-color: rgba(255, 215, 122, 0.35);
  background: rgba(255, 215, 122, 0.08);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.admin-badge-btn:hover {
  border-color: var(--primary);
  background: rgba(255, 215, 122, 0.18);
  box-shadow: 0 0 15px var(--accent-glow);
}
.admin-badge-btn.admin-authenticated {
  border-color: var(--success, #9df2c4);
  background: rgba(157, 242, 196, 0.14);
  color: #9df2c4;
}

/* Auth Modal Specifics */
.modal-auth-card {
  max-width: 440px;
  text-align: center;
}
.admin-auth-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 215, 122, 0.12);
  border: 1px solid rgba(255, 215, 122, 0.35);
  display: inline-grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 12px;
  box-shadow: 0 0 25px var(--accent-glow);
}
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input-wrap .form-input {
  padding-right: 48px;
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.btn-pass-toggle {
  position: absolute;
  right: 6px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}
.btn-pass-toggle:hover {
  color: #fff;
}
.admin-auth-hint {
  margin-top: 16px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Shake Animation on Wrong Password */
.input-error {
  border-color: #ff6b81 !important;
  box-shadow: 0 0 16px rgba(255, 107, 129, 0.5) !important;
  animation: shakeKeypad 0.4s ease-in-out;
}
@keyframes shakeKeypad {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Admin Suite Modal */
.modal-admin-card {
  max-width: 680px;
  padding: 28px 32px;
}
.admin-suite-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 14px;
}
.admin-header-title h3 {
  font-size: 1.45rem;
  margin-bottom: 3px;
}
.admin-logout-btn {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-color: rgba(255, 107, 129, 0.4);
  color: #ff94a5;
  background: rgba(255, 107, 129, 0.08);
}
.admin-logout-btn:hover {
  background: rgba(255, 107, 129, 0.2);
  color: #fff;
}

/* Admin Tab Navigation */
.admin-tab-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}
.admin-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}
.admin-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.admin-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 122, 0.25), rgba(188, 116, 255, 0.2));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 14px var(--accent-glow);
}

.admin-tab-panel {
  display: none;
  animation: fadeInAdminTab 0.25s ease-out;
}
.admin-tab-panel.active {
  display: block;
}
@keyframes fadeInAdminTab {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-field-desc {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 12px;
}
.admin-theme-dropdown {
  padding: 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
}
.admin-theme-preview-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}
.theme-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.theme-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}
.admin-theme-preview-card p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.admin-cloud-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(157, 242, 196, 0.1);
  border: 1px solid rgba(157, 242, 196, 0.3);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  color: #fff;
  margin-bottom: 12px;
}

.admin-panel-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* -------------------------------------------------------------
   MOBILE CARD SWITCHER & QUICK PHOTO UPLOAD (Desktop defaults)
   ------------------------------------------------------------- */
.mobile-card-switcher {
  display: none;
}

.polaroid-quick-action {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
.photo-quick-btn {
  background: rgba(255, 215, 122, 0.12);
  border: 1px dashed rgba(255, 215, 122, 0.45);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.photo-quick-btn:hover, .photo-quick-btn:active {
  background: rgba(255, 215, 122, 0.25);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* -------------------------------------------------------------
   PHONE & MOBILE RESPONSIVE OPTIMIZATIONS (Max-Width: 768px)
   ------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Touch target smoothing */
  button, input, select, textarea, [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  header {
    padding: 8px 12px;
  }
  .brand-group {
    gap: 8px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }
  .brand-title {
    font-size: 1.05rem;
  }
  .brand-tag {
    font-size: 0.68rem;
  }
  .hide-mobile {
    display: none !important;
  }

  /* Compact Hero on Mobile */
  .hero-banner {
    padding: 24px 14px 16px;
  }
  .hero-banner h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    margin-bottom: 8px;
  }
  .hero-banner p {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-bottom: 0;
  }

  /* Mobile Card Page Switcher */
  .mobile-card-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 14px;
    max-width: 360px;
    width: 92vw;
  }
  .mobile-card-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
  }
  .mobile-card-tab.active {
    background: linear-gradient(135deg, rgba(255, 215, 122, 0.28), rgba(188, 116, 255, 0.22));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
  }

  /* 3D Card on Phone: Full access to Photo & Stickers + Letter */
  .card-stage {
    height: min(72vh, 490px);
    width: min(92vw, 360px);
    margin: 0 auto 16px;
  }
  .card-stage.is-open {
    width: min(92vw, 360px);
  }
  .card-stage.is-open .card-container {
    transform: none !important;
  }

  /* Prevent card-flap from swinging off-screen to the left on mobile */
  .card-stage.is-open .card-flap {
    transform: none !important;
    position: absolute;
    inset: 0;
    width: 100% !important;
  }

  /* When card is open on mobile: handle photo vs letter page view */
  .card-stage.is-open .card-inside-right {
    position: absolute;
    inset: 0;
    width: 100% !important;
    border-radius: 22px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .card-stage.is-open .card-inside-left {
    position: absolute;
    inset: 0;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 22px;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  /* Specific view modes via mobile switcher */
  .card-stage.mobile-view-photo.is-open .card-flap {
    display: block !important;
    z-index: 10;
  }
  .card-stage.mobile-view-photo.is-open .card-front {
    display: none !important;
  }
  .card-stage.mobile-view-photo.is-open .card-inside-left {
    display: flex !important;
    z-index: 12;
  }
  .card-stage.mobile-view-photo.is-open .card-inside-right {
    display: none !important;
  }

  .card-stage.mobile-view-letter.is-open .card-flap {
    display: none !important;
  }
  .card-stage.mobile-view-letter.is-open .card-inside-left {
    display: none !important;
  }
  .card-stage.mobile-view-letter.is-open .card-inside-right {
    display: flex !important;
    z-index: 12;
  }

  /* By default on open when neither class is explicitly set, show photo */
  .card-stage.is-open:not(.mobile-view-letter) .card-front {
    display: none !important;
  }
  .card-stage.is-open:not(.mobile-view-letter) .card-inside-left {
    display: flex !important;
    z-index: 12;
  }
  .card-stage.is-open:not(.mobile-view-letter) .card-inside-right {
    display: none !important;
  }

  /* Mobile polaroid sizing */
  .polaroid-photo {
    height: 155px;
  }
  .polaroid-caption {
    font-size: 1.15rem;
    margin-top: 4px;
  }
  .sticker-tray {
    padding: 8px 10px;
    margin-top: 6px;
  }

  .letter-salutation {
    font-size: 1.3rem;
  }
  .letter-body {
    font-size: 1.12rem;
    line-height: 1.5;
  }

  /* Cake & Candles Phone Scaling */
  .cake-stage {
    transform: scale(0.85);
    margin: 0 auto;
    width: 100%;
  }
  .candle {
    position: relative;
  }
  /* Enlarge touch area for fingers */
  .candle::after {
    content: '';
    position: absolute;
    inset: -14px -10px;
    z-index: 10;
  }
  .mic-indicator-box {
    width: min(92vw, 340px);
    margin: 12px auto;
  }

  /* Memory Vault on Mobile */
  .memory-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 340px;
    margin: 0 auto;
  }
  .vault-card {
    height: 380px;
  }

  /* Mystery Gift on Mobile */
  .gift-box-3d {
    width: 180px;
    height: 180px;
  }
  .gift-voucher-card {
    padding: 20px 16px;
    width: min(92vw, 350px);
  }
  .gift-voucher-code {
    font-size: 1.05rem;
    letter-spacing: 1.5px;
  }

  /* Stage Footers: Mobile thumb friendly */
  .stage-footer-actions {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
    margin: 16px auto 0;
    gap: 8px;
  }
  .stage-footer-actions .glass-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  /* Floating Audio Dock Mobile Placement */
  .floating-audio-dock {
    bottom: max(14px, env(safe-area-inset-bottom));
    right: 14px;
    padding: 6px 10px;
    gap: 6px;
  }
  .floating-audio-dock .glass-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  /* Modals on Phone */
  .modal-card {
    max-width: 95vw;
    padding: 22px 16px;
    border-radius: 20px;
    max-height: 88vh;
  }
  .modal-admin-card {
    padding: 20px 14px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* -------------------------------------------------------------
   PRINT MEDIA OPTIMIZATION (Keepsake)
   ------------------------------------------------------------- */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  header, .step-dock-wrap, .floating-audio-dock, .toast-pill, .modal-overlay, canvas, .stage-footer-actions, .cake-controls, .export-banner {
    display: none !important;
  }
  .card-stage {
    width: 100% !important;
    transform: none !important;
    box-shadow: none !important;
  }
  .card-inside-right {
    width: 100% !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    color: #111 !important;
  }
}
