/* ================================================================
   QuizPunk v2.1 — jetpunk.jeandon.fr
   Pleine largeur, thème sombre (défaut) + clair via [data-theme="light"]
   ================================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-024F, U+0152-0153, U+1E00-1EFF;
}

:root {
  --bg: #0b101d;
  --bg-2: #0e1524;
  --card: #131b2e;
  --card-2: #182238;
  --glass: rgba(15, 21, 37, .78);
  --line: #223050;
  --line-strong: #2e3f66;
  --hairline: rgba(255, 255, 255, .08);
  --text: #f0f4ff;
  --muted: #8da0c9;
  --faint: #5b6b93;
  --accent: #ffd23f;
  --accent-ink: #201a00;
  --good: #2ee08a;
  --good-bg: rgba(46, 224, 138, .12);
  --bad: #ff6b6b;
  --bad-bg: rgba(255, 107, 107, .12);

  --map-land: #1b2438;
  --map-in: #2d3c60;
  --map-found: #2ecf7d;
  --map-missed: #e25c5c;
  --map-stroke: #0b101d;

  --shadow-1: 0 6px 24px -8px rgba(0, 0, 0, .55);
  --shadow-2: 0 24px 70px -24px rgba(0, 0, 0, .75);
  --radius: 18px;
  --radius-s: 12px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pagepad: clamp(18px, 4vw, 64px);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1f8;
  --bg-2: #e6ebf5;
  --card: #ffffff;
  --card-2: #f5f7fc;
  --glass: rgba(250, 251, 254, .82);
  --line: #dbe2f0;
  --line-strong: #c3cee6;
  --hairline: rgba(20, 30, 60, .1);
  --text: #111a31;
  --muted: #5c6b90;
  --faint: #94a1c0;
  --accent-ink: #201a00;
  --good: #149e5c;
  --good-bg: rgba(20, 158, 92, .1);
  --bad: #d84848;
  --bad-bg: rgba(216, 72, 72, .09);

  --map-land: #e0e6f2;
  --map-in: #aabce2;
  --map-found: #2bbb75;
  --map-missed: #e2635c;
  --map-stroke: #f6f8fd;

  --shadow-1: 0 6px 22px -10px rgba(30, 45, 90, .22);
  --shadow-2: 0 24px 60px -24px rgba(30, 45, 90, .32);
  color-scheme: light;
}

/* ---------------- base ---------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(28px + var(--sab));
  transition: background .25s ease, color .25s ease;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(1100px 560px at 84% -12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    radial-gradient(900px 500px at -8% 26%, color-mix(in srgb, #5b8cff 9%, transparent), transparent 60%),
    radial-gradient(800px 520px at 55% 118%, color-mix(in srgb, #2ee08a 6%, transparent), transparent 55%);
  pointer-events: none;
}
:root[data-theme="light"] body::before { opacity: .55; }
.wrap { position: relative; z-index: 1; padding: 0 var(--pagepad); }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.02em; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid var(--hairline);
  padding-top: var(--sat);
}
.quiz-page .topbar { position: static; z-index: auto; }
.topbar-in {
  padding: 10px var(--pagepad);
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), #ffb340);
  color: var(--accent-ink);
  display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 32%, transparent);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-name em { font-style: normal; color: var(--accent); }
.top-nav { display: flex; gap: 4px; margin: 0 auto; }
.top-nav a {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 8px 15px; border-radius: 999px;
  transition: color .15s, background .15s;
}
.top-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-nav ~ .top-actions, .quiz-title ~ .top-actions { margin-left: 0; }
.topbar .back-link {
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 8px 13px; border-radius: 999px; flex: none;
}
.topbar .back-link:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 16px;
  transition: border-color .15s, transform .1s;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.92); }

.account-btn {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); padding: 3px 13px 3px 3px;
  font-weight: 600; font-size: 14px; color: var(--muted);
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.account-btn:hover { border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-1); }
.account-btn .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  font-family: var(--font-display);
}
.account-btn.logged .avatar {
  background: linear-gradient(135deg, var(--accent), #ffb340);
  color: var(--accent-ink); border: none;
}
.account-btn.logged { color: var(--text); }
@media (max-width: 640px) {
  .account-btn .acc-name { display: none; }
  .account-btn { padding-right: 3px; }
  .top-nav { display: none; }
}

/* ---------------- boutons & puces ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  border-radius: 13px;
  padding: 11px 18px;
  font-weight: 650; font-size: 15px;
  text-decoration: none;
  transition: transform .08s ease, border-color .15s ease, filter .15s ease, box-shadow .15s;
}
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ff9a3d));
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 750;
  box-shadow: 0 8px 26px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-bg); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 16.5px; border-radius: 15px; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-weight: 600; font-size: 12.5px;
  white-space: nowrap;
}
.chip.accent { color: var(--qc, var(--accent)); border-color: color-mix(in srgb, var(--qc, var(--accent)) 45%, var(--line)); background: color-mix(in srgb, var(--qc, var(--accent)) 9%, var(--card)); }
.chip.gold { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 750; }

/* ---------------- accueil : héros ---------------- */
.hero {
  position: relative;
  padding: 58px 0 34px;
  overflow: hidden;
}
.hero-map {
  position: absolute; inset: -8% -4% auto; z-index: -1;
  height: 130%;
  background: url('/assets/thumbs/hero-world.png') center 22% / cover no-repeat;
  opacity: .3;
  -webkit-mask-image: radial-gradient(85% 90% at 50% 30%, #000 30%, transparent 78%);
  mask-image: radial-gradient(85% 90% at 50% 30%, #000 30%, transparent 78%);
  pointer-events: none;
}
:root[data-theme="light"] .hero-map { opacity: .5; }
.ping {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pc, var(--good));
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--good)) 55%, transparent);
  animation: ping 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
  animation-delay: var(--pd, 0s);
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--good)) 55%, transparent); }
  70% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  background: var(--glass); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
  margin: 18px 0 14px;
  max-width: 14ch;
  font-weight: 700;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--accent), #ff9a3d 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p.lead { color: var(--muted); font-size: 17px; max-width: 52ch; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.stat-chip {
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 14px; padding: 10px 16px;
}
.stat-chip b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-chip span { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------------- accueil : cartes de quiz ---------------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 16px; }
.section-head h2 { font-size: 25px; margin: 0; }
.section-head .sub { color: var(--muted); font-size: 14px; }

.quiz-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .14s ease, border-color .15s ease, box-shadow .2s ease;
}
.quiz-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--qc, var(--accent)) 55%, var(--line));
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--qc, var(--accent)) 50%, transparent), var(--shadow-1);
}
.qc-thumb {
  position: relative; height: 150px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--qc, var(--accent)) 10%, var(--bg-2)), var(--card));
  overflow: hidden;
}
.qc-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  transition: transform .35s ease;
}
.quiz-card:hover .qc-thumb img { transform: scale(1.05); }
.qc-thumb::after {
  content: ""; position: absolute; inset: auto 0 0;
  height: 60%;
  background: linear-gradient(180deg, transparent, var(--card));
}
.qc-time { position: absolute; top: 10px; right: 10px; z-index: 2; }
.qc-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.qc-title { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; font-family: var(--font-display); margin-top: -22px; position: relative; z-index: 2; }
.qc-title .ico {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 21px;
  background: var(--card-2);
  border: 1px solid color-mix(in srgb, var(--qc, var(--accent)) 40%, var(--line));
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--qc, var(--accent)) 60%, transparent);
}
.qc-desc { color: var(--muted); font-size: 13.5px; margin: 0; }
.qc-foot { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.qc-top {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted); font-weight: 600;
  border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px;
}
.qc-top .crown { font-size: 14px; }
.qc-top b { color: var(--text); }
.qc-top .t { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--faint); }

.grid-quiz { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.hero-quiz { display: grid; grid-template-columns: 1fr 1.3fr; margin-bottom: 16px; min-height: 250px; }
.hero-quiz .qc-thumb { height: 100%; order: 2; }
.hero-quiz .qc-thumb::after { background: linear-gradient(90deg, var(--card), transparent 55%); inset: 0; height: auto; }
.hero-quiz .qc-body { order: 1; justify-content: center; padding: 28px; gap: 12px; }
.hero-quiz .qc-title { margin-top: 0; font-size: 27px; }
.hero-quiz .qc-desc { font-size: 15px; }
@media (max-width: 760px) {
  .hero-quiz { display: flex; flex-direction: column; }
  .hero-quiz .qc-thumb { order: 1; height: 150px; }
  .hero-quiz .qc-thumb::after { inset: auto 0 0; height: 60%; background: linear-gradient(180deg, transparent, var(--card)); }
  .hero-quiz .qc-body { order: 2; padding: 4px 18px 18px; }
}

/* ---------------- classement (accueil) ---------------- */
.lb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.lb-tab {
  border: 1px solid var(--line); background: var(--card);
  color: var(--muted); border-radius: 999px;
  padding: 8px 16px; font-weight: 650; font-size: 13.5px;
  transition: all .15s;
}
.lb-tab:hover { color: var(--text); border-color: var(--line-strong); }
.lb-tab.active {
  background: color-mix(in srgb, var(--tc, var(--accent)) 14%, var(--card));
  border-color: color-mix(in srgb, var(--tc, var(--accent)) 55%, var(--line));
  color: var(--text);
}

.podium {
  display: flex; gap: 14px;
  align-items: flex-end; justify-content: center;
  margin-bottom: 14px;
  max-width: 760px;
}
.pod {
  flex: 1 1 0; max-width: 250px; min-width: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px 14px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-1);
}
.pod .medal { font-size: 26px; line-height: 1; }
.pod-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  margin: 10px auto 8px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  background: var(--card-2); border: 2px solid var(--line-strong);
}
.pod-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-name.me::after { content: " · toi"; color: var(--accent); font-size: 11.5px; font-weight: 700; }
.pod-score { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.pod-score small { color: var(--muted); font-size: 13px; font-weight: 600; }
.pod-meta { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pod-1 {
  order: 2;
  padding-top: 24px; padding-bottom: 22px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--card)), var(--card));
  box-shadow: 0 18px 48px -18px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-1);
}
.pod-1 .pod-avatar {
  width: 62px; height: 62px; font-size: 26px;
  background: linear-gradient(135deg, var(--accent), #ffb340);
  color: var(--accent-ink); border: none;
}
.pod-1 .pod-score { font-size: 26px; }
.pod-2 { order: 1; }
.pod-3 { order: 3; }
@media (max-width: 560px) {
  .podium { gap: 8px; }
  .pod { padding: 12px 8px 10px; }
  .pod-avatar { width: 42px; height: 42px; font-size: 18px; }
  .pod-1 .pod-avatar { width: 50px; height: 50px; font-size: 21px; }
  .pod-score { font-size: 18px; } .pod-1 .pod-score { font-size: 21px; }
}

.lb-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  max-width: 760px;
}
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.lb-row:last-child { border-bottom: none; }
.lb-row .rank {
  width: 30px; flex: none; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--faint); font-variant-numeric: tabular-nums;
}
.lb-row .medal { font-size: 19px; }
.lb-row .mini-avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--muted);
}
.lb-row .who { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .games { color: var(--faint); font-size: 12px; font-weight: 500; }
.lb-row .sc { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb-row .sc small { color: var(--muted); font-weight: 500; }
.lb-row .tm { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; width: 52px; text-align: right; }
.lb-row.me { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.lb-row.me .who::after { content: " · toi"; color: var(--accent); font-size: 12px; }
.lb-empty { padding: 26px 18px; color: var(--muted); text-align: center; font-size: 14px; }

.site-foot { color: var(--faint); font-size: 13px; text-align: center; padding: 44px 0 10px; }
.site-foot a { color: var(--muted); }

/* ---------------- page quiz : HUD ---------------- */
.quiz-title { margin: 0 auto; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.quiz-title .qi { font-size: 21px; }

.hud {
  position: sticky; top: 0; z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  margin: 0 calc(-1 * var(--pagepad)); padding: 10px var(--pagepad) 0;
  padding-top: max(10px, var(--sat));
  border-bottom: 1px solid var(--hairline);
}
.hud-row { display: flex; gap: 8px; align-items: center; }
#answer {
  flex: 1; min-width: 0;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  color: var(--text);
  border-radius: 13px;
  padding: 12px 16px;
  font-size: 16px; font-weight: 500;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#answer:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
#answer::placeholder { color: var(--faint); }
#answer.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.stat {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15.5px;
  padding: 10px 14px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line);
  white-space: nowrap;
}
#timer.low { color: var(--bad); border-color: var(--bad); animation: pulse 1s infinite; }
#timer.zen { color: var(--muted); letter-spacing: .05em; }
@keyframes pulse { 50% { opacity: .55; } }
#score b { color: var(--accent); }
.progress { height: 4px; background: var(--line); border-radius: 99px 99px 0 0; margin-top: 10px; overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #2ee08a));
  border-radius: 99px; transition: width .25s ease;
}

/* ---------------- page quiz : carte + réponses côte à côte ---------------- */
.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
@media (min-width: 1020px) {
  .play-area { grid-template-columns: minmax(0, 1.7fr) minmax(330px, .8fr); }
  .board-panel {
    position: sticky;
    top: 82px; /* sous le HUD épinglé */
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }
  #map svg { max-height: calc(100dvh - 210px); }
}

.map-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.map-card summary {
  list-style: none; cursor: pointer;
  padding: 12px 18px; font-weight: 650; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  user-select: none;
}
.map-card summary::-webkit-details-marker { display: none; }
.map-card summary::after { content: "▾"; margin-left: auto; transition: transform .2s; color: var(--faint); }
.map-card:not([open]) summary::after { transform: rotate(-90deg); }
#map { padding: 0 10px 10px; position: relative; }
#map svg { display: block; width: 100%; height: auto; max-height: 58vh; }
#map .map-loading { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.map-tip {
  position: fixed; z-index: 80;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13.5px; font-weight: 650;
  pointer-events: none;
  box-shadow: var(--shadow-1);
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
  transition: opacity .1s;
}
.map-tip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }

.continent-block { margin-bottom: 18px; }
.continent-block h3 {
  margin: 0 0 10px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: baseline; gap: 10px;
  font-family: var(--font-display);
}
.continent-block h3 .cc { color: var(--text); font-variant-numeric: tabular-nums; font-size: 12px; }
/* rangés en colonnes (ordre alphabétique vertical, façon JetPunk) */
.cells { columns: 150px; column-gap: 7px; }
.cell {
  min-height: 35px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 6px 11px;
  margin-bottom: 7px;
  font-size: 13.5px; font-weight: 600;
  color: transparent;
  display: flex; align-items: center;
  break-inside: avoid;
  user-select: none;
  transition: background .2s, border-color .2s, color .2s;
}
.cell.found {
  background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 42%, var(--line));
  color: var(--good);
  animation: pop .25s ease;
}
.cell.missed {
  background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 42%, var(--line));
  color: var(--bad);
}
.cell.last { box-shadow: 0 0 0 2px var(--accent); }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.03); } }

/* ---------------- overlays / modales ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.panel {
  position: relative;
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-2);
  margin: auto;
}
.panel h2 { margin: 0 0 6px; font-size: 25px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.panel .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.review-hint { color: var(--faint); font-size: 12px; margin: 12px 0 0; line-height: 1.5; }
.big-icon { font-size: 46px; margin-bottom: 6px; line-height: 1; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-2);
  color: var(--muted); font-size: 14px;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }

.start-thumb {
  width: 100%; height: 130px; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--line);
  margin-bottom: 14px;
  background: var(--bg-2);
}
.result-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rs-item {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 9px 15px; font-size: 12.5px; color: var(--muted); min-width: 84px;
}
.rs-item b { display: block; color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.mode-note { color: var(--faint); font-size: 12.5px; margin: 12px 0 0; }

.score-ring { position: relative; width: 136px; height: 136px; margin: 8px auto 14px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { stroke: var(--line); }
.score-ring .ring-val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2, .7, .3, 1); }
.score-ring .ring-txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
}
.score-ring .ring-txt small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.new-record { color: var(--accent); font-weight: 750; margin: 12px 0 0; }
.rank-line { margin: 12px 0 0; font-size: 14.5px; color: var(--muted); }
.rank-line b { color: var(--text); font-family: var(--font-display); }

.end-lb { margin-top: 18px; text-align: left; }
.end-lb h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.end-lb .lb-card { max-height: 250px; overflow-y: auto; max-width: none; }
.end-lb .lb-row { padding: 8px 14px; font-size: 13.5px; }

.save-row { display: flex; gap: 8px; margin-top: 16px; }
.save-row input {
  flex: 1; min-width: 0;
  background: var(--bg-2); border: 1.5px solid var(--line-strong);
  color: var(--text); border-radius: 12px; padding: 10px 14px;
  font-size: 15px; outline: none;
}
.save-row input:focus { border-color: var(--accent); }
.save-note { color: var(--faint); font-size: 12.5px; margin: 8px 0 0; }
.save-note a { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* ---------------- auth ---------------- */
.auth-panel { text-align: left; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 5px; border-radius: 13px; margin-bottom: 18px;
}
.auth-tab {
  border: none; background: transparent; color: var(--muted);
  padding: 9px; border-radius: 9px; font-weight: 650; font-size: 14px;
}
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-1); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%;
  background: var(--bg-2); border: 1.5px solid var(--line-strong);
  color: var(--text); border-radius: 12px; padding: 11px 14px;
  font-size: 15px; outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.auth-error { color: var(--bad); font-size: 13.5px; margin: 0 0 12px; }
.auth-hint { color: var(--faint); font-size: 12.5px; text-align: center; margin: 14px 0 0; line-height: 1.5; }
.big-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ffb340);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  margin: 4px auto 12px;
}
#authLogged { text-align: center; }

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  .hud-row { flex-wrap: wrap; }
  #answer { flex-basis: 100%; order: -1; }
  .stat { flex: 1; text-align: center; font-size: 14px; padding: 9px 6px; }
  .cells { columns: 130px; }
  .cell { font-size: 12.5px; min-height: 33px; }
  .hero { padding-top: 38px; }
}
