/**
 * Ms. Luminara Quiz System - Core Styles
 * 000.0-styles.css
 */

:root {
  --bg-deep: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --glow-warm: #f59e0b;
  --glow-warm-soft: rgba(245, 158, 11, 0.15);
  --glow-warm-ghost: rgba(245, 158, 11, 0.06);
  --correct: #10b981;
  --correct-soft: rgba(16, 185, 129, 0.15);
  --incorrect: #ef4444;
  --incorrect-soft: rgba(239, 68, 68, 0.15);
  --explore: #8b5cf6;
  --explore-soft: rgba(139, 92, 246, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.1);
  --border-warm: rgba(245, 158, 11, 0.3);
}

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

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  z-index: 0;
  pointer-events: none;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════ */

.landing {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.8s ease;
}

.landing-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.4));
}

.landing h1 {
  font-family: 'Crimson Pro', serif;
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--glow-warm), #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing .subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 300;
}

.landing .intro {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* Quiz Selection */
.quiz-select {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 520px;
}

.quiz-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-warm);
  box-shadow: 0 0 30px var(--glow-warm-ghost);
  transform: translateY(-2px);
}

.quiz-btn .label { font-weight: 500; }
.quiz-btn .count { color: var(--text-dim); font-size: 0.85rem; }

.quiz-btn.loading {
  opacity: 0.6;
  cursor: wait;
}

/* ═══════════════════════════════════════════════════════════════
   STUDY VIEW
   ═══════════════════════════════════════════════════════════════ */

.study-view { display: none; animation: fadeIn 0.5s ease; }
.study-view.active { display: block; }

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--glow-warm); }

.progress-info {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--glow-warm), #f97316);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════════
   QUESTION CARD
   ═══════════════════════════════════════════════════════════════ */

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  animation: slideUp 0.4s ease;
}

.q-chapter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--glow-warm);
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.q-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: 1rem;
}

.q-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1.35rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  font-weight: 400;
}

/* Ms. Luminara intro */
.luminara-intro {
  background: linear-gradient(135deg, var(--glow-warm-ghost), transparent);
  border-left: 3px solid var(--glow-warm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 10px 10px 0;
}

.luminara-intro .speaker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.luminara-intro p {
  font-family: 'Crimson Pro', serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   OPTIONS
   ═══════════════════════════════════════════════════════════════ */

.options { display: flex; flex-direction: column; gap: 0.6rem; }

.option-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.option-btn:hover:not(.locked) {
  background: var(--glow-warm-ghost);
  border-color: var(--border-warm);
}

.option-btn .explore-icon {
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.8rem;
}

.option-btn:hover .explore-icon {
  opacity: 0.5;
}

.option-btn.selected {
  border-color: var(--glow-warm);
  background: var(--glow-warm-soft);
}

.option-btn.correct-answer {
  border-color: var(--correct);
  background: var(--correct-soft);
}

.option-btn.wrong-answer {
  border-color: var(--incorrect);
  background: var(--incorrect-soft);
}

.option-btn.locked { cursor: default; }
.option-btn.exploring {
  border-color: var(--explore);
  background: var(--explore-soft);
}

/* ═══════════════════════════════════════════════════════════════
   EXPLORATION PANEL
   ═══════════════════════════════════════════════════════════════ */

.exploration-panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  animation: fadeIn 0.4s ease;
  display: none;
}

.exploration-panel.visible { display: block; }

.exploration-panel h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--glow-warm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exploration-panel .content {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.exploration-panel .content p {
  margin-bottom: 1rem;
}

.exploration-panel .content p:last-child {
  margin-bottom: 0;
}

.exploration-panel .verdict {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.exploration-panel .verdict.correct {
  background: var(--correct-soft);
  border-left: 3px solid var(--correct);
  color: var(--correct);
}

.exploration-panel .verdict.incorrect {
  background: var(--incorrect-soft);
  border-left: 3px solid var(--incorrect);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   MECHANISM TOUR
   ═══════════════════════════════════════════════════════════════ */

.mechanism-tour {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent);
  border: 1px solid rgba(139, 92, 246, 0.3);
  animation: fadeIn 0.4s ease;
  display: none;
}

.mechanism-tour.visible { display: block; }

.mechanism-tour h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--explore);
  margin-bottom: 1rem;
}

.mechanism-tour .content {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.mechanism-tour .metaphor {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
  font-style: italic;
}

.mechanism-tour .metaphor .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--explore);
  margin-bottom: 0.5rem;
  font-style: normal;
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION & ACTIONS
   ═══════════════════════════════════════════════════════════════ */

.action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1.25rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  border-color: var(--border-warm);
  background: var(--bg-card-hover);
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.15));
  border-color: var(--border-warm);
}

.action-btn.explore {
  border-color: rgba(139, 92, 246, 0.3);
}

.action-btn.explore:hover {
  background: var(--explore-soft);
  border-color: var(--explore);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1.5rem;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  border-color: var(--border-warm);
  background: var(--bg-card-hover);
}

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

.nav-btn.primary {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.15));
  border-color: var(--border-warm);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .container { padding: 1.25rem 1rem; }
  .landing h1 { font-size: 2rem; }
  .q-text { font-size: 1.15rem; }
  .question-card { padding: 1.5rem; }
  .action-row { flex-direction: column; }
  .action-btn { width: 100%; justify-content: center; }
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════ */

.loading-indicator {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-family: 'Crimson Pro', serif;
  font-style: italic;
}

.loading-indicator::before {
  content: '🔬';
  display: block;
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Loader Overlay */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#loader .loader-content {
  text-align: center;
  color: var(--text-secondary);
}

#loader .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--glow-warm);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

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

/* Error Message */
#errorMessage {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--incorrect-soft);
  border: 1px solid var(--incorrect);
  color: var(--incorrect);
  padding: 1rem 2rem;
  border-radius: 8px;
  z-index: 1001;
  font-family: 'DM Sans', sans-serif;
}

/* Landing Content */
#landing .landing-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  animation: fadeIn 0.8s ease;
  position: relative;
  z-index: 1;
}

#landing .landing-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

#landing .header-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

#landing .last-updated {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.7;
  white-space: nowrap;
}

#landing h1 {
  font-family: 'Crimson Pro', serif;
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(135deg, var(--glow-warm), #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#landing .settings-btn {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--explore);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

#landing .settings-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--explore);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

#landing h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 2rem 0 1rem;
}

#landing .subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 300;
}

.luminara-welcome {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 600px;
  text-align: left;
  box-shadow: 0 0 30px var(--glow-warm-ghost);
  margin-bottom: 2rem;
}

.luminara-welcome .speaker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--glow-warm);
  margin-bottom: 0.75rem;
}

.luminara-welcome p {
  font-family: 'Crimson Pro', serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  font-style: italic;
}

/* Quiz Select Grid */
.quiz-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 700px;
}

.quiz-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-btn:hover {
  border-color: var(--border-warm);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--glow-warm-ghost);
}

.quiz-btn .label {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.quiz-btn .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
}

.reference-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.reference-note a {
  color: var(--glow-warm);
  text-decoration: none;
}

.reference-note a:hover {
  text-decoration: underline;
}

/* Study View */
#studyView {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  position: relative;
  z-index: 1;
}

#studyView.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--glow-warm), #fbbf24);
  transition: width 0.3s ease;
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.nav-header span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   WARMUP & PHASE STYLING
   ═══════════════════════════════════════════════════════════════ */

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.phase-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-weight: 500;
}

.phase-badge.warmup {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.phase-badge.main {
  background: var(--glow-warm-soft);
  color: var(--glow-warm);
  border: 1px solid var(--border-warm);
}

.warmup-card {
  border-color: rgba(59, 130, 246, 0.3) !important;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.08) !important;
}

.warmup-context {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.warmup-context .context-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.warmup-context .context-question {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.skip-warmup {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.skip-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-dim);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.skip-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   GAMIFICATION UI
   ═══════════════════════════════════════════════════════════════ */

/* Stats Bar (Top of Study View) */
.stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.stat-item .icon {
  font-size: 1rem;
}

.stat-item .value {
  color: var(--glow-warm);
  font-weight: 600;
}

.stat-item .label {
  color: var(--text-dim);
  font-size: 0.7rem;
}

/* XP Bar */
.xp-container {
  flex: 1;
  max-width: 200px;
}

.xp-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--glow-warm), #fbbf24, #f97316);
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.xp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: xpShimmer 2s infinite;
}

@keyframes xpShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.xp-text {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   HP BAR (Scaffold Remediation System)
   ═══════════════════════════════════════════════════════════════ */

.hp-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 70px;
}

.hp-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s ease;
}

.hp-text {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   DAMAGE ROLL OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.damage-roll-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.damage-container {
  background: var(--bg-card);
  padding: 2rem 3rem;
  border-radius: 16px;
  text-align: center;
  border: 2px solid var(--incorrect);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.damage-container.fumble {
  border-color: var(--correct);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

.damage-container.crit-hit {
  border-color: var(--glow-warm);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
  animation: critPulse 0.5s ease infinite;
}

@keyframes critPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.damage-header {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--incorrect);
  margin-bottom: 1rem;
}

.dice-spinning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.damage-dice {
  font-size: 3rem;
  animation: diceRoll 0.2s ease infinite;
}

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

.damage-rolling {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.damage-result .roll-value {
  font-size: 4rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.damage-result .roll-value.fumble {
  color: var(--correct);
}

.damage-result .roll-value.crit-hit {
  color: var(--glow-warm);
}

.fumble-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--correct);
  margin-bottom: 0.5rem;
}

.damage-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--incorrect);
  margin-bottom: 0.5rem;
}

.crit-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.con-reduction {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.damage-message {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-size: 0.95rem;
}

.scaffold-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--explore-soft);
  border-radius: 8px;
  color: var(--explore);
  font-weight: 600;
}

.scaffold-notice .scaffold-icon {
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   SCAFFOLD QUESTION CARD
   ═══════════════════════════════════════════════════════════════ */

.scaffold-card {
  border-left: 4px solid var(--explore) !important;
}

.scaffold-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.scaffold-badge {
  background: var(--explore);
  color: white;
  padding: 0.35rem 0.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8rem;
}

.scaffold-purpose {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.luminara-scaffold-intro {
  background: var(--explore-soft);
  border-left: 3px solid var(--explore);
  padding: 1rem;
  margin-bottom: 1.25rem;
  border-radius: 0 8px 8px 0;
}

.luminara-scaffold-intro .speaker {
  font-weight: 700;
  color: var(--explore);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.luminara-scaffold-intro p {
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.scaffold-progress {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.progress-dots {
  display: flex;
  gap: 1rem;
}

.progress-dots .dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.progress-dots .dot.completed {
  background: var(--correct);
  border-color: var(--correct);
  color: white;
}

.progress-dots .dot.active {
  background: var(--explore);
  border-color: var(--explore);
  color: white;
  transform: scale(1.1);
}

.scaffold-next-container {
  margin-top: 1.5rem;
  text-align: center;
}

.scaffold-next-btn {
  background: linear-gradient(135deg, var(--explore), #7c3aed);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scaffold-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* Scaffold option button styling */
.scaffold-option {
  border-color: var(--explore) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SCAFFOLD HEAL POPUP
   ═══════════════════════════════════════════════════════════════ */

.scaffold-heal-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  border: 2px solid var(--correct);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
  text-align: center;
  z-index: 1000;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.scaffold-heal-popup.hiding {
  animation: popOut 0.4s ease forwards;
}

@keyframes popOut {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.scaffold-heal-popup .heal-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.scaffold-heal-popup .heal-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--correct);
  margin-bottom: 0.25rem;
}

.scaffold-heal-popup .heal-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   SCAFFOLD COMPLETE POPUP
   ═══════════════════════════════════════════════════════════════ */

.scaffold-complete-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.scaffold-complete-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  border: 2px solid var(--explore);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
  text-align: center;
  max-width: 400px;
}

.complete-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.complete-icon {
  font-size: 1.5rem;
}

.complete-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.complete-stats .stat {
  text-align: center;
}

.complete-stats .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--correct);
  font-family: 'JetBrains Mono', monospace;
}

.complete-stats .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.complete-message {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.complete-continue {
  background: linear-gradient(135deg, var(--explore), #7c3aed);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.complete-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   KNOCKOUT OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.knockout-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  animation: fadeIn 0.5s ease;
}

.knockout-card {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 16px;
  border: 2px solid var(--incorrect);
  box-shadow: 0 0 50px rgba(239, 68, 68, 0.3);
  text-align: center;
  max-width: 450px;
}

.knockout-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: wobble 0.5s ease;
}

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

.knockout-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--incorrect);
  margin-bottom: 1rem;
}

.knockout-message {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.knockout-effect {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.knockout-effect .effect-item {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.knockout-effect .effect-item.penalty {
  color: var(--incorrect);
}

.knockout-continue {
  background: linear-gradient(135deg, var(--glow-warm), #f97316);
  color: var(--bg-deep);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.knockout-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

/* Level Badge */
.level-badge {
  background: linear-gradient(135deg, var(--glow-warm), #f97316);
  color: var(--bg-deep);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Streak Counter */
.streak-counter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.streak-counter.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(249, 115, 22, 0.2));
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.streak-counter .fire {
  font-size: 1rem;
  animation: fireFlicker 0.5s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  from { transform: scale(1) rotate(-3deg); }
  to { transform: scale(1.1) rotate(3deg); }
}

.streak-counter .count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f97316;
}

/* XP Popup */
.xp-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 2px solid var(--glow-warm);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  z-index: 1000;
  animation: xpPopIn 0.4s ease;
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.3);
  text-align: center;
  min-width: 280px;
}

@keyframes xpPopIn {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.xp-popup.hiding {
  animation: xpPopOut 0.3s ease forwards;
}

@keyframes xpPopOut {
  to { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

.xp-popup .total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--glow-warm), #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.xp-popup .breakdown {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.xp-popup .breakdown-item {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0.25rem 0;
}

.xp-popup .breakdown-item .value {
  color: var(--correct);
}

.xp-popup .lucky-strike {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.1));
  border-radius: 8px;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--glow-warm);
  font-style: italic;
  animation: luckyPulse 0.5s ease infinite alternate;
}

@keyframes luckyPulse {
  from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
  to { box-shadow: 0 0 20px rgba(245, 158, 11, 0.6); }
}

.xp-popup .message {
  margin-top: 0.75rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Achievement Notification */
.achievement-notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--explore);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  z-index: 1001;
  animation: achieveSlideIn 0.5s ease;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 350px;
}

@keyframes achieveSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.achievement-notification.hiding {
  animation: achieveSlideOut 0.4s ease forwards;
}

@keyframes achieveSlideOut {
  to { transform: translateX(100%); opacity: 0; }
}

.achievement-notification .badge-icon {
  font-size: 2rem;
  animation: badgeBounce 0.5s ease;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.achievement-notification .content {
  flex: 1;
}

.achievement-notification .title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--explore);
  margin-bottom: 0.25rem;
}

.achievement-notification .name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.achievement-notification .message {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Streak Broken Message */
.streak-broken {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 2px solid var(--incorrect);
  border-radius: 12px;
  padding: 1.25rem 2rem;
  z-index: 1000;
  animation: shakeBroken 0.5s ease;
  text-align: center;
}

@keyframes shakeBroken {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  20% { transform: translate(-50%, -50%) rotate(-3deg); }
  40% { transform: translate(-50%, -50%) rotate(3deg); }
  60% { transform: translate(-50%, -50%) rotate(-2deg); }
  80% { transform: translate(-50%, -50%) rotate(2deg); }
}

.streak-broken .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.streak-broken .text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--incorrect);
}

.streak-broken .message {
  margin-top: 0.5rem;
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Level Up Celebration */
.level-up-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
  animation: fadeIn 0.3s ease;
}

.level-up-card {
  background: var(--bg-card);
  border: 3px solid var(--glow-warm);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  animation: levelUpPop 0.6s ease;
  box-shadow: 0 0 100px rgba(245, 158, 11, 0.5);
}

@keyframes levelUpPop {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.level-up-card .stars {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: starSpin 1s ease infinite;
}

@keyframes starSpin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(10deg); }
}

.level-up-card .title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.level-up-card .level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--glow-warm), #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.level-up-card .message {
  margin-top: 1rem;
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
}

.level-up-card .dismiss {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--glow-warm), #f97316);
  border: none;
  color: var(--bg-deep);
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.level-up-card .dismiss:hover {
  transform: scale(1.05);
}

/* Session Summary */
.session-summary {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1003;
  animation: fadeIn 0.4s ease;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  animation: slideUp 0.5s ease;
}

.summary-card h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--glow-warm);
  text-align: center;
  margin-bottom: 1.5rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.summary-stat .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.summary-stat .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.summary-achievements {
  margin-bottom: 1.5rem;
}

.summary-achievements h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--explore);
  margin-bottom: 0.75rem;
}

.summary-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--explore-soft);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.summary-badge .icon {
  font-size: 1.25rem;
}

.summary-badge .name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.summary-message {
  text-align: center;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  border-top: 1px solid var(--border);
  margin-bottom: 1rem;
}

.summary-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.summary-actions button {
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.summary-actions .continue {
  background: linear-gradient(135deg, var(--glow-warm), #f97316);
  border: none;
  color: var(--bg-deep);
  font-weight: 600;
}

.summary-actions .home {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.summary-actions button:hover {
  transform: translateY(-2px);
}

/* Revenge indicator */
.revenge-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--explore);
  margin-left: 0.5rem;
}

/* Landing Stats Preview */
.landing-stats {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  gap: 2rem;
  max-width: 400px;
}

.landing-stat {
  text-align: center;
}

.landing-stat .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.landing-stat .label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* Progress Controls (Save/Load/Reset) */
.progress-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.progress-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.progress-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-warm);
  color: var(--text-primary);
}

.progress-btn.danger:hover {
  border-color: var(--wrong);
  color: var(--wrong);
}

/* Dewey Decimal Category Grid */
.quiz-select {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 600px;
}

.dewey-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.dewey-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.dewey-header:hover {
  background: var(--bg-card-hover);
}

.dewey-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--glow-warm);
  min-width: 3rem;
}

.dewey-title {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.dewey-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  background: var(--bg-deep);
  border-radius: 4px;
}

.dewey-expand {
  color: var(--text-dim);
  margin-left: 0.75rem;
  transition: transform 0.2s;
}

.dewey-group.expanded .dewey-expand {
  transform: rotate(180deg);
}

.dewey-banks {
  display: none;
  padding: 0.5rem;
  background: var(--bg-deep);
}

.dewey-group.expanded .dewey-banks {
  display: block;
}

.dewey-bank {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  margin: 0.25rem 0;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.dewey-bank:hover {
  border-color: var(--border-warm);
  transform: translateX(4px);
}

.dewey-bank-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--glow-warm);
  opacity: 0.7;
  min-width: 3.5rem;
}

.dewey-bank-title {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dewey-bank-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.dewey-bank-mastery {
  width: 40px;
  height: 4px;
  background: var(--bg-deep);
  border-radius: 2px;
  margin-left: 0.75rem;
  overflow: hidden;
}

.dewey-bank-mastery-fill {
  height: 100%;
  background: var(--correct);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   SCAFFOLDING UI (Vygotsky Adaptive Learning)
   ═══════════════════════════════════════════════════════════════ */

/* Scaffold Level Indicator */
.scaffold-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  margin-left: 0.75rem;
}

.scaffold-indicator .icon {
  font-size: 0.9rem;
}

.scaffold-indicator .label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scaffold-indicator.scaffold-heavy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.scaffold-indicator.scaffold-moderate {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
}

.scaffold-indicator.scaffold-light {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--correct);
}

.scaffold-indicator.scaffold-challenge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.1));
  border: 1px solid var(--border-warm);
  color: var(--glow-warm);
}

/* Scaffold Hint Panel */
.scaffold-hint {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.04));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.15); }
}

.scaffold-hint .scaffold-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.scaffold-hint .scaffold-icon {
  font-size: 1.1rem;
}

.scaffold-hint .scaffold-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #60a5fa;
}

.scaffold-hint .scaffold-message {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* Adaptive Message Toast */
.adaptive-message {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  z-index: 999;
  animation: adaptiveSlideUp 0.5s ease;
  max-width: 400px;
  text-align: center;
}

@keyframes adaptiveSlideUp {
  from { transform: translateX(-50%) translateY(100%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.adaptive-message.hiding {
  animation: adaptiveSlideDown 0.5s ease forwards;
}

@keyframes adaptiveSlideDown {
  to { transform: translateX(-50%) translateY(100%); opacity: 0; }
}

.adaptive-message.adaptive-encouragement {
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.adaptive-message.adaptive-support {
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

.adaptive-message.adaptive-progress,
.adaptive-message.adaptive-confidence {
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.adaptive-message.adaptive-mastery,
.adaptive-message.adaptive-advanced {
  border: 1px solid var(--border-warm);
  box-shadow: 0 0 30px var(--glow-warm-ghost);
}

.adaptive-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.adaptive-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.adaptive-speaker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--glow-warm);
}

/* Review Queue Indicator */
.review-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  margin-top: 1rem;
}

.review-indicator .icon {
  font-size: 1rem;
}

.review-indicator .text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--explore);
}

.review-indicator .count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* Mastery progress in topic selection */
.quiz-btn .mastery-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.quiz-btn .mastery-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quiz-btn .mastery-fill.learning {
  background: #60a5fa;
}

.quiz-btn .mastery-fill.developing {
  background: var(--explore);
}

.quiz-btn .mastery-fill.proficient {
  background: var(--correct);
}

.quiz-btn .mastery-fill.mastered {
  background: linear-gradient(90deg, var(--glow-warm), #fbbf24);
}

/* ═══════════════════════════════════════════════════════════════
   D20 RPG SYSTEM UI
   ═══════════════════════════════════════════════════════════════ */

/* Dice Roll Overlay */
.dice-roll-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1005;
  animation: fadeIn 0.2s ease;
}

.dice-roll-overlay.hiding {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

.dice-container {
  text-align: center;
}

.dice-spinning {
  animation: diceRoll 1s ease-out;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(180deg) scale(1.2); }
  50% { transform: rotate(360deg) scale(1); }
  75% { transform: rotate(540deg) scale(1.1); }
  100% { transform: rotate(720deg) scale(1); }
}

.d20-face {
  font-size: 6rem;
  filter: drop-shadow(0 0 30px rgba(245, 158, 11, 0.5));
}

.dice-result {
  animation: resultReveal 0.4s ease;
}

@keyframes resultReveal {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.roll-context {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.roll-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.roll-value.crit-success {
  color: var(--glow-warm);
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
  animation: critPulse 0.5s ease infinite alternate;
}

.roll-value.crit-fail {
  color: var(--incorrect);
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
}

@keyframes critPulse {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

.roll-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
}

.roll-type.advantage {
  background: var(--correct-soft);
  color: var(--correct);
}

.roll-type.disadvantage {
  background: var(--incorrect-soft);
  color: var(--incorrect);
}

.roll-modifier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.roll-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  color: var(--glow-warm);
  font-weight: 600;
}

.crit-message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  animation: critFlash 0.3s ease infinite alternate;
}

.crit-success .crit-message {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(249, 115, 22, 0.2));
  color: var(--glow-warm);
}

.crit-fail .crit-message {
  background: var(--incorrect-soft);
  color: var(--incorrect);
}

@keyframes critFlash {
  from { opacity: 1; }
  to { opacity: 0.7; }
}

/* Character Sheet */
.character-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1006;
  animation: fadeIn 0.3s ease;
}

.character-sheet {
  background: var(--bg-card);
  border: 2px solid var(--border-warm);
  border-radius: 20px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.2);
}

.character-sheet .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
}

.character-sheet .close-btn:hover {
  color: var(--text-primary);
}

.cs-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cs-title {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  color: var(--glow-warm);
  font-style: italic;
}

.cs-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.stat-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-mod {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--glow-warm);
  margin-top: 0.1rem;
}

.stat-xp-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.stat-xp-fill {
  height: 100%;
  background: var(--explore);
  border-radius: 2px;
}

.cs-resources {
  display: flex;
  justify-content: space-around;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.resource {
  text-align: center;
}

.resource-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.25rem;
}

.resource-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.cs-criticals {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.crit-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crit-icon {
  font-size: 1rem;
}

.crit-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.crit-stat.nat20 .crit-count {
  color: var(--glow-warm);
}

.crit-stat.nat1 .crit-count {
  color: var(--incorrect);
}

.crit-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cs-footer {
  text-align: center;
  padding-top: 1rem;
}

.cs-flavor {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.cs-signature {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--glow-warm);
  margin-top: 0.5rem;
}

/* Skill Check Prompt */
.skill-check-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1004;
  animation: fadeIn 0.2s ease;
}

.skill-check-card {
  background: var(--bg-card);
  border: 1px solid var(--explore);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.check-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.check-icon {
  font-size: 1.5rem;
}

.check-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.check-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.cost-value {
  color: var(--glow-warm);
  font-weight: 600;
}

.current-points {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.check-description {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.check-actions {
  display: flex;
  gap: 0.75rem;
}

.check-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.check-btn.cancel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.check-btn.roll {
  background: linear-gradient(135deg, var(--explore), #7c3aed);
  border: none;
  color: white;
  font-weight: 600;
}

.check-btn.roll:hover:not(.disabled) {
  transform: translateY(-2px);
}

.check-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Insight Result */
.insight-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1004;
  animation: fadeIn 0.3s ease;
}

.insight-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 380px;
  text-align: center;
}

.insight-roll {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-family: 'JetBrains Mono', monospace;
}

.insight-roll .roll-label {
  width: 100%;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.insight-roll .roll-value {
  font-size: 2rem;
  font-weight: 700;
}

.insight-roll .roll-modifier,
.insight-roll .roll-total {
  font-size: 1rem;
  color: var(--text-secondary);
}

.insight-roll .roll-dc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.insight-quality {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.insight-hint {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.insight-points-remaining {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.insight-dismiss {
  background: var(--explore);
  border: none;
  color: white;
  padding: 0.6rem 2rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}

/* Streak Save Prompt */
.streak-save-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1005;
  animation: fadeIn 0.2s ease;
}

.streak-save-card {
  background: var(--bg-card);
  border: 2px solid #f97316;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 350px;
  text-align: center;
  animation: shakeBroken 0.5s ease;
}

.save-header {
  margin-bottom: 1rem;
}

.save-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.save-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #f97316;
}

.save-streak {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.streak-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #f97316;
}

.save-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.save-actions {
  display: flex;
  gap: 0.75rem;
}

.save-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.save-btn.decline {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.save-btn.attempt {
  background: linear-gradient(135deg, #f97316, var(--glow-warm));
  border: none;
  color: var(--bg-deep);
  font-weight: 600;
}

/* Encounter Banner */
.encounter-banner {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  z-index: 999;
  animation: bannerSlide 0.5s ease;
}

@keyframes bannerSlide {
  from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.encounter-banner.hiding {
  animation: bannerSlideOut 0.5s ease forwards;
}

@keyframes bannerSlideOut {
  to { transform: translateX(-50%) translateY(-100%); opacity: 0; }
}

.encounter-banner.encounter-standard {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.encounter-banner.encounter-elite {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid var(--explore);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.encounter-banner.encounter-boss {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.1));
  border: 2px solid var(--glow-warm);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

.encounter-icon {
  font-size: 1.25rem;
}

.encounter-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.encounter-modifier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.encounter-modifier.advantage {
  background: var(--correct-soft);
  color: var(--correct);
}

.encounter-modifier.disadvantage {
  background: var(--incorrect-soft);
  color: var(--incorrect);
}

.encounter-reward {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--glow-warm);
  font-weight: 600;
}

/* Character Mini (in stats bar) */
.char-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.char-mini:hover {
  border-color: var(--border-warm);
  background: var(--glow-warm-ghost);
}

.char-title {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: var(--glow-warm);
  font-style: italic;
}

.char-stats-mini {
  display: flex;
  gap: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.insight-points {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--explore);
}

/* Roll for Insight Button */
.insight-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 6px;
  color: var(--explore);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.75rem;
}

.insight-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.insight-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   DIABLO-STYLE INVENTORY & PAPERDOLL UI
   ═══════════════════════════════════════════════════════════════ */

/* Inventory Button in Stats Bar */
.inventory-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.inventory-btn:hover {
  border-color: var(--glow-warm);
  background: var(--glow-warm-ghost);
  transform: scale(1.1);
}

/* Inventory Overlay */
.inventory-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1010;
  animation: fadeIn 0.3s ease;
}

.inventory-panel {
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1319 100%);
  border: 2px solid #3d4663;
  border-radius: 4px;
  width: 95%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.inventory-panel .close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #ef4444;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.inventory-panel .close-btn:hover {
  background: #ef4444;
  color: white;
}

.inv-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #3d4663;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(61, 70, 99, 0.3) 0%, transparent 100%);
}

.inv-header h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  color: #c4a35a;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gold-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.inv-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

@media (max-width: 700px) {
  .inv-content {
    grid-template-columns: 1fr;
  }
}

/* Paperdoll Section */
.paperdoll-section h3,
.inventory-section h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b9dc3;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #3d4663;
}

.paperdoll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(30, 35, 50, 0.8) 0%, rgba(15, 19, 25, 0.8) 100%);
  border: 1px solid #3d4663;
  border-radius: 4px;
}

.paperdoll-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.equip-slot {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #1e2332 0%, #0f1319 100%);
  border: 2px solid #3d4663;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.equip-slot:hover {
  border-color: #5d6b8f;
  box-shadow: 0 0 15px rgba(93, 107, 143, 0.3);
}

.equip-slot.filled {
  background: linear-gradient(135deg, #252a3a 0%, #1a1f2e 100%);
}

.equip-slot .slot-icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

.equip-slot.filled .slot-icon {
  opacity: 1;
}

.equip-slot .item-level {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: #8b9dc3;
}

/* Equipment Stats */
.equip-stats {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(30, 35, 50, 0.5);
  border: 1px solid #3d4663;
  border-radius: 4px;
}

.equip-stats h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #8b9dc3;
  margin-bottom: 0.5rem;
}

.equip-stats .stat-row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.2rem 0;
  color: #a8b4c8;
}

.equip-stats .stat-row .stat-val {
  color: #22c55e;
}

.equip-stats .stat-row.bonus .stat-val {
  color: #3b82f6;
}

/* Set Bonuses */
.set-bonuses {
  margin-top: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, transparent 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
}

.set-bonuses h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #22c55e;
  margin-bottom: 0.5rem;
}

.set-info {
  margin-bottom: 0.5rem;
}

.set-name {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: #22c55e;
}

.set-bonus {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #22c55e;
  padding-left: 0.5rem;
}

/* Inventory Grid */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(30, 35, 50, 0.5) 0%, rgba(15, 19, 25, 0.5) 100%);
  border: 1px solid #3d4663;
  border-radius: 4px;
  min-height: 150px;
}

.inv-item {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1e2332 0%, #0f1319 100%);
  border: 2px solid #3d4663;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.inv-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.inv-item .item-icon {
  font-size: 1.25rem;
}

.inv-item .item-level {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: #8b9dc3;
}

.inv-item .socket-indicator {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 0.5rem;
  color: #a855f7;
}

.empty-inv {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #5d6b8f;
  font-style: italic;
}

/* Gems Grid */
.gems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.4rem;
  padding: 0.75rem;
  background: linear-gradient(180deg, rgba(30, 35, 50, 0.5) 0%, rgba(15, 19, 25, 0.5) 100%);
  border: 1px solid #3d4663;
  border-radius: 4px;
  min-height: 80px;
}

.inv-gem {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #1e2332 0%, #0f1319 100%);
  border: 2px solid #3d4663;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}

.inv-gem:hover {
  transform: scale(1.1);
}

.inv-gem .gem-icon {
  font-size: 1.1rem;
}

.inv-gem .gem-tier {
  position: absolute;
  bottom: 0;
  right: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: #8b9dc3;
}

/* Item Detail Overlay */
.item-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1020;
  animation: fadeIn 0.2s ease;
}

.item-detail {
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1319 100%);
  border: 2px solid;
  border-radius: 4px;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.item-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #3d4663;
}

.item-icon-large {
  font-size: 2.5rem;
}

.item-title {
  flex: 1;
}

.item-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
}

.item-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #8b9dc3;
  margin-top: 0.25rem;
}

.item-level-req {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #8b9dc3;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
}

.item-lore {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: #c4a35a;
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid #3d4663;
}

.item-stats {
  padding: 1rem;
}

.item-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #3b82f6;
  padding: 0.2rem 0;
}

.item-special {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: #f59e0b;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border-top: 1px solid rgba(245, 158, 11, 0.3);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.item-sockets {
  padding: 0.75rem 1rem;
  border-top: 1px solid #3d4663;
}

.socket-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #8b9dc3;
  margin-bottom: 0.5rem;
}

.socket-row {
  display: flex;
  gap: 0.5rem;
}

.socket {
  font-size: 1.25rem;
}

.socket.empty {
  color: #3d4663;
}

.item-set-info {
  padding: 0.5rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border-top: 1px solid rgba(34, 197, 94, 0.3);
}

.set-name-label {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: #22c55e;
}

.item-actions {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #3d4663;
}

.item-btn {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid #3d4663;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.item-btn.equip {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-color: #22c55e;
  color: white;
}

.item-btn.unequip {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
  color: white;
}

.item-btn.sell {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #f59e0b;
  color: #1a1f2e;
}

.item-btn.close {
  background: #1e2332;
  color: #8b9dc3;
}

.item-btn:hover {
  transform: translateY(-2px);
}

/* Loot Drop Notifications */
.loot-drop-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1005;
  pointer-events: none;
}

.loot-drop {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1319 100%);
  border: 2px solid #3d4663;
  border-radius: 4px;
  animation: lootDropIn 0.5s ease forwards, lootDropOut 0.5s ease 3s forwards;
  opacity: 0;
}

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

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

.loot-drop .loot-icon {
  font-size: 1.5rem;
}

.loot-drop .loot-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
}

.loot-drop.gold-drop {
  border-color: #ffd700;
}

.loot-drop.gold-drop .loot-text {
  color: #ffd700;
}

.loot-drop.rarity-legendary {
  border-color: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  animation: lootDropIn 0.5s ease forwards, legendaryGlow 1s ease infinite alternate, lootDropOut 0.5s ease 3.5s forwards;
}

@keyframes legendaryGlow {
  from { box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
  to { box-shadow: 0 0 40px rgba(245, 158, 11, 0.7); }
}

.loot-drop.rarity-unique {
  border-color: #06b6d4;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
}

.gem-detail .gem-socket-info {
  text-align: center;
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: #8b9dc3;
  font-style: italic;
  padding: 1rem;
  border-top: 1px solid #3d4663;
}

/* ═══════════════════════════════════════════════════════════════
   GAUNTLET MODE - ROGUELIKE BOSS BATTLES
   ═══════════════════════════════════════════════════════════════ */

.gauntlet-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

.gauntlet-landing {
  text-align: center;
}

.gauntlet-header h1 {
  font-family: 'Crimson Pro', serif;
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--incorrect) 0%, var(--glow-warm) 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gauntlet-subtitle {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
}

.gauntlet-intro {
  background: var(--bg-card);
  border: 1px solid var(--border-warm);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: left;
}

.gauntlet-intro .speaker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.gauntlet-intro p {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Difficulty Select */
.difficulty-select {
  margin: 2rem 0;
}

.difficulty-select h3 {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.difficulty-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.difficulty-btn:hover:not(.locked) {
  border-color: var(--glow-warm);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.difficulty-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.difficulty-btn .diff-icon {
  font-size: 2rem;
}

.difficulty-btn .diff-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.difficulty-btn .diff-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.difficulty-btn .unlock-req {
  font-size: 0.7rem;
  color: var(--incorrect);
  font-style: italic;
}

.difficulty-btn.easy:hover:not(.locked) { border-color: var(--correct); }
.difficulty-btn.hard:hover:not(.locked) { border-color: #f97316; }
.difficulty-btn.nightmare:hover:not(.locked) { border-color: var(--incorrect); }

/* Gauntlet Actions */
.gauntlet-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.gauntlet-btn {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.gauntlet-btn:hover {
  border-color: var(--glow-warm);
  background: var(--bg-card-hover);
}

.gauntlet-btn.leaderboard:hover {
  border-color: #ffd700;
}

/* Gauntlet Stats */
.gauntlet-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 1.5rem;
}

.g-stat {
  text-align: center;
}

.g-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.g-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   BOSS ARENA
   ═══════════════════════════════════════════════════════════════ */

.boss-arena {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-card) 100%);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.boss-arena::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--incorrect), transparent);
  animation: bossGlow 2s ease-in-out infinite;
}

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

.boss-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.boss-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: var(--incorrect-soft);
  color: var(--incorrect);
}

.boss-portrait {
  position: relative;
  margin-bottom: 1rem;
}

.boss-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.5));
  animation: bossBreathe 3s ease-in-out infinite;
}

@keyframes bossBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.boss-phase-indicator {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.boss-phase-indicator.phase1 { border-color: var(--correct); color: var(--correct); }
.boss-phase-indicator.phase2 { border-color: var(--glow-warm); color: var(--glow-warm); }
.boss-phase-indicator.enraged { border-color: var(--incorrect); color: var(--incorrect); animation: pulse 0.5s infinite; }

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

.boss-info {
  margin-bottom: 1rem;
}

.boss-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.boss-title {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Boss HP Bar */
.boss-hp-section {
  margin: 1.5rem 0;
}

.boss-hp-bar {
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--incorrect), #f97316);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
}

.boss-hp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 10px 10px 0 0;
}

.boss-hp-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.boss-armor {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Boss Taunt */
.boss-taunt {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--incorrect);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.taunt-text {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--text-secondary);
}

/* Boss Weakness */
.boss-weakness {
  margin: 1rem 0;
  font-size: 0.85rem;
}

.weakness-label {
  color: var(--text-dim);
}

.weakness-stat {
  color: var(--correct);
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Boss Abilities */
.boss-abilities {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.boss-ability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
}

.boss-ability.passive {
  border-color: var(--explore);
  color: var(--explore);
}

.ability-icon {
  font-size: 1rem;
}

/* Battle Actions */
.battle-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.battle-btn {
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.battle-btn:hover {
  transform: translateY(-2px);
}

.battle-btn.attack {
  border-color: var(--incorrect);
}

.battle-btn.attack:hover {
  background: var(--incorrect-soft);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.battle-btn.special {
  border-color: var(--explore);
}

.battle-btn.special:hover {
  background: var(--explore-soft);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.battle-btn.defend {
  border-color: var(--correct);
}

.battle-btn.defend:hover {
  background: var(--correct-soft);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Player Status */
.player-status {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
}

.player-hp { color: var(--incorrect); }
.player-streak { color: var(--glow-warm); }
.battle-score { color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════
   BOSS ATTACK OVERLAYS
   ═══════════════════════════════════════════════════════════════ */

.boss-attack-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.boss-attack-overlay.hiding {
  animation: fadeOut 0.4s ease forwards;
}

.attack-animation,
.defense-animation {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  min-width: 300px;
}

.attack-animation.hit { border-color: var(--correct); }
.attack-animation.miss { border-color: var(--text-dim); }
.attack-animation.critical { border-color: var(--glow-warm); box-shadow: 0 0 30px rgba(245, 158, 11, 0.5); }

.defense-animation.blocked { border-color: var(--correct); }
.defense-animation.hit { border-color: var(--incorrect); }

.attack-roll,
.defense-roll {
  margin-bottom: 1.5rem;
}

.roll-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.roll-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.roll-value.critical { color: var(--glow-warm); }

.roll-modifier {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.roll-vs {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.damage-dealt,
.defense-success,
.defense-fail {
  padding: 1rem;
  border-radius: 8px;
}

.damage-dealt {
  background: var(--correct-soft);
}

.damage-dealt.critical {
  background: linear-gradient(135deg, var(--glow-warm-soft), var(--correct-soft));
}

.damage-value,
.damage-taken {
  font-size: 2.5rem;
  font-weight: 700;
}

.damage-dealt .damage-value { color: var(--correct); }
.defense-fail .damage-taken { color: var(--incorrect); }

.damage-type {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--glow-warm);
}

.attack-miss {
  padding: 1rem;
}

.miss-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dim);
}

.miss-flavor,
.damage-flavor,
.block-flavor {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.5rem;
}

.defense-success {
  background: var(--correct-soft);
}

.block-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--correct);
}

.defense-fail {
  background: var(--incorrect-soft);
}

.reduction {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.boss-attack-header {
  margin-bottom: 1rem;
}

.boss-attack-icon {
  font-size: 2rem;
  margin-right: 0.5rem;
}

.boss-attack-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--incorrect);
}

/* ═══════════════════════════════════════════════════════════════
   BOSS DEFEAT / RUN COMPLETE
   ═══════════════════════════════════════════════════════════════ */

.boss-defeat-overlay,
.run-complete-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.boss-defeat-card,
.run-complete-card {
  background: var(--bg-card);
  border: 2px solid var(--correct);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.run-complete-card.victory { border-color: var(--correct); }
.run-complete-card.defeat { border-color: var(--incorrect); }

.defeat-header,
.run-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.defeat-icon,
.run-icon {
  font-size: 2.5rem;
}

.defeat-title,
.run-title {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  font-weight: 600;
}

.run-header.victory .run-title { color: var(--correct); }
.run-header.defeat .run-title { color: var(--incorrect); }

.boss-defeated {
  margin: 1.5rem 0;
}

.boss-defeated .boss-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.boss-defeated .boss-icon.fading {
  animation: bossDefeat 2s ease forwards;
}

@keyframes bossDefeat {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 0.1; transform: scale(0.8) rotate(10deg); }
}

.boss-quote {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.defeat-stats,
.run-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0;
}

.defeat-stats .stat,
.run-stats .stat {
  text-align: center;
}

.defeat-stats .value,
.run-stats .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.defeat-stats .label,
.run-stats .label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.loot-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.loot-header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.loot-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.loot-item {
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.9rem;
}

.loot-item.gold { color: #ffd700; }
.loot-item.special { color: var(--glow-warm); }

.defeat-continue {
  padding: 0.75rem 2rem;
  background: var(--correct);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.defeat-continue:hover {
  transform: scale(1.05);
}

/* Run Complete Specific */
.run-title-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.title-icon {
  font-size: 1.5rem;
}

.title-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.high-score-banner {
  background: linear-gradient(135deg, var(--glow-warm) 0%, #fbbf24 100%);
  color: #000;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: highScorePulse 0.5s ease infinite alternate;
}

@keyframes highScorePulse {
  from { transform: scale(1); }
  to { transform: scale(1.02); }
}

.score-breakdown {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breakdown-row.multiplier {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.breakdown-total {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0 0;
  margin-top: 0.5rem;
  border-top: 2px solid var(--glow-warm);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.tokens-earned {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--explore-soft);
  border-radius: 8px;
  margin: 1rem 0;
}

.tokens-icon {
  font-size: 1.25rem;
}

.tokens-amount {
  font-size: 1rem;
  font-weight: 600;
  color: var(--explore);
}

.run-achievements {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--glow-warm-soft);
  border-radius: 8px;
}

.achievements-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.run-achievement {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.achieve-icon {
  font-size: 1.25rem;
}

.achieve-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.fun-fact {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-card-hover);
  border-radius: 8px;
  text-align: left;
}

.fact-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.fact-text {
  font-family: 'Crimson Pro', serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.run-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.run-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.run-btn.home {
  background: var(--bg-card);
  color: var(--text-primary);
}

.run-btn.home:hover {
  border-color: var(--glow-warm);
}

.run-btn.retry {
  background: var(--glow-warm);
  color: #000;
  border-color: var(--glow-warm);
}

.run-btn.retry:hover {
  background: #fbbf24;
}

/* ═══════════════════════════════════════════════════════════════
   HIGH SCORES / LEADERBOARD
   ═══════════════════════════════════════════════════════════════ */

.highscores-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
}

.highscores-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.hs-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hs-header h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.75rem;
  background: linear-gradient(135deg, #ffd700, var(--glow-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.current-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rank-icon {
  font-size: 1.5rem;
}

.rank-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.next-rank {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.next-rank.max-rank {
  color: var(--glow-warm);
}

.hs-section {
  margin-bottom: 1.5rem;
}

.hs-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-card-hover);
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.score-row.first { border-left-color: #ffd700; background: rgba(255, 215, 0, 0.1); }
.score-row.second { border-left-color: #c0c0c0; }
.score-row.third { border-left-color: #cd7f32; }

.score-row .rank {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 30px;
}

.score-row .score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--glow-warm);
  min-width: 80px;
}

.score-row .title {
  font-size: 1rem;
}

.score-row .details {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: right;
}

.score-row .difficulty {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.score-row .difficulty.easy { background: var(--correct-soft); color: var(--correct); }
.score-row .difficulty.normal { background: var(--explore-soft); color: var(--explore); }
.score-row .difficulty.hard { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.score-row .difficulty.nightmare { background: var(--incorrect-soft); color: var(--incorrect); }

.no-scores {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-style: italic;
}

.bests-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.best-item,
.stat-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-card-hover);
  border-radius: 8px;
}

.best-value,
.stat-item .val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.best-label,
.stat-item .lbl {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   POWER-UP SHOP
   ═══════════════════════════════════════════════════════════════ */

.powerup-shop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
}

.powerup-shop-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.shop-header h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  color: var(--glow-warm);
}

.token-balance {
  padding: 0.5rem 1rem;
  background: var(--explore-soft);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--explore);
}

.shop-section {
  margin-bottom: 1.5rem;
}

.shop-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.shop-item {
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.15s;
}

.shop-item:not(.locked):not(.cant-afford):hover {
  border-color: var(--glow-warm);
}

.shop-item.cant-afford {
  opacity: 0.6;
}

.shop-item.locked {
  opacity: 0.5;
}

.shop-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.shop-item .item-icon {
  font-size: 1.5rem;
}

.shop-item .item-name {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.shop-item .item-rarity {
  font-size: 0.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.item-rarity.common { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }
.item-rarity.uncommon { background: var(--correct-soft); color: var(--correct); }
.item-rarity.rare { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.item-rarity.legendary { background: var(--glow-warm-soft); color: var(--glow-warm); }

.shop-item .item-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.shop-item .item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shop-item .item-owned {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.buy-btn {
  padding: 0.4rem 0.75rem;
  background: var(--explore);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.1s;
}

.buy-btn:hover:not(:disabled) {
  background: #a78bfa;
  transform: scale(1.05);
}

.buy-btn:disabled {
  background: var(--text-dim);
  cursor: not-allowed;
}

.unlock-progress {
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.unlock-progress .progress-fill {
  height: 100%;
  background: var(--glow-warm);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   POWER-UP ACTIVATION
   ═══════════════════════════════════════════════════════════════ */

.powerup-activation {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2100;
  animation: powerupPopIn 0.3s ease;
}

@keyframes powerupPopIn {
  0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.powerup-activation.hiding {
  animation: powerupPopOut 0.4s ease forwards;
}

@keyframes powerupPopOut {
  0% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-30px) scale(0.8); opacity: 0; }
}

.powerup-card {
  background: linear-gradient(135deg, var(--explore) 0%, #7c3aed 100%);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.5);
}

.powerup-card .powerup-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.powerup-card .powerup-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.powerup-card .powerup-effect {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ═══════════════════════════════════════════════════════════════
   RUN PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */

.run-progress-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.run-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.run-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.run-difficulty.easy { background: var(--correct-soft); color: var(--correct); }
.run-difficulty.normal { background: var(--explore-soft); color: var(--explore); }
.run-difficulty.hard { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.run-difficulty.nightmare { background: var(--incorrect-soft); color: var(--incorrect); }

.run-wave {
  font-size: 0.9rem;
  font-weight: 600;
}

.run-progress {
  width: 100px;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.run-progress .progress-fill {
  height: 100%;
  background: var(--glow-warm);
  border-radius: 3px;
  transition: width 0.3s;
}

.run-progress .progress-text {
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.run-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.run-score { color: var(--glow-warm); }
.run-streak { color: var(--incorrect); }
.run-accuracy { color: var(--correct); }

.active-powerups {
  display: flex;
  gap: 0.5rem;
}

.active-powerup {
  position: relative;
  font-size: 1.25rem;
  padding: 0.25rem;
  background: var(--explore-soft);
  border-radius: 6px;
}

.active-powerup .duration {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.6rem;
  background: var(--bg-card);
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   GAMIFICATION ENHANCEMENTS (7 PASSES)
   ═══════════════════════════════════════════════════════════════ */

/* PASS 1: Daily Challenges */
.daily-challenges {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.daily-challenges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.daily-challenges-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--glow-warm);
}

.daily-challenges-timer {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.daily-challenge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  background: var(--bg-card-hover);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.daily-challenge.completed {
  background: var(--correct-soft);
  border: 1px solid var(--correct);
}

.daily-challenge-icon {
  font-size: 1.5rem;
  min-width: 40px;
  text-align: center;
}

.daily-challenge-info {
  flex: 1;
}

.daily-challenge-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.daily-challenge-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.daily-challenge-reward {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--glow-warm);
  padding: 0.25rem 0.5rem;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 4px;
}

.daily-challenge.completed .daily-challenge-reward {
  color: var(--correct);
  background: rgba(52, 211, 153, 0.2);
}

.daily-bonus-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--glow-warm) 0%, #f59e0b 100%);
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  margin-top: 0.75rem;
}

.daily-bonus-banner.claimed {
  background: linear-gradient(135deg, var(--correct) 0%, #34d399 100%);
}

/* PASS 2: Combo System */
.combo-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 150;
  animation: comboPulse 0.5s ease infinite;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  display: none;
}

.combo-indicator.active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.combo-indicator .combo-timer {
  width: 30px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.combo-indicator .combo-timer-fill {
  height: 100%;
  background: white;
  transition: width 0.1s linear;
}

@keyframes comboPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.combo-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.8), 0 0 60px rgba(249, 115, 22, 0.6);
  z-index: 200;
  pointer-events: none;
  animation: comboExplode 1s ease forwards;
}

@keyframes comboExplode {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1); }
}

/* PASS 3: Milestone Celebrations */
.milestone-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 2px solid var(--glow-warm);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  z-index: 250;
  animation: milestoneAppear 0.5s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 350px;
}

.milestone-popup .milestone-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: milestoneBounce 1s ease infinite;
}

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

.milestone-popup .milestone-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.milestone-popup .milestone-reward {
  font-size: 1.25rem;
  color: var(--correct);
  margin-bottom: 1rem;
}

.milestone-popup .milestone-dismiss {
  padding: 0.75rem 1.5rem;
  background: var(--glow-warm);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.milestone-popup .milestone-dismiss:hover {
  transform: scale(1.05);
}

@keyframes milestoneAppear {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Confetti effect */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* PASS 4: Study Calendar */
.study-calendar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.day-streak-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg-card-hover);
  border-radius: 4px;
}

.calendar-day.studied {
  background: var(--correct);
  color: white;
}

.calendar-day.today {
  border: 2px solid var(--glow-warm);
}

.calendar-day.today.studied {
  background: linear-gradient(135deg, var(--correct) 0%, var(--glow-warm) 100%);
}

.calendar-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.calendar-stat {
  text-align: center;
}

.calendar-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.calendar-stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* PASS 5: Mastery Tiers */
.mastery-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.mastery-tier-badge.diamond {
  background: linear-gradient(135deg, #b9f2ff 0%, #89e0f2 100%);
  color: #0d4f5f;
  box-shadow: 0 0 10px rgba(185, 242, 255, 0.5);
}

.mastery-tier-badge.platinum {
  background: linear-gradient(135deg, #e5e4e2 0%, #c4c3c0 100%);
  color: #3d3d3d;
}

.mastery-tier-badge.gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  color: #5a4800;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.mastery-tier-badge.silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
  color: #404040;
}

.mastery-tier-badge.bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
  color: #fff;
}

.mastery-tier-badge.unranked {
  background: var(--bg-card-hover);
  color: var(--text-dim);
}

.tier-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.tier-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tier-progress-fill.diamond { background: linear-gradient(90deg, #89e0f2, #b9f2ff); }
.tier-progress-fill.platinum { background: linear-gradient(90deg, #a0a0a0, #e5e4e2); }
.tier-progress-fill.gold { background: linear-gradient(90deg, #ffb700, #ffd700); }
.tier-progress-fill.silver { background: linear-gradient(90deg, #808080, #c0c0c0); }
.tier-progress-fill.bronze { background: linear-gradient(90deg, #8b4513, #cd7f32); }

/* PASS 7: Seasonal Events */
.seasonal-banner {
  background: linear-gradient(135deg, var(--glow-warm) 0%, #f59e0b 100%);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000;
  animation: seasonalGlow 2s ease infinite;
}

@keyframes seasonalGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.6); }
}

.seasonal-banner .event-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seasonal-banner .event-icon {
  font-size: 1.5rem;
}

.seasonal-banner .event-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.seasonal-banner .event-desc {
  font-size: 0.75rem;
  opacity: 0.8;
}

.seasonal-banner .event-bonus {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Seasonal theme variations */
.seasonal-banner.winter {
  background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
}

.seasonal-banner.spooky {
  background: linear-gradient(135deg, #f97316 0%, #a855f7 100%);
}

.seasonal-banner.hearts {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.seasonal-banner.flowers {
  background: linear-gradient(135deg, #f472b6 0%, #a3e635 100%);
}

/* XP Breakdown popup */
.xp-breakdown {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--glow-warm);
  border-radius: 12px;
  padding: 1rem;
  min-width: 200px;
  z-index: 150;
  animation: xpBreakdownSlide 0.3s ease;
}

@keyframes xpBreakdownSlide {
  0% { opacity: 0; transform: translateY(-50%) translateX(50px); }
  100% { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.xp-breakdown-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.xp-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.85rem;
}

.xp-breakdown-row .label {
  color: var(--text-dim);
}

.xp-breakdown-row .value {
  color: var(--correct);
  font-weight: 600;
}

.xp-breakdown-row.lucky {
  color: var(--glow-warm);
  font-weight: 700;
}

.xp-breakdown-total {
  display: flex;
  justify-content: space-between;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
}

.xp-breakdown-total .value {
  color: var(--glow-warm);
}

/* Achievement notification variants */
.achievement-notification.daily-challenge-complete {
  border-color: var(--glow-warm);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
}

.achievement-notification.daily-challenge-complete .title {
  color: var(--glow-warm);
}

.achievement-notification.daily-challenge-complete .reward,
.achievement-notification .reward {
  color: var(--correct);
  font-weight: 600;
  font-size: 0.9rem;
}

.achievement-notification.tier-up {
  border-color: var(--correct);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.4);
}

.achievement-notification.tier-up .title {
  color: var(--correct);
}

.achievement-notification.day-streak {
  border-color: #f97316;
  box-shadow: 0 0 40px rgba(249, 115, 22, 0.4);
}

.achievement-notification.day-streak .title {
  color: #f97316;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE GAUNTLET
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .difficulty-grid {
    grid-template-columns: 1fr;
  }

  .gauntlet-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .g-stat {
    flex: 1 0 40%;
  }

  .battle-actions {
    grid-template-columns: 1fr;
  }

  .player-status {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .bests-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .score-row {
    flex-wrap: wrap;
  }

  .score-row .details {
    flex-basis: 100%;
    text-align: left;
    margin-top: 0.25rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TEST PREP GAUNTLET STYLES
   ═══════════════════════════════════════════════════════════════ */

.testprep-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Landing Page */
.testprep-landing {
  text-align: center;
}

.testprep-header h1 {
  font-size: 2rem;
  color: var(--glow-warm);
  margin-bottom: 0.5rem;
}

.testprep-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.testprep-intro {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
}

.testprep-intro .speaker {
  color: var(--glow-warm);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.testprep-intro p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

.testprep-stats-box {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.tp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tp-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--glow-warm);
}

.tp-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.testprep-start-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, var(--glow-warm), #d97706);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 1.25rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 auto;
}

.testprep-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.testprep-start-btn .btn-icon {
  font-size: 1.5rem;
}

.testprep-start-btn .btn-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
}

/* Progress Bar with Ghost Line */
.testprep-progress-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.testprep-progress-bar {
  position: relative;
  height: 24px;
  background: var(--bg-deep);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.testprep-progress-bar .progress-ghost {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(245, 158, 11, 0.2);
  border-right: 2px dashed var(--glow-warm);
  transition: width 0.3s ease;
  z-index: 1;
}

.testprep-progress-bar .progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--correct), #059669);
  border-radius: 12px;
  transition: width 0.3s ease;
  z-index: 2;
}

.testprep-progress-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Question Type Indicator */
.testprep-question-type {
  text-align: center;
  margin-bottom: 1rem;
}

.type-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.type-badge.scaffold {
  background: var(--explore-soft);
  color: var(--explore);
  border: 1px solid var(--explore);
}

.type-badge.main {
  background: var(--glow-warm-soft);
  color: var(--glow-warm);
  border: 1px solid var(--glow-warm);
  animation: pulse-main 1.5s ease infinite;
}

@keyframes pulse-main {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

/* Question Card */
.testprep-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.testprep-question-card .question-text {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.testprep-question-card .options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.testprep-question-card .option-btn {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.testprep-question-card .option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--glow-warm);
}

.testprep-question-card .option-btn.correct {
  background: var(--correct-soft);
  border-color: var(--correct);
  color: var(--correct);
}

.testprep-question-card .option-btn.incorrect {
  background: var(--incorrect-soft);
  border-color: var(--incorrect);
  color: var(--incorrect);
}

.testprep-question-card .option-btn.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.testprep-question-card .feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.testprep-question-card .feedback.correct-feedback {
  background: var(--correct-soft);
  border: 1px solid var(--correct);
  color: var(--correct);
}

.feedback-tap-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.7;
  font-style: italic;
}

.testprep-question-card .feedback.incorrect-feedback {
  background: var(--incorrect-soft);
  border: 1px solid var(--incorrect);
  color: var(--text-primary);
}

.testprep-question-card .feedback.gameover-feedback {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 2px solid var(--incorrect);
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
}

/* Lifelines Bar */
.lifelines-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.lifeline-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 70px;
}

.lifeline-btn:hover:not(.used):not(.disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.lifeline-btn.used,
.lifeline-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.lifeline-icon {
  font-size: 1.5rem;
}

.lifeline-name {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.lifeline-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.streak-display {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(251, 146, 60, 0.1));
  border: 1px solid rgba(251, 146, 60, 0.5);
  border-radius: 20px;
}

.streak-icon {
  font-size: 1.2rem;
}

.streak-count {
  font-size: 1rem;
  font-weight: 700;
  color: #fb923c;
}

/* Eliminated options */
.option-btn.eliminated {
  opacity: 0.3;
  text-decoration: line-through;
  pointer-events: none;
}

/* Hint display */
.hint-display {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.hint-display .hint-label {
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 0.5rem;
}

/* Extra life active indicator */
.extra-life-active {
  position: fixed;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 100;
  animation: pulse 2s infinite;
}

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

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* Game Over Overlay */
.testprep-gameover {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.gameover-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.gameover-title {
  font-size: 2rem;
  color: var(--incorrect);
  margin-bottom: 1.5rem;
}

.gameover-title.victory {
  color: var(--correct);
}

.gameover-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.go-stat-main, .go-stat-best {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.go-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.go-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.go-stat-best .go-value {
  color: var(--glow-warm);
}

.go-percent {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.gameover-progress-bar {
  position: relative;
  height: 20px;
  background: var(--bg-deep);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.gameover-progress-bar .progress-ghost {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(245, 158, 11, 0.25);
  border-right: 2px dashed var(--glow-warm);
  z-index: 1;
}

.gameover-progress-bar .progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--incorrect);
  border-radius: 10px;
  z-index: 2;
}

.gameover-progress-bar .progress-fill.victory {
  background: var(--correct);
}

.gameover-details {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.gameover-details p {
  margin-bottom: 0.5rem;
}

.detail-label {
  color: var(--text-dim);
}

.gameover-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.go-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.go-btn.primary {
  background: var(--glow-warm);
  color: #000;
}

.go-btn.primary:hover {
  background: #d97706;
}

.go-btn.secondary {
  background: var(--bg-deep);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.go-btn.secondary:hover {
  border-color: var(--glow-warm);
}

/* Responsive */
@media (max-width: 600px) {
  .testprep-stats-box {
    gap: 1rem;
  }

  .tp-value {
    font-size: 1.5rem;
  }

  .gameover-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .gameover-actions {
    flex-direction: column;
  }
}

/* ============================================
   SCAFFOLD HINT SYSTEM
   ============================================ */

.scaffold-hint-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scaffold-hint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.hint-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

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

.hint-content {
  background: var(--bg-card, #1f2937);
  padding: 1.75rem;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  border: 2px solid var(--explore, #8b5cf6);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
  animation: slideUp 0.25s ease;
}

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

.hint-content h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--glow-warm, #f59e0b);
}

.hint-text {
  margin: 0 0 1.25rem;
  line-height: 1.6;
  color: var(--text-primary, #f1f5f9);
  font-size: 0.95rem;
}

.hint-context {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.hint-context strong {
  color: var(--explore, #8b5cf6);
  display: block;
  margin-bottom: 0.5rem;
}

.hint-context em {
  color: var(--text-dim, #94a3b8);
  font-style: italic;
}

.hint-close-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: var(--explore, #8b5cf6);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.hint-close-btn:hover {
  background: #7c3aed;
}

/* ============================================
   VOCABULARY HOVER DEFINITIONS
   ============================================ */

.vocab-term {
  border-bottom: 1px dotted var(--explore, #8b5cf6);
  cursor: help;
  position: relative;
  color: inherit;
}

.vocab-term:hover,
.vocab-term:focus {
  color: var(--explore, #8b5cf6);
}

.vocab-term:hover::after,
.vocab-term:focus::after {
  content: attr(data-definition);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card, #1f2937);
  border: 1px solid var(--border, #374151);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 320px;
  width: max-content;
  z-index: 1000;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary, #f1f5f9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  white-space: normal;
  text-align: left;
}

/* Arrow for tooltip */
.vocab-term:hover::before,
.vocab-term:focus::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border, #374151);
  z-index: 1001;
}

/* ============================================
   FF6-STYLE BATTLE SCENE
   ============================================ */

.battle-scene {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  background:
    linear-gradient(180deg, rgba(15, 10, 26, 0.85) 0%, rgba(26, 16, 48, 0.8) 40%, rgba(21, 8, 32, 0.9) 100%),
    url('../assets/backgrounds/cave-battle.png');
  background-size: cover, cover;
  background-position: center, center;
  border: 4px solid #2d1f4a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* Monster Zone */
.battle-monster-zone {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  background: radial-gradient(ellipse at center bottom, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
}

/* Monster HP */
.monster-hp-container {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  text-align: center;
}

.monster-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e879f9;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(232, 121, 249, 0.5);
}

.monster-hp-bar {
  height: 20px;
  background: #1f1f2e;
  border: 2px solid #4a3a6a;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.monster-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 50%, #fbbf24 100%);
  border-radius: 8px;
  transition: width 0.3s ease;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}

.monster-hp-fill.warning {
  background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

.monster-hp-fill.critical {
  background: #ef4444;
  animation: hpPulse 0.5s ease infinite;
}

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

.monster-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px black;
}

/* Monster Sprite Container */
.monster-sprite-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  min-height: 140px;
  position: relative;
}

/* PNG Pixel Art Sprites - Using actual sprite images */
.pixel-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 32px;
  height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: scale(4);
  transition: transform 0.1s;
}

.pixel-sprite.shake {
  animation: monsterShake 0.3s ease;
}

@keyframes monsterShake {
  0%, 100% { transform: scale(4) translateX(0); }
  25% { transform: scale(4) translateX(-8px); }
  50% { transform: scale(4) translateX(8px); }
  75% { transform: scale(4) translateX(-4px); }
}

.pixel-sprite.defeated {
  animation: monsterDefeat 0.5s ease forwards;
}

@keyframes monsterDefeat {
  0% { transform: scale(4) rotate(0deg); opacity: 1; }
  50% { transform: scale(4) rotate(10deg); }
  100% { transform: scale(4) rotate(90deg) translateY(20px); opacity: 0.3; }
}

/* Monster Sprites - PNG images */
.monster-cell-slime {
  background-image: url('../assets/monsters/cell-slime.png');
}

.monster-mind-flayer {
  background-image: url('../assets/monsters/mind-flayer.png');
}

.monster-synapse-serpent {
  background-image: url('../assets/monsters/synapse-serpent.png');
}

.monster-tissue-titan {
  background-image: url('../assets/monsters/tissue-titan.png');
}

.monster-autonomic-specter {
  background-image: url('../assets/monsters/autonomic-specter.png');
}

.monster-eye-tyrant {
  background-image: url('../assets/monsters/eye-tyrant.png');
}

.monster-hormone-horror {
  background-image: url('../assets/monsters/hormone-horror.png');
}

/* Monster Taunt Bubble */
.monster-taunt {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #4a3a6a;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #e2e8f0;
  max-width: 280px;
  text-align: center;
  margin-top: 0.5rem;
  animation: tauntBounce 0.3s ease;
}

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

.monster-taunt.hit {
  color: #fbbf24;
  border-color: #f59e0b;
}

.monster-taunt.attack {
  color: #ef4444;
  border-color: #dc2626;
}

.monster-taunt.defeated {
  color: #94a3b8;
  opacity: 0.6;
}

/* Battle Divider */
.battle-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
}

.battle-vs {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #c084fc;
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
  letter-spacing: 0.2em;
}

/* Battle Action Menu */
.battle-action-menu {
  flex: 1;
  background: linear-gradient(180deg, #0a0a14 0%, #12121f 100%);
  border-top: 3px solid #3a2a5a;
  padding: 1.25rem;
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.action-label {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.combo-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #a855f7;
  opacity: 0;
  transition: opacity 0.2s;
}

.combo-counter.active {
  opacity: 1;
  animation: comboPulse 0.5s ease infinite;
}

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

/* Damage Numbers */
#damageContainer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.damage-number {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
  animation: damageFloat 1s ease-out forwards;
  z-index: 100;
}

.damage-number.player-damage {
  color: #ef4444;
}

.damage-number.monster-damage {
  color: #fbbf24;
}

@keyframes damageFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -30px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px) scale(0.8);
  }
}

/* Screen Flash Effects */
.battle-scene.flash-incorrect {
  animation: flashRed 0.2s ease;
}

@keyframes flashRed {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(239, 68, 68, 0.2); }
}

.battle-scene.flash-correct {
  animation: flashGreen 0.2s ease;
}

@keyframes flashGreen {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(34, 197, 94, 0.2); }
}

/* Battle Scene Responsive */
@media (max-width: 600px) {
  .battle-scene {
    min-height: 450px;
  }

  .battle-monster-zone {
    flex: 0 0 160px;
    padding: 1rem;
  }

  .pixel-sprite {
    transform: scale(4);
  }

  .pixel-sprite.shake {
    animation: monsterShakeMobile 0.3s ease;
  }

  @keyframes monsterShakeMobile {
    0%, 100% { transform: scale(4) translateX(0); }
    25% { transform: scale(4) translateX(-6px); }
    50% { transform: scale(4) translateX(6px); }
    75% { transform: scale(4) translateX(-3px); }
  }

  .monster-hp-container {
    width: 180px;
  }

  .monster-taunt {
    font-size: 0.8rem;
    max-width: 240px;
  }
}

/* ============================================
   PLAYER STATS BAR (Combat Encounter System)
   ============================================ */

.player-stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(20, 15, 35, 0.95) 0%, rgba(15, 10, 25, 0.9) 100%);
  border-bottom: 3px solid #3a2a5a;
}

.player-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.player-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.5));
}

.player-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: #a855f7;
  margin-top: 2px;
}

.player-hp-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-hp-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: #22c55e;
}

.player-hp-bar {
  flex: 1;
  height: 18px;
  background: #1f1f2e;
  border: 2px solid #2d4a3a;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  max-width: 200px;
}

.player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #4ade80 50%, #86efac 100%);
  border-radius: 7px;
  transition: width 0.3s ease;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3);
}

.player-hp-fill.warning {
  background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
}

.player-hp-fill.critical {
  background: #ef4444;
  animation: playerHpPulse 0.5s ease infinite;
}

@keyframes playerHpPulse {
  0%, 100% { opacity: 1; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 0 10px rgba(239, 68, 68, 0.5); }
  50% { opacity: 0.7; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3), 0 0 15px rgba(239, 68, 68, 0.8); }
}

.player-hp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px black;
}

.combat-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  min-width: 80px;
}

.kill-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #94a3b8;
}

/* Monster Info (Level + Name) */
.monster-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.monster-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: #f97316;
  background: rgba(249, 115, 22, 0.2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

/* Battle Phase Indicators */
.battle-phase {
  padding: 0.5rem 1rem;
  text-align: center;
}

.phase-combat {
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  color: #f97316;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

.phase-victory {
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
  animation: victoryGlow 1s ease infinite;
}

@keyframes victoryGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
  50% { text-shadow: 0 0 20px rgba(34, 197, 94, 0.8), 0 0 30px rgba(34, 197, 94, 0.4); }
}

/* Victory state */
.battle-scene.monster-defeated .battle-monster-zone {
  background: radial-gradient(ellipse at center bottom, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
}

.battle-scene.monster-defeated .monster-hp-bar {
  border-color: #4a4a5a;
  opacity: 0.6;
}

/* Critical Damage Numbers */
.damage-number.critical {
  font-size: 2rem;
  color: #fbbf24 !important;
  animation: critDamageFloat 1.2s ease-out forwards;
}

@keyframes critDamageFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.5);
  }
  30% {
    transform: translate(-50%, -20px) scale(1.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(1);
  }
}

.damage-number.blocked {
  color: #94a3b8 !important;
  font-size: 1.2rem;
}

/* Game Over Flash */
.battle-scene.flash-gameover {
  animation: flashGameOver 0.6s ease;
}

@keyframes flashGameOver {
  0%, 100% { background-color: transparent; }
  25% { background-color: rgba(239, 68, 68, 0.4); }
  50% { background-color: rgba(239, 68, 68, 0.2); }
  75% { background-color: rgba(239, 68, 68, 0.3); }
}

/* Responsive Player Stats */
@media (max-width: 600px) {
  .player-stats-bar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .player-portrait {
    min-width: 40px;
  }

  .player-icon {
    font-size: 1.25rem;
  }

  .player-hp-bar {
    max-width: 150px;
    height: 16px;
  }

  .player-hp-text {
    font-size: 0.6rem;
  }

  .combat-stats {
    min-width: 60px;
  }

  .combo-counter {
    font-size: 0.75rem;
  }

  .kill-count {
    font-size: 0.6rem;
  }

  .monster-info {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ============================================
   LIMIT BREAK EFFECTS
   ============================================ */

/* Limit Break Flash */
.battle-scene.limit-break-flash {
  animation: limitBreakFlash 0.8s ease;
}

@keyframes limitBreakFlash {
  0% { filter: brightness(1); }
  15% { filter: brightness(3) saturate(0); }
  30% { filter: brightness(2) saturate(0.5); }
  50% { filter: brightness(1.5) saturate(1); }
  100% { filter: brightness(1); }
}

/* Limit Break Overlay */
.limit-break-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
  z-index: 100;
  pointer-events: none;
  animation: limitBreakOverlayPulse 1.5s ease forwards;
}

@keyframes limitBreakOverlayPulse {
  0% { opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1.2); }
  40% { transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

.limit-break-text {
  font-family: 'Crimson Pro', serif;
  font-size: 3rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow:
    0 0 20px #ffd700,
    0 0 40px #ff8c00,
    0 0 60px #ff4500,
    2px 2px 0 #000;
  animation: limitBreakTextPulse 0.5s ease infinite alternate;
}

@keyframes limitBreakTextPulse {
  0% { transform: scale(1); text-shadow: 0 0 20px #ffd700, 0 0 40px #ff8c00, 2px 2px 0 #000; }
  100% { transform: scale(1.1); text-shadow: 0 0 30px #ffd700, 0 0 60px #ff8c00, 0 0 80px #ff4500, 2px 2px 0 #000; }
}

/* Screen Shake */
.battle-scene.screen-shake {
  animation: screenShake 0.5s ease;
}

@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px) rotate(-1deg); }
  20% { transform: translateX(10px) rotate(1deg); }
  30% { transform: translateX(-8px) rotate(-0.5deg); }
  40% { transform: translateX(8px) rotate(0.5deg); }
  50% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  90% { transform: translateX(-1px); }
}

/* Devastating Counter Flash */
.battle-scene.flash-devastating {
  animation: flashDevastating 0.8s ease;
}

@keyframes flashDevastating {
  0% { filter: brightness(1); }
  10% { filter: brightness(0.3) sepia(1) hue-rotate(-30deg); }
  20% { filter: brightness(2) sepia(0.5) hue-rotate(-30deg); }
  40% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

/* Victory State */
.battle-scene.victory {
  background: linear-gradient(180deg,
    rgba(34, 197, 94, 0.1) 0%,
    rgba(15, 10, 25, 0.95) 30%,
    rgba(10, 5, 20, 0.95) 100%);
}

.battle-scene.victory .monster-sprite-container {
  filter: grayscale(0.8) brightness(0.5);
}

/* Phase Labels */
.phase-limit-break {
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  animation: limitBreakReady 1s ease infinite;
}

@keyframes limitBreakReady {
  0%, 100% {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.9), 0 0 30px rgba(255, 140, 0, 0.5);
    transform: scale(1.05);
  }
}

/* Monster Triumph (after devastating counter) */
.monster-taunt.monster-triumph {
  color: #ef4444 !important;
  animation: monsterTriumph 0.5s ease;
}

@keyframes monsterTriumph {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); color: #ff0000; }
  100% { transform: scale(1); }
}

/* Monster Weakened (at 1 HP, ready for limit break) */
.monster-taunt.monster-weak {
  color: #fbbf24 !important;
  font-style: italic;
}

.monster-hp-fill.critical {
  animation: criticalPulse 0.5s ease infinite;
}

@keyframes criticalPulse {
  0%, 100% { opacity: 1; background: #ef4444; }
  50% { opacity: 0.6; background: #dc2626; }
}

