/* นักสำรวจ 77 จังหวัด — atlas-plate look: paper, graticule ticks, region tints; the map is the hero */
:root {
  --paper: #eef2ec;
  --card: #ffffff;
  --ink: #16314a;
  --ink-soft: #4f6577;
  --rule: #cfd9d1;
  --sea: #cbe4ec;
  --sea-ink: #4f86a0;
  --land: #e4dfd1;
  --accent: #e04a2f;
  --good: #23855a;
  --bad: #c0392b;
  --display: "Mali", "IBM Plex Sans Thai Looped", "Tahoma", sans-serif;
  --body: "IBM Plex Sans Thai Looped", "Sarabun", "Tahoma", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Menlo", monospace;
  --r: 14px;
  --shadow: 0 1px 0 rgba(22, 49, 74, .06), 0 8px 24px -12px rgba(22, 49, 74, .25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); line-height: 1.35; margin: 0; text-wrap: balance; font-weight: 700; }
h1 { font-size: clamp(30px, 5vw, 50px); }
h2 { font-size: clamp(24px, 3.2vw, 32px); }
h3 { font-size: 21px; }
p { margin: 0 0 .7em; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand b { font-family: var(--display); font-size: 20px; line-height: 1.1; display: block; }
.brand b .n { font-family: var(--mono); font-weight: 600; color: var(--accent); letter-spacing: -.04em; }
.brand small { display: block; font-size: 12.5px; color: var(--ink-soft); line-height: 1.2; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  flex: none; white-space: nowrap; text-decoration: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 16px; color: var(--ink-soft);
}
.nav a:hover { background: var(--card); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.explored-chip {
  font-family: var(--mono); font-size: 13px; background: var(--card); border: 1px solid var(--rule);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; color: var(--ink-soft);
}
.explored-chip b { color: var(--accent); }

/* ---------- layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; display: grid; gap: 40px; }
.section { display: grid; gap: 18px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head p { color: var(--ink-soft); margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--accent); text-transform: uppercase; }
.lede { font-size: 19px; color: var(--ink-soft); max-width: 60ch; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 2px solid var(--ink); background: var(--ink); color: #fff; font: 600 17px/1.2 var(--body);
  padding: 11px 20px; border-radius: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); color: #fff; background: #0f2438; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--card); color: var(--ink); }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.accent:hover { background: #c63c23; }
.btn.small { font-size: 15px; padding: 7px 14px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }

/* plate = framed card with graticule tick marks on its edge */
.plate {
  position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow);
}
.plate.ticks::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 48px) top / 100% 6px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 48px) bottom / 100% 6px no-repeat;
  opacity: .22;
}

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 28px; align-items: center; }
.hero h1 .num { color: var(--accent); font-family: var(--mono); font-weight: 600; letter-spacing: -.04em; }
.hero-copy { display: grid; gap: 18px; }
.hero-map { padding: 10px; }
.hero-map .map-wrap { height: min(76vh, 640px); }
.region-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.region-key span { display: inline-flex; align-items: center; gap: 6px; }
.region-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.facts > div { padding: 16px 18px; border-left: 1px solid var(--rule); display: grid; gap: 2px; }
.facts > div:first-child { border-left: 0; }
.facts b { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.facts span { font-size: 14.5px; color: var(--ink-soft); line-height: 1.45; }

/* region cards */
.regions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.region-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 14px; text-decoration: none; color: var(--ink);
  border-top: 5px solid var(--rc); transition: transform .15s ease;
}
.region-card:hover { transform: translateY(-2px); color: var(--ink); }
.region-card .mini { width: 92px; height: 120px; }
.region-card h3 { font-size: 19px; }
.region-card p { font-size: 15px; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.55; }
.region-card .count { font-family: var(--mono); font-size: 13px; color: var(--rc); font-weight: 600; }

/* learning path */
.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.step {
  display: grid; grid-template-columns: 54px 1fr; gap: 14px; padding: 16px; text-decoration: none; color: var(--ink); align-items: start;
}
.step:hover { color: var(--ink); border-color: var(--ink-soft); }
.step .no {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 20px;
  background: var(--sc, var(--ink)); color: #fff;
}
.step h3 { font-size: 18.5px; }
.step p { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
.stars { font-size: 15px; letter-spacing: 2px; color: #c9cfc9; white-space: nowrap; }
.stars .on { color: #e8a317; }

/* games grid */
.games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.game-card { padding: 18px; display: grid; gap: 8px; text-decoration: none; color: var(--ink); align-content: start; }
.game-card:hover { color: var(--ink); border-color: var(--ink-soft); }
.game-card .gi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); }
.game-card h3 { font-size: 19px; }
.game-card p { margin: 0; font-size: 15px; color: var(--ink-soft); line-height: 1.55; }
.best { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }

/* ---------- map ---------- */
.map-wrap.map3d { background: #d6e9ee; }
.map3d .map3d-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.map3d .map3d-canvas:active { cursor: grabbing; }
.map3d-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 14px; color: var(--sea-ink); }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--card); }
.view-toggle button { appearance: none; border: 0; background: none; font: 600 16px/1 var(--body); padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.hint3d { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.5; }
.map-wrap { position: relative; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; background: var(--sea); touch-action: manipulation; }
.map-wrap .map-svg { width: 100%; height: 100%; display: block; }
.map-wrap .prov { stroke: #fff; stroke-width: .55; stroke-linejoin: round; transition: fill .2s ease, opacity .2s ease; cursor: pointer; vector-effect: non-scaling-stroke; }
.map-wrap.plain .prov { fill: #f7f5ee; stroke: #a9b5ad; }
.map-wrap .prov:hover { filter: brightness(1.08) saturate(1.1); }
.map-wrap .prov.dim { opacity: .28; }
.map-wrap .prov.sel { stroke: var(--ink); stroke-width: 2.2; }
.map-wrap .prov.hl { fill: var(--accent) !important; opacity: 1; stroke: var(--ink); stroke-width: 2.4; }
.map-wrap.focus .prov:not(.hl):not(.ok):not(.no) { opacity: .5; }
.map-wrap .prov.ok { fill: #19c37d !important; opacity: 1; stroke: var(--ink); stroke-width: 2.4; }
.map-wrap .prov.no { fill: var(--bad) !important; opacity: 1; stroke: var(--ink); stroke-width: 2; }
.map-wrap .nb { fill: var(--land); stroke: #c9c2ae; stroke-width: .5; vector-effect: non-scaling-stroke; }
.map-wrap .grat line { stroke: var(--sea-ink); stroke-width: .5; stroke-dasharray: 2 3; opacity: .55; vector-effect: non-scaling-stroke; }
.map-wrap .grat text { font-family: var(--mono); font-weight: 500; fill: var(--sea-ink); }
.map-wrap .nb-label { font-family: var(--body); font-weight: 600; fill: #857d66; letter-spacing: .06em; pointer-events: none; }
.map-wrap .sea-label { font-family: var(--body); font-weight: 600; fill: var(--sea-ink); letter-spacing: .1em; pointer-events: none; }
.map-wrap .plabel { font-family: var(--body); font-weight: 600; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 1.2px; }
.map-wrap.no-labels .plabel { display: none; }
.map-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 15px;
  line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; z-index: 3;
}
.map-tip small { display: block; opacity: .75; font-size: 12.5px; }
.map-hud {
  position: absolute; left: 10px; bottom: 10px; display: grid; gap: 6px; pointer-events: none; z-index: 2;
}
.coord { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.88); padding: 3px 8px; border-radius: 6px; color: var(--ink); }
.scale { display: grid; gap: 1px; background: rgba(255,255,255,.88); padding: 4px 8px 3px; border-radius: 6px; font-family: var(--mono); font-size: 11px; }
.scale-bar { height: 6px; border: 1.5px solid var(--ink); border-top: 0; background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50%) ; background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom; }
.north { position: absolute; right: 10px; top: 10px; width: 38px; height: 50px; pointer-events: none; z-index: 2; }
.map-zoom { position: absolute; right: 10px; bottom: 10px; display: grid; gap: 4px; z-index: 2; }
.map-zoom button {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--rule); background: #fff; font: 600 18px var(--body); color: var(--ink); cursor: pointer;
}
.map-zoom button:hover { background: var(--paper); }

.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.map-page .map-plate { padding: 10px; position: sticky; top: 76px; }
.map-page .map-wrap { height: calc(100vh - 110px); max-height: 860px; min-height: 480px; }
.side { display: grid; gap: 14px; }
.tools { padding: 14px; display: grid; gap: 10px; }
.search { width: 100%; font: 17px var(--body); padding: 10px 14px; border: 2px solid var(--rule); border-radius: 10px; background: #fff; color: var(--ink); }
.search:focus { border-color: var(--ink); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; border: 1.5px solid var(--rule); background: #fff; color: var(--ink); font: 600 14.5px/1 var(--body); padding: 7px 11px; border-radius: 999px;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.results { display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.results button { text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; font: 16px var(--body); color: var(--ink); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.results button:hover { background: var(--paper); }
.results i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* province info card */
.pcard { padding: 18px; display: grid; gap: 12px; border-top: 6px solid var(--rc, var(--ink)); }
.pcard-head { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: start; }
.pcard .reg { font-size: 14.5px; font-weight: 600; color: var(--rc); }
.pcard h2 { font-size: 30px; }
.pcard .en { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.pcard .mini { width: 92px; height: 92px; }
.pcard ul.facts-list { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.meta { display: grid; gap: 8px; font-size: 15.5px; }
.meta > div { display: grid; grid-template-columns: 118px 1fr; gap: 8px; border-top: 1px dashed var(--rule); padding-top: 8px; }
.meta dt, .meta .k { color: var(--ink-soft); }
.linklist { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.linklist button, .linklist a { border: 0; background: var(--paper); border-radius: 6px; padding: 1px 8px; font: 15px var(--body); color: var(--ink); cursor: pointer; text-decoration: none; }
.linklist button:hover, .linklist a:hover { background: var(--ink); color: #fff; }
.pcard.empty { color: var(--ink-soft); }
.pcard.empty h3 { color: var(--ink); }

/* ---------- provinces directory ---------- */
.dir-tools { padding: 14px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dir-tools .search { max-width: 320px; }
.dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pc { padding: 12px; display: grid; grid-template-rows: 96px auto auto; gap: 4px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--rc); }
.pc:hover { color: var(--ink); transform: translateY(-2px); }
.pc .mini { width: 100%; height: 96px; }
.pc b { font-family: var(--display); font-size: 18px; line-height: 1.3; }
.pc span { font-size: 13.5px; color: var(--rc); font-weight: 600; }
.pc.seen b::after { content: " ✓"; color: var(--good); font-size: 15px; }
.mini path { stroke: none; }
.dir-group h3 { margin: 8px 0 10px; display: flex; align-items: center; gap: 10px; }
.dir-group h3 i { width: 14px; height: 14px; border-radius: 4px; background: var(--rc); }
.dir-group h3 small { font: 500 14px var(--mono); color: var(--ink-soft); }

.pdetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pdetail .map-plate { padding: 10px; }
.pdetail .map-wrap { height: 560px; }
.crumbs { font-size: 15px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- lessons ---------- */
.lesson { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.toc { position: sticky; top: 76px; padding: 14px; display: grid; gap: 2px; }
.toc a { text-decoration: none; padding: 7px 10px; border-radius: 8px; display: grid; grid-template-columns: 26px 1fr; gap: 8px; font-size: 15.5px; line-height: 1.4; color: var(--ink-soft); }
.toc a b { font-family: var(--mono); font-weight: 600; color: var(--ink-soft); }
.toc a:hover { background: var(--paper); color: var(--ink); }
.toc a[aria-current="page"] { background: var(--ink); color: #fff; }
.toc a[aria-current="page"] b { color: #fff; }
.lesson-body { display: grid; gap: 22px; min-width: 0; }
.lesson-hero { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; align-items: center; border-top: 6px solid var(--rc, var(--ink)); }
.lesson-hero .mini-map { height: 260px; }
.lesson-hero .k { font-family: var(--mono); font-size: 13px; color: var(--rc, var(--accent)); letter-spacing: .04em; }
.lesson-hero h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 2px 0 14px; line-height: 1.3; }
.lesson-hero p { color: var(--ink-soft); margin: 0; max-width: 60ch; }
.lsec { padding: 22px 24px; }
.lsec h2 { font-size: 24px; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.lsec h2 small { font: 500 13px var(--mono); color: var(--ink-soft); }
.lsec ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.lsec .hint { margin-top: 12px; font-size: 15.5px; background: var(--paper); padding: 8px 12px; border-radius: 8px; border-left: 3px solid var(--accent); }
.prov-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prov-chips a { text-decoration: none; background: var(--rt, var(--paper)); border-radius: 8px; padding: 3px 10px; font-size: 15.5px; }
.prov-chips a:hover { background: var(--ink); color: #fff; }
.t { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 6px 0 10px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding: 6px 8px; }
.t td { border-bottom: 1px solid var(--rule); padding: 7px 8px; vertical-align: top; line-height: 1.55; }
.t td:first-child { font-weight: 600; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.coord-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.coord-box > div { background: var(--paper); border-radius: 10px; padding: 10px 14px; display: grid; }
.coord-box span { font-size: 14px; color: var(--ink-soft); }
.coord-box b { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.compass-grid { display: grid; grid-template-columns: 1fr 120px 1fr; grid-template-areas: ". n ." "w c e" ". s ."; gap: 8px; text-align: center; max-width: 520px; margin: 6px auto 0; }
.compass-grid > div { background: var(--paper); border-radius: 10px; padding: 8px; display: grid; line-height: 1.35; }
.compass-grid span { font-size: 13.5px; color: var(--ink-soft); }
.compass-grid b { font-family: var(--display); font-size: 18px; }
.compass-grid small { font-size: 13px; color: var(--ink-soft); }
.cg-n { grid-area: n; } .cg-s { grid-area: s; } .cg-w { grid-area: w; } .cg-e { grid-area: e; }
.cg-c { grid-area: c; background: var(--ink) !important; color: #fff; font: 600 14px/1.5 var(--mono); place-content: center; border-radius: 50% !important; aspect-ratio: 1; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.parts > div { background: var(--paper); padding: 10px 12px; border-radius: 10px; display: grid; gap: 2px; line-height: 1.5; }
.parts span { font-size: 15px; color: var(--ink-soft); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-col > div { background: var(--paper); padding: 12px 14px; border-radius: 10px; }
.two-col p { margin: 4px 0 0; font-size: 15.5px; }
.terms { display: grid; gap: 8px; }
.terms div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; border-top: 1px dashed var(--rule); padding-top: 8px; }
.terms b { font-family: var(--display); }
.didyou { background: var(--ink); color: #fff; border-color: var(--ink); }
.didyou h2 { color: #fff; }
.didyou p { font-size: 18px; margin: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- quiz / games ---------- */
.quiz { padding: 22px 24px; display: grid; gap: 14px; }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-progress { display: flex; gap: 4px; }
.q-progress i { width: 22px; height: 6px; border-radius: 3px; background: var(--rule); }
.q-progress i.done { background: var(--ink); }
.q-progress i.ok { background: var(--good); }
.q-progress i.no { background: var(--bad); }
.q-text { font-family: var(--display); font-size: 23px; line-height: 1.45; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  appearance: none; text-align: left; border: 2px solid var(--rule); background: #fff; color: var(--ink); font: 17px/1.45 var(--body);
  padding: 12px 14px; border-radius: 12px; cursor: pointer; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start;
  transition: border-color .12s ease, background .12s ease;
}
.choice:hover:not([disabled]) { border-color: var(--ink); }
.choice .letter { font: 600 14px/28px var(--mono); width: 28px; height: 28px; text-align: center; border-radius: 50%; background: var(--paper); }
.choice.ok { border-color: var(--good); background: #e7f4ec; }
.choice.ok .letter { background: var(--good); color: #fff; }
.choice.no { border-color: var(--bad); background: #fbe9e6; }
.choice.no .letter { background: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; }
.feedback { border-radius: 12px; padding: 12px 14px; font-size: 16px; display: none; }
.feedback.show { display: block; }
.feedback.ok { background: #e7f4ec; border-left: 4px solid var(--good); }
.feedback.no { background: #fbe9e6; border-left: 4px solid var(--bad); }
.feedback b { display: block; font-family: var(--display); font-size: 18px; }
.result { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 10px 0; }
.result .big { font: 600 54px/1 var(--mono); letter-spacing: -.04em; }
.result .stars { font-size: 34px; }

.game { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.game .map-plate { padding: 10px; }
.game .map-wrap { height: calc(100vh - 150px); min-height: 520px; }
.game-panel { padding: 20px; display: grid; gap: 14px; position: sticky; top: 76px; }
.game-panel .prompt { font-family: var(--display); font-size: 26px; line-height: 1.35; }
.game-panel .prompt em { font-style: normal; color: var(--accent); }
.scorebar { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }
.scorebar b { color: var(--ink); font-size: 18px; }
.timer { height: 8px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }
.region-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.region-btns button {
  appearance: none; border: 2px solid var(--rc); background: var(--rt); color: var(--ink); font: 600 16px/1.3 var(--body); padding: 12px 10px; border-radius: 12px; cursor: pointer;
}
.region-btns button:hover { background: var(--rc); color: #fff; }
.region-btns button.ok { background: var(--good); border-color: var(--good); color: #fff; }
.region-btns button.no { background: var(--bad); border-color: var(--bad); color: #fff; }
.sort-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; background: var(--paper); border-radius: 12px; padding: 12px; }
.sort-card .mini { width: 110px; height: 110px; }
.sort-card b { font-family: var(--display); font-size: 28px; }
.level { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--rule); }
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 20px 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.foot b { color: var(--ink); }

.about { display: grid; gap: 16px; max-width: 820px; }
.about .plate { padding: 22px 24px; }
.about ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts > div:nth-child(4) { border-left: 0; }
  .facts > div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .regions, .path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-page, .game, .pdetail { grid-template-columns: 1fr; }
  .map-page .map-plate, .game-panel { position: static; }
  .map-page .map-wrap, .game .map-wrap { height: 68vh; min-height: 420px; }
  .lesson { grid-template-columns: 1fr; }
  .toc { position: static; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .top { position: static; }
  .top-in { flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; }
  .brand small { display: none; }
  .brand b { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; }
  .explored-chip { font-size: 12px; padding: 3px 8px; }
  .nav a { padding: 5px 12px; font-size: 15.5px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .explored-chip { margin-left: auto; order: 2; }
  .nav { order: 3; }
  main { padding: 20px 16px 48px; gap: 30px; }
  .hero { grid-template-columns: 1fr; }
  .hero-map .map-wrap { height: 70vh; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div { border-left: 0 !important; border-top: 1px solid var(--rule); }
  .facts > div:nth-child(-n+2) { border-top: 0; }
  .regions, .path, .games { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr; }
  .lesson-hero { grid-template-columns: 1fr; }
  .lesson-hero .mini-map { height: 200px; }
  .two-col, .coord-box { grid-template-columns: 1fr; }
  .terms div, .meta > div { grid-template-columns: 1fr; gap: 0; }
  .foot { grid-template-columns: 1fr; }
  .pdetail .map-wrap { height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.opt2d { display: grid; gap: 8px; }
.opt2d[hidden], .hint3d[hidden] { display: none; }

/* ===== หน้าแรก: แผนที่ 3 มิติเต็มจอ ===== */
main.wide { max-width: none; padding: 0 0 48px; gap: 28px; }
.home { display: grid; gap: 28px; }
.home-under { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 20px; }
.stage { position: relative; height: calc(100vh - 61px); min-height: 600px; overflow: hidden; background: #d6e9ee; }
.stage-map { position: absolute; inset: 0; }
.stage-map .map-wrap { position: absolute; inset: 0; height: 100%; border-radius: 0; }
.stage-intro {
  position: absolute; z-index: 4; top: 18px; left: max(18px, calc(50vw - 600px)); width: 340px; display: grid; gap: 12px;
  padding: 18px; border-radius: var(--r); background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); box-shadow: var(--shadow); border: 1px solid var(--rule);
}
.stage-intro h1 { font-size: 32px; }
.stage-intro h1 .num { color: var(--accent); font-family: var(--mono); font-weight: 600; letter-spacing: -.04em; }
.stage-intro p { margin: 0; font-size: 15.5px; color: var(--ink-soft); line-height: 1.6; }
.stage-intro .chips .chip { font-size: 13.5px; padding: 6px 9px; }
.stage-search { position: relative; }
.stage-search .search { padding: 8px 12px; font-size: 16px; }
.stage-search .results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); z-index: 6; padding: 4px; }
.stage-link { font-size: 14.5px; color: var(--ink-soft); }
.stage .map-zoom { right: auto; left: max(18px, calc(50vw - 600px)); bottom: 54px; }
.stage .map-hud { left: max(18px, calc(50vw - 600px)); bottom: 14px; }
.stage .north { right: auto; top: auto; left: calc(max(18px, calc(50vw - 600px)) + 50px); bottom: 58px; }

/* ป๊อปอัปจังหวัด — เรืองแสงสีของภาค */
.popup {
  position: absolute; z-index: 5; top: 18px; right: max(18px, calc(50vw - 600px)); width: 400px; max-height: calc(100% - 36px); overflow: auto;
  background: #fff; border-radius: 18px; padding: 20px 20px 16px; display: grid; gap: 12px; align-content: start;
  border: 1.5px solid color-mix(in srgb, var(--rc, var(--ink)) 55%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc, var(--ink)) 16%, transparent), 0 0 46px 2px color-mix(in srgb, #ffc95c 55%, transparent), 0 18px 40px -18px rgba(22, 49, 74, .5);
}
.popup[hidden] { display: none; }
.popup.in { animation: pop-in .42s cubic-bezier(.2, .9, .25, 1.15) both, glow-pulse 2.6s ease-in-out .42s infinite; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--rc, var(--ink)) 16%, transparent), 0 0 36px 0 color-mix(in srgb, #ffc95c 45%, transparent), 0 18px 40px -18px rgba(22, 49, 74, .5); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--rc, var(--ink)) 22%, transparent), 0 0 64px 6px color-mix(in srgb, #ffc95c 65%, transparent), 0 18px 40px -18px rgba(22, 49, 74, .5); }
}
.pop-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: #fff; font: 600 20px/1 var(--body); color: var(--ink); cursor: pointer; }
.pop-x:hover { background: var(--paper); }
.pop-head h2 { font-size: 32px; margin-top: 4px; }
.pop-head .en { font-size: 13px; color: var(--ink-soft); }
.reg-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--rc); background: color-mix(in srgb, var(--rc) 12%, #fff); padding: 3px 10px; border-radius: 999px; }
.reg-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.pop-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; }
.pop-meta span { background: var(--paper); padding: 2px 10px; border-radius: 999px; color: var(--ink-soft); }
.pop-tip { margin: 0; font-size: 13.5px; color: var(--ink-soft); background: #fff8e6; border-radius: 10px; padding: 8px 10px; line-height: 1.55; }
.btn.earth { background: #1a73e8; border-color: #1a73e8; }
.btn.earth:hover { background: #1558b0; }

/* หัวข้อเนื้อหาจังหวัด */
.geo { display: grid; gap: 10px; }
.geo section { border-left: 3px solid var(--ic); padding: 2px 0 2px 12px; }
.geo h4 { margin: 0 0 2px; font: 600 15.5px/1.4 var(--body); color: var(--ic); display: flex; align-items: center; gap: 6px; }
.geo h4 i { width: 18px; height: 18px; display: inline-grid; }
.geo h4 svg { width: 18px; height: 18px; }
.geo p { margin: 0 0 4px; font-size: 15.5px; line-height: 1.6; }
.geo ul { margin: 0; padding-left: 1.1em; font-size: 15px; display: grid; gap: 3px; }
.muted { color: var(--ink-soft); font-size: 13.5px !important; }
.ind { font: 600 11.5px/1 var(--mono); color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule); padding: 3px 6px; border-radius: 6px; letter-spacing: 0; }

/* บทเรียน: อดีต → ปัจจุบัน */
.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.timeline > div { background: var(--paper); border-radius: 12px; padding: 12px 14px; border-top: 4px solid var(--rc); }
.timeline > div:nth-child(2) { border-top-color: color-mix(in srgb, var(--rc) 65%, #16314a); }
.timeline > div:nth-child(3) { border-top-color: var(--accent); }
.timeline span { font: 600 13px var(--mono); color: var(--ink-soft); }
.timeline p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.6; }
.change-sec ul { margin-top: 4px; }

/* ===== แบบทดสอบ ===== */
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.level-card { padding: 20px; display: grid; gap: 8px; text-decoration: none; color: var(--ink); align-content: start; border-top: 6px solid var(--lc); }
.level-card:hover { color: var(--ink); transform: translateY(-2px); }
.level-card.lv-easy { --lc: #3f8f5f; } .level-card.lv-medium { --lc: #d98a2b; } .level-card.lv-hard { --lc: #c0392b; }
.level-card h2 { font-size: 26px; }
.level-card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.level-card .btn { justify-self: start; margin-top: 6px; }
.lv-dots { color: var(--lc); letter-spacing: 3px; font-size: 14px; }
.level-all { display: flex; align-items: center; gap: 16px; padding: 18px 20px; text-decoration: none; color: var(--ink); flex-wrap: wrap; }
.level-all > div { flex: 1 1 260px; }
.level-all h3 { font-size: 21px; }
.level-all p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.level-all:hover { color: var(--ink); border-color: var(--ink-soft); }
.q-tags { display: flex; gap: 6px; }
.tag { font: 600 12.5px/1 var(--body); padding: 5px 9px; border-radius: 999px; background: var(--paper); color: var(--ink-soft); }
.tag.ind { font-family: var(--mono); }
.qbody.with-fig { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.qfig { margin: 0; background: #cbe4ec; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); }
.qfig svg { display: block; width: 100%; height: 320px; }
.qfig figcaption { font-size: 12.5px; color: var(--ink-soft); background: #fff; padding: 6px 10px; }
.choices.one { grid-template-columns: 1fr; }
.match-help { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-soft); }
.match { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); align-items: stretch; }
.match .mcol { display: grid; gap: 10px; align-content: start; position: relative; z-index: 2; }
.match .mcol:last-child { grid-column: 3; }
.mlines { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: visible; }
.mitem {
  appearance: none; text-align: left; font: 16px/1.4 var(--body); color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--lc, var(--rule)); border-radius: 12px; padding: 11px 13px; min-height: 52px; transition: border-color .12s, background .12s, transform .12s;
}
.mitem:hover:not([disabled]) { border-color: var(--ink); }
.mitem.pick { border-color: var(--ink); background: #fff8e6; transform: scale(1.02); box-shadow: 0 0 0 3px #ffd36b; }
.mitem.linked { background: color-mix(in srgb, var(--lc) 9%, #fff); }
.mitem.ok { border-color: var(--good); background: #e7f4ec; }
.mitem.no { border-color: var(--bad); background: #fbe9e6; }
.mitem[disabled] { cursor: default; }
.by-ind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(460px, 100%); }
.by-ind > div { background: var(--paper); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.by-ind b { font-family: var(--mono); color: var(--ink-soft); font-size: 13px; }
.by-ind span { font: 600 26px/1.1 var(--mono); }
.by-ind small { font-size: 12.5px; color: var(--ink-soft); }
.review { border-top: 1px dashed var(--rule); padding-top: 14px; }
.review h3 { font-size: 19px; margin-bottom: 6px; }
.review ol { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; font-size: 15px; line-height: 1.6; }
.review small { color: var(--ink-soft); }

@media (max-width: 1020px) {
  .levels { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .qbody.with-fig { grid-template-columns: 1fr; }
  .qfig svg { height: 260px; }
}
@media (max-width: 760px) {
  .stage { height: auto; min-height: 0; overflow: visible; display: grid; background: none; }
  .stage-intro { position: static; width: auto; margin: 12px 16px; box-shadow: none; }
  .stage-intro h1 { font-size: 27px; }
  .stage-map { position: relative; height: 74vh; min-height: 440px; }
  .stage .map-zoom, .stage .map-hud { left: 12px; }
  .stage .north { left: 60px; }
  .popup { position: absolute; top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 64vh; }
  .stage { position: relative; }
  .match { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); }
  .mitem { font-size: 14.5px; padding: 9px 10px; }
  .by-ind { grid-template-columns: 1fr; }
}

.results[hidden] { display: none; }
.match-wrap > .btns { margin-top: 14px; }
@media (max-width: 760px) {
  .popup { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 52vh; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .popup.in { animation: sheet-in .38s cubic-bezier(.2, .9, .25, 1.05) both, glow-pulse 2.6s ease-in-out .4s infinite; }
}
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== แผนที่ภูมิประเทศ ===== */
.relief-legend {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 12px; display: grid; gap: 6px; justify-items: center;
  background: rgba(255,255,255,.92); border: 1px solid var(--rule); border-radius: 12px; padding: 8px 12px; font-size: 13px; box-shadow: var(--shadow); max-width: calc(100% - 24px);
}
.rl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; justify-content: center; }
.rl-row b { font-weight: 600; }
.rl-row span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rl-row i { width: 16px; height: 11px; border-radius: 2px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.rl-row i.riv { height: 3px; background: #2f7fc4; border-radius: 2px; box-shadow: none; }
.rl-ex { display: inline-flex; align-items: center; gap: 8px; }
.rl-ex input { width: 130px; accent-color: var(--ink); }
.rl-ex b { font-family: var(--mono); min-width: 32px; }
.rl-mode { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; background: #fff; }
.rl-mode button { appearance: none; border: 0; background: none; font: 600 12.5px/1 var(--body); padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.rl-mode button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.map-wrap .relief-legend.flat { display: none; }
.map-wrap.relief .relief-legend.flat { display: grid; }
.map-wrap .relief-img { display: none; }
.map-wrap.relief .relief-img { display: inline; }
.map-wrap.relief .nb { display: none; }
.map-wrap.relief .prov { fill-opacity: 0; stroke: rgba(255,255,255,.85); stroke-width: .6; }
.map-wrap.relief .prov:hover { fill: #fff !important; fill-opacity: .28; filter: none; }
.map-wrap.relief .prov.sel { fill: #ffd36b !important; fill-opacity: .3; stroke: var(--ink); stroke-width: 2.2; }
.map-wrap.relief .prov.dim { opacity: 1; fill: #fff !important; fill-opacity: .45; }
.map-wrap.relief .nb-label { fill: #5f5a4a; }
.stage .relief-legend { top: 14px; bottom: auto; left: calc(max(18px, 50vw - 600px) + 356px); transform: none; max-width: 440px; }
.rbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.rbar i { display: block; height: 100%; }
.rleg { list-style: none; padding: 0 !important; margin: 0 0 6px !important; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 2px 10px !important; font-size: 13.5px !important; }
.rleg li { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.rleg li b { margin-left: auto; font-family: var(--mono); font-weight: 600; color: var(--ink); }
.rleg li.big { color: var(--ink); font-weight: 600; }
.rleg i { width: 12px; height: 10px; border-radius: 2px; flex: none; }

@media (max-width: 760px) {
  .relief-legend { font-size: 11.5px; padding: 6px 8px; left: 8px; right: 8px; transform: none; bottom: 8px; }
  .stage .relief-legend { left: 8px; right: 8px; }
  .rl-ex input { width: 90px; }
  .stage .map-zoom { bottom: 108px; } .stage .map-hud { bottom: 86px; } .stage .north { bottom: 112px; }
}
.map-wrap.relief { background: #c4e1e9; }
.map-wrap.relief .map-svg > rect { fill: #c4e1e9; }

/* ===== แผนที่ละเอียดรายจังหวัด (แบบ Google Earth) ===== */
.pop-detail { justify-content: center; }
main.wide .earth-page { margin-bottom: -48px; }
.earth-page { height: calc(100vh - 61px); height: calc(100dvh - 61px); min-height: 520px; }
.earth { position: relative; height: 100%; overflow: hidden; background: #0c1a24; }
.earth-map { position: absolute; inset: 0; }
.earth-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; font-size: 15px; color: #cfe3ea; }
.earth-loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #ffd36b; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.earth-panel {
  position: absolute; z-index: 5; top: 14px; left: 14px; width: 330px; max-height: calc(100% - 28px); overflow: auto;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-radius: 16px; border: 1px solid var(--rule); box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); padding: 16px;
}
.ep-toggle { display: none; }
.ep-body { display: grid; gap: 12px; }
.ep-head h1 { font-size: 30px; margin-top: 4px; }
.ep-head p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }
.ep-ctrl { display: grid; gap: 8px; justify-items: start; }
.ep-ctrl .rl-ex { display: flex; align-items: center; gap: 8px; font-size: 14px; width: 100%; }
.ep-ctrl .rl-ex input { flex: 1; }
.ep-checks { display: flex; gap: 16px; font-size: 14px; }
.ep-checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ep-legend { width: 100%; }
.ep-legend[hidden] { display: none; }
.ep-legend .bar { display: block; height: 10px; border-radius: 5px; border: 1px solid rgba(0,0,0,.15); }
.ep-legend .ticks { display: flex; justify-content: space-between; font: 500 11.5px var(--mono); color: var(--ink-soft); margin-top: 2px; }
.ep-legend .ticks i { font-style: normal; }
.ep-hint { margin: 0; font-size: 13.5px; color: var(--ink); background: #fff6dc; border: 1px solid #f3dfa4; border-radius: 10px; padding: 8px 10px; line-height: 1.55; }
.earth-panel section h3 { font-size: 16.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.earth-panel .ic { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; color: #fff; flex: none; }
.ic.peak { background: #8b5a2b; } .ic.river { background: #2f7fc4; } .ic.water { background: #1c8fc0; } .ic.town { background: #16314a; }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.ep-list li.muted { font-size: 13.5px; padding: 4px 8px; color: var(--ink-soft); }
.ep-list button { width: 100%; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; text-align: left; border: 0; background: none; padding: 5px 8px; border-radius: 8px; font: 15px/1.4 var(--body); color: var(--ink); cursor: pointer; }
.ep-list button:hover, .ep-list button:focus-visible { background: var(--paper); }
.ep-list button b { font-weight: 600; }
.ep-list button span { font: 500 12.5px var(--mono); color: var(--ink-soft); white-space: nowrap; }
.ep-list button.more { color: var(--accent); font-size: 14px; justify-content: flex-start; }
.ep-src { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.earth-panel .btns button.btn { font: inherit; cursor: pointer; background: none; }
.earth-msg { position: absolute; z-index: 8; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 14px; padding: 16px 18px; width: min(620px, calc(100% - 32px)); box-shadow: var(--shadow); border: 1px solid var(--rule); line-height: 1.6; }
.earth-msg[hidden] { display: none; }
.earth-msg { max-height: calc(100% - 24px); overflow: auto; }
@media (min-width: 761px) { .earth-msg { left: calc(50% + 175px); width: min(620px, calc(100% - 400px)); } }
.earth-ex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.earth-ex img { width: 100%; border-radius: 8px; border: 1px solid var(--rule); display: block; }
.earth-msg small { color: var(--ink-soft); }
.earth-msg p { margin: 8px 0 0; }
.em { border: 0; cursor: pointer; font: 600 13px/1.25 var(--body); white-space: nowrap; }
.em-peak { background: none; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 2px #000, 0 0 6px rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; padding: 0; }
.em-peak i { font-style: normal; color: #ffd36b; font-size: 15px; line-height: 1; order: 3; }
.em-peak small { font: 600 11.5px var(--mono); }
.em-river { background: rgba(23, 92, 150, .9); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.em-water { background: rgba(10, 120, 175, .94); color: #fff; padding: 3px 9px; border-radius: 6px; font-size: 12.5px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.em-amp { background: rgba(255,255,255,.88); color: var(--ink); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.em:hover { filter: brightness(1.12); }
.earth-map.no-labels .em { display: none; }
.earth-pop .maplibregl-popup-content { font: 14.5px/1.6 var(--body); border-radius: 12px; padding: 12px 30px 12px 14px; color: var(--ink); box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); }
.earth-pop .maplibregl-popup-close-button { font-size: 20px; width: 28px; height: 28px; }
.earth-pop small { color: var(--ink-soft); }
.ep-kind { font: 600 12px var(--mono); color: var(--accent); }
.ep-name { font-family: var(--display); font-size: 19px; }
.earth .maplibregl-ctrl-attrib { font-size: 11px; }
@media (max-width: 760px) {
  .earth-page { height: calc(100vh - 100px); height: calc(100dvh - 100px); }
  .earth-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 55%; border-radius: 16px 16px 0 0; padding: 6px 14px 14px; }
  .earth-panel.closed { padding-bottom: 6px; }
  .ep-toggle { display: flex; justify-content: space-between; width: 100%; border: 0; background: none; font: 600 15px var(--body); color: var(--ink); padding: 8px 2px; cursor: pointer; }
  .ep-toggle span b { font-family: var(--display); }
  .ep-toggle i { font-style: normal; }
  .earth-panel.closed .ep-body { display: none; }
  .ep-head h1 { font-size: 24px; }
  .earth .maplibregl-ctrl-bottom-right { bottom: 46px; }
  .earth-msg { top: 12px; transform: translateX(-50%); max-height: calc(100% - 96px); }
  .earth-ex { grid-template-columns: 1fr; }
}
