:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f7fb;
  background: #07090f;
  --muted: #aab5c6;
  --line: #2c3c52;
  --gold: #f5b942;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
a { color: #9ebfff; }
[hidden] { display: none !important; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
}
.brand { color: #f4f7fb; font-size: 1.35rem; font-weight: 900; text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 18px; }
.topbar nav a { color: #c6cfdd; font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 22px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 36px;
}
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #111827; }
.question-panel { padding: clamp(18px, 2.5vw, 30px); }
.kicker { margin: 0 0 10px; color: #8eb5ff; font-size: 0.76rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
h1 { margin: 0 0 14px; font-size: clamp(2rem, 3.8vw, 3.5rem); line-height: 1.05; letter-spacing: -0.035em; }
.intro, .hint, .map-help, .map-credit, .source-notes p { color: var(--muted); line-height: 1.55; }
.intro { margin: 0 0 22px; }
.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #0c1220; }
.stat span { color: #9ebcff; font-size: 0.8rem; font-weight: 800; }
.stat strong { display: block; margin-top: 4px; font-size: 1.45rem; }
.prompt { margin: 20px 0 16px; padding: 18px; border: 1px solid #45617f; border-radius: 8px; background: #0c1220; }
.topic { margin: 0 0 10px; color: var(--gold); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; }
.prompt h2 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.3; }
.hint { margin: 12px 0 0; font-size: 0.9rem; }
.answers { display: grid; gap: 10px; }
.answer { min-height: 52px; padding: 13px 15px; border: 1px solid #40516a; border-radius: 8px; color: #f4f7fb; background: #0c1220; font-weight: 750; text-align: left; }
.answer:hover:not(:disabled) { border-color: #8eb5ff; background: #182b48; }
.answer:disabled { opacity: 1; }
.answer.correct { border-color: #39b985; background: #153f2d; color: #d9fbe7; }
.answer.wrong { border-color: #ef7e7e; background: #461c24; color: #ffe4e1; }
.answer .result { float: right; margin-left: 10px; font-size: 0.85rem; }
.feedback { min-height: 120px; margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #0c1220; }
.feedback strong { display: block; margin-bottom: 7px; }
.feedback p { margin: 0; color: #bdc9da; line-height: 1.55; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.primary, .ghost { min-height: 46px; padding: 10px 18px; border: 1px solid #45617f; border-radius: 8px; font-weight: 800; }
.primary { color: white; background: #2f6df6; }
.ghost { color: #17283c; background: #eef3fb; }
.score-card { margin-top: 18px; padding: 18px; border: 1px solid #39b985; border-radius: 8px; background: #123126; }
.score-card h2 { margin: 0 0 10px; }
.score-card p { margin: 8px 0 0; line-height: 1.5; }
.map-panel { overflow: hidden; }
.map-heading { padding: 26px 22px 18px; background: radial-gradient(ellipse at top right, #194e6c, #132339 70%); border-bottom: 1px solid var(--line); }
.map-heading h2 { margin: 0 0 10px; font-size: 1.8rem; letter-spacing: -0.025em; }
.map-heading > p:last-child { margin: 0; min-height: 1.5em; color: #d4e1f0; }
.map-wrap { padding: 18px; }
.map-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.map-toolbar button { min-width: 44px; min-height: 44px; padding: 6px; border: 1px solid #45617f; border-radius: 8px; background: #0c1220; color: #f4f7fb; font-size: 1.5rem; }
.map-toolbar output { min-width: 48px; text-align: center; font-size: 0.85rem; font-weight: 800; }
.map-toolbar .fit-button { margin-left: auto; padding: 8px 12px; font-size: 0.85rem; font-weight: 750; }
.map-frame { width: 100%; aspect-ratio: 12 / 5; overflow: auto; border: 1px solid #45617f; border-radius: 8px; background: #071321; }
.map-frame svg { display: block; width: 100%; max-width: none; height: auto; }
.map-frame path { vector-effect: non-scaling-stroke; }
.map-frame .map-target { fill: var(--gold); stroke: #fff0bc; stroke-width: 1.5; }
.map-marker { fill: none; stroke: #ffe3a3; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-help, .map-credit { margin: 12px 0; font-size: 0.78rem; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.78rem; color: #d4e1f0; }
.swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.location-note { color: var(--muted); }
.discovery { margin: 0 18px 18px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #0c1220; }
.discovery h2 { margin: 0; font-size: 1.4rem; }
.discovery > p:not(.kicker) { color: #bdc9da; line-height: 1.6; }
.discovery a { display: inline-block; margin-top: 4px; font-size: 0.9rem; }
.source-notes { margin: 0 20px 20px; color: var(--muted); font-size: 0.8rem; }
.source-notes summary { cursor: pointer; }
@media (max-width: 920px) {
  .game-shell { grid-template-columns: 1fr; }
  .map-panel { order: -1; }
  .map-heading { padding: 18px; }
  .map-heading h2 { font-size: 1.4rem; }
  .discovery { padding: 14px; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .topbar nav { gap: 12px; }
  .map-wrap { padding: 12px; }
  .map-frame { aspect-ratio: 1.8; }
  .map-heading .kicker { display: none; }
  .map-help, .map-credit { font-size: 0.72rem; }
  .location-note { display: none; }
  .discovery { margin: 0 12px 12px; }
  .discovery > p:not(.kicker) { font-size: 0.9rem; }
  .source-notes { margin: 0 14px 16px; }
}
