/* KGP Field Guide. Shares its colours, fonts, header and the bar between the sites with the
   quest guides; its own accent is the gentoo's orange bill (the quest guides' is bronze).
   Layout: a slim top bar with the two views (Map, Quest guide); the map view is a sidebar list
   beside a full-height map, stacked on phones. */
:root {
  --bg: #f3f2ef;
  --panel: #ffffff;
  --sunk: #ebe9e4;
  --ink: #17181b;
  --muted: #5f636b;
  --line: #dcdad4;
  --shadow: 0 1px 2px rgba(20, 20, 25, .06), 0 6px 18px rgba(20, 20, 25, .07);
  --accent: #c9431a;
  --accent-soft: #fbe3d9;
  --water: #c9d6df;
  --found: #8a96a3;
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r-brynmoor: #1b8a3a;
  --r-ghornfell: #c99400;
  --r-fellhollow: #7b3fbf;
  --r-scorned: #b0204a;
  --r-dowdun: #1f6fd1;
  --r-umbral: #e0601a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316; --panel: #1a1c20; --sunk: #16171a; --ink: #eceef1; --muted: #9b9fa8; --line: #2c2f35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --accent: #ff7a4a; --accent-soft: #3a2018; --water: #1a242d; --found: #5d6a77;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; display: flex; flex-direction: column; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- the bar shared by the three Dragonwilds sites (same in all three) ---- */
.suite { background: #101114; border-bottom: 1px solid #24262c; font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; }
.suite-in { max-width: 1200px; margin: 0 auto; padding: 6px 12px; display: flex; justify-content: center; gap: 6px; }
.st { --c: #e9a948; position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 16px 6px 6px; border-radius: 12px; color: #c9ccd4; text-decoration: none; transition: background .15s, color .15s; }
.st:hover { background: #1a1c21; color: #fff; }
.st:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
.st-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); transition: background .15s, color .15s; }
.st-ico img { width: 24px; height: 24px; display: block; }
.st-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.st-t b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.st-t small { font-size: 11.5px; color: #8b8f99; white-space: nowrap; }
.st-s { display: none; }
.st[aria-current="page"] { background: #1c1e24; color: #fff; box-shadow: inset 0 0 0 1px #2d3039; }
.st[aria-current="page"] .st-ico { background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 65%, transparent); }
.st[aria-current="page"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -7px; height: 2px; border-radius: 2px; background: var(--c); }
.st-q { --c: #e9a948; }
.st-p { --c: #ff8a5c; }
.st-m { --c: #8b95ff; }
@media (max-width: 760px) {
  .suite-in { gap: 4px; padding: 6px 8px; }
  .st { flex: 1 1 0; justify-content: center; gap: 7px; padding: 6px 8px; }
  .st-t small { display: none; }
  .st-ico { width: 28px; height: 28px; border-radius: 8px; }
  .st-ico img { width: 21px; height: 21px; }
  .st[aria-current="page"]::after { left: 10px; right: 10px; }
}
@media (max-width: 480px) {
  .st-l { display: none; }
  .st-s { display: inline; }
  .st-t b { font-size: 13px; }
  .st { gap: 6px; padding: 5px 6px; }
}

.allquests { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #9a5d12; color: var(--ink); text-decoration: none; font-size: 14px; }
.allquests:hover { border-color: #9a5d12; }
.allquests .aq-ico { width: 36px; height: 36px; flex: none; }
.allquests b { display: block; font-size: 15px; }
.allquests span:nth-child(2) { flex: 1; color: var(--muted); }
.allquests span:nth-child(2) b { color: var(--ink); }
.allquests .aq-go { font-weight: 600; color: var(--accent); white-space: nowrap; }
@media (max-width: 520px) { .allquests { flex-wrap: wrap; } .allquests .aq-go { width: 100%; text-align: right; } }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; color: var(--ink); min-width: 0; }
.brand .mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.brand b, .brand h1 { display: block; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: .01em; }
.brand small { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.views { display: flex; gap: 4px; background: var(--bg); padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.views a { text-decoration: none; color: var(--ink); padding: 5px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.views a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.progress { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.progress b { color: var(--ink); font-weight: 500; }

/* Map view */
.mapview { flex: 1; display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 0; }
.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.filters { padding: 12px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip .n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: .75; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type="search"], .row select { flex: 1; min-width: 0; font: 14px var(--font-body); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; }
.confirm { font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.confirm button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 10px; cursor: pointer; }
.confirm button.no { background: none; color: var(--ink); border-color: var(--line); }
.count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.list { overflow-y: auto; flex: 1; margin: 0; padding: 0; list-style: none; }
.group { position: sticky; top: 0; background: var(--panel); padding: 8px 14px 4px; font-family: var(--font-display); font-weight: 700; font-size: 18px; border-bottom: 1px solid var(--line); z-index: 1; display: flex; align-items: center; gap: 8px; }
.group .sw { width: 10px; height: 10px; border-radius: 50%; }
.spot { display: grid; grid-template-columns: 22px 2.6em minmax(0, 1fr); gap: 0 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.spot:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.spot.on { background: var(--accent-soft); }
.spot.found .where { color: var(--found); text-decoration: line-through; }
.spot input { margin: 4px 0 0; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.spot .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.spot .where { font-weight: 500; font-size: 14px; }
.spot .meta { grid-column: 3; display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.xy { font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.pop .xy { margin-top: 4px; }
.downloads { font-size: 12px; color: var(--muted); }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.tag.special { border-color: var(--accent); color: var(--accent); }
.empty { padding: 20px 14px; color: var(--muted); }

.mapwrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--water); }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 600; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; max-width: calc(100% - 24px); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.legend i.shop { border-radius: 2px; transform: rotate(45deg); background: var(--accent); }
.legend i.found { background: var(--found); }

/* Scorned Wilderness: its own map over the world map */
.mapwrap .inset { position: absolute; inset: 0; z-index: 1100; background: var(--water); display: block; padding: 0; }
/* Sea in the world map's grey-teal, so the zone reads like the rest of the map. */
#smap { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, #62777a 0%, #4b5d61 75%); }
.landmark-label { color: #f6eedd; font: 600 12px var(--font-body); white-space: nowrap; text-shadow: 0 1px 2px #000, 0 0 2px #000; pointer-events: none; transform: translate(10px, -50%); }
.zone-title { color: #f1e6cf; font: 800 26px var(--font-display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 2px 4px rgba(0,0,0,.6); pointer-events: none; transform: translate(-50%, -50%); }
.zone-note { position: absolute; top: 12px; left: 60px; right: 12px; z-index: 1000; margin: 0; max-width: 62ch; font-size: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--muted); }
.zone-note b { color: var(--ink); }
.zone-badge { font: 700 15px var(--font-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: #fff; background: var(--r-scorned); border: 2px solid #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.zone-badge:hover { filter: brightness(1.1); }

/* Leaflet bits */
.leaflet-container { font-family: var(--font-body); background: var(--water); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; line-height: 1.45; }
.pop h3 { margin: 0 0 2px; font-family: var(--font-display); font-size: 20px; }
.pop .sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.pop .acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.pop button { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.pop button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.place-label { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 1px #000; pointer-events: none; transform: translate(-50%, -50%); }
.shop-icon { width: 22px; height: 22px; background: var(--accent); border: 3px solid #fff; transform: rotate(45deg); box-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* Guide view */
.guide { flex: 1; overflow-y: auto; }
.guide .inner { max-width: 820px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); display: grid; gap: 28px; }
.guide h2 { font-family: var(--font-display); font-size: 40px; line-height: 1; margin: 0 0 6px; text-wrap: balance; }
.guide h3 { font-family: var(--font-display); font-size: 26px; margin: 0 0 8px; }
.guide p { margin: 0 0 10px; max-width: 68ch; }
.guide .lede { color: var(--muted); font-size: 16px; }
.guide ol, .guide ul { margin: 0 0 10px; padding-left: 22px; max-width: 68ch; }
.guide li { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fact b { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1.1; }
.fact span { font-size: 13px; color: var(--muted); }
.dialogue { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; font-size: 14px; }
.dialogue .who { font-weight: 600; }
.dialogue .you { color: var(--muted); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.n { font-family: var(--font-mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 14px; text-decoration: none; font-weight: 500; cursor: pointer; }
.note { font-size: 13px; color: var(--muted); }

/* Footer */
footer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); font-size: 12px; color: var(--muted); display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; }
/* Ko-fi: its own colour, on every view. */
.coffee { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 14px; font-weight: 700; text-decoration: none; background: #ff5e5b; color: #fff; border-radius: 999px; padding: 7px 16px; box-shadow: 0 2px 0 #d9403d, 0 3px 10px rgba(255, 94, 91, .3); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.coffee:hover { transform: translateY(-1px); box-shadow: 0 3px 0 #d9403d, 0 6px 16px rgba(255, 94, 91, .45); }
.coffee:active { transform: translateY(1px); box-shadow: 0 1px 0 #d9403d; }
.coffee-top { font-size: 14px; }
.coffee-foot { margin-left: auto; font-size: 14px; }
.coffee-big { font-size: 17px; padding: 10px 22px; }
.toplink { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.toplink:hover { background: var(--accent); color: #fff; }
.toplink .short { display: none; }
/* The mod, in the map view: a strip above the list, closed for good with x. */
.promo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.promo-icon { font-size: 24px; line-height: 1; }
.promo p { margin: 0; font-size: 13px; line-height: 1.35; }
.promo .btn { padding: 4px 12px; font-size: 13px; white-space: nowrap; }
.promo-x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.promo-x:hover { color: var(--ink); }
/* The mod, in the guide: text beside the leaderboard screenshot. */
.feature { background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; padding: 18px; display: grid; gap: 16px; }
.feature h3 { margin-top: 0; }
.feature img { width: 100%; height: auto; border-radius: 8px; display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 8px; align-content: start; justify-items: start; }
.card h3 { margin: 0; }
.card p { margin: 0; font-size: 14px; }
.coffee-card { border: 2px solid #ff5e5b; background: color-mix(in srgb, #ff5e5b 8%, var(--panel)); }
@media (prefers-reduced-motion: reduce) { .coffee, .coffee:hover, .coffee:active { transition: none; transform: none; } }

[hidden] { display: none !important; }

@media (max-width: 820px) {
  body { height: auto; min-height: 100%; }
  .mapview { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58vh auto; }
  .mapwrap { order: -1; min-height: 58vh; }
  .sidebar { border-right: 0; border-top: 1px solid var(--line); }
  .list { overflow: visible; }
  .group { top: 0; }
  .coffee-foot { margin-left: 0; }
  .toplink .long { display: none; }
  .toplink .short { display: inline; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* the shared bar keeps its height in this full-height layout */
.suite { flex: none; }

/* game icons */
.toplink .ico { width: 20px; height: 20px; flex: none; }
img.promo-icon { width: 30px; height: 30px; flex: none; }
