/* ==========================================================================
   GLOUBI'S 33RD BIRTHDAY - BESPOKE FAIRY AUTUMN EDITORIAL DESIGN
   Mobile-First (Calibrated for iPhone 15 & modern viewports) • 100dvh • Scroll-Snap
   ========================================================================== */

:root {
  --bg-deep: #08130c;
  --bg-surface: rgba(14, 26, 18, 0.82);
  --bg-surface-elevated: rgba(22, 38, 27, 0.9);
  --bg-parchment: #fcf8ee;
  
  --amber-gold: #e59819;
  --amber-light: #fbe285;
  --copper: #c85a17;
  --terracotta: #a8421e;
  --emerald-moss: #2d6a4f;
  --emerald-light: #52b788;
  
  --text-main: #f9f6ee;
  --text-muted: #c9d1c8;
  --text-dim: #a9b7a8;
  --text-parchment: #292015;
  --text-parchment-muted: #6b5c47;
  
  --border-gold-subtle: rgba(229, 152, 25, 0.25);
  --border-gold-glow: rgba(251, 226, 133, 0.8);
  --border-organic: rgba(255, 255, 255, 0.1);
  
  --font-display: 'Fraunces', Georgia, serif;
  --font-accent: 'Italiana', serif;
  --font-script: 'Caveat', cursive;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: -webkit-fill-available;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(button, input, textarea, [role="radio"]):focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 3px;
}

body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere */
#forestCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
}

.ambient-aurora {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 15%, rgba(200, 90, 23, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(45, 106, 79, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(168, 66, 30, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, #060e09 0%, #101c13 50%, #060e09 100%);
  z-index: 0;
  pointer-events: none;
}

/* Subtle Organic Grain */
.ambient-grain {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 24px 24px;
  z-index: 2;
  pointer-events: none;
}

/* Minimal prologue */
.welcome-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(circle at 50% 58%, rgba(7, 22, 14, 0.08), rgba(4, 11, 7, 0.34));
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.65s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.welcome-gate[hidden] {
  display: none;
}

.welcome-gate.is-leaving {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
}

.welcome-gate-content {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.welcome-touch-hint {
  max-width: 290px;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 5vw, 1.45rem);
  font-style: italic;
  line-height: 1.35;
  color: #fff8df;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(251, 226, 133, 0.38);
  animation: welcomeWhisper 3.2s ease-in-out infinite;
}

.welcome-enter-btn {
  min-height: 52px;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(251, 226, 133, 0.6);
  border-radius: 999px;
  background: rgba(8, 19, 12, 0.72);
  color: var(--amber-light);
  font: 700 0.9rem/1 var(--font-body);
  letter-spacing: 0.15px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36), inset 0 0 22px rgba(229, 152, 25, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.welcome-enter-btn:active {
  transform: scale(0.96);
  background: rgba(35, 48, 25, 0.9);
}

@keyframes welcomeWhisper {
  0%, 100% { opacity: 0.68; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

body.welcome-active .app-header,
body.welcome-active .progress-line-track,
body.welcome-active .typeform-container,
body.welcome-active .bottom-deck-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Top App Bar */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(var(--safe-top) + 10px) 16px 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(6, 14, 9, 0.92) 0%, rgba(6, 14, 9, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-leaf {
  font-size: 1.1rem;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--amber-light);
}

.brand-tag {
  font-family: var(--font-script);
  font-size: 1.05rem;
  color: var(--amber-gold);
  transform: rotate(-3deg);
  margin-left: 2px;
}

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

.audio-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold-subtle);
  color: var(--amber-light);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.audio-btn:active {
  transform: scale(0.92);
}

.step-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber-light);
  background: rgba(14, 26, 18, 0.8);
  border: 1px solid var(--border-gold-subtle);
  padding: 4px 10px;
  border-radius: 20px;
}

/* Progress Line */
.progress-line-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 60;
}

.progress-line-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--copper), var(--amber-gold), var(--amber-light), var(--emerald-light));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Typeform Slider Main Engine
   ========================================================================== */
.typeform-container {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  z-index: 10;
}

.typeform-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--safe-top) + 54px) 14px calc(var(--safe-bottom) + 72px) 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}

.typeform-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 20;
}

.typeform-slide.slide-exit-up {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-30px) scale(0.98);
}

.typeform-slide.slide-exit-down {
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.98);
}

/* Editorial Storybook Card */
.editorial-card {
  width: 100%;
  max-width: 480px;
  margin: auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 20px;
  padding: 22px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(200, 90, 23, 0.15);
  position: relative;
}

/* Card Header Ornaments */
.editorial-header {
  margin-bottom: 16px;
  position: relative;
}

.story-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--amber-gold);
  margin-bottom: 6px;
}

.story-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.3px;
}

.story-title em {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--amber-light);
  font-weight: 400;
}

.story-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.story-script-note {
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--amber-light);
  display: block;
  margin-top: 4px;
}

/* ==========================================================================
   Slide 0: Hero & Live Sacred Ticker
   ========================================================================== */
.hero-emblem {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 8px;
  display: inline-block;
  animation: emblemFloat 3s ease-in-out infinite alternate;
}

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

.live-ticker-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.ticker-tile {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.ticker-digits {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--amber-light);
  display: block;
  line-height: 1.15;
}

.ticker-tile-seconds {
  position: relative;
  overflow: hidden;
  border-color: rgba(251, 226, 133, 0.3);
  background: rgba(0, 0, 0, 0.38);
  perspective: 320px;
}

.ticker-tile-seconds .ticker-digits {
  color: #f5e9bb;
  text-shadow: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.airport-char {
  display: inline-block;
  min-width: 0.62em;
  padding: 0.03em 0.02em;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.055) 49%, rgba(0,0,0,0.18) 50%);
  box-shadow: inset 0 -1px rgba(255,255,255,0.04);
  transform-origin: 50% 0;
  backface-visibility: hidden;
}

.airport-separator {
  min-width: 0.26em;
  padding: 0;
  background: none;
  box-shadow: none;
}

.airport-char.is-changing {
  animation: airportFlip 0.48s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes airportFlip {
  0% { opacity: 0.45; transform: rotateX(-82deg); }
  62% { opacity: 1; transform: rotateX(7deg); }
  100% { transform: rotateX(0); }
}

.ticker-caption {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
  display: block;
}

.cosmic-facts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}

.cosmic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cosmic-row strong {
  color: var(--amber-light);
}

/* ==========================================================================
   Slide 1: Secrets of August 28
   ========================================================================== */
.history-flow-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px 0;
}

.history-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.history-year-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--amber-light);
  background: rgba(200, 90, 23, 0.25);
  border: 1px solid var(--border-gold-subtle);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.history-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.history-desc strong {
  color: #fff;
}

/* ==========================================================================
   Inputs & Tags (Slide 2 & others)
   ========================================================================== */
.bespoke-input-box {
  margin: 14px 0;
}

.bespoke-textarea, .bespoke-input {
  width: 100%;
  background: rgba(5, 12, 7, 0.85);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  resize: none;
}

.bespoke-textarea:focus, .bespoke-input:focus {
  border-color: var(--amber-gold);
  background: rgba(7, 16, 10, 0.95);
  box-shadow: 0 0 14px rgba(229, 152, 25, 0.35);
}

.bespoke-textarea::placeholder, .bespoke-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

.privacy-note,
.ritual-whisper {
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.4;
  margin-top: 10px;
}

/* ==========================================================================
   Horizontal Swipe Carousel for Visuals (Slides 3, 4, 5) - iPhone 15 Perfect
   ========================================================================== */
.swipe-carousel-wrapper {
  margin: 12px 0 16px 0;
  position: relative;
}

.swipe-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 10px 2px;
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.swipe-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  flex: 0 0 calc(78% - 10px);
  max-width: 280px;
  scroll-snap-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-gold-subtle);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-card:focus-visible {
  border-color: #fff3b0;
}

.carousel-card.selected {
  border-color: var(--amber-light);
  box-shadow: 0 0 20px rgba(229, 152, 25, 0.5);
  transform: scale(1.02);
  background: rgba(229, 152, 25, 0.12);
}

.carousel-img-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
}

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

.card-select-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--amber-gold);
  color: #1a0f02;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel-card.selected .card-select-badge {
  display: block;
}

.carousel-meta {
  padding: 8px 10px;
  text-align: center;
}

.carousel-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.carousel-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
}

/* ==========================================================================
   Slide 5: Interactive Three.js Black Rabbit
   ========================================================================== */
.rabbit-experience {
  margin: 10px 0 15px;
}

.rabbit-stage {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border: 1px solid rgba(251, 226, 133, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 55%, rgba(82, 183, 136, 0.16), transparent 34%),
    radial-gradient(circle at 25% 20%, rgba(229, 152, 25, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(5, 15, 10, 0.88), rgba(10, 24, 15, 0.96));
  box-shadow: inset 0 0 45px rgba(0, 0, 0, 0.38);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.rabbit-stage:active {
  cursor: grabbing;
}

.rabbit-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.rabbit-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 22px;
  color: var(--text-muted);
  text-align: center;
  font: italic 0.84rem/1.4 var(--font-display);
}

.rabbit-loading::before {
  content: '◌';
  color: var(--amber-light);
  font-size: 1.8rem;
  animation: rabbitLoading 1.8s linear infinite;
}

.rabbit-loading.is-fallback::before {
  display: none;
}

.rabbit-fallback-icon {
  display: block;
  font-size: 3rem;
  filter: grayscale(1) brightness(0.4);
}

.rabbit-gesture-hint {
  margin: 6px 0 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  text-align: center;
}

.rabbit-fact-tabs {
  display: flex;
  gap: 6px;
  margin: 0 -4px 10px;
  padding: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rabbit-fact-tabs::-webkit-scrollbar {
  display: none;
}

.rabbit-fact-tab {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 8px 11px;
  scroll-snap-align: start;
  border: 1px solid rgba(251, 226, 133, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text-muted);
  font: 700 0.7rem/1 var(--font-body);
  cursor: pointer;
}

.rabbit-fact-tab.selected {
  border-color: rgba(251, 226, 133, 0.72);
  background: rgba(229, 152, 25, 0.14);
  color: var(--amber-light);
}

.rabbit-fact-panel {
  min-height: 150px;
  padding: 14px;
  border: 1px solid rgba(251, 226, 133, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
}

.rabbit-fact-panel.fact-enter {
  animation: rabbitFactEnter 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.rabbit-fact-number {
  display: block;
  margin-bottom: 3px;
  color: var(--amber-gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.rabbit-fact-panel h3 {
  color: #fff8df;
  font: 700 1rem/1.25 var(--font-display);
}

.rabbit-fact-panel p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

@keyframes rabbitLoading {
  to { transform: rotate(360deg); }
}

@keyframes rabbitFactEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 500px) {
  .rabbit-stage { height: 340px; }
  .rabbit-fact-panel { min-height: 130px; }
}

/* ==========================================================================
   Slide 6: Triptych Wishes (Today, Tomorrow, Sunday)
   ========================================================================== */
.wishes-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px 0;
}

.wish-row-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.wish-row-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   Slide 7: Store (Action 100%)
   ========================================================================== */
.store-list-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 14px 0;
}

.store-choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 56px;
}

.store-choice-row.selected {
  border-color: var(--amber-light);
  background: rgba(229, 152, 25, 0.18);
  box-shadow: 0 0 14px rgba(229, 152, 25, 0.35);
}

.store-key-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(229, 152, 25, 0.2);
  border: 1px solid var(--amber-gold);
  color: var(--amber-light);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-name-bold {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.store-subtitle-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.store-alert-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(45, 106, 79, 0.25);
  border: 1px solid var(--emerald-light);
  color: #d8f3dc;
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 12px;
  display: none;
}

.store-alert-bubble.visible {
  display: block;
  animation: bubblePop 0.25s ease;
}

@keyframes bubblePop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Slide 8: Cake Choices
   ========================================================================== */
.cake-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.cake-tile {
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid var(--border-gold-subtle);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 96px;
}

.cake-tile.selected {
  border-color: var(--amber-light);
  background: rgba(229, 152, 25, 0.2);
  box-shadow: 0 0 14px rgba(229, 152, 25, 0.4);
}

.cake-emoji-icon {
  font-size: 1.7rem;
  display: block;
  margin-bottom: 4px;
}

.cake-tile-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.cake-tile-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

/* ==========================================================================
   Slide 9: 33 Candles & Rituals
   ========================================================================== */
.ritual-block {
  margin: 10px 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 12px;
}

.ritual-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.energy-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  border-radius: 4px;
  background: transparent;
  outline: none;
}

.custom-range-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--emerald-light), var(--amber-gold), var(--copper), #ef4444);
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber-light);
  border: 2px solid #000;
  box-shadow: 0 0 8px rgba(251, 226, 133, 0.8);
  cursor: pointer;
  margin-top: -8px;
}

.energy-feedback {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.energy-percent-badge {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--amber-light);
}

.energy-text-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Superpower Grid */
.power-2x2-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.power-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 0.72rem;
  color: #fff;
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-chip.selected {
  background: rgba(229, 152, 25, 0.22);
  border-color: var(--amber-light);
  font-weight: 700;
}

/* 33 Candles Board */
.candles-cake-board {
  text-align: center;
}

.candles-nest-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 3px;
  background: radial-gradient(circle, rgba(200, 90, 23, 0.15) 0%, rgba(0, 0, 0, 0.4) 80%);
  border: 1px dashed var(--border-gold-subtle);
  border-radius: 12px;
  padding: 8px 6px;
  margin-bottom: 8px;
}

.fairy-candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 3px 5px;
  cursor: pointer;
  user-select: none;
  width: 20px;
  min-height: 40px;
  border-radius: 8px;
}

.fairy-candle:disabled {
  opacity: 1;
  cursor: default;
}

.flame-wrapper {
  position: relative;
  display: block;
  width: 12px;
  height: 15px;
  overflow: visible;
}

.candle-flame {
  position: absolute;
  left: 50%;
  bottom: 1px;
  display: block;
  width: 8px;
  height: 13px;
  background: radial-gradient(ellipse at 50% 75%, #fff 0 16%, #fff0a8 25%, #ffb32b 52%, #e94b12 76%, transparent 78%);
  border-radius: 62% 38% 58% 42% / 72% 68% 32% 28%;
  box-shadow: 0 0 5px rgba(255, 241, 170, 0.95), 0 0 10px rgba(239, 113, 21, 0.7);
  transform-origin: 50% 100%;
  animation: flameWiggle 0.9s infinite alternate ease-in-out;
}

.candle-flame::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 238, 0.92);
  transform: translateX(-50%);
}

@keyframes flameWiggle {
  0% { transform: translateX(-50%) scale(0.92, 1.02) rotate(-4deg); }
  50% { transform: translateX(-50%) scale(1.04, 0.96) rotate(2deg); }
  100% { transform: translateX(-50%) scale(0.97, 1.08) rotate(5deg); }
}

.candle-smoke {
  position: absolute;
  left: 50%;
  bottom: 2px;
  display: none;
  width: 3px;
  height: 8px;
  background: rgba(220, 220, 220, 0.7);
  border-radius: 50%;
  transform: translateX(-50%);
}

.candle-wick {
  display: block;
  width: 1.5px;
  height: 3px;
  background: #222;
}

.candle-stick {
  width: 5px;
  height: 12px;
  background: linear-gradient(180deg, var(--amber-light), var(--copper));
  border-radius: 2px;
}

.fairy-candle.extinguished .candle-flame {
  display: none;
}

.fairy-candle.extinguished .candle-smoke {
  display: block;
  animation: smokeRise 0.8s ease-out forwards;
}

.fairy-candle.extinguished .candle-stick {
  opacity: 0.4;
  filter: grayscale(0.8);
}

@keyframes smokeRise {
  0% { transform: translateX(-50%) translateY(0) scale(1); opacity: 0.7; }
  100% { transform: translateX(-50%) translateY(-10px) scale(2); opacity: 0; }
}

.candles-counter-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.candles-counter-label.celebrate-text {
  color: var(--amber-light);
  font-weight: 700;
}

/* ==========================================
   Buttons & Navigation
   ========================================== */
.btn-gold-action {
  background: linear-gradient(135deg, var(--amber-gold) 0%, var(--copper) 100%);
  color: #160d03;
  border: none;
  border-radius: 28px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(200, 90, 23, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}

.btn-gold-action:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(200, 90, 23, 0.5);
}

.btn-outline-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold-subtle);
  color: var(--amber-light);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-outline-subtle:active {
  background: rgba(229, 152, 25, 0.2);
}

.btn-outline-subtle:disabled {
  opacity: 0.72;
  cursor: default;
}

/* Bottom Bar */
.bottom-deck-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 8px 16px calc(var(--safe-bottom) + 8px) 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(0deg, rgba(6, 14, 9, 0.95) 0%, rgba(6, 14, 9, 0) 100%);
  pointer-events: none;
}

.nav-circle-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 26, 18, 0.9);
  border: 1.5px solid var(--border-gold-subtle);
  color: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.nav-circle-btn:active {
  transform: scale(0.92);
}

.nav-circle-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.deck-swipe-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  max-width: 230px;
  text-align: center;
}

/* ==========================================================================
   Slide 10: Gazette Royal Certificate
   ========================================================================== */
.gazette-parchment {
  background: linear-gradient(135deg, rgba(18, 30, 22, 0.95) 0%, rgba(24, 16, 9, 0.95) 100%);
  border: 2px solid var(--amber-gold);
  border-radius: 16px;
  padding: 16px 14px;
  color: #fff;
  margin-bottom: 14px;
}

.gazette-header {
  text-align: center;
  margin-bottom: 12px;
}

.gazette-seal {
  display: inline-block;
  background: var(--amber-gold);
  color: #1a0f02;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 4px;
}

.gazette-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--amber-light);
}

.gazette-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.gazette-divider {
  color: var(--amber-gold);
  font-size: 0.8rem;
  letter-spacing: 3px;
  margin-top: 2px;
}

.gazette-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

.stat-value {
  font-size: 0.82rem;
  color: var(--amber-light);
}

.gazette-section {
  margin: 10px 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid var(--border-gold-subtle);
}

.gazette-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-gold);
  margin-bottom: 4px;
}

.gazette-quote {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--amber-light);
  line-height: 1.35;
}

.gazette-trio-visuals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.visual-item {
  text-align: center;
}

.visual-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--amber-gold);
  margin-bottom: 2px;
}

.visual-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rabbit-recap-sigil {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 52%, rgba(251, 226, 133, 0.2), transparent 45%), linear-gradient(145deg, #173324, #0a0e0c);
}

.rabbit-recap-sigil span {
  font-size: clamp(2.1rem, 11vw, 3.2rem);
  filter: grayscale(1) brightness(0.34) contrast(1.4) drop-shadow(0 0 8px rgba(251, 226, 133, 0.4));
  transform: scaleX(-1);
}

.visual-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
}

.visual-item strong {
  font-size: 0.74rem;
  color: #fff;
  display: block;
  line-height: 1.15;
}

.wish-row {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.wish-day {
  color: var(--amber-light);
  font-weight: 700;
}

.wish-val {
  color: #fff;
}

.gazette-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.gazette-mini-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold-subtle);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
}

.gift-card-wide {
  grid-column: 1 / -1;
  padding: 10px;
}

.mini-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

.mini-val {
  font-size: 0.78rem;
  color: #fff;
  display: block;
  margin-top: 2px;
}

.mini-val.highlight-action {
  color: var(--amber-light);
}

.mini-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

.gazette-footer {
  text-align: center;
  margin-top: 10px;
  border-top: 1px dashed var(--border-gold-subtle);
  padding-top: 8px;
}

.footer-candles {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--amber-light);
}

.footer-sign {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.gazette-export-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Final mystery gift */
.final-gift {
  position: relative;
  overflow: hidden;
  margin: 16px 0;
  padding: 22px 16px 18px;
  border: 1px solid rgba(251, 226, 133, 0.4);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 22%, rgba(229, 152, 25, 0.15), transparent 36%),
    linear-gradient(145deg, rgba(10, 28, 17, 0.96), rgba(31, 17, 8, 0.96));
  text-align: center;
  box-shadow: inset 0 0 35px rgba(229, 152, 25, 0.06), 0 12px 32px rgba(0, 0, 0, 0.32);
}

.final-gift::before {
  content: '✦  ·  ✧  ·  ✦';
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  color: rgba(251, 226, 133, 0.24);
  letter-spacing: 9px;
  font-size: 0.65rem;
}

.final-gift-eyebrow {
  justify-content: center;
  margin-top: 6px;
}

.final-gift h3 {
  font: 700 1.2rem/1.25 var(--font-display);
  color: #fff8df;
}

.final-gift > p {
  max-width: 340px;
  margin: 5px auto 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.mystery-gift-btn {
  --gift-open-progress: 0;
  position: relative;
  width: 142px;
  height: 136px;
  margin: 15px auto 4px;
  display: block;
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.4));
}

.mystery-gift-btn:disabled {
  opacity: 1;
  cursor: default;
}

.gift-box,
.gift-lid,
.gift-ribbon-vertical,
.gift-ribbon-horizontal,
.gift-bow {
  position: absolute;
  display: block;
  pointer-events: none;
}

.gift-box {
  left: 17px;
  bottom: 10px;
  width: 108px;
  height: 82px;
  border: 1px solid rgba(251, 226, 133, 0.58);
  border-radius: 5px 5px 13px 13px;
  background:
    linear-gradient(135deg, transparent 44%, rgba(255, 255, 255, 0.08) 45%, transparent 48%),
    linear-gradient(145deg, #7f2517, #bb4c21 58%, #6f1d16);
  box-shadow: inset 0 0 18px rgba(255, 215, 120, 0.12);
}

.gift-lid {
  z-index: 4;
  left: 10px;
  top: 37px;
  width: 122px;
  height: 29px;
  border: 1px solid rgba(251, 226, 133, 0.7);
  border-radius: 7px;
  background: linear-gradient(145deg, #c85a17, #8d2f18);
  transform: translateY(calc(var(--gift-open-progress) * -5px)) rotate(calc(var(--gift-open-progress) * -2deg));
  transform-origin: left bottom;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gift-ribbon-vertical {
  z-index: 5;
  left: 61px;
  top: 37px;
  width: 20px;
  height: 91px;
  background: linear-gradient(90deg, #b77a16, #fbe285 50%, #b77a16);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 55% 91%, 0 100%);
  transition: opacity 0.25s ease;
}

.gift-ribbon-horizontal {
  z-index: 3;
  left: 17px;
  top: 80px;
  width: 108px;
  height: 17px;
  background: linear-gradient(#fbe285, #b77a16);
}

.gift-bow {
  z-index: 6;
  top: 4px;
  left: 46px;
  width: 50px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 58% 42% 55% 45%;
  background: radial-gradient(circle, #fff2b2, #d69b2d 45%, #8c5a0b 70%);
  color: #6c3b08;
  font-size: 1rem;
  transform: rotate(calc(var(--gift-open-progress) * 14deg));
  transition: transform 0.3s ease;
}

.mystery-gift-btn.gift-tap {
  animation: giftKnock 0.42s ease;
}

.mystery-gift-btn.is-open .gift-lid,
.mystery-gift-btn.is-open .gift-bow {
  transform: translate(-26px, -40px) rotate(-18deg);
}

.mystery-gift-btn.is-open .gift-ribbon-vertical,
.mystery-gift-btn.is-open .gift-ribbon-horizontal {
  opacity: 0;
}

.mystery-gift-btn.is-open::after {
  content: '✦  ✧  ✦';
  position: absolute;
  inset: 35px 0 auto;
  color: #fff4af;
  text-shadow: 0 0 10px #f6bd45;
  animation: giftMagic 1.5s ease-out both;
}

.gift-progress {
  min-height: 20px;
  color: var(--amber-light);
  font-size: 0.74rem;
}

.gift-reveal {
  margin-top: 16px;
  padding: 15px 13px;
  border: 1px solid rgba(251, 226, 133, 0.26);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  animation: revealLetter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gift-reveal[hidden] {
  display: none;
}

.gift-reveal-kicker {
  display: block;
  color: var(--amber-gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.gift-riddle {
  margin: 9px auto;
  max-width: 380px;
  color: #fff8df;
  font: italic 0.9rem/1.55 var(--font-display);
}

.riddle-answer {
  margin: 9px auto 14px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.riddle-answer summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--amber-light);
}

.gift-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(4, 10, 6, 0.72);
}

.gift-code-row code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: #fff4af;
  font: 700 0.82rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.6px;
}

.copy-code-btn {
  min-width: 74px;
  min-height: 44px;
  border: 1px solid rgba(251, 226, 133, 0.55);
  border-radius: 9px;
  background: rgba(229, 152, 25, 0.14);
  color: var(--amber-light);
  font: 700 0.75rem/1 var(--font-body);
  cursor: pointer;
}

.copy-code-status {
  min-height: 18px;
  margin-top: 6px;
  color: var(--emerald-light);
  font-size: 0.7rem;
}

@keyframes giftKnock {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-3deg) scale(1.04); }
  55% { transform: rotate(3deg) scale(0.98); }
  78% { transform: rotate(-1deg) scale(1.02); }
}

@keyframes giftMagic {
  0% { opacity: 0; transform: translateY(24px) scale(0.6); }
  45% { opacity: 1; }
  100% { opacity: 0.35; transform: translateY(-35px) scale(1.35); }
}

@keyframes revealLetter {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 390px) {
  .deck-swipe-hint {
    max-width: 190px;
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #forestCanvas,
  #confettiCanvas {
    display: none !important;
  }
}

/* ==========================================================================
   PRINT / PDF EXPORT STYLESHEET
   ========================================================================== */
@media print {
  body, html {
    background: #ffffff !important;
    color: #1a1a1a !important;
    overflow: visible !important;
    height: auto !important;
  }

  #forestCanvas, .ambient-aurora, .ambient-grain, .welcome-gate, .app-header, .progress-line-track, .bottom-deck-bar, .gazette-export-stack, .final-gift {
    display: none !important;
  }

  .typeform-container {
    height: auto !important;
    overflow: visible !important;
  }

  .typeform-slide {
    display: none !important;
  }

  .typeform-slide#slide10 {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .editorial-card {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .gazette-parchment {
    background: #fdfbf7 !important;
    border: 2.5px solid #a8421e !important;
    color: #292015 !important;
    box-shadow: none !important;
    padding: 20px !important;
  }

  .gazette-title {
    color: #a8421e !important;
  }

  .gazette-quote {
    color: #6b3417 !important;
  }

  .stat-box, .gazette-section, .gazette-mini-card {
    background: rgba(229, 152, 25, 0.08) !important;
    border: 1px solid #c85a17 !important;
    color: #292015 !important;
  }

  .stat-value, .wish-day, .footer-candles {
    color: #a8421e !important;
  }

  .visual-img-wrap {
    border-color: #a8421e !important;
  }

  .visual-item strong, .mini-val, .wish-val {
    color: #292015 !important;
  }
}
