/* ============================================================
   Leonida Guide — design system
   Methodology adopted from GeFeiSites "design recipe":
   fixed palette, one type scale, 4px spacing grid, 2 fonts max,
   one radius value, <= 3 accent colours, WCAG AA contrast.
   ============================================================ */

/* Self-hosted variable fonts. Both files cover every weight these pages use,
   so there is no request to a third-party CDN and no dependency on a domain
   that can be slow or blocked. Files are stamped with a content hash like any
   other asset. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2?v=f11d729b") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2?v=c0781ea2") format("woff2");
}

:root {
  /* palette: 2 backgrounds, 2 text tones, 1 brand + 1 accent */
  --bg: #0b0f1a;
  --surface: #151b2b;
  --surface-2: #1b2335;
  --text: #e8ecf5;
  --muted: #9aa4b8;
  --primary: #7c5cff;
  --primary-dark: #6847e8;
  --primary-soft: #a78bfa;
  --accent: #22d3ee;
  --border: #263042;

  /* type scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;

  /* spacing: 4px grid only */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;

  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.45);

  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --maxw: 1120px;

  /* Width the margin game treats as "the content column". The aiming strips
     are drawn strictly outside this box, so they can only ever cover blank
     space and never overlap the layout. */
  --chaos-gutter-base: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}

p {
  margin: 0 0 var(--sp-4);
}

a {
  color: var(--primary-soft);
  text-decoration: none;
  transition: color 150ms ease;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section {
  padding: var(--sp-12) 0;
}

.section-head {
  max-width: 70ch;
  margin-bottom: var(--sp-8);
}

.section-head p {
  color: var(--muted);
  font-size: var(--fs-lg);
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--text);
  letter-spacing: 0.02em;
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: var(--fs-lg);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease,
    transform 150ms ease, color 150ms ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary-dark);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--primary-soft);
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: var(--sp-16) 0 var(--sp-12);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto -20%;
  height: 520px;
  background: radial-gradient(
    circle at 30% 40%,
    rgba(124, 92, 255, 0.22),
    transparent 60%
  );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 780px;
}

.hero h1 {
  font-size: var(--fs-4xl);
  margin-bottom: var(--sp-4);
}

.hero h1 .glow {
  color: var(--primary-soft);
}

.hero-lede {
  font-size: var(--fs-lg);
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: var(--sp-8);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-12);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.stat dt {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}

.stat dd {
  margin: 0;
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.stat dd small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---------- cards ---------- */

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  transition: transform 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-2);
}

.card h3 {
  margin-bottom: var(--sp-2);
}

.card p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-6);
}

.card .card-link {
  margin-top: auto;
  font-weight: 600;
  font-size: var(--fs-sm);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: var(--sp-4);
}

/* ---------- notice / disclaimer ---------- */

.notice {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.notice strong {
  color: var(--text);
}

/* ---------- table / filter ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.filter-bar input,
.filter-bar select {
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-sm);
}

.filter-bar input {
  flex: 1 1 220px;
}

.filter-bar input::placeholder {
  color: var(--muted);
}

.filter-bar input:hover,
.filter-bar select:hover {
  border-color: var(--primary-soft);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

th,
td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: none;
}

.tag {
  display: inline-block;
  padding: 2px var(--sp-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.tag-accent {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.35);
}

.empty-state {
  padding: var(--sp-8);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---------- map ---------- */

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.map-canvas {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.map-canvas svg {
  width: 100%;
  height: auto;
  display: block;
}

.region {
  fill: var(--surface-2);
  stroke: var(--border);
  stroke-width: 1;
  transition: fill 150ms ease;
}

.region.is-active {
  fill: rgba(124, 92, 255, 0.28);
}

.marker {
  cursor: pointer;
  transition: transform 150ms ease;
  transform-origin: center;
  transform-box: fill-box;
}

.marker:hover {
  transform: scale(1.35);
}

.marker circle {
  stroke: var(--bg);
  stroke-width: 2;
}

.marker text {
  font-family: var(--font-body);
  font-size: 10px;
  fill: var(--text);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.map-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  position: sticky;
  top: 88px;
}

.map-panel h3 {
  font-size: var(--fs-lg);
}

.map-panel p {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.marker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.marker-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  padding: var(--sp-2) var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.marker-list button:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

/* ---------- faq ---------- */

.faq {
  max-width: 80ch;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-base);
  list-style: none;
  display: block;
  position: relative;
  padding-right: var(--sp-6);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: var(--fs-lg);
  line-height: 1;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: var(--sp-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---------- prose (article pages) ---------- */

.prose {
  max-width: 70ch;
  font-size: var(--fs-lg);
  line-height: 1.7;
}

.prose h2 {
  margin-top: var(--sp-12);
  font-size: var(--fs-2xl);
}

.prose h3 {
  margin-top: var(--sp-8);
  font-size: var(--fs-lg);
}

.prose ul,
.prose ol {
  padding-left: var(--sp-6);
  color: var(--muted);
}

.prose li {
  margin-bottom: var(--sp-2);
}

.prose code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: var(--fs-sm);
}

.page-head {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
}

.page-head p {
  color: var(--muted);
  max-width: 70ch;
  margin-bottom: 0;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-8) 0;
  margin-top: var(--sp-12);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-note {
  margin-top: var(--sp-6);
  font-size: var(--fs-xs);
  color: var(--muted);
  max-width: 80ch;
}

/* ---------- fact list ---------- */

.facts {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.facts > div:last-child {
  border-bottom: none;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  padding: 1px var(--sp-2);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.badge-ok {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.4);
}

.badge-warn {
  color: var(--muted);
  border-style: dashed;
}

/* ---------- article meta ---------- */

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: var(--sp-4) 0 0;
}

/* ---------- trophy / item grid ---------- */

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-3);
}

.trophy {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  transition: border-color 150ms ease, transform 150ms ease;
}

.trophy:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.trophy-type {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.trophy h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--sp-1);
}

.trophy p {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0;
}

/* ---------- region grid ---------- */

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-4);
}

.region-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.region-card h3 {
  font-size: var(--fs-base);
  margin-bottom: var(--sp-1);
}

.region-card p {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0;
}

/* ---------- map engine ---------- */

.map-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.map-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.map-search-wrap {
  margin-bottom: var(--sp-4);
}

.map-search {
  width: 100%;
  min-height: 40px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--sp-2) var(--sp-3);
  font-family: inherit;
  font-size: var(--fs-sm);
}

.map-search::placeholder {
  color: var(--muted);
}

.map-search:hover {
  border-color: var(--primary-soft);
}

.map-side-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
  font-weight: 600;
}

.map-filters {
  list-style: none;
  margin: 0 0 var(--sp-4);
  padding: 0;
  display: grid;
  gap: 2px;
}

.map-filter label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-2);
  border-radius: 8px;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background-color 150ms ease;
}

.map-filter label:hover {
  background: var(--surface-2);
}

.map-filter input[type="checkbox"] {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  flex: none;
}

.map-filter-name {
  flex: 1;
}

.map-filter-count {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.map-progress {
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}

.map-hide-found {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.map-results {
  margin: var(--sp-3) 0 var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-xs);
}

.map-area-results { list-style: none; padding: 0; margin: 10px 0; }
.map-area-results button { background: var(--bg); color: var(--accent); border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-align: left; cursor: pointer; font: inherit; font-size: var(--fs-xs); width: 100%; }

.map-progress-track {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.map-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 200ms ease;
}

.map-progress-text {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: var(--sp-2) 0;
}

.map-progress-text strong {
  color: var(--text);
}

.map-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  cursor: pointer;
  font-family: inherit;
  transition: color 150ms ease, border-color 150ms ease;
}

.map-reset:hover {
  color: var(--text);
  border-color: var(--primary-soft);
}

.map-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  overflow: hidden;
}

.map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-water {
  fill: #0c1120;
}

.region {
  fill: #222c44;
  stroke: #35415f;
  stroke-width: 1;
  transition: fill 150ms ease;
}

.region.is-active {
  fill: rgba(124, 92, 255, 0.45);
}

.region-label {
  fill: #8b97b5;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-family: var(--font-body);
  paint-order: stroke;
  stroke: #222c44;
  stroke-width: 3px;
  pointer-events: none;
}

.marker {
  cursor: pointer;
}

.marker circle {
  stroke: var(--bg);
  stroke-width: 1.5;
  transition: transform 120ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.marker:hover circle,
.marker:focus-visible circle {
  transform: scale(1.5);
}

.marker.is-selected circle {
  stroke: var(--accent);
  stroke-width: 3;
  transform: scale(1.6);
}

.marker.is-found circle {
  opacity: 0.3;
}

.marker .marker-hit {
  fill: transparent;
  stroke: none;
  transform: none;
  pointer-events: all;
}

.map-detail {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  width: min(320px, calc(100% - 24px));
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: var(--shadow-2);
}

.map-detail-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
}

.map-detail-title {
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-2);
}

.map-detail-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0 0 var(--sp-2);
}

.map-detail-meta {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0 0 var(--sp-4);
}

/* confidence + provenance, shown only on items that carry real data */
.map-detail-confidence {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-2);
}

.map-detail-verified {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.map-detail-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-xs);
}

.map-detail-sources-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.map-detail-source {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.map-detail-source:hover {
  color: var(--primary-soft);
}

.map-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.map-found-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: var(--fs-sm);
}

.map-detail-link {
  font-size: var(--fs-sm);
}

.map-error {
  padding: var(--sp-6);
  color: var(--muted);
  text-align: center;
  font-size: var(--fs-sm);
}

.map-hero {
  padding: var(--sp-6) 0 var(--sp-8);
}

.poi-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-2);
}

.poi-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.poi-list strong {
  color: var(--text);
}

.poi-id {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.poi-future {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 1px var(--sp-2);
  border-radius: 999px;
  border: 1px dashed rgba(34, 211, 238, 0.45);
  color: var(--accent);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.poi-source {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}

.poi-source:hover {
  color: var(--primary-soft);
}

/* ---------- placeholder / under construction ---------- */

.construction-banner {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(251, 191, 36, 0.07) 0 12px,
      transparent 12px 24px
    ),
    var(--surface);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-left: 4px solid #fbbf24;
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.construction-banner strong {
  display: block;
  color: #fbbf24;
  margin-bottom: 2px;
}

.marker[data-placeholder] circle {
  stroke-width: 2;
  stroke-dasharray: 3 3;
}

.marker[data-placeholder].is-selected circle {
  stroke-width: 3.5;
  stroke-dasharray: 0;
}

.map-detail-future {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 8px;
  padding: var(--sp-2) var(--sp-3);
  margin: 0 0 var(--sp-4);
}

.map-detail-future-label {
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.map-detail-future-value {
  display: block;
  color: var(--accent);
  font-size: var(--fs-base);
  margin-bottom: 2px;
}

.map-detail-future-note {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ---------- demolition range (chaos toy) ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chaos-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

.chaos-stats strong {
  color: var(--text);
}

.chaos-stats .map-reset {
  margin-left: auto;
}

.chaos-walls {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.chaos-wall {
  position: absolute;
  top: var(--sp-16);
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 0 1px,
    transparent 1px 32px
  );
}

.chaos-wall--left {
  left: 0;
  width: max(0px, calc((100vw - var(--chaos-gutter-base)) / 2));
}

.chaos-wall--right {
  right: 0;
  width: max(0px, calc((100vw - var(--chaos-gutter-base)) / 2));
}

/* Blank space below the footer on short pages. Height is set by the script
   from the real footer position, so it can only ever cover empty area. */
.chaos-wall--bottom {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
}

.chaos-column {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  color: rgba(154, 164, 184, 0.5);
  transition: color 200ms ease;
}

.chaos-wall:hover .chaos-column {
  color: rgba(154, 164, 184, 0.85);
}

.word {
  display: inline-block;
}

.ch {
  display: inline-block;
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.3, 1.35),
    opacity 420ms ease;
  will-change: transform;
}

.chaos-launcher {
  display: none;
}

.chaos-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #cfe3ff, #7c5cff 58%, #4b2fb3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 6px 18px rgba(124, 92, 255, 0.45);
  pointer-events: none;
  z-index: 3;
}

.chaos-aim {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  transform-origin: 0 50%;
  background: linear-gradient(
    90deg,
    rgba(34, 211, 238, 0.9),
    rgba(34, 211, 238, 0)
  );
  pointer-events: none;
  z-index: 2;
}

.chaos-hint {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: var(--sp-3) 0 0;
}

.chaos-narrow {
  font-size: var(--fs-sm);
  color: #fbbf24;
  margin: var(--sp-3) 0 0;
}

/* ---------- 404 ---------- */

.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
}

.error-page h1 {
  font-size: var(--fs-4xl);
}

/* ---------- mobile ---------- */

@media (max-width: 1120px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: var(--sp-3) 0;
    font-size: var(--fs-base);
  }

  .nav-toggle {
    display: inline-block;
  }

  .map-app { grid-template-columns: 1fr; }
  .map-detail { position: static; width: auto; margin-top: var(--sp-3); }
}

@media (max-width: 640px) {
  :root {
    --fs-4xl: 32px;
    --fs-3xl: 28px;
    --fs-2xl: 22px;
  }

  .container {
    padding: 0 var(--sp-4);
  }

  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--sp-8) 0;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    position: static;
  }

  .facts > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* nowrap cells made every table wider than the phone screen and pushed the
     whole document wider than the viewport; let cells wrap instead */
  th,
  td {
    white-space: normal;
  }

  table {
    font-size: var(--fs-xs);
  }

  .map-app {
    grid-template-columns: 1fr;
  }

  .map-detail {
    position: static;
    width: auto;
    margin-top: var(--sp-3);
  }

  .chaos-stats .map-reset {
    margin-left: 0;
  }

  .prose {
    font-size: var(--fs-base);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Checklist and backup tools share the existing site palette and content width. */
.map-filter-panel summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 8px 0 14px; }
.map-filter-panel .map-side-title { margin-top: 8px; }
.map-tracker-link { display: block; margin-top: 16px; font-size: var(--fs-sm); color: var(--accent); }
.tracker-overview { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; align-items: center; padding: 32px; background: linear-gradient(110deg,#201c3d,var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); margin: 24px 0 16px; }
.tracker-total { display: block; font-size: 44px; letter-spacing: -.04em; line-height: 1.3; }
.tracker-overview p { color: var(--muted); font-size: var(--fs-sm); margin: 8px 0 0; }
.tracker-progress > div { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.tracker-progress strong { font-size: 28px; } .tracker-progress span { color: var(--muted); }
.tracker-progress progress { display: block; width: 100%; height: 12px; accent-color: var(--primary); border: 0; border-radius: 999px; overflow: hidden; }
.tracker-progress progress::-webkit-progress-bar { background: var(--bg); }
.tracker-progress progress::-webkit-progress-value { background: linear-gradient(90deg,var(--primary),var(--accent)); }
.tracker-regions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 32px; }
.tracker-region { display: flex; justify-content: space-between; gap: 10px; padding: 16px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; text-align: left; font: inherit; font-size: var(--fs-sm); }
.tracker-region strong { color: var(--text); white-space: nowrap; } .tracker-region.is-active { border-color: var(--primary); background: #211e38; }
.tracker-workspace { margin-bottom: 64px; }
.tracker-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; }
.tracker-toolbar h2 { font-size: 22px; margin: 0 0 4px; } .tracker-toolbar p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.tracker-backups { display: flex; gap: 8px; } .tracker-backups .btn { font-size: var(--fs-sm); padding: 10px 14px; }
.tracker-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tracker-filters label { display: flex; flex: 1; min-width: 130px; flex-direction: column; gap: 6px; color: var(--muted); font-size: var(--fs-xs); }
.tracker-filters label:first-child { flex: 2; }
.tracker-filters input,.tracker-filters select,.list-pagination select { min-height: 42px; width: 100%; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); color: var(--text); padding: 8px 10px; font: inherit; }
.tracker-filters .map-reset { min-height: 42px; }
.tracker-notice { color: var(--muted); font-size: var(--fs-sm); min-height: 22px; margin: 16px 0; }
.tracker-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tracker-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tracker-check { display: flex; align-items: center; gap: 14px; min-width: 0; cursor: pointer; }
.tracker-check input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--primary); }
.tracker-copy { display: grid; gap: 5px; } .tracker-copy strong { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.tracker-meta { font-size: var(--fs-xs); color: var(--muted); }
.tracker-row.is-done .tracker-copy strong { color: var(--muted); text-decoration: line-through; }
.tracker-map { font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; }
.list-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; font-size: var(--fs-sm); }
.list-pagination .btn { padding: 8px 16px; font-size: var(--fs-sm); }
.list-pagination label { display: flex; align-items: center; gap: 8px; } .list-pagination select { width: auto; }
button:disabled { opacity: .45; cursor: default; transform: none; }
[data-poi-link] { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width:1121px) { .map-filter-panel > summary { display: none; } }
@media (max-width:640px) {
 .tracker-overview { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
 .tracker-regions { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .tracker-region { padding: 12px; font-size: 12px; }
 .tracker-toolbar { flex-direction: column; align-items: stretch; }
 .tracker-backups .btn { flex: 1; }
 .tracker-filters { padding: 12px; } .tracker-filters label:first-child { flex-basis: 100%; }
 .tracker-row { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px; }
 .tracker-map { margin-left: 34px; }
 .tracker-total { font-size: 38px; }
}
