:root {
  --bg: #0f1226;
  --bg2: #1a1f3d;
  --card: #20264a;
  --accent: #ff7059;       /* map-pin coral */
  --accent2: #06d6a0;
  --gold: #ffd166;
  --purple: #8b5cf6;
  --purple-lt: #b79bfd;
  --blurple: #5865f2;      /* Discord brand — "you" rows, active tabs */
  --wrong: #ef476f;
  --text: #f0f2ff;
  --muted: #9aa0c7;
  --border: #2e3566;
  --line: rgba(125, 135, 200, .25);
  --ocean: #141a36;
  --land: #3b4377;
}

/* Outfit — self-hosted so it loads inside Discord's activity proxy too */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/outfit.woff2") format("woff2");
}

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

body {
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 700px at 75% -10%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(900px 650px at -15% 110%, rgba(6, 214, 160, .10), transparent 60%),
    radial-gradient(circle at top, var(--bg2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
}

:focus-visible { outline: 2px solid var(--purple-lt); outline-offset: 2px; border-radius: 6px; }

/* Decorative backdrop — faint flags and pins, never distracting. */
.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.bg span { position: absolute; user-select: none; line-height: 0; }
.bg span svg { display: block; }
.bg img { position: absolute; height: auto; border-radius: 2px; }

.app { position: relative; z-index: 1; width: 100%; max-width: 640px; }
/* Desktop gets a properly sized play area — the map earns the width */
@media (min-width: 1100px) {
  .app { max-width: 940px; }
  .mode-grid { grid-template-columns: 1fr 1fr 1fr; }
  .prompt h2 { font-size: 2.1rem; }
  .prompt-media .quiz-flag { max-width: 360px; }
  .prompt-media .shape-svg { width: 280px; max-height: 240px; }
}

header { text-align: center; margin-bottom: 24px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.logo {
  width: 46px;
  height: 46px;
  display: inline-block;
  filter: drop-shadow(0 4px 10px rgba(139, 92, 246, .45));
  animation: logo-bounce 4s ease-in-out infinite;
}
@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}
.wordmark {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(95deg, #b79bfd 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); margin-top: 8px; }
.center-link { display: block; margin: 18px auto 0; }

.card {
  background: linear-gradient(180deg, #242b55 0%, #1d2347 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .45),
    0 2px 8px rgba(0, 0, 0, .25),
    inset 0 1px 0 rgba(255, 255, 255, .06);
}

.hidden { display: none !important; }

h2 { font-size: 1.3rem; margin-bottom: 20px; text-align: center; }

/* Mode select: Mixed Round is the headline button, specialties sit in a
   compact two-column grid below it. */
.mode-btn {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
@media (hover: hover) {
  .mode-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
}
.mode-icon { line-height: 0; }
.mode-icon svg { display: block; filter: drop-shadow(0 3px 6px rgba(0,0,0,.3)); }
.mode-title { font-size: 1.05rem; font-weight: 700; }
.mode-desc { color: var(--muted); font-size: .9rem; }
.mode-best { color: var(--gold); font-size: .78rem; font-weight: 700; }

/* text stack beside an icon: the icon centres against the whole block, so
   tiles align with or without their "your best" line */
.mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

/* the default: one big Mixed Round button */
.mode-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  width: 100%;
  padding: 16px 18px;
  border-color: var(--purple);
  background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(6, 214, 160, .08));
  box-shadow: 0 8px 30px rgba(139, 92, 246, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.mode-hero .mode-icon { width: 54px; height: 54px; flex: 0 0 auto; }
.mode-hero .mode-title { font-size: 1.3rem; }
@media (hover: hover) {
  .mode-hero:hover { border-color: #b79bfd; box-shadow: 0 6px 24px rgba(139, 92, 246, .3); }
}

.menu-divider {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin: 16px 0 12px;
}

/* the specialties: compact tiles, icon left */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-grid .mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 14px;
}
.mode-grid .mode-icon { width: 34px; height: 34px; flex: 0 0 auto; transition: transform .15s; }
@media (hover: hover) { .mode-grid .mode-btn:hover .mode-icon { transform: scale(1.12) rotate(-4deg); } }
.mode-grid .mode-title { font-size: .95rem; }
.mode-grid .mode-best { font-size: .72rem; }

/* Scorebar — stats as soft pills */
.scorebar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 8px;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.stat {
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(125, 135, 200, .16);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}
.stat strong { color: var(--text); font-size: 1rem; }

/* "New High Score!" celebration on the Score stat */
.score-stat { display: inline-block; transform-origin: left center; white-space: nowrap; }
.score-stat.record #score-label { color: var(--gold); font-weight: 800; text-shadow: 0 0 10px rgba(255,209,102,.85); }
.score-stat.record strong { color: var(--gold); }
.score-stat.celebrate { animation: highscorePop .75s ease; }
@keyframes highscorePop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.32); }
  45%  { transform: scale(1.12) rotate(-3deg); }
  65%  { transform: scale(1.24) rotate(3deg); }
  100% { transform: scale(1); }
}
/* Streak glow once the player beats their personal-best streak */
.stat.glow strong { color: var(--gold); animation: streakGlow 1.1s ease-in-out infinite; }
@keyframes streakGlow {
  0%, 100% { text-shadow: 0 0 4px rgba(255,209,102,.5); }
  50% { text-shadow: 0 0 12px rgba(255,209,102,1), 0 0 22px rgba(255,209,102,.7); }
}
.link-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; text-decoration: underline; font-size: .9rem;
}
@media (hover: hover) {
  .link-btn:hover { color: var(--wrong); }
}
.pause-btn {
  text-decoration: none;
  font-size: 1.05rem;
  opacity: .7;
  padding: 2px 4px;
  transition: opacity .12s, color .12s;
}
@media (hover: hover) {
  .pause-btn:hover { opacity: 1; color: var(--gold); }
}

/* Per-question countdown: left→right gradient from red (late) to green
   (early); a "spent" overlay eats from the right (green side) as time runs.
   The leftmost third is the showdown zone — in multiplayer all answers go
   public once the live edge enters it. */
.timer {
  position: relative;
  height: 8px;
  margin-top: 22px;
  border-radius: 999px;
  overflow: hidden;
}
.timer-track {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    #ef476f 0%, #ff6b6b 16%, #ff9f45 40%, #ffd166 62%, #46e6a8 100%);
}
.timer-zone {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 33.333%;
  border-right: 2px solid rgba(255, 209, 102, .9);
  background: repeating-linear-gradient(-45deg,
    rgba(255, 255, 255, 0) 0 5px, rgba(255, 255, 255, .28) 5px 8px);
}
.timer.showdown .timer-zone { animation: zonePulse 0.9s ease-in-out infinite; }
@keyframes zonePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.8); }
}
.timer-spent {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 0%;
  background: rgba(15, 18, 38, .82);
  z-index: 1;
}

/* Question entrance — a soft rise per question */
@keyframes qIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-enter .prompt,
.q-enter .choices,
.q-enter .map-panel,
.q-enter .slider-panel { animation: qIn .28s ease both; }
@media (prefers-reduced-motion: reduce) {
  .q-enter .prompt, .q-enter .choices, .q-enter .map-panel, .q-enter .slider-panel { animation: none; }
}

/* Prompt */
.prompt { text-align: center; margin-bottom: 24px; }
.prompt-label {
  display: inline-block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.prompt h2 { font-size: 1.9rem; margin: 0; font-weight: 800; letter-spacing: -.4px; }
.prompt h2 .dist-arrow { color: var(--muted); margin: 0 2px; }
.prompt-flag {
  height: 1.5rem;
  width: auto;
  border-radius: 4px;
  vertical-align: -0.18em;
  margin-right: 12px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.3);
}

/* Media slot under the prompt: big flag or country silhouette */
.prompt-media { margin-top: 14px; line-height: 0; }
.prompt-media .quiz-flag {
  max-width: min(300px, 80%);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.12);
}
.prompt-media .shape-svg {
  width: min(240px, 70%);
  height: auto;
  max-height: 200px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.4));
}
.prompt-media .shape-svg path {
  fill: var(--accent2);
  stroke: #048f6b;
  stroke-width: .4;
}

/* Helpers (lifeline + showdown tag) */
.helpers { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 14px; }
.showdown-tag {
  color: var(--gold);
  font-size: .85rem;
  font-weight: 800;
  animation: tagFlash .9s ease-in-out infinite;
}
@keyframes tagFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.help-btn {
  background: rgba(6, 214, 160, .12);
  border: 2px solid var(--accent2);
  color: var(--accent2);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .12s, opacity .12s;
}
.help-btn:disabled { opacity: .4; cursor: default; border-color: var(--border); color: var(--muted); background: none; }

/* Choices — 2x2 grid */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice.removed { opacity: .22; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)), var(--bg2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.choice:active:not(:disabled) { transform: scale(.98); }
@media (max-width: 380px) { .choice { font-size: .92rem; min-height: 58px; } }
@media (hover: hover) {
  .choice:hover:not(:disabled) {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  }
}
.choice:disabled { cursor: default; }
.choice.selected {
  border-color: var(--gold);
  background: rgba(255, 209, 102, .12);
  box-shadow: 0 0 12px rgba(255, 209, 102, .25);
}
.choice.correct {
  border-color: var(--accent2);
  background: rgba(6,214,160,.15);
  animation: correctPop .4s ease;
}
.choice.wrong { border-color: var(--wrong); background: rgba(239,71,111,.15); }
@keyframes correctPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.05); box-shadow: 0 0 18px rgba(6,214,160,.55); }
  100% { transform: scale(1); }
}

/* ---- Drop a Pin map ---- */
.map-panel { margin-top: 2px; }
.map-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ocean);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .4);
  touch-action: none; /* we handle pan/pinch ourselves */
}
#world-map {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 403;
  cursor: crosshair;
}
#world-map .bg-land {
  fill: #2b3263; /* non-quiz territories — visible but clearly inert */
  stroke: #20264a;
  stroke-width: .5;
}
#world-map .country {
  fill: var(--land);
  stroke: #20264a;
  stroke-width: .6;
  transition: fill .12s;
}
#world-map .country.hover { fill: #5b6ac0; }
#world-map .country.selected { fill: var(--gold); }
#world-map .country.wrong-pick { fill: var(--wrong); }
#world-map .cdot {
  fill: #7d8ade; /* micro-nation markers — constant size on screen */
  stroke: #20264a;
  stroke-width: .4;
  transition: fill .12s;
}
#world-map .cdot.hover { fill: #aab4f0; }
#world-map .cdot.selected { fill: var(--gold); }
#world-map .cdot.wrong-pick { fill: var(--wrong); }
#world-map .country.target-reveal,
#world-map .cdot.target-reveal {
  fill: var(--accent2);
  animation: targetBlink 1s ease infinite;
}
#world-map .place-zone {
  fill: rgba(6, 214, 160, .16);
  stroke: #06d6a0;
}
#world-map .place-tube {
  fill: none;
  stroke: rgba(6, 214, 160, .5);
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes targetBlink {
  0%, 100% { fill-opacity: 1; }
  50% { fill-opacity: .55; }
}
.map-zoom {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-zoom button {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(32, 38, 74, .9);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
@media (hover: hover) { .map-zoom button:hover { border-color: var(--accent); } }
/* Your Discord pfp pinned to the answer you gave (Guess-the-Song style) */
.answer-pfp {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  animation: pfpPop .25s ease;
  pointer-events: none;
}
.slider-pfp {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
  animation: pfpPop .25s ease;
  pointer-events: none;
  z-index: 2;
}
@keyframes pfpPop {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---- Slider (By the Numbers) ---- */
.slider-panel { position: relative; padding: 6px 4px 0; }
.slider-readout {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 14px;
  min-height: 1.6em;
}
.slider-readout.untouched { color: var(--muted); font-size: 1.1rem; font-weight: 600; }
#num-slider {
  width: 100%;
  height: 34px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
#num-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg2), var(--border));
  border: 1px solid var(--border);
}
#num-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a3, var(--gold) 60%, #e8a93d);
  border: 3px solid #b06f00;
  box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 14px rgba(255, 209, 102, .35);
}
#num-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg2), var(--border));
  border: 1px solid var(--border);
}
#num-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid #b06f00;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.slider-ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .82rem;
  margin-top: 2px;
}

/* Feedback bar — also acts as the "next question" button */
.feedback {
  position: relative;
  overflow: hidden;
  display: none; /* hidden state — JS removes hidden class to show */
  align-items: center;
  margin-top: 20px;
  width: 100%;
  padding: 15px 52px 15px 18px; /* right padding leaves room for the ▶| icon */
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}
.feedback:not(.hidden) { display: flex; }
.feedback.right { background: rgba(6,214,160,.15); color: var(--accent2); }
.feedback.nope  { background: rgba(239,71,111,.15); color: var(--wrong); }

/* ▶| skip icon — always present, right-aligned */
.next-skip {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: .65;
  z-index: 1;
  letter-spacing: -1px;
}

/* Text content of the feedback */
.feedback-text { position: relative; z-index: 1; flex: 1; }

/* Auto-advance fill sweeps left-to-right behind the text */
.next-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}

/* Play again / Back to menu buttons */
.primary-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #ff8a6b 0%, var(--accent) 55%, #f4486b 100%);
  color: #1a1230;
  border: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 112, 89, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.primary-btn:active:not(:disabled) { transform: scale(.985); }
@media (hover: hover) {
  .primary-btn:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(255, 112, 89, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
  }
}

/* Game over + leaderboards */
.go-summary { text-align: center; color: var(--muted); margin-bottom: 20px; }
.go-summary strong { color: var(--text); }
.go-best { color: var(--muted); font-size: .85rem; }

.name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}
.name-label { color: var(--muted); font-size: .9rem; }
.name-input {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 8px 12px;
  width: 200px;
  text-align: center;
}
.name-input:focus { outline: none; border-color: var(--accent); }
.name-hint { color: var(--muted); font-size: .78rem; width: 100%; text-align: center; }

/* Segmented controls, Discord style: one recessed track, filled active pill */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: rgba(8, 10, 28, .55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}
.mode-tabs { margin-bottom: 8px; flex-wrap: wrap; }
.mode-tabs .tab { font-size: .8rem; padding: 8px 4px; min-width: 96px; }
.tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--muted);
  padding: 9px 10px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
}
@media (hover: hover) { .tab:hover:not(.active) { color: var(--text); background: rgba(255, 255, 255, .05); } }
.tab.active {
  background: var(--blurple);
  color: #fff;
  box-shadow: 0 2px 10px rgba(88, 101, 242, .4);
}

/* ---- Leaderboard: podium for the top three… ---- */
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 16px;
}
.lb-podium:empty { display: none; }
.pod {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 124px;
  padding: 14px 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
  animation: podIn .35s ease backwards;
}
.pod-1 { order: 2; padding-top: 18px; padding-bottom: 18px; animation-delay: .05s; }
.pod-2 { order: 1; animation-delay: .15s; }
.pod-3 { order: 3; animation-delay: .25s; }
@keyframes podIn { from { opacity: 0; transform: translateY(12px); } }
.pod .lb-avatar { width: 56px; height: 56px; }
.pod-1 .lb-avatar { width: 74px; height: 74px; }
.pod-1 .lb-avatar { box-shadow: 0 0 0 3px var(--gold), 0 4px 18px rgba(255, 209, 102, .35); }
.pod-2 .lb-avatar { box-shadow: 0 0 0 3px #cdd3e8, 0 4px 14px rgba(205, 211, 232, .25); }
.pod-3 .lb-avatar { box-shadow: 0 0 0 3px #e0945c, 0 4px 14px rgba(224, 148, 92, .3); }
.pod-crown {
  position: absolute;
  top: -15px;
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5));
}
.pod-rank {
  margin-top: -11px;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 900;
  color: #1a1230;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.pod-1 .pod-rank { background: var(--gold); }
.pod-2 .pod-rank { background: #cdd3e8; }
.pod-3 .pod-rank { background: #e0945c; }
.pod-name {
  margin-top: 7px;
  font-weight: 700;
  font-size: .88rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pod-value { font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }
.pod-stats { color: var(--muted); font-size: .68rem; font-weight: 700; margin-top: 2px; }
.pod.you { border-color: rgba(88, 101, 242, .65); background: rgba(88, 101, 242, .12); }

/* ---- …and rows for everyone else ---- */
.leaderboard { list-style: none; margin: 0 0 8px; padding: 0; }
.leaderboard li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .025);
  transition: background .15s;
}
@media (hover: hover) { .leaderboard li:hover { background: rgba(255,255,255,.055); } }
.leaderboard li.lb-empty {
  justify-content: center;
  color: var(--muted);
  padding: 22px 14px;
  background: none;
}
.leaderboard li.you,
.leaderboard li.you:hover {
  border-color: rgba(88, 101, 242, .65);
  background: rgba(88, 101, 242, .16);
}
.lb-rank { width: 24px; color: var(--muted); font-weight: 800; font-size: .88rem; text-align: center; flex: 0 0 auto; }
.lb-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--bg2);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .3);
}
.lb-avatar img,
.lb-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-avatar-fallback { color: #fff; font-weight: 800; font-size: .95rem; user-select: none; }
.pod .lb-avatar-fallback { font-size: 1.5rem; }
.pod-1 .lb-avatar-fallback { font-size: 2rem; }
.lb-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.lb-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-flag { display: inline-flex; flex: 0 0 auto; }
.lb-flag img { width: 16px; height: auto; border-radius: 2px; display: block; opacity: .85; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.you-pill {
  flex: 0 0 auto;
  background: var(--blurple);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 2px 6px;
  border-radius: 5px;
}
.pod .you-pill { vertical-align: 2px; margin-left: 4px; }
.lb-value { font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.lb-unit { color: var(--muted); font-size: .68rem; font-weight: 700; }

/* ---- gameover modes: results/winners hide the board chrome; the
       leaderboards live behind their own button ---- */
#gameover.results-mode .tabs,
#gameover.results-mode .name-row { display: none; }
#gameover.boards-mode #lb-btn { display: none; }
#gameover.boards-mode .go-summary { display: none; }
/* Discord identity: the nickname is your account — not editable there */
.name-row.locked .name-hint { visibility: hidden; }
.name-row.locked .name-input {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

/* ---- party lobby strip on the menu ---- */
.party-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(88, 101, 242, .1);
  border: 1px solid rgba(88, 101, 242, .4);
}
.party-label { font-weight: 800; font-size: .85rem; color: var(--purple-lt); }
.party-member { display: inline-flex; align-items: center; gap: 6px; }
.party-member .lb-avatar { width: 26px; height: 26px; }
.party-member .lb-avatar-fallback { font-size: .8rem; }
.party-name { font-size: .85rem; font-weight: 700; }
.party-crown { font-size: .9rem; margin-right: -2px; }
.party-wins { color: var(--gold); font-size: .72rem; font-weight: 800; }
.party-hint { width: 100%; color: var(--muted); font-size: .76rem; }
.party-len {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.party-len b { color: var(--text); font-variant-numeric: tabular-nums; }
.party-len input[type="range"] {
  width: 110px;
  height: 18px;
  accent-color: var(--blurple);
  cursor: pointer;
}
.party-start {
  background: var(--blurple);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(88, 101, 242, .45);
  transition: transform .12s, filter .15s;
}
@media (hover: hover) { .party-start:hover { filter: brightness(1.1); transform: translateY(-1px); } }
.party-start:active { transform: scale(.97); }
/* leader's currently-picked mode; everyone else's menu is read-only */
.mode-btn.party-pick { border-color: var(--blurple); box-shadow: 0 0 0 2px rgba(88, 101, 242, .35); }
#menu.party-locked .mode-btn { opacity: .55; cursor: default; }
#menu.party-locked .mode-btn:hover { transform: none; }
.lb-stats { color: var(--muted); font-size: .7rem; font-weight: 700; flex: 0 0 auto; }

/* ---- in-quiz multiplayer strip: lock-ins, then running standings ---- */
.mp-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
  min-height: 30px;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: .42;
  transition: opacity .2s;
}
.mp-chip .lb-avatar { width: 26px; height: 26px; }
.mp-chip .lb-avatar-fallback { font-size: .8rem; }
.mp-chip.locked { opacity: 1; }
.mp-chip.locked .lb-avatar { box-shadow: 0 0 0 2px var(--accent2); }
.mp-chip.standing { opacity: 1; font-size: .85rem; }
.mp-chip.standing b { font-variant-numeric: tabular-nums; }
.mp-chip.standing.self .lb-avatar { box-shadow: 0 0 0 2px var(--blurple); }
.mp-place { color: var(--muted); font-size: .72rem; font-weight: 800; }

/* multiplayer feedback bar can't skip ahead for everyone */
.no-skip .next-skip { display: none; }

/* ---- Logos ---- */
.logo-card {
  width: 150px;
  height: 150px;
  margin: 4px auto 0;
  padding: 30px;
  border-radius: 20px;
  background: rgba(8, 10, 28, .55);
  border: 1px solid var(--border);
  color: #eef0ff; /* the mark renders in currentColor */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.logo-card svg { width: 100%; height: 100%; display: block; }
/* Commons heavyweights arrive in brand colours — whiten to match the
   monochrome marks (and kill the colour giveaway) */
.logo-card .logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(.93);
}

/* ---- Guess the Language ---- */
.lang-sample {
  font-size: 1.35rem;
  line-height: 1.55;
  font-weight: 600;
  max-width: 560px;
  margin: 4px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(8, 10, 28, .5);
  border: 1px solid var(--border);
  unicode-bidi: plaintext;
}
.lang-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3ee6b8, #059e77);
  color: #04331f;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(6, 214, 160, .35);
  transition: transform .12s, filter .15s;
}
@media (hover: hover) { .lang-play:hover { filter: brightness(1.08); transform: translateY(-1px); } }
.lang-play:active { transform: scale(.97); }

/* Floating +N score pop on correct answer */
.points-pop {
  position: fixed;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 55;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  animation: pointsPop .85s ease-out forwards;
}
@keyframes pointsPop {
  0%   { transform: translate(-50%, -50%) scale(.5);  opacity: 0; }
  18%  { transform: translate(-50%, -70%) scale(1.35); opacity: 1; }
  55%  { transform: translate(-50%,-105%) scale(1.1);  opacity: 1; }
  100% { transform: translate(-50%,-160%) scale(.9);  opacity: 0; }
}

footer { text-align: center; margin-top: 20px; color: var(--muted); font-size: .85rem; }

/* Compact mobile layout: the whole menu fits one screen without scrolling.
   Mode cards become horizontal rows (icon left, text right). */
@media (max-width: 480px) {
  body { padding: 10px 12px; }
  header { margin-bottom: 10px; }
  .logo { width: 32px; height: 32px; }
  .wordmark { font-size: 1.9rem; }
  .tagline { font-size: .85rem; margin-top: 2px; }
  .card { padding: 16px; border-radius: 14px; }
  h2 { font-size: 1.05rem; margin-bottom: 12px; }
  .mode-hero { gap: 12px; padding: 12px 14px; }
  .mode-hero .mode-icon { width: 42px; height: 42px; }
  .mode-hero .mode-title { font-size: 1.1rem; }
  .mode-hero .mode-desc { font-size: .78rem; }
  .menu-divider { margin: 12px 0 10px; }
  .mode-grid { gap: 8px; }
  .mode-grid .mode-btn { gap: 9px; padding: 9px 11px; }
  .mode-grid .mode-icon { width: 28px; height: 28px; }
  .mode-grid .mode-title { font-size: .85rem; }
  .mode-grid .mode-best { font-size: .65rem; }
  .center-link { margin-top: 10px; }
  footer { margin-top: 10px; font-size: .75rem; }
  .prompt h2 { font-size: 1.5rem; }
  .map-zoom button { width: 40px; height: 40px; }
}
