/* Signal Age · game screen. One layout for every era; the accent shifts (brass, copper, signal blue).
   Hosted edition: Automate Your Network improved selected-tool contrast and narrow clock wrapping, 2026-11-20. */

:root {
  --bg: #11161b;
  --hud: #1d262e;
  --hud-2: #26323c;
  --hud-ink: #efe8d6;
  --accent: #d1a64b;
  --accent-ink: #1b1405;
  --paper: #f6eedb;
  --paper-2: #efe3c6;
  --paper-line: #d8c69f;
  --ink: #2a241b;
  --muted: #6b6151;
  --ok: #2c8a45;
  --ok-bg: #e7f4e5;
  --bad: #b23a2b;
  --bad-bg: #fbe8e4;
  --focus: #2b7fff;
  --radius: 12px;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
}
body[data-era='2'] { --accent: #d3874a; }
body[data-era='3'] { --accent: #5ec8f0; --accent-ink: #062030; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 50% -10%, #23303a 0%, var(--bg) 60%) fixed, var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 0.45rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; margin-top: 0.6rem; }
p { margin: 0 0 0.6rem; }
a { color: #8a5a12; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px rgb(255 255 255 / 0.65); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: 0.5rem; top: -3rem; background: var(--paper); color: var(--ink); padding: 0.5rem 0.75rem; border-radius: 8px; z-index: 50; }
.skip-link:focus { top: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

button {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 0.45rem 0.95rem; min-height: 2.5rem; border-radius: 9px;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
button.secondary { background: transparent; color: inherit; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.small-button { min-height: 2.1rem; padding: 0.2rem 0.7rem; font-size: 0.86rem; }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem;
  padding: 0.5rem 1rem 0.4rem; color: var(--hud-ink);
  background: linear-gradient(180deg, var(--hud-2), var(--hud));
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 18px rgb(0 0 0 / 0.45);
}
.hud p { margin: 0; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.hud-era { font-family: var(--serif); font-size: 1.02rem; }
.hud-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.hud-clock .date { font-variant-numeric: tabular-nums; margin-right: 0.35rem; min-width: 15ch; }
.clock-btn { background: #33424e; color: var(--hud-ink); border: 1px solid #4b5d6b; min-height: 2.15rem; padding: 0.15rem 0.6rem; }
.clock-btn[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.clock-btn.skip { font-weight: 600; }
.hud-money .coin { color: var(--accent); }
.hud-money .muted, .hud-progress { color: #c9c1ad; }
.hud-progress strong { color: var(--hud-ink); }
.hud-actions { display: flex; gap: 0.4rem; margin-left: auto; }
.hud-actions button { color: var(--hud-ink); min-height: 2.15rem; padding: 0.15rem 0.75rem; }
.timeline { flex: 1 1 100%; display: flex; gap: 4px; list-style: none; margin: 0.15rem 0 0; padding: 0; font-size: 0.78rem; }
.timeline li { flex: 1; padding: 1px 8px; border-radius: 999px; background: #2b3843; color: #a9b3ba; text-align: center; }
.timeline li.done { background: #3c4a39; color: #cfe0c2; }
.timeline li.current { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ---------- layout ---------- */
main { display: block; max-width: 2000px; margin: 0 auto; padding: 12px; }
h1[tabindex='-1']:focus, h2[tabindex='-1']:focus, h3[tabindex='-1']:focus, p[tabindex='-1']:focus { outline: none; box-shadow: none; }
main:focus { outline: none; }
.loading { color: var(--hud-ink); }
:root { --hud-h: 88px; --fit-h: calc(100vh - var(--hud-h) - 26px); }
.game { display: grid; grid-template-columns: 214px minmax(0, 1fr) 372px; grid-template-areas: 'tools stage side'; gap: 12px; align-items: start; }
.stage-col { grid-area: stage; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #0e1a24; width: 100%;
  max-width: calc(var(--fit-h) * 10 / 7); margin: 0 auto;
  border: 2px solid var(--accent); box-shadow: 0 12px 34px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.side { grid-area: side; display: flex; flex-direction: column; gap: 10px; position: sticky; top: calc(var(--hud-h) + 12px); max-height: var(--fit-h); overflow: auto; padding-right: 2px; }

/* ---------- the map ---------- */
.map-wrap { position: relative; width: 100%; aspect-ratio: 10 / 7; overflow: hidden; user-select: none; container-type: inline-size; }
.map-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-img.fade-out { animation: fade-out 1.8s ease-in forwards; z-index: 1; }
.map-img.fade-in { animation: zoom-in 2.2s ease-out; }
.stage.dim .map-img { filter: brightness(0.94); }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.overlay-top { z-index: 4; }
.sprites { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.settlement { position: absolute; margin: 0; transform: translate(-50%, calc(-1 * var(--sprite-origin))); }
.settlement img { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.35)); }
.settlement figcaption {
  position: absolute; left: 50%; top: 80%; transform: translateX(-50%); white-space: nowrap;
  font: 700 12px/1.3 system-ui, sans-serif; color: #fff; padding: 2px 9px; border-radius: 999px;
  background: rgb(18 22 26 / 0.74); border: 1px solid rgb(255 255 255 / 0.25);
}
.settlement.label-above figcaption { top: auto; bottom: 86%; }
.animate-growth .settlement.grew img { animation: grow 1.7s cubic-bezier(.2,.8,.2,1.2); }
.animate-growth .settlement.new img { animation: appear 1.5s ease-out; }
.offmap {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 700 12px system-ui, sans-serif;
  color: #fff; background: rgb(18 22 26 / 0.8); padding: 3px 10px; border-radius: 999px; border: 1px dashed rgb(255 255 255 / 0.6);
}
.demand-badge {
  position: absolute; z-index: 4; transform: translate(-50%, -205%); white-space: nowrap; pointer-events: none;
  font: 800 12px system-ui, sans-serif; color: var(--accent-ink); background: var(--accent);
  padding: 3px 11px; border-radius: 999px; box-shadow: 0 4px 12px rgb(0 0 0 / 0.4); animation: bob 2.6s ease-in-out infinite;
}
.scale-bar { position: absolute; left: 10px; bottom: 10px; z-index: 5; padding: 4px 8px 2px; border-radius: 8px; background: rgb(18 22 26 / 0.55); }
.scale-bar.br { left: auto; right: 10px; }
.scale-bar.tl { bottom: auto; top: 10px; }
.scale-line { height: 7px; border: 2px solid #fff; border-top: 0; }
.scale-text { font: 700 12px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.north {
  position: absolute; right: 12px; top: 10px; z-index: 4; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 800 13px var(--serif); color: #1b1405; background: rgb(246 238 219 / 0.85); border: 2px solid var(--accent);
}
button.skip-travel { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; background: rgb(18 22 26 / 0.85); color: #fff; border-color: rgb(255 255 255 / 0.7); }

/* demand, builds and messages (SVG units: the map is 100 x 70) */
.demand-route { fill: none; stroke: #ffd77a; stroke-width: 0.42; stroke-dasharray: 1.4 1; stroke-linecap: round; animation: march 1.4s linear infinite; }
.demand.lit .demand-route { stroke: #7dff9a; stroke-dasharray: none; animation: none; }
.demand-area { fill: rgb(255 215 122 / 0.12); stroke: #ffd77a; stroke-width: 0.32; stroke-dasharray: 1.2 0.8; animation: pulse 2.4s ease-in-out infinite; }
.demand.lit .demand-area { stroke: #7dff9a; fill: rgb(125 255 154 / 0.12); }
.build-target { fill: transparent; stroke: transparent; stroke-width: 5; pointer-events: all; cursor: crosshair; }
.build-target:hover { stroke: rgb(255 255 255 / 0.16); }
.build { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.build.voice { stroke: #fff; stroke-width: 0.35; stroke-dasharray: 0.25 0.8; }
.build.drum { stroke: #f2a65a; stroke-width: 0.4; stroke-dasharray: 1 0.6; }
.build.beacon { stroke: #ff7a2f; stroke-width: 0.45; stroke-dasharray: 1.6 0.7; }
.build.courier { stroke: #6e4320; stroke-width: 0.5; stroke-dasharray: 0.12 0.9; }
.build.semaphore { stroke: #5f5a52; stroke-width: 0.35; }
.build.wire { stroke: #9a6131; stroke-width: 0.34; }
.build.copper { stroke: #e08c3e; stroke-width: 0.55; }
.build.copper.glow { stroke: #ffb35c; stroke-width: 1.2; opacity: 0.35; filter: url(#map-glow); }
.build.fiber { stroke: #b4f6ff; stroke-width: 0.36; }
.build.fiber.glow { stroke: #2fd0ff; stroke-width: 1.5; opacity: 0.55; filter: url(#map-glow); }
.build.fiber.thin { stroke-width: 0.2; }
.build.construction { stroke: #f4ecd9 !important; stroke-dasharray: 0.7 0.7 !important; opacity: 0.9; animation: march 1s linear infinite; }
.build.glow.construction { display: none; }
.build.legacy, .pole.legacy, .tower-glyph.legacy { opacity: 0.85; }
.build.wire.legacy, .build.courier.legacy { stroke-width: 0.45; }
.pole { stroke: #5b3a1d; stroke-width: 0.22; }
.site-dot { fill: #f6eedb; stroke: #2a241b; stroke-width: 0.2; }
.site-label { font: 700 1.7px system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: rgb(0 0 0 / 0.7); stroke-width: 0.4; }
.tower-glyph { fill: none; stroke: #3d3a35; stroke-width: 0.26; stroke-linecap: round; }
.tower-glyph.wireless { stroke: #3b2a8c; stroke-width: 0.26; }
.tower-tip { fill: #ff4d6d; stroke: #fff; stroke-width: 0.1; }
.tower-waves { fill: none; stroke: #e9e3ff; stroke-width: 0.18; stroke-linecap: round; }
.signal-ring { fill: none; stroke: rgb(170 140 255 / 0.6); stroke-width: 0.14; animation: ripple 2.2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.flame { fill: #ff8a2a; stroke: #ffd36b; stroke-width: 0.12; animation: flicker 0.9s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: bottom; }
.drum-glyph { fill: #8a3b2a; stroke: #f2d3a0; stroke-width: 0.15; }
.progress-label { font: 700 2.1px system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: rgb(0 0 0 / 0.65); stroke-width: 0.45; }
.satellite-beam { fill: none; stroke: #ffe08a; stroke-width: 0.3; stroke-dasharray: 1 0.7; animation: march 1.6s linear infinite; }
.sat-panel { stroke: #59b8ff; stroke-width: 0.9; }
.sat-body { fill: #f3f3f3; stroke: #2b2b2b; stroke-width: 0.15; }
.sat-footprint { fill: rgb(255 224 138 / 0.13); stroke: rgb(255 224 138 / 0.55); stroke-width: 0.2; }
.message-dot { stroke: #1a1a1a; stroke-width: 0.25; }
.message-dot.on-time { fill: #6dff8e; }
.message-dot.late { fill: #ff5d4d; }
.message-dot.stopped { fill: #c9c9c9; }
.deadline-flag line { stroke: #ff5d4d; stroke-width: 0.25; }
.deadline-flag path { fill: #ff5d4d; }
.arrival-ring { fill: none; stroke-width: 0.6; }
.arrival-ring.on-time { stroke: #6dff8e; }
.arrival-ring.stopped { stroke: #ff5d4d; }
.arrival-ring.animating { animation: ring 1.5s ease-out; transform-box: fill-box; transform-origin: center; }

/* ---------- build menu ---------- */
.toolbar {
  grid-area: tools; position: sticky; top: calc(var(--hud-h) + 12px); max-height: var(--fit-h); overflow: auto;
  background: linear-gradient(180deg, #24303a, #1b242c); border: 1px solid #3a4955; border-radius: 14px; padding: 8px;
  box-shadow: 0 8px 22px rgb(0 0 0 / 0.4);
}
.toolbar::before { content: 'Build menu'; display: block; font: 700 0.95rem var(--serif); color: var(--accent); margin: 2px 4px 8px; }
.toolbar ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.tool {
  width: 100%; height: 100%; display: grid; grid-template-columns: 34px 1fr; grid-template-areas: 'icon name' 'icon line' 'icon cost';
  column-gap: 8px; text-align: left; align-items: center; padding: 6px 8px; min-height: 62px;
  background: #2a3843; color: #f1ead8; border: 1px solid #44566a; border-radius: 11px; font-weight: 600;
}
.tool:hover { background: #324452; }
.tool[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; background: #33485a; }
.tool.built { border-style: dashed; }
.tool .icon { grid-area: icon; color: var(--accent); width: 34px; height: 34px; }
.tool .icon svg, .tool-title .icon svg, .builds-card .icon svg, .unlocks .icon svg { width: 100%; height: 100%; display: block; }
.tool-name { grid-area: name; font-size: 0.9rem; line-height: 1.15; }
.tool-line { grid-area: line; font-size: 0.74rem; font-weight: 500; color: #b9c3ca; line-height: 1.2; }
.tool-cost { grid-area: cost; font-size: 0.76rem; color: var(--hud-ink); font-weight: 800; }

/* ---------- side panel cards ---------- */
.card {
  background: linear-gradient(180deg, var(--paper), var(--paper-2)); color: var(--ink);
  border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.28);
}
.card h2 { font-size: 1.12rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.15rem; }
.story { font-style: italic; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.7rem; margin: 0.3rem 0 0; font-size: 0.9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.countdown { margin: 0.35rem 0 0.4rem; }
.countdown p { margin: 0.3rem 0 0; font-size: 0.9rem; }
.countdown-bar { height: 9px; border-radius: 999px; background: #e2d4b2; overflow: hidden; }
.countdown-bar span { display: block; height: 100%; background: linear-gradient(90deg, #b88a2c, var(--accent)); }
.notice { background: #fff3c4; color: #3a2f12; border-left: 5px solid #c99a1a; border-radius: 10px; padding: 9px 12px; margin: 0; font-weight: 600; }
.tool-title { display: flex; align-items: center; gap: 8px; }
.tool-title .icon { width: 30px; height: 30px; color: #8a5a12; flex: none; }
.tool-card .summary { font-size: 0.9rem; color: var(--muted); }
.scores { display: grid; gap: 4px; margin: 0.5rem 0; }
.score-chip { display: grid; grid-template-columns: 4.8rem 1fr; grid-template-areas: 'label value' 'bar num'; gap: 0 8px; margin: 0; font-size: 0.82rem; align-items: center; }
.score-chip .label { grid-area: label; color: var(--muted); }
.score-chip .value { grid-area: value; font-weight: 700; }
.score-chip .bar { grid-area: bar; height: 6px; border-radius: 999px; background: #e0d3b2; overflow: hidden; }
.score-chip .bar > span { display: block; height: 100%; background: #8a5a12; }
.score-chip .num { grid-area: num; color: var(--muted); }
.build-btn { width: 100%; margin-top: 0.3rem; font-size: 1.02rem; }
.builds-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.88rem; }
.builds-card li { display: flex; gap: 8px; align-items: flex-start; }
.builds-card .icon { width: 22px; height: 22px; color: #8a5a12; flex: none; }
.report.served { background: var(--ok-bg); border-left: 6px solid var(--ok); }
.report.unserved { background: var(--bad-bg); border-left: 6px solid var(--bad); }
.report.overbuilt { background: #fff3d1; border-left: 6px solid #b7791f; }
.report.overbuilt .mark { color: #8a5a12; }
.report .mark { font-weight: 900; }
.report.served .mark { color: var(--ok); }
.report.unserved .mark { color: var(--bad); }
.efficiency { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.card button.secondary, .overlay-card button.secondary { color: #6b4710; border-color: #b8913f; }
.steps { padding-left: 1.2rem; font-size: 0.9rem; }
.map-details summary { cursor: pointer; font-weight: 700; }
.text-equivalent { padding-left: 1.1rem; margin: 0.4rem 0 0; font-size: 0.88rem; }

/* ---------- overlays ---------- */
.game.overlay-screen { grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: 'stage side'; }
.overlay-card-wrap { grid-area: side; position: sticky; top: calc(var(--hud-h) + 12px); }
.overlay-card {
  width: 100%; max-height: var(--fit-h); overflow: auto;
  background: linear-gradient(180deg, var(--paper), var(--paper-2)); color: var(--ink);
  border: 2px solid var(--accent); border-radius: 16px; padding: 20px 24px; box-shadow: 0 20px 50px rgb(0 0 0 / 0.55);
}
.overlay-card h1 { font-size: 1.8rem; }
.example { margin: 0.6rem 0; padding: 0.6rem 0.9rem; border-left: 4px solid var(--accent); background: rgb(255 255 255 / 0.55); border-radius: 8px; }
.example figcaption { font-weight: 700; }
.how { background: rgb(255 255 255 / 0.5); border-radius: 8px; padding: 0.5rem 0.8rem; }
.note { color: var(--muted); font-style: italic; }
.years { font: 700 3.2rem/1 var(--serif); color: #8a5a12; margin: 0.2rem 0 0.6rem; font-variant-numeric: tabular-nums; }

.unlocks { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.unlocks li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.unlocks .icon { width: 24px; height: 24px; color: #8a5a12; flex: none; }
.interim { font-weight: 700; color: var(--bad); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
caption { text-align: left; padding: 0.4rem 0.5rem; color: var(--muted); font-size: 0.84rem; }
th, td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
thead th { background: rgb(255 255 255 / 0.45); white-space: nowrap; }
tbody th { white-space: nowrap; }
.compare th, .compare td { white-space: normal; padding: 0.3rem 0.35rem; font-size: 0.85rem; }

/* ---------- dialogs ---------- */
dialog { border: 2px solid var(--accent); border-radius: 14px; padding: 1rem 1.25rem; max-width: 28rem; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
dialog.ledger { max-width: min(1250px, 96vw); width: 96vw; max-height: 90vh; }
.ledger-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
dialog button.secondary { color: #6b4710; border-color: #b8913f; }
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--paper-line); border-radius: 10px; }
tr.comparison { color: var(--muted); }
.tag { display: inline-block; margin-left: 0.4rem; font-size: 0.72rem; border: 1px solid var(--paper-line); border-radius: 1rem; padding: 0 0.4rem; }
.split { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.provenance { font-size: 0.78rem; color: var(--muted); min-width: 9rem; }
.metric { min-width: 8.5rem; }
.metric .value { display: block; font-weight: 700; }
.metric .score { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; }
.metric .bar { display: inline-block; width: 3rem; height: 0.45rem; background: #e0d3b2; border-radius: 1rem; overflow: hidden; }
.metric .bar > span { display: block; height: 100%; background: #8a5a12; }
.metric .band { color: var(--muted); }
.load-error { max-width: 46rem; margin: 2rem auto; }

/* ---------- animation ---------- */
@keyframes march { to { stroke-dashoffset: -4.8; } }
@keyframes pulse { 50% { fill: rgb(255 215 122 / 0.2); } }
@keyframes bob { 50% { transform: translate(-50%, -225%); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes zoom-in { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes grow { from { transform: scale(0.55); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }
@keyframes appear { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ripple { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes flicker { from { transform: scaleY(0.9); } to { transform: scaleY(1.12); } }
@keyframes ring { from { transform: scale(0.25); } to { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- narrow windows ---------- */
@media (max-width: 1150px) {
  .game, .game.overlay-screen { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'stage' 'tools' 'side'; }
  .overlay-card-wrap { position: static; }
  .toolbar, .side { position: static; max-height: none; overflow: visible; }
  .toolbar ul { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .stage { max-width: none; }
  .hud-actions { margin-left: 0; }
}
@media (max-width: 720px) {
  main { padding: 8px; }
  .hud { gap: 0.3rem 0.7rem; }
  .overlay-card { max-height: none; }
  .settlement figcaption { font-size: 10px; padding: 1px 6px; }
  .demand-badge { font-size: 10px; }
  .toolbar ul { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
