/* ChristmasQuiz - Festive Vintage Game Show */

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

:root {
  /* Rich, theatrical palette */
  --velvet: #4A1C2A;
  --burgundy: #722F37;
  --wine: #8B3A3A;
  --brass: #C9A227;
  --gold: #E8C547;
  --gold-light: #F5DEB3;
  --cream: #FFF8E7;
  --ivory: #FFFEF5;
  --evergreen: #1B4332;
  --holly: #2D5A3D;
  --cranberry: #9B2335;
  --shadow: rgba(0, 0, 0, 0.4);
  --glow: rgba(201, 162, 39, 0.3);
  --snow: rgba(255, 255, 255, 0.9);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Layered theatrical background */
  background:
    /* Spotlight effect from top */
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(139, 58, 58, 0.4) 0%, transparent 70%),
    /* Warm glow from center */
    radial-gradient(ellipse 100% 100% at 50% 50%, var(--burgundy) 0%, var(--velvet) 100%);
  background-attachment: fixed;

  position: relative;
}

/* Subtle velvet texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* Floating sparkle particles */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, var(--gold) 50%, transparent 100%),
    radial-gradient(2px 2px at 40% 70%, var(--brass) 50%, transparent 100%),
    radial-gradient(1px 1px at 90% 20%, var(--gold-light) 50%, transparent 100%),
    radial-gradient(2px 2px at 70% 80%, var(--gold) 50%, transparent 100%),
    radial-gradient(1px 1px at 10% 90%, var(--brass) 50%, transparent 100%),
    radial-gradient(2px 2px at 60% 10%, var(--gold-light) 50%, transparent 100%),
    radial-gradient(3px 3px at 80% 50%, var(--gold) 50%, transparent 100%),
    radial-gradient(2px 2px at 30% 85%, var(--brass) 50%, transparent 100%);
  background-size: 200px 200px;
  animation: sparkle 8s ease-in-out infinite;
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(-10px); }
}

/* Snowfall overlay */
.snowfall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  color: var(--snow);
  font-size: 1rem;
  animation: fall linear infinite;
  opacity: 0.8;
  text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.6; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* Mode-specific visibility */
body[data-mode="contestant"] .presenter-only { display: none !important; }
body[data-mode="presenter"] .contestant-only { display: none !important; }

/* Header - Elegant brass bar with ribbon */
#quiz-header {
  background: linear-gradient(180deg,
    rgba(0,0,0,0.4) 0%,
    rgba(0,0,0,0.2) 100%);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, transparent, var(--gold), var(--brass), var(--gold), transparent) 1;
  position: relative;
  z-index: 100;
}

/* Decorative holly corners on header */
#quiz-header::before,
#quiz-header::after {
  content: '🎄';
  position: absolute;
  font-size: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  animation: gentlePulse 3s ease-in-out infinite;
}

#quiz-header::before { left: 0.5rem; }
#quiz-header::after { right: 0.5rem; content: '🎄'; }

@keyframes gentlePulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.1); }
}

#section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px var(--glow);
}

#slide-counter {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--gold-light);
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

#mode-indicator {
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--brass) 0%, var(--gold) 50%, var(--brass) 100%);
  background-size: 200% 200%;
  color: var(--velvet);
  border: 2px solid var(--gold-light);
  border-radius: 2rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow:
    0 2px 10px var(--glow),
    inset 0 1px 0 rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  animation: shimmerBadge 4s ease-in-out infinite;
}

@keyframes shimmerBadge {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

#mode-indicator:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 25px var(--glow);
}

body[data-mode="presenter"] #mode-indicator {
  cursor: default;
  background: linear-gradient(135deg, var(--holly) 0%, var(--evergreen) 100%);
  border-color: var(--holly);
  color: var(--cream);
}

body[data-mode="presenter"] #mode-indicator:hover {
  transform: none;
}

/* Main slide area */
#slide-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

#slide-content {
  max-width: 900px;
  width: 100%;
  animation: fadeSlideIn 0.5s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Festive Card Container */
.question-card {
  background: linear-gradient(135deg, rgba(74,28,42,0.9) 0%, rgba(114,47,55,0.85) 100%);
  border: 2px solid var(--brass);
  border-radius: 1rem;
  padding: 2.5rem;
  position: relative;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 0 60px -20px var(--glow);
}

/* Decorative ribbon corners */
.question-card::before,
.question-card::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid var(--gold);
}

.question-card::before {
  top: -3px;
  left: -3px;
  border-right: none;
  border-bottom: none;
  border-radius: 1rem 0 0 0;
}

.question-card::after {
  bottom: -3px;
  right: -3px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 1rem 0;
}

/* Question styling */
.question-text {
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--ivory);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  font-weight: 400;
}

.question-number {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.question-number::before,
.question-number::after {
  content: '✦';
  font-size: 0.8rem;
  animation: twinkle 2s ease-in-out infinite;
}

.question-number::after {
  animation-delay: 1s;
}

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

/* Answer styling - Box appears fast, text reveals gradually */
.answer-reveal {
  background: linear-gradient(135deg, var(--brass) 0%, var(--gold) 50%, var(--brass) 100%);
  background-size: 200% 200%;
  color: var(--velvet);
  padding: 1.5rem 2.5rem;
  border-radius: 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin-top: 2rem;
  box-shadow:
    0 4px 30px var(--glow),
    inset 0 2px 0 rgba(255,255,255,0.4),
    0 0 0 4px rgba(201,162,39,0.2);
  animation: boxAppear 0.8s ease-out forwards, shimmer 3s ease-in-out infinite;
  animation-delay: 0s, 0.8s;
  position: relative;
  overflow: hidden;
}

/* Text inside answer box fades in slower */
.answer-reveal .answer-text {
  animation: textReveal 7s ease-out forwards;
}

/* Scanning line effect during reveal */
.answer-reveal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.5) 50%,
    transparent 100%
  );
  animation: scanLine 1.75s ease-in-out 4;
}

/* Decorative stars on answer */
.answer-reveal::after {
  content: '★';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--velvet);
  opacity: 0.3;
  animation: starSpin 4s linear infinite;
}

@keyframes starSpin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes scanLine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Box appears quickly */
@keyframes boxAppear {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Text reveals gradually with snow-in effect */
@keyframes textReveal {
  0% {
    opacity: 0;
    filter: blur(15px);
    transform: translateY(-5px);
  }
  30% {
    opacity: 0.3;
    filter: blur(10px);
  }
  60% {
    opacity: 0.6;
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Elf sheet image */
.elf-sheet {
  max-width: 100%;
  max-height: 55vh;
  border-radius: 0.75rem;
  border: 4px solid var(--brass);
  box-shadow:
    0 8px 40px rgba(0,0,0,0.5),
    0 0 0 1px rgba(201, 162, 39, 0.3),
    0 0 60px -10px var(--glow);
}

.elf-number-prompt {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-top: 1.5rem;
  color: var(--gold);
  font-style: italic;
}

/* Audio/Video player */
.media-container {
  margin: 1.5rem 0;
}

audio {
  width: 100%;
  max-width: 400px;
  height: 48px;
  border-radius: 2rem;
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--brass);
}

audio::-webkit-media-controls-panel {
  background: linear-gradient(135deg, rgba(74,28,42,0.9), rgba(114,47,55,0.9));
}

video {
  width: 100%;
  max-height: 55vh;
  border-radius: 0.75rem;
  border: 3px solid var(--brass);
  background: #000;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.5),
    0 0 40px -10px var(--glow);
}

/* Elf answer layout with movie info */
.elf-answer-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.elf-video-section {
  flex: 2;
  min-width: 300px;
}

/* Movie info card */
.movie-info-card {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  background: linear-gradient(135deg, rgba(74,28,42,0.9) 0%, rgba(45,90,61,0.85) 100%);
  border: 2px solid var(--brass);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: left;
  animation: cardFadeIn 1.5s ease-out forwards;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.movie-poster {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 0.5rem;
  border: 2px solid var(--brass);
  margin: 0 auto 1rem;
  display: block;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  animation: posterFadeIn 1s ease-out 0.5s both;
}

@keyframes posterFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardFadeIn {
  0% {
    opacity: 0;
    transform: translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.movie-info-card h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(201,162,39,0.3);
  padding-bottom: 0.75rem;
}

.movie-info-card .movie-detail {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--cream);
}

.movie-info-card .movie-detail .label {
  font-weight: 600;
  color: var(--gold-light);
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.movie-info-card .movie-detail .value {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Movie source title - bigger and bolder */
.movie-source {
  font-family: var(--font-display);
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: var(--gold) !important;
  margin-top: 1rem !important;
  text-shadow: 0 2px 15px var(--glow);
  animation: sourceReveal 1s ease-out 0.5s both;
}

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

.audio-prompt {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.audio-number {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow:
    0 0 60px var(--glow),
    0 4px 20px rgba(0,0,0,0.4),
    0 0 120px var(--gold);
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: numberGlow 3s ease-in-out infinite;
}

@keyframes numberGlow {
  0%, 100% { text-shadow: 0 0 40px var(--glow), 0 4px 20px rgba(0,0,0,0.4); }
  50% { text-shadow: 0 0 80px var(--glow), 0 4px 20px rgba(0,0,0,0.4), 0 0 120px var(--gold); }
}

/* Answer details for carols */
.carol-answer {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.carol-answer .title {
  font-size: 1.6rem;
  font-weight: 700;
}

.carol-answer .artist {
  font-size: 1.3rem;
  font-weight: 400;
}

.carol-answer .year {
  font-size: 1rem;
  opacity: 0.7;
}

/* Navigation controls - Festive buttons */
#nav-controls {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 100;
}

#nav-controls button {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  background: linear-gradient(180deg, var(--wine) 0%, var(--burgundy) 100%);
  color: var(--gold);
  border: 3px solid var(--brass);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 2px 0 rgba(255,255,255,0.15),
    0 0 0 4px rgba(201,162,39,0.1);
  position: relative;
}

/* Button decorative ring */
#nav-controls button::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px dashed rgba(201,162,39,0.3);
  border-radius: 50%;
  animation: spinRing 20s linear infinite;
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#nav-controls button:hover {
  background: linear-gradient(180deg, var(--burgundy) 0%, var(--velvet) 100%);
  border-color: var(--gold);
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 8px 30px rgba(0,0,0,0.5),
    0 0 30px var(--glow),
    inset 0 2px 0 rgba(255,255,255,0.2);
}

#nav-controls button:active {
  transform: translateY(0) scale(1);
}

#replay-btn {
  background: linear-gradient(135deg, var(--brass) 0%, var(--gold) 100%);
  color: var(--velvet);
  border-color: var(--gold-light);
}

#replay-btn:hover {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
}

/* Section navigation (shared styles) */
#section-nav, #presenter-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  border-top: 2px solid;
  border-image: linear-gradient(90deg, transparent, var(--brass), transparent) 1;
  position: relative;
  z-index: 100;
}

#section-nav button, #presenter-nav button {
  font-family: var(--font-display);
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
  background: rgba(74,28,42,0.6);
  color: var(--gold-light);
  border: 2px solid rgba(201, 162, 39, 0.4);
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

/* Shimmer effect on buttons */
#section-nav button::before, #presenter-nav button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

#section-nav button:hover::before, #presenter-nav button:hover::before {
  left: 100%;
}

#section-nav button.active, #presenter-nav button.active {
  background: linear-gradient(135deg, var(--brass) 0%, var(--gold) 100%);
  color: var(--velvet);
  border-color: var(--gold);
  font-weight: 600;
  box-shadow: 0 2px 20px var(--glow);
  transform: scale(1.05);
}

#section-nav button:hover:not(.active), #presenter-nav button:hover:not(.active) {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 162, 39, 0.2);
  transform: translateY(-2px);
}

/* Presenter nav specifics */
.nav-divider {
  color: var(--brass);
  font-size: 1.5rem;
  margin: 0 0.5rem;
  opacity: 0.5;
}

.answers-btn {
  background: linear-gradient(135deg, rgba(155,35,53,0.4), rgba(139,58,58,0.4)) !important;
  border-color: var(--cranberry) !important;
}

.answers-btn.active {
  background: linear-gradient(135deg, var(--cranberry) 0%, var(--wine) 100%) !important;
  border-color: var(--cranberry) !important;
  color: var(--cream) !important;
}

/* Password modal */
#password-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(74,28,42,0.98), rgba(30,10,15,0.99));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  z-index: 1000;
  animation: modalFadeIn 0.4s ease-out;
}

#modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  font-size: 2rem;
  background: rgba(74,28,42,0.8);
  color: var(--gold-light);
  border: 2px solid rgba(201, 162, 39, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#modal-close:hover {
  background: rgba(201, 162, 39, 0.3);
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#password-modal.hidden {
  display: none;
}

#password-modal h2 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-shadow: 0 0 40px var(--glow);
}

#password-modal input {
  font-family: var(--font-body);
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
  border: 3px solid var(--brass);
  border-radius: 0.75rem;
  width: 300px;
  text-align: center;
  background: rgba(0,0,0,0.4);
  color: var(--cream);
  transition: all 0.3s ease;
}

#password-modal input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--glow);
}

#password-modal input::placeholder {
  color: rgba(255,248,231,0.5);
}

#password-modal #modal-unlock {
  font-family: var(--font-display);
  padding: 1rem 3rem;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--brass) 0%, var(--gold) 100%);
  color: var(--velvet);
  border: 2px solid var(--gold-light);
  border-radius: 2rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--glow);
}

#password-modal #modal-unlock:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--glow);
}

#password-modal .error {
  color: #ff8a8a;
  font-size: 0.95rem;
  text-shadow: 0 0 10px rgba(255,100,100,0.5);
}

/* Title slide - Grand entrance */
.title-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: titleReveal 1.2s ease-out;
}

@keyframes titleReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateX(20deg);
    filter: blur(15px);
  }
  50% {
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(0);
    filter: blur(0);
  }
}

.title-slide h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--gold);
  text-shadow:
    0 0 80px var(--glow),
    0 4px 20px rgba(0,0,0,0.5),
    0 0 200px var(--gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  animation: titlePulse 4s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 60px var(--glow), 0 4px 20px rgba(0,0,0,0.5); }
  50% { text-shadow: 0 0 100px var(--glow), 0 4px 20px rgba(0,0,0,0.5), 0 0 200px var(--gold); }
}

.title-slide .subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--cream);
  opacity: 0.9;
  font-style: italic;
  animation: subtitleFade 1s ease-out 0.4s both;
}

@keyframes subtitleFade {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 0.9; transform: translateY(0); }
}

.title-slide .instructions {
  font-family: var(--font-body);
  font-size: 1rem;
  margin-top: 2rem;
  color: var(--gold-light);
  opacity: 0.7;
  animation: subtitleFade 1s ease-out 0.7s both;
}

/* Decorative ornaments on title */
.title-slide::before {
  content: '❄ ❅ ❆';
  font-size: 2rem;
  letter-spacing: 1rem;
  animation: ornamentDance 5s ease-in-out infinite;
  margin-bottom: 1rem;
}

@keyframes ornamentDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(5deg); }
  75% { transform: translateY(5px) rotate(-5deg); }
}

/* Section title slide */
.section-title-slide h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--gold);
  text-shadow: 0 0 50px var(--glow);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-title-slide .points {
  font-family: var(--font-body);
  font-size: 1.2rem;
  margin-top: 1rem;
  color: var(--cream);
  opacity: 0.85;
}

/* Loading state */
.loading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Keyboard hints */
.keyboard-hints {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--gold-light);
  opacity: 0.5;
}

.keyboard-hints kbd {
  font-family: var(--font-body);
  background: rgba(201, 162, 39, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: 0.3rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  margin: 0 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #quiz-header {
    padding: 0.75rem 1rem;
  }

  #quiz-header::before,
  #quiz-header::after {
    display: none;
  }

  #section-title {
    font-size: 1.1rem;
  }

  #slide-container {
    padding: 1.5rem 1rem;
  }

  #nav-controls button {
    width: 56px;
    height: 56px;
  }

  #nav-controls button::before {
    display: none;
  }

  .keyboard-hints {
    display: none;
  }

  .audio-number {
    font-size: 4rem;
  }
}

/* Print styles for answer sheet */
@media print {
  body {
    background: white;
    color: black;
  }

  body::before, body::after {
    display: none;
  }

  #nav-controls, #section-nav, #quiz-header {
    display: none;
  }
}
