:root {
  --bg: #faf7f1;
  --fg: #1e1a15;
  --muted: #78716c;
  --line: #e7dfd2;
  --card: #ffffff;
  --accent: #96690a;
  --accent-ink: #ffffff;
  --accent-soft: #f6ead0;
  --focus: #6f4c05;
  --route: #96690a;
  --route-faint: #c9b98f;
  --land: #efe9dc;
  --land-line: #b9ad94;
}
html[data-theme="dark"] {
  --bg: #191712;
  --fg: #f4efe3;
  --muted: #a8a091;
  --line: #453f33;
  --card: #242019;
  --accent: #f0b429;
  --accent-ink: #1e1a15;
  --accent-soft: #3a2f14;
  --focus: #f6c453;
  --route: #f0b429;
  --route-faint: #6b5d33;
  --land: #242019;
  --land-line: #6e6350;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 17px;
}
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.9rem;
  height: 52px; padding: 0 1rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  font-size: 0.95rem; white-space: nowrap;
}
.topbar .home { color: var(--fg); text-decoration: none; font-weight: 700; }
.topnav { display: flex; gap: 0.9rem; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a[aria-current="true"] { color: var(--fg); font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--fg);
  cursor: pointer; flex: none;
}
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
section { scroll-margin-top: 64px; }
.icon-btn:focus-visible, button:focus-visible, a:focus-visible,
input:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.hero { padding: 2.5rem 0 1rem; }
.kicker {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem;
  color: var(--accent); font-weight: 700; margin: 0 0 0.5rem;
}
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
.answer { font-size: 1.35rem; margin: 0 0 1rem; }
.answer strong { color: var(--accent); }
.standfirst { font-size: 1.05rem; margin: 0 0 0.75rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.figure-map { margin: 1.5rem 0 0; }
.figure-map svg {
  display: block; width: 100%; height: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.figure-map figcaption {
  color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem;
}
.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: end;
  margin: 1rem 0; padding: 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.ctl { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem;
  color: var(--muted); margin: 0; padding: 0; border: 0; }
.ctl input, .ctl select {
  font-size: 1rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); min-width: 12rem;
  max-width: 100%;
}
.seg { flex-direction: row; align-items: center; gap: 0.35rem; }
.seg legend { font-size: 0.85rem; color: var(--muted); padding: 0; margin-bottom: 0.35rem; }
.seg button {
  font-size: 0.9rem; padding: 0.4rem 0.8rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--bg); color: var(--fg); cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 700;
}
.count { margin: 0 0 0 auto; font-size: 0.85rem; color: var(--muted); align-self: center; }
.table-wrap { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 40rem; }
caption { text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line);
  vertical-align: top; }
thead th { border-bottom: 2px solid var(--accent); white-space: nowrap; }
tbody th[scope="row"] { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.winner th, tr.winner td { background: var(--accent-soft); }
.note {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.note h3 { margin-top: 0; }
.rules { padding-left: 1.25rem; }
.rules li { margin-bottom: 0.75rem; }
.explorer-result {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem 1.25rem; margin: 1rem 0;
}
.explorer-result p { margin: 0.25rem 0; }
.explorer-result .big { font-size: 1.25rem; }
.explorer-result .big strong { color: var(--accent); }
details { margin-bottom: 0.5rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); padding: 0.75rem 1rem; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.5rem 0 0.25rem; }
footer {
  margin-top: 3rem; padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem;
}
footer a { color: var(--muted); }
@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  .answer { font-size: 1.15rem; }
  .ctl input, .ctl select { min-width: 0; width: 100%; }
  .ctl { flex: 1 1 100%; }
}
