/* ============================================================
   DeGameWar — Complete CSS
   Premium dark game UI, mobile-first
   ============================================================ */

/* ----- Variables ----- */
:root {
  --bg-primary: #0c0c1a;
  --bg-secondary: #141428;
  --bg-card: #1c1c36;
  --bg-card-hover: #24244a;
  --color-a: #ff3d71;
  --color-a-light: rgba(255, 61, 113, 0.15);
  --color-b: #00d9ff;
  --color-b-light: rgba(0, 217, 255, 0.15);
  --gold: #ffd700;
  --green: #00e676;
  --red: #ff1744;
  --purple: #b44dff;
  --orange: #ff6d00;
  --text-primary: #f0f0ff;
  --text-secondary: #9999bb;
  --text-muted: #555577;
  --green-success: var(--green);
  --red-fail: var(--red);
  --purple-epic: var(--purple);
  --orange-fire: var(--orange);
}

/* Theme variants */
html[data-theme="neon-blue"] { --color-a: #3d71ff; --bg-primary: #0a0a20; }
html[data-theme="purple-rain"] { --color-a: #b44dff; --color-b: #ff4db4; --bg-primary: #12061a; }
html[data-theme="blood-red"] { --color-a: #ff1744; --color-b: #ff6d00; --bg-primary: #1a0606; }
html[data-theme="retro"] { --color-a: #ff6b6b; --color-b: #4ecdc4; --bg-primary: #1a1a2e; }

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255,61,113,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0,217,255,0.04) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body.game-active { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
.hidden { display: none !important; }

/* ============================================================
   APP CONTAINER
   ============================================================ */
#app {
  position: relative;
  min-height: 100dvh;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}
.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s ease;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 14px 28px;
  font-family: "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  transition: transform 150ms, box-shadow 150ms, opacity 150ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn-large { width: 100%; font-size: 18px; padding: 16px 32px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-a), #ff6b8a);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,61,113,0.35);
}
.btn-primary:active { box-shadow: 0 2px 10px rgba(255,61,113,0.2); }
.btn-secondary {
  background: linear-gradient(135deg, var(--color-b), #0088cc);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,217,255,0.3);
}
.btn-secondary:active { box-shadow: 0 2px 10px rgba(0,217,255,0.15); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #000;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(255,215,0,0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-primary);
}
.btn-text { background: transparent; color: var(--text-secondary); padding: 8px 16px; font-size: 14px; }
.btn-danger { background: var(--red); color: #fff; }
.btn-pulse { animation: pulse 2.5s ease-in-out infinite; }
.btn-next {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
  padding: 14px 48px;
}
.btn-next:active { transform: translateX(-50%) scale(0.96); }
.btn-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  border-radius: 50%;
}
.btn-icon:active { background: rgba(255,255,255,0.06); }
.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 16px; padding: 8px 0;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-disabled { opacity: 0.4; pointer-events: none; }

/* ============================================================
   HOME — HERO PLAY BUTTON
   ============================================================ */
.btn-play-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--color-a), #ff6b8a);
  box-shadow: 0 8px 32px rgba(255,61,113,0.4);
  border: none;
  cursor: pointer;
  transition: transform 150ms, box-shadow 150ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  margin-bottom: 16px;
}
.btn-play-main:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(255,61,113,0.25);
}
.btn-play-text {
  font-family: "Bebas Neue", cursive;
  font-size: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}
.btn-play-sub {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

/* ============================================================
   HOME CONTAINER
   ============================================================ */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 80px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow-y: auto;
  min-height: 100dvh;
}

.home-header {
  text-align: center;
  margin-bottom: 20px;
  width: 100%;
}

.logo {
  font-family: "Bebas Neue", cursive;
  font-size: 56px;
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-a), var(--color-b));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-accent {
  background: linear-gradient(135deg, var(--color-b), var(--color-a));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ============================================================
   HOME — STATS ROW (Pills)
   ============================================================ */
.home-stats-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
}

.stat-pill-icon {
  font-size: 16px;
  line-height: 1;
}

.stat-pill-value {
  font-family: "Space Mono", monospace;
  font-weight: 700;
  color: var(--text-primary);
}

/* Gold color for bolts pill */
.stat-pill:first-child .stat-pill-value {
  color: var(--gold);
}

.stat-pill-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   HOME — XP BAR
   ============================================================ */
.xp-bar-wrap {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 20px;
  text-align: center;
}

.xp-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 99px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.xp-text {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

/* ============================================================
   HOME — SECONDARY ACTIONS (Daily + Friends)
   ============================================================ */
.home-secondary-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
}

.btn-action {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--bg-card-hover);
  cursor: pointer;
  transition: transform 150ms, background 150ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-action:active {
  transform: scale(0.96);
  background: var(--bg-card-hover);
}

.btn-action-icon {
  font-size: 24px;
  margin-bottom: 4px;
  line-height: 1;
}

.btn-action-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-action-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: "Space Mono", monospace;
  margin-top: 2px;
}

/* ============================================================
   HOME — SECTION LABEL
   ============================================================ */
.section-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 4px;
  width: 100%;
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  width: 100%;
  padding: 0 0 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 8px;
}
.category-cards::-webkit-scrollbar { display: none; }

.category-card {
  flex: 0 0 80px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 200ms;
}
.category-card:active { transform: scale(0.95); }
.category-card.active {
  border-color: var(--color-a);
  background: var(--bg-card-hover);
  box-shadow: 0 0 12px rgba(255,61,113,0.15);
}

.cat-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

.cat-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ============================================================
   BOTTOM NAV — FIXED
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(12,12,26,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 150ms;
}
.nav-tab:active {
  opacity: 0.7;
}
.nav-tab:active .nav-tab-label {
  color: var(--text-primary);
}

.nav-tab-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-tab-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  transition: color 150ms;
}

/* ============================================================
   GAME SCREEN
   ============================================================ */
#screen-game {
  height: 100dvh;
  overflow: hidden;
  flex-direction: column;
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(12,12,26,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
  z-index: 10;
}

.game-progress {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.game-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-score-display {
  font-family: "Bebas Neue", cursive;
  font-size: 26px;
  color: var(--gold);
  line-height: 1;
}
.game-score-display span:last-child {
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.game-streak {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
}

.game-lives {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
  font-size: 20px;
}
.life-empty { opacity: 0.2; }
.streak-fire { font-size: 20px; }

/* Timer */
.timer-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
  transition: width 0.1s linear;
}
.timer-danger { animation: pulse 0.5s ease-in-out infinite; }

/* Question */
.game-question-area {
  padding: 14px 16px 6px;
  text-align: center;
  flex-shrink: 0;
}

.game-question {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(16px, 4vw, 22px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

/* Reveal text */
.game-reveal-text {
  text-align: center;
  padding: 6px 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   OPTIONS A/B — THE HERO
   ============================================================ */
.game-options {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 40vh;
  position: relative;
}

.option {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 14px;
  min-height: 180px;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 200ms;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option:active { transform: scale(0.98); }

/* Option label letter — VISIBLE */
.option-label {
  font-family: "Bebas Neue", cursive;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.3;
}
.option-a .option-label { color: var(--color-a); }
.option-b .option-label { color: var(--color-b); }

/* Option A — pink/red gradient with STRONGER backgrounds */
.option-a {
  background: linear-gradient(180deg, rgba(255,61,113,0.15) 0%, rgba(255,61,113,0.04) 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
}
.option-a:active, .option-a.selected {
  background: linear-gradient(180deg, rgba(255,61,113,0.3) 0%, rgba(255,61,113,0.1) 100%);
  box-shadow: inset 0 0 80px rgba(255,61,113,0.2);
}

/* Option B — cyan/blue gradient */
.option-b {
  background: linear-gradient(180deg, rgba(0,217,255,0.15) 0%, rgba(0,217,255,0.04) 100%);
}
.option-b:active, .option-b.selected {
  background: linear-gradient(180deg, rgba(0,217,255,0.3) 0%, rgba(0,217,255,0.1) 100%);
  box-shadow: inset 0 0 80px rgba(0,217,255,0.2);
}

/* Option text — bigger and bolder */
.option-text {
  font-family: "DM Sans", sans-serif;
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Option states */
.option.disabled { pointer-events: none; }
.option.winner {
  filter: brightness(1.3);
  box-shadow: inset 0 0 40px rgba(0,230,118,0.1);
}
.option.loser { opacity: 0.35; filter: grayscale(0.3); }
.option.dimmed { filter: brightness(0.35); transition: filter 0.4s; }
.option.flash-select { animation: optionFlash 0.3s ease; }
@keyframes optionFlash { 0% { filter: brightness(1); } 50% { filter: brightness(1.8); } 100% { filter: brightness(1); } }

/* Reveal percentages — dramatic */
.option-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.option-percent {
  font-family: "Space Mono", monospace;
  font-size: clamp(40px, 12vw, 60px);
  font-weight: 700;
  line-height: 1;
}
.option-a .option-percent {
  color: var(--color-a);
  text-shadow: 0 0 30px rgba(255,61,113,0.6), 0 0 60px rgba(255,61,113,0.2);
}
.option-b .option-percent {
  color: var(--color-b);
  text-shadow: 0 0 30px rgba(0,217,255,0.6), 0 0 60px rgba(0,217,255,0.2);
}

.option-bar {
  width: 80%;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}
.option-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1.5s ease-out;
}
.bar-a { background: var(--color-a); }
.bar-b { background: var(--color-b); }

/* Result overlay */
.game-result-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
  text-align: center;
}
.game-result-text {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
}
.result-correct { color: var(--green); text-shadow: 0 0 30px rgba(0,230,118,0.4); }
.result-wrong { color: var(--text-secondary); }
.result-tie { color: var(--gold); text-shadow: 0 0 30px rgba(255,215,0,0.4); }
.game-result-points {
  font-family: "Bebas Neue", cursive;
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255,215,0,0.4);
  display: block;
  margin-top: 4px;
}

/* Fun fact */
.game-fun-fact {
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   RESULTS
   ============================================================ */
.results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  max-width: 400px;
  margin: 0 auto;
  min-height: 100dvh;
  justify-content: center;
}

.results-rank-emoji { font-size: 56px; margin-bottom: 8px; }

.results-rank-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.results-score-wrap { text-align: center; margin-bottom: 20px; }

.results-score {
  font-family: "Bebas Neue", cursive;
  font-size: 64px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 25px rgba(255,215,0,0.3);
}
.results-score-label { font-size: 14px; color: var(--text-secondary); }

.results-stats {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}

.results-stat {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border-radius: 14px;
}
.results-stat-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.results-stat-value {
  font-family: "Bebas Neue", cursive;
  font-size: 28px;
  line-height: 1;
  display: block;
  margin-bottom: 3px;
}
.results-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.results-bolts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.bolts-earned {
  font-family: "Space Mono", monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
}
.results-bolts .bolts-label { font-size: 14px; color: var(--text-secondary); }

.results-percentile {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}
.results-near-miss {
  font-size: 13px;
  color: var(--purple);
  text-align: center;
  margin-bottom: 12px;
}
.pulse-animation { animation: pulse 2s ease-in-out infinite; }

.results-new-record {
  font-family: "Bebas Neue", cursive;
  font-size: 28px;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
  text-align: center;
  margin-bottom: 12px;
}

/* Results — prominent share actions */
.results-share-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

.btn-share-main {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 150ms, background 150ms;
  -webkit-tap-highlight-color: transparent;
}
.btn-share-main:active {
  transform: scale(0.96);
  background: var(--bg-card-hover);
}
.btn-challenge-main {
  border-color: rgba(255,61,113,0.25);
}

/* ============================================================
   SECONDARY SCREENS
   ============================================================ */
.page-container {
  padding: 24px 16px 100px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.screen-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 16px;
  background: var(--bg-card);
  border-radius: 14px;
  text-align: center;
}

.stat-value {
  font-family: "Bebas Neue", cursive;
  font-size: 32px;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.achievement-card {
  padding: 14px;
  background: var(--bg-card);
  border-radius: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.achievement-card.locked { opacity: 0.35; filter: grayscale(0.5); }
.achievement-card.unlocked { border: 1px solid rgba(180,77,255,0.2); }
.achievement-icon { font-size: 28px; }
.achievement-name { font-size: 12px; font-weight: 700; }
.achievement-desc { font-size: 10px; color: var(--text-muted); }

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 8px; }

.ranking-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 14px;
}
.ranking-pos { font-size: 20px; min-width: 28px; text-align: center; }
.ranking-info { flex: 1; }
.ranking-score { font-family: "Space Mono", monospace; font-size: 16px; font-weight: 700; display: block; }
.ranking-details { font-size: 11px; color: var(--text-muted); }
.empty-message { text-align: center; color: var(--text-muted); padding: 32px; }

/* Settings */
.settings-list { display: flex; flex-direction: column; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.setting-icon { font-size: 20px; }
.setting-label { flex: 1; font-size: 15px; }

.setting-select {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-hover);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.setting-danger { padding: 20px 0; border-bottom: none; }

.setting-links {
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: none;
  padding-top: 20px;
}
.setting-links a {
  color: var(--text-secondary);
  transition: color 150ms;
}
.setting-links a:active { color: var(--text-primary); }
.footer-sep { opacity: 0.3; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--bg-card-hover);
  border-radius: 24px;
  transition: background 200ms;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  border-radius: 50%;
  transition: transform 200ms;
}
.toggle input:checked + .toggle-slider { background: var(--color-b); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Shop */
.shop-section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 10px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-item {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 200ms;
}
.shop-item:active { transform: scale(0.96); }
.shop-item.active-item { border-color: var(--gold); background: rgba(255,215,0,0.04); }
.shop-item.owned { border-color: rgba(0,230,118,0.2); }
.shop-item.locked { opacity: 0.4; }
.item-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.item-name { font-size: 12px; font-weight: 700; display: block; margin-bottom: 4px; }
.item-price { font-family: "Space Mono", monospace; font-size: 13px; color: var(--gold); display: block; }
.item-price.free { color: var(--green); }
.item-status { font-size: 11px; color: var(--green); font-weight: 600; display: block; }
.item-desc { font-size: 10px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.item-owned { font-family: "Space Mono", monospace; font-size: 12px; color: var(--text-secondary); display: block; }

/* Bolts display (shop) */
.bolts-display {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: "Space Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.bolts-icon { font-size: 18px; }
.bolts-display-large { justify-content: center; margin: 16px 0 24px; font-size: 28px; }
.bolts-display-large .bolts-icon { font-size: 28px; }
.bolts-display-large .bolts-label { font-size: 14px; color: var(--text-secondary); margin-left: 4px; }
.bolts-icon-sm { font-size: 12px; }

/* ============================================================
   MULTIPLAYER
   ============================================================ */
.mp-setup-container, .mp-game-container {
  padding: 24px 16px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.mp-mode-select { display: flex; gap: 10px; margin-bottom: 24px; }
.mp-mode-btn { flex: 1; }
.mp-mode-btn.active { box-shadow: 0 0 0 2px var(--color-a); }
.mp-mode-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.mp-players { margin-bottom: 24px; }
.mp-players h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.mp-player-inputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.mp-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-hover);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
}
.mp-input:focus { outline: none; border-color: var(--color-b); }
.mp-input::placeholder { color: var(--text-muted); }

/* MP Phases */
.mp-phase { text-align: center; padding: 32px 0; }
.mp-protagonist { font-family: "Bebas Neue", cursive; font-size: 36px; color: var(--color-b); margin-bottom: 12px; }
.mp-instruction { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.pass-phone { text-align: center; }
.pass-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.mp-predict-label { font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.mp-reveal-title { font-family: "Space Grotesk", sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.mp-reveal-results { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.mp-reveal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 14px;
}
.mp-reveal-row.correct { border-left: 3px solid var(--green); }
.mp-reveal-row.wrong { border-left: 3px solid var(--red); opacity: 0.6; }
.mp-reveal-player { font-weight: 600; }
.mp-reveal-score { font-family: "Space Mono", monospace; font-size: 14px; color: var(--gold); }

/* MP Results */
.mp-final-ranking { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.mp-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 16px;
}
.mp-rank-row.winner { border: 1px solid var(--gold); background: rgba(255,215,0,0.05); }
.mp-rank-pos { font-size: 24px; min-width: 32px; }
.mp-rank-name { flex: 1; font-weight: 700; font-size: 16px; }
.mp-rank-score { font-family: "Space Mono", monospace; font-size: 16px; color: var(--gold); }

/* Versus */
.versus-container { padding: 16px; max-width: 420px; margin: 0 auto; }

.versus-top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.versus-name { font-family: "Space Grotesk", sans-serif; font-size: 18px; font-weight: 700; }
.versus-vs { font-family: "Bebas Neue", cursive; font-size: 28px; color: var(--text-muted); }

.versus-scores {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.versus-score { font-family: "Bebas Neue", cursive; font-size: 40px; }
.versus-round-info { font-size: 13px; color: var(--text-muted); }
.versus-waiting { text-align: center; padding: 20px; }
.versus-reveal-info { text-align: left; }
.versus-majority { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.color-a { color: var(--color-a); }
.color-b { color: var(--color-b); }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
}
.modal-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.modal-content h3 { font-family: "Space Grotesk", sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.modal-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* Share modal */
.share-preview {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.5;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
  overflow: hidden;
}
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }

.btn-share {
  flex: 1;
  min-width: 90px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn-whatsapp { background: #25D366; }
.btn-twitter { background: #1DA1F2; }
.btn-copy { background: var(--purple); }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 32px 24px;
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
}

.onboarding-slides { margin-bottom: 24px; }
.onboarding-slide { display: none; flex-direction: column; align-items: center; }
.onboarding-slide.active { display: flex; }
.onboarding-emoji { font-size: 56px; margin-bottom: 20px; }

.onboarding-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.onboarding-text { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.onboarding-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  transition: all 200ms;
}
.dot.active { background: var(--color-a); width: 24px; border-radius: 4px; }

/* ============================================================
   ACHIEVEMENT TOAST
   ============================================================ */
.achievement-toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10003;
  background: linear-gradient(135deg, #6366F1, #A855F7);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(99,102,241,0.4);
  font-size: 14px;
  white-space: nowrap;
  transition: top 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.achievement-toast-icon { font-size: 22px; }
.achievement-toast-title { font-size: 10px; opacity: 0.7; display: block; }
.achievement-toast-desc { font-weight: 700; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scalePop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-40px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes slideInLeft { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fireWobble { 0% { transform: scale(1) rotate(-5deg); } 100% { transform: scale(1.2) rotate(5deg); } }
.fire-animation .streak-fire { animation: fireWobble 0.6s ease-in-out infinite alternate; }

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (min-width: 600px) {
  .home-container {
    max-width: 520px;
  }

  .page-container, .results-container,
  .mp-setup-container, .mp-game-container, .versus-container {
    max-width: 560px;
  }

  .home-secondary-actions .btn-action {
    padding: 18px;
  }

  .category-card { flex: 0 0 90px; padding: 12px 8px; }
  .cat-icon { font-size: 26px; }
  .cat-name { font-size: 11px; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .achievements-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }

  .option-text { font-size: 20px; }
  .game-question { font-size: 20px; }
}

/* ============================================================
   RESPONSIVE — DESKTOP
   ============================================================ */
@media (min-width: 900px) {
  #app {
    max-width: 640px;
    margin: 0 auto;
    border-left: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
  }

  .home-container {
    max-width: 580px;
    padding: 32px 24px 100px;
  }

  .page-container, .results-container {
    max-width: 580px;
    padding: 32px 24px 100px;
  }

  .logo { font-size: 72px; letter-spacing: 8px; }
  .tagline { font-size: 16px; }

  .xp-bar { height: 8px; }

  .btn-play-main {
    height: 72px;
  }
  .btn-play-text {
    font-size: 32px;
  }

  .home-secondary-actions .btn-action {
    padding: 20px;
  }
  .btn-action-icon { font-size: 28px; }
  .btn-action-label { font-size: 14px; }

  .category-card { flex: 0 0 100px; padding: 14px 10px; border-radius: 14px; }
  .cat-icon { font-size: 28px; margin-bottom: 6px; }
  .cat-name { font-size: 12px; }

  /* Bottom nav stays fixed, adjust for desktop */
  .bottom-nav {
    max-width: 640px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }

  /* Game screen — bigger on desktop */
  .game-top-bar { padding: 14px 20px; }
  .game-score-display { font-size: 32px; }
  .game-question { font-size: 24px; }
  .option-text { font-size: 22px; }
  .option-label { font-size: 48px; }
  .option-percent { font-size: 56px; }
  .game-result-text { font-size: 28px; }

  /* Results */
  .results-rank-emoji { font-size: 72px; }
  .results-rank-name { font-size: 26px; }
  .results-score { font-size: 80px; }

  /* Stats grid wider */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stat-value { font-size: 38px; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  /* Modals wider */
  .modal-content { max-width: 420px; padding: 32px 28px; }
}

/* ============================================================
   RESPONSIVE — LARGE DESKTOP
   ============================================================ */
@media (min-width: 1200px) {
  #app { max-width: 720px; }
  .home-container, .page-container { max-width: 660px; }
  .bottom-nav { max-width: 720px; }
  .logo { font-size: 80px; }
  .game-question { font-size: 26px; }
  .option-text { font-size: 24px; }
  .category-card { flex: 0 0 110px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
