/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink: #ff69b4;
  --purple: #a855f7;
  --blue: #38bdf8;
  --gold: #fbbf24;
  --green: #4ade80;
  --red: #f87171;
  --bg: #fff8f0;
  --bg2: #fef3e2;
  --card: #ffffff;
  --text: #3b2f4a;
  --text-dim: #8b7a9e;
  --radius: 18px;
  --shadow: 0 4px 16px rgba(160,120,200,0.15);
}

html, body {
  height: 100%;
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
}

#app {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px;
  min-height: 100vh;
}

/* ─── Typography ───────────────────────────────────────────────── */
h1, h2, h3 { font-weight: 800; }
h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; margin-bottom: 14px; }
h3 { font-size: 1.4rem; margin-bottom: 10px; }
p { margin-bottom: 10px; line-height: 1.7; font-size: 1.15rem; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: center;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; box-shadow: var(--shadow); }
.btn-secondary { background: var(--card); color: var(--text); border: 2px solid var(--purple); }
.btn-ghost { background: transparent; color: var(--text-dim); text-decoration: underline; padding: 8px 14px; font-size: 1rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 18px 36px; font-size: 1.35rem; width: 100%; border-radius: 22px; }
.btn-sm { padding: 8px 14px; font-size: 0.95rem; }

.hidden { display: none !important; }

/* ─── Input ────────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 1.2rem;
  outline: none;
  margin: 8px 0;
}
.input-field:focus { border-color: var(--pink); }

/* ─── Home Screen ──────────────────────────────────────────────── */
.home-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
  text-align: center;
  gap: 20px;
}
.game-title {
  font-size: 2.8rem;
  background: linear-gradient(135deg, var(--pink), var(--gold), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.game-subtitle { color: var(--text-dim); font-size: 1.3rem; }
.home-buttons { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }
.home-hero { animation: float 3s ease-in-out infinite; }

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

/* ─── Profiles ─────────────────────────────────────────────────── */
.profiles-screen { text-align: center; padding-top: 20px; }
.profile-list { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 18px 0; }
.profile-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  width: 150px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  border: 3px solid #e8dff5;
  text-align: center;
  box-shadow: var(--shadow);
}
.profile-card.active { border-color: var(--pink); }
.profile-card:hover { transform: scale(1.05); }
.profile-name { font-weight: 700; margin-top: 8px; font-size: 1.1rem; }
.profile-progress { font-size: 0.95rem; color: var(--text-dim); margin-top: 4px; }
.profile-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 18px; }
#create-profile-form { margin-top: 18px; display: flex; gap: 10px; justify-content: center; align-items: center; }

/* ─── Character Select ─────────────────────────────────────────── */
.character-screen { text-align: center; padding-top: 40px; }
.variant-grid { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.variant-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid #e8dff5;
  box-shadow: var(--shadow);
}
.variant-card:hover { transform: scale(1.08); border-color: var(--gold); box-shadow: 0 6px 24px rgba(160,120,200,0.25); }
.variant-label { margin-top: 10px; font-weight: 700; font-size: 1.15rem; }

/* ─── Settings Select ──────────────────────────────────────────── */
.settings-screen { padding-top: 40px; text-align: center; }
.setting-group { background: var(--card); border-radius: var(--radius); padding: 24px; margin: 18px 0; box-shadow: var(--shadow); }
.setting-group label { display: block; font-weight: 700; margin-bottom: 14px; font-size: 1.25rem; }
.grade-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.grade-btn { min-width: 90px; }
.slider { width: 100%; height: 12px; -webkit-appearance: none; appearance: none; background: #e8dff5; border-radius: 6px; outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--pink), var(--purple)); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; font-size: 1rem; color: var(--text-dim); margin-top: 6px; }
.setting-actions { margin-top: 28px; }

/* ─── Level Map ────────────────────────────────────────────────── */
.level-map-screen { padding-top: 10px; }
.map-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.map-info { flex: 1; }
.map-info h2 { margin-bottom: 2px; font-size: 1.5rem; }
.map-stats { font-size: 1rem; color: var(--text-dim); }

.level-path { display: flex; flex-direction: column; gap: 12px; }
.level-node {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 6px solid transparent;
  box-shadow: var(--shadow);
}
.level-node.unlocked { cursor: pointer; border-left-color: var(--blue); }
.level-node.unlocked:hover { transform: translateX(4px); box-shadow: 0 6px 24px rgba(160,120,200,0.25); }
.level-node.completed { border-left-color: var(--green); }
.level-node.locked { opacity: 0.45; }
.level-node.boss { border-left-color: var(--red); }
.level-node.boss.completed { border-left-color: var(--gold); }
.level-num { font-size: 1.8rem; font-weight: 800; min-width: 52px; text-align: center; }
.level-title { flex: 1; font-weight: 700; font-size: 1.2rem; }
.level-stars { font-size: 1.2rem; }
.level-lock { font-size: 1.5rem; }

.upgrades-bar { margin-top: 24px; margin-bottom: 18px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.upgrades-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.upgrade-badge { font-size: 2rem; opacity: 1; transition: transform 0.15s; display: inline-block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.upgrade-badge.earned:hover { transform: scale(1.3); }
.upgrade-badge.locked { opacity: 0.2; filter: grayscale(1); }
.upgrade-badge.locked:hover { transform: scale(1.1); }

/* ─── Upgrade Story Panel ──────────────────────────────────────── */
.upgrade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 18px;
}
.upgrade-overlay.visible { opacity: 1; }
.upgrade-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.upgrade-overlay.visible .upgrade-panel { transform: translateY(0); }
.upgrade-panel-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
}
.upgrade-panel-hero { margin-bottom: 8px; }
.upgrade-panel-emoji { font-size: 4rem; margin: 8px 0; }
.upgrade-panel-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--purple);
  margin-bottom: 8px;
}
.upgrade-panel-power {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 16px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255,105,180,0.1), rgba(168,85,247,0.1));
  border-radius: 12px;
}
.upgrade-panel-story {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
  text-align: left;
}

body.theme-retro .upgrade-panel {
  border: 3px solid var(--purple);
  border-radius: 0;
  box-shadow: 0 0 20px var(--purple);
}
body.theme-retro .upgrade-panel-name { color: var(--gold); }
body.theme-retro .upgrade-panel-power {
  color: var(--blue);
  background: rgba(0,229,255,0.1);
  border-radius: 0;
}

/* ─── Story Screen ─────────────────────────────────────────────── */
.story-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 90vh;
  padding-top: 20px;
  gap: 14px;
}

.story-scene {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px;
}

/* Chat bubble shared */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  opacity: 0;
  animation: bubbleFadeIn 0.5s ease forwards;
}
.chat-row .chat-avatar { flex-shrink: 0; }
.chat-row .chat-avatar svg { display: block; }

/* Hero bubbles — left aligned */
.chat-row.hero { flex-direction: row; }
.chat-row.hero .chat-bubble {
  background: linear-gradient(135deg, #fce4f6, #f3e8ff);
  border-radius: 20px 20px 20px 4px;
  border: 2px solid #f0c6e8;
}

/* Villain bubbles — right aligned */
.chat-row.villain { flex-direction: row-reverse; }
.chat-row.villain .chat-bubble {
  background: linear-gradient(135deg, #e2e8f0, #d4dae3);
  border-radius: 20px 20px 4px 20px;
  border: 2px solid #bfc8d6;
  color: #3b4252;
}

/* Narration — centered, no avatar */
.chat-row.narration { justify-content: center; }
.chat-row.narration .chat-bubble {
  background: var(--card);
  border-radius: 20px;
  border: 2px solid #e8dff5;
  text-align: center;
  font-style: italic;
}

/* Announcement — bold centered */
.chat-row.announce { justify-content: center; }
.chat-row.announce .chat-bubble {
  background: linear-gradient(135deg, #fef9c3, #fce7f3);
  border-radius: 20px;
  border: 2px solid var(--gold);
  text-align: center;
  font-weight: 800;
  color: var(--purple);
}

.chat-bubble {
  padding: 14px 18px;
  font-size: 1.25rem;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  max-width: 85%;
}
.chat-bubble strong { color: var(--purple); }
.chat-bubble em { color: var(--pink); font-style: normal; }
.chat-speaker { font-size: 0.9rem; font-weight: 700; color: var(--text-dim); margin-bottom: 3px; padding-left: 66px; }
.chat-speaker.right { padding-left: 0; padding-right: 66px; text-align: right; }

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

.story-hero { animation: float 3s ease-in-out infinite; }

.story-continue {
  margin-top: 12px;
  width: 100%;
  max-width: 460px;
}

/* ─── Practice Screen ──────────────────────────────────────────── */
.practice-screen { padding-top: 10px; }
.practice-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.practice-level { font-weight: 800; font-size: 1.25rem; }
.practice-progress { font-size: 1.05rem; color: var(--text-dim); }

/* ─── Hero Journey Visual ─────────────────────────────────────── */
.hero-journey { margin-bottom: 18px; }
.journey-track {
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
}
.journey-line {
  position: absolute;
  left: 0;
  right: 36px;
  top: 50%;
  height: 6px;
  background: #e8dff5;
  border-radius: 3px;
  transform: translateY(-50%);
}
.journey-line-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 6px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 3px;
  transform: translateY(-50%);
  transition: width 0.5s ease;
  max-width: calc(100% - 36px);
}
.journey-hero {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: left 0.5s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.journey-dest {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  z-index: 1;
}

body.theme-retro .journey-line { background: #2a2a4a; }
body.theme-retro .journey-line-fill { background: var(--green); }

.progress-bar { height: 12px; background: #e8dff5; border-radius: 6px; margin-bottom: 24px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--purple)); border-radius: 6px; transition: width 0.3s; }

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.question-text { font-size: 3rem; font-weight: 800; margin-bottom: 28px; color: var(--text); }

/* ─── Multiple Choice ──────────────────────────────────────────── */
.choices-grid {
  display: grid;
  gap: 14px;
  max-width: 400px;
  margin: 0 auto;
}
.choices-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.choices-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.choice-btn {
  padding: 22px 14px;
  font-size: 1.8rem;
  font-weight: 800;
  border: 3px solid #e8dff5;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  box-shadow: var(--shadow);
}
.choice-btn:active { transform: scale(0.95); }
.choice-btn:hover { border-color: var(--purple); }

.choice-btn.correct {
  background: #d1fae5;
  border-color: var(--green);
  animation: bounceCorrect 0.5s ease;
}
.choice-btn.incorrect {
  background: #fee2e2;
  border-color: var(--red);
  animation: shake 0.5s ease;
}
.choice-btn.reveal-correct {
  background: #d1fae5;
  border-color: var(--green);
}

@keyframes bounceCorrect {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.feedback {
  margin-top: 20px;
  padding: 14px;
  border-radius: 14px;
  font-size: 1.4rem;
  font-weight: 700;
}
.feedback.correct { background: #d1fae5; color: #166534; }
.feedback.incorrect { background: #fee2e2; color: #991b1b; }
.fb-icon { font-size: 1.6rem; }

/* ─── Emoji Particle Burst ─────────────────────────────────────── */
.emoji-particle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.emoji-particle {
  position: absolute;
  font-size: 2.4rem;
  opacity: 0;
  animation: emojiPop 1.2s ease-out forwards;
}

@keyframes emojiPop {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.3) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: translate(
      calc(var(--drift-x) * 0.6),
      calc(var(--drift-y) * 0.6)
    ) scale(var(--end-scale)) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift-x), var(--drift-y)) scale(0) rotate(360deg);
  }
}

/* ─── Level Complete ───────────────────────────────────────────── */
.complete-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  gap: 18px;
}
.complete-title { font-size: 1.4rem; color: var(--text-dim); }
.complete-stats { display: flex; gap: 28px; margin: 14px 0; }
.stat { text-align: center; }
.stat-val { font-size: 2.2rem; font-weight: 800; color: var(--purple); }
.stat-label { font-size: 1rem; color: var(--text-dim); }
.reward-card {
  background: linear-gradient(135deg, #fef9c3, #fce7f3);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  animation: glow 2s ease-in-out infinite alternate;
  box-shadow: var(--shadow);
}
.reward-emoji { font-size: 5rem; }
.reward-name { font-size: 1.6rem; font-weight: 800; color: var(--purple); margin-top: 8px; }
.reward-desc { color: var(--text-dim); font-size: 1.15rem; }

.emoji-burst {
  font-size: 2.8rem;
  animation: burstIn 0.8s ease-out;
  letter-spacing: 8px;
}

@keyframes burstIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes glow {
  from { box-shadow: 0 0 10px rgba(251,191,36,0.2); }
  to { box-shadow: 0 0 30px rgba(251,191,36,0.4); }
}

/* ─── Parent Settings ──────────────────────────────────────────── */
.parent-screen { padding-top: 20px; }
.parent-section { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.profile-list.compact { flex-direction: column; gap: 10px; }
.profile-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.profile-row-name { flex: 1; font-weight: 700; font-size: 1.1rem; }
.toggle-label { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 1.1rem; }
.toggle-label input { width: 20px; height: 20px; }
.msg-success { color: #166534; margin-top: 10px; font-weight: 600; font-size: 1.05rem; }
.msg-error { color: #991b1b; margin-top: 10px; font-weight: 600; font-size: 1.05rem; }

/* ─── Error Screen ─────────────────────────────────────────────── */
.error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  gap: 18px;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 360px) {
  .question-text { font-size: 2.2rem; }
  .choice-btn { padding: 16px 10px; font-size: 1.4rem; }
}

/* ─── Retro Pixel-Art Theme ───────────────────────────────────── */
body.theme-retro {
  --pink: #ff2975;
  --purple: #b026ff;
  --blue: #00e5ff;
  --gold: #ffe600;
  --green: #39ff14;
  --red: #ff1744;
  --bg: #0f0f23;
  --bg2: #1a1a3e;
  --card: #1c1c3a;
  --text: #e0e0ff;
  --text-dim: #7a7aaa;
  --radius: 0;
  --shadow: none;
  font-family: 'Press Start 2P', monospace;
  background: var(--bg);
}

body.theme-retro h1 { font-size: 1.6rem; }
body.theme-retro h2 { font-size: 1.2rem; }
body.theme-retro h3 { font-size: 0.9rem; }
body.theme-retro p { font-size: 0.8rem; line-height: 1.8; }
body.theme-retro .btn { font-size: 0.8rem; border-radius: 0; box-shadow: none; }
body.theme-retro .btn-primary { background: var(--pink); }
body.theme-retro .btn-secondary { border: 3px solid var(--blue); color: var(--blue); background: transparent; }
body.theme-retro .btn-lg { font-size: 0.9rem; border-radius: 0; }
body.theme-retro .btn-ghost { color: var(--text-dim); }
body.theme-retro .btn-danger { background: var(--red); }

body.theme-retro .game-title {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--pink), var(--gold), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-retro .input-field { border: 3px solid var(--blue); background: var(--card); color: var(--text); border-radius: 0; }
body.theme-retro .input-field:focus { border-color: var(--pink); }

body.theme-retro .profile-card { border: 3px solid var(--purple); background: var(--card); box-shadow: none; border-radius: 0; }
body.theme-retro .profile-card.active { border-color: var(--pink); }
body.theme-retro .variant-card { border: 3px solid var(--purple); background: var(--card); box-shadow: none; border-radius: 0; }
body.theme-retro .variant-card:hover { border-color: var(--gold); box-shadow: 0 0 12px var(--gold); }

body.theme-retro .setting-group { background: var(--card); border: 2px solid var(--purple); box-shadow: none; border-radius: 0; }
body.theme-retro .slider { background: #2a2a4a; border-radius: 0; }
body.theme-retro .slider::-webkit-slider-thumb { border-radius: 0; background: var(--pink); width: 24px; height: 24px; }

body.theme-retro .level-node { background: var(--card); border: 2px solid var(--purple); box-shadow: none; border-radius: 0; border-left: 6px solid transparent; }
body.theme-retro .level-node.unlocked { border-left-color: var(--blue); }
body.theme-retro .level-node.unlocked:hover { box-shadow: 0 0 10px var(--blue); }
body.theme-retro .level-node.completed { border-left-color: var(--green); }
body.theme-retro .level-node.boss { border-left-color: var(--red); }
body.theme-retro .upgrades-bar { background: var(--card); border: 2px solid var(--purple); box-shadow: none; border-radius: 0; }

body.theme-retro .progress-bar { background: #2a2a4a; border-radius: 0; }
body.theme-retro .progress-fill { background: var(--green); border-radius: 0; }

body.theme-retro .question-card { background: var(--card); border: 3px solid var(--blue); box-shadow: none; border-radius: 0; }
body.theme-retro .question-text { font-size: 2rem; color: var(--gold); }
body.theme-retro .choice-btn { border: 3px solid var(--purple); background: var(--card); color: var(--text); box-shadow: none; border-radius: 0; font-size: 1.4rem; }
body.theme-retro .choice-btn:hover { border-color: var(--blue); box-shadow: 0 0 8px var(--blue); }
body.theme-retro .choice-btn.correct { background: #0a2a0a; border-color: var(--green); box-shadow: 0 0 12px var(--green); }
body.theme-retro .choice-btn.incorrect { background: #2a0a0a; border-color: var(--red); box-shadow: 0 0 12px var(--red); }
body.theme-retro .choice-btn.reveal-correct { background: #0a2a0a; border-color: var(--green); }

body.theme-retro .feedback { border-radius: 0; }
body.theme-retro .feedback.correct { background: #0a2a0a; color: var(--green); }
body.theme-retro .feedback.incorrect { background: #2a0a0a; color: var(--red); }

body.theme-retro .chat-row.hero .chat-bubble { background: var(--card); border: 2px dashed var(--pink); border-radius: 0; color: var(--text); }
body.theme-retro .chat-row.villain .chat-bubble { background: var(--card); border: 2px dashed var(--red); border-radius: 0; color: var(--text); }
body.theme-retro .chat-row.narration .chat-bubble { background: var(--card); border: 2px dashed var(--text-dim); border-radius: 0; color: var(--text); }
body.theme-retro .chat-row.announce .chat-bubble { background: var(--card); border: 2px solid var(--gold); border-radius: 0; color: var(--gold); }
body.theme-retro .chat-bubble strong { color: var(--blue); }
body.theme-retro .chat-bubble em { color: var(--pink); }

body.theme-retro .reward-card { background: var(--card); border: 3px solid var(--gold); border-radius: 0; box-shadow: 0 0 20px rgba(255,230,0,0.3); }
body.theme-retro .reward-name { color: var(--gold); }
body.theme-retro .stat-val { color: var(--blue); }

body.theme-retro .parent-section { background: var(--card); border: 2px solid var(--purple); box-shadow: none; border-radius: 0; }

body.theme-retro .theme-card { border: 3px solid var(--purple); background: var(--card); color: var(--text); border-radius: 0; }
body.theme-retro .theme-card.active { border-color: var(--green); box-shadow: 0 0 12px var(--green); }

@keyframes neonGlow {
  from { box-shadow: 0 0 8px rgba(255,230,0,0.3); }
  to { box-shadow: 0 0 24px rgba(255,230,0,0.6); }
}
body.theme-retro .reward-card { animation: neonGlow 2s ease-in-out infinite alternate; }

/* Theme picker cards (shared) */
.theme-picker { display: flex; gap: 14px; justify-content: center; margin: 18px 0; }
.theme-card {
  background: var(--card);
  border: 3px solid #e8dff5;
  border-radius: var(--radius);
  padding: 18px 24px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s;
  flex: 1;
  max-width: 200px;
}
.theme-card:hover { transform: scale(1.05); }
.theme-card.active { border-color: var(--pink); }
.theme-card-label { font-weight: 700; font-size: 1.1rem; margin-top: 6px; }
body.theme-retro .theme-card-label { font-size: 0.7rem; }

/* ─── Version Badge ─────────────────────────────────────────────── */
#version-badge {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 0.65rem;
  opacity: 0.45;
  pointer-events: none;
  z-index: 9999;
  color: var(--text-dim);
}

/* ─── PIN Modal ─────────────────────────────────────────────────── */
.pin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 18px;
}
.pin-modal-overlay.visible { opacity: 1; }
.pin-modal {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pin-modal-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple);
}
.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 4px 0;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  background: transparent;
  transition: background 0.15s ease;
}
.pin-dot.filled {
  background: var(--purple);
}
@keyframes pin-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.pin-shake { animation: pin-shake 0.5s ease; }
.pin-error {
  color: #e53935;
  font-size: 0.85rem;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 260px;
}
.pin-key {
  min-height: 60px;
  min-width: 60px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  background: transparent;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:active { background: rgba(168,85,247,0.2); transform: scale(0.93); }
.pin-key-del { border-color: var(--text-dim); color: var(--text-dim); font-size: 1.2rem; }
body.theme-retro .pin-modal {
  border: 3px solid var(--purple);
  border-radius: 0;
  box-shadow: 0 0 20px var(--purple);
}
body.theme-retro .pin-key {
  border-radius: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
}
