/* A nature documentary's palette: deep greens and charcoal, warm amber for what matters. Always dark,
   so the map's dusk and the glow of luminous Bitzkeys read the same on every screen. */
:root {
  --bg: #0e1311; --panel: #151c19; --panel-2: #1b2420; --text: #e9ede6; --muted: #98a59d; --line: #26312c;
  --accent: #f2c66d; --accent-soft: rgba(242, 198, 109, 0.14); --control: rgba(21, 28, 25, 0.82);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at top, #16201b 0%, var(--bg) 60%) fixed; color: var(--text);
       font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, .brand { font-family: var(--display); font-weight: 650; letter-spacing: 0.01em; }
a { color: var(--accent); }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line);
       background: rgba(14, 19, 17, 0.8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 1.3rem; text-decoration: none; color: var(--text); }
.bar nav a { margin-left: 16px; text-decoration: none; color: var(--muted); }
.bar nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 16px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.map-panel { min-width: 0; }
.map-frame { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
#map { display: block; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45); cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 36px; height: 36px; padding: 0; font-size: 1.25rem; line-height: 1; background: var(--control);
               backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, 0.08); }
.zoom button:disabled { opacity: 0.45; cursor: default; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
button { font: inherit; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer;
         transition: border-color 0.15s, background 0.15s; }
button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.zoom button, .close { border-radius: 10px; }
#replay-status { color: var(--muted); font-size: 0.9rem; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
        border-radius: 14px; padding: 16px 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.card.muted p { color: var(--muted); margin: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.counts { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.counts li { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.counts strong { color: var(--accent); font-weight: 600; }
.note { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.note:empty { display: none; }
.prose { max-width: 680px; margin: 0 auto; padding: 24px 16px; }

/* The details modal */
dialog { width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line);
         border-radius: 16px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text);
         box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
dialog::backdrop { background: rgba(4, 7, 6, 0.6); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 8px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.25rem; }
.dialog-body { padding: 12px 16px 16px; overflow-y: auto; }
.close { width: 36px; height: 36px; padding: 0; font-size: 1.25rem; line-height: 1; }

/* Touch screens: every control at least 44 px, so fingers can hit it */
@media (pointer: coarse) {
  .brand, .bar nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .bar nav a { padding: 0 6px; margin-left: 8px; }
  button { min-height: 44px; }
  .zoom button, .close { width: 44px; height: 44px; }
}
