@font-face { font-family: "Courier Prime"; font-weight: 400; font-display: swap; src: url("/fonts/courier-prime-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Courier Prime"; font-weight: 700; font-display: swap; src: url("/fonts/courier-prime-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-condensed-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700-latin.woff2") format("woff2"); }

:root {
  --desk: #2c2e29;
  --paper: #e8e0c8;
  --sheet: #efe9d8;
  --note: #f6f1e3;
  --sea: #cdd6d2;
  --sea-line: #b3c3c0;
  --contour: #a3ad8c;
  --contour-index: #86936f;
  --grid: #8c8a78;
  --boundary: #857c66;
  --coast: #56626a;
  --ink: #26231f;
  --ink-soft: #5d574b;
  --rule: #c9bfa4;
  --tape: rgba(226, 210, 166, 0.82);
  --danger: #a8281f;
  --typed: "Courier Prime", "Courier New", monospace;
  --print: "Barlow Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--desk); color: var(--ink); font-family: var(--typed); font-size: 17px; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(226, 210, 166, 0.85); color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the sheet */
.map { display: block; width: 100%; height: 100%; background: var(--sea); user-select: none; -webkit-user-select: none; }
.sea { fill: var(--sea); }
.sea-line { stroke: var(--sea-line); stroke-width: 1.2; }
.land { fill: var(--paper); }
.contour { fill: none; stroke: var(--contour); stroke-width: 1.3; }
.contour.index { stroke: var(--contour-index); stroke-width: 2; }
.shade { fill: transparent; }
.edge { fill: none; stroke: transparent; stroke-width: 16; stroke-opacity: 0.5; }
.boundary { fill: none; stroke: var(--boundary); stroke-width: 1.6; stroke-dasharray: 7 5; }
.coast { fill: none; stroke: var(--coast); stroke-width: 2.4; stroke-linejoin: round; }
.gridline { stroke: var(--grid); stroke-width: 1; opacity: 0.35; }
.gridref { font: 700 21px var(--print); fill: var(--ink-soft); text-anchor: middle; dominant-baseline: central; letter-spacing: 0.08em; }
.town { fill: var(--ink); }
.town-ring { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.label { font: 600 23px var(--print); letter-spacing: 0.07em; text-transform: uppercase; text-anchor: middle; fill: var(--ink-soft); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.label.city { font-weight: 700; font-size: 26px; fill: var(--ink); }
.margin { fill: var(--sheet); }
.margin-rule { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.film { fill: rgba(255, 255, 255, 0.05); stroke: rgba(255, 255, 255, 0.6); stroke-width: 2; pointer-events: none; }
.tape { fill: var(--tape); pointer-events: none; }
.unit rect { fill: var(--note); fill-opacity: 0.92; stroke-width: 3.5; }
.unit.neutral rect { stroke: var(--boundary); stroke-dasharray: 5 4; stroke-width: 2.2; }
.unit .count.rough { font-size: 16px; font-style: italic; }
.unit .count { font: 700 19px var(--typed); text-anchor: middle; dominant-baseline: central; }
.unit .num { font: 700 11px var(--print); letter-spacing: 0.06em; text-anchor: middle; }
.mark { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 7; }
.lead { stroke: none; }
.lead.pass { opacity: 0.5; }
.lead.halo { fill: var(--note); opacity: 0.9; }
.reveal { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.mark.battle { stroke-width: 4.5; }
.draw-on { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-on 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes draw-on { to { stroke-dashoffset: 0; } }
.ink { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 6; opacity: 0.9; }
.region { fill: transparent; }

/* typed staff notes */
.note { background: var(--note); color: var(--ink); border-radius: 3px; box-shadow: 0 6px 18px rgba(20, 18, 14, 0.28), 0 1px 2px rgba(20, 18, 14, 0.2); position: relative; }
.note::before { content: ""; position: absolute; top: -9px; left: 50%; width: 84px; height: 20px; margin-left: -42px; background: var(--tape); transform: rotate(-2deg); }
.caps { font: 700 13px var(--print); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.btn { border: 2px solid var(--ink); background: transparent; border-radius: 3px; padding: 9px 14px; font: 700 17px var(--print); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); transition: transform 100ms ease-out, background-color 120ms ease-out; touch-action: manipulation; }
.btn:hover { background: rgba(38, 35, 31, 0.06); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--note); }
.btn.primary:hover { background: #3a3630; }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }
.swatch { display: inline-block; width: 26px; height: 8px; border-radius: 4px; flex: none; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .draw-on { animation: none; stroke-dashoffset: 0; }
}
