/* Country War — war-room map table: slate ocean, muted nations, the player's empire in brass */
:root {
  color-scheme: dark;
  --sea-0: #0A1B24;
  --panel: rgba(8, 19, 25, 0.9);
  --panel-solid: #09161D;
  --line: #1F3A46;
  --line-soft: rgba(143, 184, 196, 0.12);
  --ink: #E6EEEC;
  --ink-2: #9DB3B8;
  --ink-3: #6A8389;
  --brass: #D6A446;
  --brass-hi: #FFDE8C;
  --brass-ink: #1B1405;
  --hostile: #E2573F;
  --hostile-hi: #FF9C87;
  --peace: #62B98F;
  --display: "Saira Stencil One", Impact, "Arial Narrow", sans-serif;
  --ui: "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--sea-0);
  color: var(--ink);
  font: 500 18px/1.4 var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
kbd { font: 500 13px var(--mono); border: 1px solid var(--line); padding: 0 4px; color: var(--ink-2); border-radius: 2px; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
#game.dragging { cursor: grabbing; }
#game.placing { cursor: cell; }

.panel { background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.eyebrow { font: 500 13px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 4px; }
.fi { width: 18px; height: 12px; object-fit: cover; vertical-align: -1px; margin-right: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }

/* ---------- phase visibility ---------- */
body[data-phase="pick"] .bar,
body[data-phase="pick"] .side,
body[data-phase="pick"] .dock,
body[data-phase="pick"] .coords,
body[data-phase="watch"] .dock { display: none; }

/* ---------- command bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 22px;
  padding: 8px 16px;
  background: linear-gradient(var(--panel-solid), rgba(9, 22, 29, .85));
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-size: 28px; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.brand span { color: var(--brass); margin-left: .2em; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 20px; border-left: 1px solid var(--line); min-width: 0; }
.me img { width: 42px; height: 28px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.5); flex: none; }
.me-text { min-width: 0; }
.me-name { font-weight: 700; font-size: 21px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; color: var(--brass-hi); }
.me-sub { font: 500 13px/1.3 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.stats { display: flex; gap: 24px; margin: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font: 500 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.stats dd { margin: 0; font-weight: 700; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; }
.stats dd small { font-size: 16px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stats .gold span { color: var(--brass-hi); }
.stats .gold small { color: #B89A5C; }
.meter { position: relative; display: inline-block; width: 72px; height: 5px; background: var(--line); margin-left: 9px; }
.meter b { position: absolute; inset: 0 auto 0 0; background: var(--brass); }
.meter i { position: absolute; left: 80%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.clock { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.date { font: 500 16px var(--mono); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.seg { display: flex; border: 1px solid var(--line); }
.seg button { background: transparent; border: 0; padding: 5px 9px; font-weight: 700; font-size: 16px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--brass); color: var(--brass-ink); }
.seg button:hover:not([aria-pressed="true"]) { background: rgba(255,255,255,.06); color: var(--ink); }
.tool { background: transparent; border: 1px solid var(--line); padding: 5px 10px; font-weight: 700; font-size: 16px; color: var(--ink-2); cursor: pointer; }
.tool[aria-pressed="true"] { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); }
.narrow-only { display: none; }

/* ---------- left column ---------- */
.side {
  position: fixed; top: 64px; left: 16px; z-index: 4; width: 268px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100% - 200px); overflow: hidden; pointer-events: none;
}
.side > * { pointer-events: auto; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 12px 5px; }
.panel-h h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.panel-h span { font: 14px var(--mono); color: var(--ink-3); }
.ranks { list-style: none; margin: 0; padding: 0 4px 6px; }
.ranks li { display: grid; grid-template-columns: 18px 22px 1fr auto 44px; align-items: center; gap: 7px; padding: 3px 8px; cursor: pointer; font-size: 16px; }
.ranks li:hover { background: rgba(255,255,255,.05); }
.ranks li.mine { background: rgba(214,164,70,.13); }
.ranks li.mine .nm { color: var(--brass-hi); }
.ranks li.gap { display: block; text-align: center; color: var(--ink-3); cursor: default; padding: 0; line-height: 1; }
.ranks .rk { font: 14px var(--mono); color: var(--ink-3); }
.ranks img { width: 22px; height: 15px; object-fit: cover; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.ranks .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ranks .pct, .ranks .tr { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 16px; text-align: right; }
.ranks .tr { color: var(--ink-3); }
.fronts { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 5px; }
.fronts li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; font-size: 16px; }
.fronts li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fronts li b { font-variant-numeric: tabular-nums; }
.fronts li.out b { color: var(--brass-hi); }
.fronts li.in span, .fronts li.in b { color: var(--hostile-hi); }
.fronts button { background: none; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 700; padding: 1px 6px; cursor: pointer; }
.fronts button:hover { color: var(--ink); border-color: var(--ink-3); }
.log { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 7px; overflow: hidden; }
.log li { font-size: 16px; line-height: 1.35; color: var(--ink-2); animation: slide-in .35s ease-out; }
.log time { display: block; font: 13px var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.log li.mine b { color: var(--brass-hi); }
.log li.hostile b { color: var(--hostile-hi); }
.log li.peace b { color: var(--peace); }
.log .emo { font-size: 20px; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- dossier ---------- */
.dossier { position: fixed; top: 64px; right: 16px; z-index: 4; width: 312px; max-height: calc(100% - 260px); overflow: auto; padding: 16px; }
.close { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; background: none; border: 0; color: var(--ink-3); font-size: 28px; line-height: 1; cursor: pointer; }
.close:hover { color: var(--ink); }
.d-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 20px; }
.d-flag { width: 84px; height: 56px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.35); }
.dossier h2 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; margin: 0 0 7px; text-wrap: balance; letter-spacing: .01em; }
.chip { display: inline-block; font: 600 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border: 1px solid currentColor; }
.chip-self { color: var(--brass-hi); }
.chip-ally { color: var(--peace); }
.chip-war { color: var(--hostile-hi); }
.chip-neutral, .chip-fallen { color: var(--ink-3); }
.d-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.d-stats .span { grid-column: 1 / -1; }
.d-stats dt { font: 500 13px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.d-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.d-stats .span dd { font-weight: 600; font-size: 16px; color: var(--ink-2); }
.d-actions { display: flex; flex-direction: column; gap: 7px; }
.note { color: var(--ink-2); font-size: 16px; margin: 0; }
.btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--ink); font-weight: 700; font-size: 18px; cursor: pointer; }
.btn:hover { background: rgba(255,255,255,.07); }
.btn-attack { background: var(--hostile); border-color: var(--hostile); color: #fff; text-transform: uppercase; letter-spacing: .06em; font-size: 16px; }
.btn-attack:hover { background: #F06A51; }
.btn-nuke { border-color: rgba(226,87,63,.6); color: var(--hostile-hi); }
.btn-brass { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn-brass:hover { background: #E7B75A; }
.btn-quiet { border-color: transparent; color: var(--ink-3); font-weight: 600; }
.btn-quiet:hover { color: var(--ink); }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; border: 1px solid var(--line); padding: 4px; max-height: 220px; overflow-y: auto; }
.emoji-grid h4 { grid-column: 1 / -1; margin: 4px 0 1px; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); position: sticky; top: -4px; background: var(--panel-solid); padding: 3px 2px; }
.emoji-grid button { background: none; border: 0; font-size: 23px; line-height: 1; padding: 4px 0; cursor: pointer; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.emoji-grid button:hover { background: rgba(255,255,255,.1); transform: scale(1.15); }

.chat { border: 1px solid var(--line); }
.chat-log { max-height: 132px; overflow-y: auto; padding: 7px 9px; display: flex; flex-direction: column; gap: 6px; }
.chat-log p { margin: 0; font-size: 16px; line-height: 1.35; color: var(--ink-2); }
.chat-log p b { display: block; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.chat-log p.me b { color: var(--brass-hi); }
.chat-log p.muted { color: var(--ink-3); font-style: italic; }
.chat-row { display: flex; border-top: 1px solid var(--line); }
.chat-input { flex: 1; min-width: 0; background: rgba(255,255,255,.03); border: 0; color: var(--ink); padding: 8px 10px; font: 500 16px var(--ui); }
.chat-input:focus { outline: none; background: rgba(255,255,255,.07); }
.chat-row .btn { width: auto; border: 0; border-left: 1px solid var(--line); padding: 8px 12px; font-size: 16px; }
.log .say { color: var(--ink); }

/* ---------- requests & mode banner ---------- */
.requests { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 32px)); }
.req { position: relative; display: grid; grid-template-columns: 42px 1fr; gap: 6px 12px; align-items: center; padding: 12px 14px 14px; animation: slide-in .3s ease-out; }
.req img { width: 42px; height: 28px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.req p { margin: 0; font-size: 18px; }
.req-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-actions .btn { padding: 6px 10px; }
.req-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.req-timer b { display: block; height: 100%; background: var(--peace); transition: width .25s linear; }
.req-land .req-timer b { background: var(--brass); }
.req-help .req-timer b { background: var(--hostile); }
.btn-claim { border-color: rgba(214,164,70,.55); color: var(--brass-hi); }
.btn-call { border-color: rgba(226,87,63,.45); }
.tip .claim { color: var(--brass-hi); }
.mode {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; width: max-content; max-width: calc(100% - 32px);
  background: var(--panel-solid); border: 1px solid var(--brass); font-weight: 600;
}
.mode .btn { width: auto; padding: 5px 10px; white-space: nowrap; }

/* ---------- bottom dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: stretch; gap: 16px; padding: 8px 10px 8px 14px; max-width: calc(100% - 32px);
}
.ratio { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto auto; column-gap: 8px; align-content: center; min-width: 150px; }
.ratio label { grid-column: 1 / -1; font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ratio input { width: 110px; accent-color: var(--brass); margin: 4px 0; }
.ratio output { font-weight: 700; font-size: 23px; color: var(--brass-hi); font-variant-numeric: tabular-nums; align-self: center; }
.ratio .sub { grid-column: 1 / -1; font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.builds { display: grid; grid-template-columns: repeat(12, 66px); gap: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.builds button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 4px 6px; background: rgba(255,255,255,.02); border: 1px solid var(--line); cursor: pointer; color: var(--ink);
}
.builds button:hover { background: rgba(255,255,255,.07); border-color: var(--ink-3); }
.builds svg { width: 20px; height: 20px; fill: var(--ink); }
.builds svg.line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.builds b { font-size: 16px; line-height: 1.1; }
.builds em { font: normal 500 14px var(--mono); color: var(--brass-hi); font-variant-numeric: tabular-nums; }
.builds kbd { position: absolute; top: 3px; right: 3px; font-size: 11px; padding: 0 3px; border: 0; color: var(--ink-3); }
.builds .danger svg { fill: var(--hostile-hi); }
.builds button.poor em { color: var(--hostile-hi); }
.builds button.poor svg, .builds button.locked svg { opacity: .45; }
.builds button.locked b { color: var(--ink-3); }
.builds button[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.builds button[aria-pressed="true"] svg { fill: var(--brass-ink); opacity: 1; }
.builds button[aria-pressed="true"] svg.line { fill: none; stroke: var(--brass-ink); }
.builds button[aria-pressed="true"] em, .builds button[aria-pressed="true"] kbd { color: var(--brass-ink); }

/* ---------- map furniture ---------- */
.zoom { position: fixed; right: 16px; bottom: 16px; z-index: 4; display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); }
.zoom button { background: none; border: 0; color: var(--ink-2); font-weight: 700; font-size: 15px; padding: 6px 10px; cursor: pointer; min-width: 58px; }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
#zoom-in, #zoom-out { font-size: 23px; line-height: 1; }
/* build stamp: tucked into the 16px strip under the zoom column (and under the dock on
   narrow screens), above every overlay, and never in the way of a click */
.ver { position: fixed; right: 6px; bottom: 2px; z-index: 40; pointer-events: none; font: 13px/1 var(--mono); color: var(--ink-3); letter-spacing: .04em; opacity: .75; }
.coords { position: fixed; left: 16px; bottom: 16px; z-index: 3; font: 14px var(--mono); color: var(--ink-3); letter-spacing: .04em; pointer-events: none; font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 20; pointer-events: none; padding: 7px 10px; background: rgba(6, 15, 20, .94); border: 1px solid var(--line); font-size: 16px; color: var(--ink-2); white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.tip-h { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.tip-h img { width: 24px; height: 16px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.tip-h em { font: normal 600 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.tip-h .rel-your { color: var(--brass-hi); }
.tip-h .rel-ally { color: var(--peace); }
.tip-h .rel-at { color: var(--hostile-hi); }
.toast {
  position: fixed; left: 50%; bottom: 150px; z-index: 30; transform: translate(-50%, 8px);
  max-width: calc(100% - 32px); padding: 8px 14px; background: var(--panel-solid); border: 1px solid var(--line);
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mode:not([hidden]) ~ .toast, body:has(.mode:not([hidden])) .toast { bottom: 200px; }

/* ---------- overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: stretch; pointer-events: none;
  padding-inline: 16px;
  background: linear-gradient(90deg, rgba(6,15,20,.95) 0, rgba(6,15,20,.86) 500px, rgba(6,15,20,.1) 72%, rgba(6,15,20,0));
}
.overlay > * { pointer-events: auto; }
.overlay-center { justify-content: center; align-items: center; background: rgba(6,15,20,.8); pointer-events: auto; }
.brief { width: min(480px, 100%); padding-block: 32px 24px; display: flex; flex-direction: column; gap: 16px; overflow: auto; margin-left: clamp(0px, 3vw, 40px); }
.brief h1 { font-family: var(--display); font-weight: 400; font-size: clamp(46px, 7vw, 74px); line-height: .88; margin: 0; letter-spacing: .01em; text-wrap: balance; }
.brief h1 span { display: block; color: var(--brass); }
.lede { font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 44ch; margin: 0; }
.diff { border: 0; padding: 0; margin: 0; }
.diff legend, .field-h { font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; padding: 0; display: block; }
.field-h span { text-transform: none; letter-spacing: 0; font-family: var(--ui); font-size: 16px; margin-left: 6px; }
.diff-opts { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.diff-opts label { position: relative; display: flex; flex-direction: column; padding: 8px 10px; cursor: pointer; }
.diff-opts label + label { border-left: 1px solid var(--line); }
.diff-opts input { position: absolute; opacity: 0; pointer-events: none; }
.diff-opts b { font-size: 19px; }
.diff-opts small { font-size: 15px; color: var(--ink-3); line-height: 1.25; }
.diff-opts label:has(input:checked) { background: var(--brass); color: var(--brass-ink); }
.diff-opts label:has(input:checked) small { color: rgba(27,20,5,.75); }
.diff-opts label:has(input:focus-visible) { outline: 2px solid var(--brass-hi); outline-offset: -2px; }
.choose input[type="search"] { width: 100%; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--ink); padding: 9px 12px; font: 500 19px var(--ui); }
.choose input[type="search"]:focus { border-color: var(--brass); outline: none; }
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 210px; overflow: auto; border: 1px solid var(--line); border-top: 0; padding: 4px; align-content: start; }
.pick { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 5px 8px; text-align: left; cursor: pointer; color: var(--ink-2); min-width: 0; }
.pick:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.pick img { width: 24px; height: 16px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pick[aria-pressed="true"] { background: rgba(214,164,70,.16); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brass); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tier-easy { background: var(--peace); }
.tier-mid { background: var(--brass); }
.tier-hard { background: var(--hostile); }
.tier-easy-text { color: var(--peace); }
.tier-mid-text { color: var(--brass-hi); }
.tier-hard-text { color: var(--hostile-hi); }
.pick-card { display: flex; gap: 14px; align-items: center; min-height: 64px; }
.pick-card img { width: 96px; height: 64px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 8px 20px rgba(0,0,0,.35); }
.pick-card h2 { font-family: var(--display); font-weight: 400; font-size: 33px; line-height: 1; margin: 0 0 4px; }
.pick-stats { margin: 0; font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pick-kit { margin: 4px 0 0; font-size: 16px; color: var(--brass-hi); line-height: 1.3; }
.pick-kit b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.start-row { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.btn-big { padding: 13px 16px; font-size: 20px; text-transform: uppercase; letter-spacing: .08em; }
.how { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; font-size: 16px; color: var(--ink-3); }
.how b { color: var(--ink-2); font-weight: 600; }
.brief-end { margin: 0; align-items: center; text-align: center; background: var(--panel-solid); border: 1px solid var(--line); padding: 32px 28px; width: min(520px, 100%); max-height: calc(100% - 32px); }
.brief-end .lede { margin-inline: auto; }
.end-flag { width: 120px; height: 80px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.45); }
.end-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; width: 100%; margin: 0; padding: 14px 0; border-block: 1px solid var(--line); }
.end-stats dt { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.end-stats dd { margin: 2px 0 0; font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums; }
.brief-end .start-row { width: 100%; }

/* ---------- narrow screens ---------- */
@media (max-width: 1180px) {
  .stats .wide, .date { display: none; }
  .builds { grid-template-columns: repeat(12, 56px); }
  .builds kbd { display: none; }
}
@media (max-width: 860px) {
  .brand { display: none; }
  .me { padding-left: 0; border-left: 0; }
  .me-name { max-width: 120px; }
  .stats { gap: 14px; }
  .stats dd { font-size: 20px; }
  .stats dd small { display: none; }
  .narrow-only { display: inline-block; }
  .side { display: none; }
  body.side-open .side { display: flex; max-height: calc(100% - 260px); }
  .dock { flex-direction: column; gap: 8px; padding: 8px; bottom: 12px; }
  .ratio { grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; }
  .ratio label { grid-column: auto; }
  .ratio input { width: 100%; }
  .ratio .sub { display: none; }
  .builds { grid-template-columns: repeat(12, minmax(0, 1fr)); padding-left: 0; border-left: 0; }
  .requests { top: 190px; }   /* the zoom column moves to the top-right at this width */
  .builds b { font-size: 14px; }
  .dossier { top: auto; bottom: 170px; left: 16px; right: 16px; width: auto; max-height: 45%; }
  .zoom { bottom: auto; top: 64px; }
  .coords { display: none; }
  .mode, .toast { bottom: 180px; }
  .overlay { background: rgba(6,15,20,.93); }
  .brief { margin-left: 0; margin-inline: auto; }
  .picker { grid-template-columns: 1fr; height: 180px; }
}
/* eleven build buttons stop fitting on one row here, so the dock becomes two rows tall
   and everything pinned above it has to move up out of the way */
@media (max-width: 620px) {
  .builds { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mode, .toast { bottom: 250px; }
  .dossier { bottom: 240px; }
}
@media (max-width: 520px) {
  .clock .seg button { padding: 5px 6px; }
  .me img { display: none; }
  .diff-opts small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- unions ---------- */
.union-list { list-style: none; margin: 0; padding: 0 4px 4px; }
.union-list li { display: grid; grid-template-columns: 22px 1fr 44px; align-items: center; gap: 7px; padding: 3px 8px; cursor: pointer; font-size: 16px; }
.union-list li:hover { background: rgba(255,255,255,.05); }
.union-list li.mine { background: rgba(214,164,70,.13); }
.union-list li.mine .nm { color: var(--brass-hi); }
.union-list img { width: 22px; height: 15px; object-fit: cover; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.union-list .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.union-list .tr { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 16px; text-align: right; }
.union-list .chair { color: var(--brass-hi); font-style: normal; }
.union-note { margin: 0; padding: 0 12px 10px; font-size: 14px; line-height: 1.35; color: var(--ink-3); }
#union-panel .panel-h h3 { color: var(--brass-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.union-found { border: 1px solid var(--line); padding: 10px 10px 0; }
.union-found h4 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-hi); }
.union-found .note { font-size: 15px; line-height: 1.4; margin-bottom: 9px; }
.union-found .chat-row { margin: 0 -10px; }
.union-found > .btn { display: block; width: calc(100% + 20px); margin: 0 -10px 10px; }
.req-article5 { border-color: rgba(214,164,70,.5); }

/* ---------------- online play (js/net.js) ---------------- */
.online { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.online-row { display: flex; gap: 8px; flex-wrap: wrap; }
.online-row input { flex: 1 1 120px; min-width: 0; text-transform: uppercase; letter-spacing: .06em; font: inherit;
  padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.3); color: inherit; }
.lobby { margin-top: 16px; padding: 14px; border: 1px solid rgba(214,164,70,.5); border-radius: 8px; background: rgba(214,164,70,.07); }
.lobby-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 10px; }
.lobby-code b { font-size: 35px; letter-spacing: .08em; color: rgb(214,164,70); user-select: all; }
.lobby-seats { list-style: none; margin: 0 0 8px; padding: 0; }
.lobby-seats li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.lobby-seats img, .lobby-seats .noflag { width: 30px; height: 20px; object-fit: cover; border-radius: 2px; background: rgba(255,255,255,.1); }
.lobby-seats small { margin-left: auto; opacity: .6; }
.lobby-note { margin: 4px 0 10px; opacity: .8; }
body.in-lobby #start-btn, body.in-lobby .online { display: none; }
body.online-guest .diff { opacity: .6; }
body.online-guest #speed { opacity: .55; }
