:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1c304b;
  background: #f7f9fc;
  --muted: #556b83;
  --border: #dce5ef;
  --blue: #2463b5;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
header { background: white; border-bottom: 1px solid var(--border); }
.top { max-width: 1100px; padding: 14px 24px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 25px; letter-spacing: -.9px; font-weight: 850; color: #173d71; text-decoration: none; }
.buzz { color: #996208; }
.nav, footer a { color: #315b8e; }
.nav { font-size: .88rem; font-weight: 650; text-decoration: none; }
.nav:hover { text-decoration: underline; }
main { max-width: 1100px; margin: auto; padding: 32px 24px 22px; }
.eyebrow { font-size: .7rem; font-weight: 800; letter-spacing: .13em; color: #315b8e; margin: 0 0 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #efb338; margin-right: 5px; }
h1 { margin: 0; font-size: clamp(2rem,5vw,3rem); line-height: 1.1; letter-spacing: -.05em; }
.intro > p:last-child { color: var(--muted); margin: 10px 0 0; }
.game-heading, .map-tools, footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.game-heading { align-items: flex-end; margin-bottom: 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); align-items: start; gap: 17px; }
.map-card, .quiz-card, .rules { border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.map-card { overflow: hidden; }
#map { height: 452px; background: #d5e8f4; }
#map .country-border { vector-effect: non-scaling-stroke; }
.map-tools { padding: 9px 13px; border-top: 1px solid var(--border); }
.legend { color: #405976; font-size: .82rem; }
.legend i { width: 11px; height: 11px; border: 1px solid #ab7018; vertical-align: -1px; }
.quiz-card { padding: 19px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.stats > div { display: grid; gap: 3px; padding: 9px; border-radius: 8px; background: #f0f5fb; }
.stats span { font-size: .66rem; color: #526d8b; font-weight: 800; letter-spacing: .07em; }
.stats strong { font-size: 1.04rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
progress { width: 100%; height: 6px; border: 0; border-radius: 8px; background: #e5edf6; color: var(--blue); margin: 13px 0 15px; display: block; overflow: hidden; }
progress::-webkit-progress-bar { background: #e5edf6; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
h2 { font-size: 1.28rem; margin: 0 0 5px; letter-spacing: -.025em; }
#points, #final-score, #load-status { color: var(--muted); font-size: .87rem; margin: 0 0 15px; }
#load-status { margin: 12px 0 0; }
label, h3 { font-size: .85rem; font-weight: 700; }
label { display: block; margin-bottom: 6px; }
input, button { font: inherit; border-radius: 8px; }
input { width: 100%; border: 1px solid #b6c6d9; padding: 10px; color: inherit; background: white; }
button { cursor: pointer; min-height: 38px; font-weight: 700; }
button:disabled { opacity: .57; cursor: default; }
.secondary { border: 1px solid #cdd9e8; background: #fff; color: #2f5888; font-size: .82rem; padding: 6px 11px; }
.secondary:hover:enabled { background: #eef5fd; }
.primary { width: 100%; background: var(--blue); color: #fff; border: 0; padding: 10px 13px; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.primary:hover:enabled { background: #194f96; }
:focus-visible { outline: 3px solid #ce8e1c; outline-offset: 2px; }
.clues { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 13px; }
.clues h3 { margin: 0 0 7px; }
#hint { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 4px; }
#hint small { color: var(--muted); white-space: nowrap; }
#hints, #review { padding-left: 20px; color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
#hints li, #review li { margin-bottom: 4px; }
.result { font-size: .9rem; border-radius: 8px; background: #fff0df; padding: 10px; margin: 9px 0 0; }
.result[data-correct="true"] { background: #e4f5eb; color: #1d633e; }
.game-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
#share-game, .sudoku-link { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; }
.sudoku-link { border-radius: 8px; font-weight: 700; text-decoration: none; }
.sudoku-link:hover { background: #eef5fd; }
#share-status { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.rules { margin-top: 14px; padding: 12px 15px; font-size: .89rem; }
summary { font-weight: 700; cursor: pointer; }
.rules p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
footer { padding-top: 17px; font-size: .75rem; color: var(--muted); }
.map-label.leaflet-tooltip { border: 0; border-radius: 6px; box-shadow: 0 1px 4px #173d7130; color: #173d71; font-weight: 700; }
@media (max-width: 720px) {
  main { padding: 22px 12px 16px; }
  .top { padding: 11px 12px; }
  .brand { font-size: 22px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  #map { height: clamp(235px, 37vh, 360px); }
  .quiz-card { padding: 14px; }
}
.quiz-globe {
  position: absolute;
  inset: 0;
  z-index: 650;
  display: grid;
  place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  overflow: hidden;
  background: radial-gradient(ellipse at center, #315b7e, #162d4c 78%);
  pointer-events: none;
}
.quiz-globe canvas {
  width: min(72%, 360px, calc(var(--globe-height, 452px) * .8));
  aspect-ratio: 1;
  filter: drop-shadow(0 0 18px #89b7e050);
}
@media (max-width: 720px) {
  #map { --globe-height: clamp(235px, 37vh, 360px); }
}

#game-status, #rank-status { font-size: .85rem; color: var(--muted); }
#game-status:empty, #rank-status:empty { display: none; }
#rank-form { margin-bottom: 10px; }
#rank-form button { margin-top: 6px; }
.leaderboard table { width: 100%; border-collapse: collapse; margin-top: 9px; text-align: left; }
.leaderboard th, .leaderboard td { padding: 7px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.leaderboard th:first-child { width: 4rem; }
.leaderboard th:last-child { width: 6rem; }
