@font-face { font-family: 'Barlow'; src: url('assets/fonts/barlow-latin-400-normal.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'Barlow'; src: url('assets/fonts/barlow-latin-500-normal.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Barlow'; src: url('assets/fonts/barlow-latin-600-normal.woff2') format('woff2'); font-weight: 600; }
@font-face { font-family: 'Barlow'; src: url('assets/fonts/barlow-latin-700-normal.woff2') format('woff2'); font-weight: 700; }
@font-face { font-family: 'Barlow Condensed'; src: url('assets/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Barlow Condensed'; src: url('assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; }
@font-face { font-family: 'Barlow Condensed'; src: url('assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; }
@font-face { font-family: 'Saira'; src: url('assets/fonts/saira-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; }

:root {
  /* Panels are near-opaque instead of frosted: a backdrop blur over the live map has to be
     recomputed every frame the map changes, which cost ~2 W of GPU on its own. */
  --panel: rgba(13, 17, 22, 0.92);
  --panel-2: rgba(22, 28, 35, 0.92);
  /* Panels that carry a list or text blocks over the map: the huge country names must not ghost through the rows. */
  --panel-solid: rgba(13, 17, 22, 0.985);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #e6e9ec;
  --muted: #8d98a3;
  --dim: #5f6a75;
  --gold: #d6b25e;
  --green: #6fcf8e;
  --red: #e5534b;
  --blue: #5fa8ff;
  --ally: #5fd37a;
  /* Relation colours of the map (palette.js RELC.hex; colorblind mode overrides them). */
  --rel-player: #4da3ff;
  --rel-ally: #4fd16a;
  --rel-enemy: #ff5a4f;
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, sans-serif;
  --r: 5px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1c2c; color: var(--ink); font-family: var(--body); font-weight: 500; font-size: 13px; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: var(--body); cursor: pointer; color: inherit; }
kbd { font-family: var(--display); }
.ic { flex: none; display: block; }
b { font-weight: 600; }

/* ───── map labels ───── */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity 0.4s; }
/* Behind the title menu the globe stays clean: country names would draw over the buttons. (The nation picker keeps them.) */
#app:has(#title:not(.hidden):not(.picking)) #labels { opacity: 0; }
.lbl-layer { position: absolute; inset: 0; }
.lbl-country, .lbl-cap, .lbl-lm, .lbl-float, .lbl-base, .lbl-zone { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.lbl-country {
  /* Heavy extended caps (Saira Black, stretched wide) in the spirit of Eurostile Extended. */
  font-family: 'Saira', var(--display); font-weight: 900; color: rgba(245, 247, 250, 0.9);
  text-shadow: 0 1px 2px rgba(5, 10, 16, 0.55), 0 0 8px rgba(5, 10, 16, 0.25);
}
.lbl-country.rel-player { color: #ffffff; }
.lbl-base { display: flex; align-items: center; gap: 3px; padding: 1px 5px 1px 4px; border-radius: 3px; background: rgba(12, 20, 30, 0.78); border: 1px solid rgba(143, 208, 255, 0.55); color: #cfe8ff; font: 700 11px/1.2 var(--display); text-shadow: none; }
.lbl-base.war { border-color: rgba(241, 201, 75, 0.7); color: #ffe7a8; }
.lbl-base svg { width: 11px; height: 11px; }
.lbl-country.rel-allied { color: color-mix(in srgb, var(--rel-ally) 45%, #f4fff6); }
.lbl-country.rel-war { color: color-mix(in srgb, var(--rel-enemy) 55%, #fff4f2); }
/* Stencilled relation tag under the name, matching the band round that nation's land. */
.lbl-country .rel-tag {
  position: absolute; left: 50%; top: 100%; margin-top: 1px; transform: translateX(-50%) scaleX(0.78);
  font: 700 clamp(9px, 0.36em, 11px)/1 var(--display); letter-spacing: 0.16em; padding: 2px 3px 1px 5px;
  border: 1px solid; border-radius: 1px; background: rgba(8, 12, 16, 0.78); text-shadow: none;
}
.lbl-country .rel-tag:empty { display: none; }
.lbl-country.rel-war .rel-tag { color: color-mix(in srgb, var(--rel-enemy) 70%, #fff); border-color: var(--rel-enemy); }
.lbl-country.rel-allied .rel-tag { color: color-mix(in srgb, var(--rel-ally) 70%, #fff); border-color: var(--rel-ally); }
.lbl-country.rel-fighting { color: #f2cfa6; }
.lbl-country.rel-defeated { color: #a9adb2; }
.lbl-cap { display: flex; font-size: 11.5px; font-weight: 600; color: #f1f3f5; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.6); display: flex; align-items: center; gap: 4px; }
.lbl-cap i { width: 7px; height: 7px; border: 1.5px solid #fff; background: #2b3036; transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.lbl-cap.rel-player i { background: var(--blue); }
.lbl-cap.rel-allied i { background: var(--ally); }
.lbl-cap.rel-war i { background: var(--red); }
.lbl-cap.occupied { font-style: italic; opacity: 0.85; }
.lbl-cap.destroyed { opacity: 0.5; text-decoration: line-through; }
.lbl-lm { font-size: 10.5px; font-style: italic; font-weight: 500; color: rgba(236, 231, 216, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95); display: flex; align-items: center; gap: 4px; }
.lbl-lm i { width: 5px; height: 5px; border: 1px solid rgba(236, 231, 216, 0.7); transform: rotate(45deg); }
.lbl-lm i.bounty { border-color: var(--gold); background: rgba(214, 178, 94, 0.5); }
.lbl-lm i.own { border-color: var(--blue); background: rgba(95, 168, 255, 0.5); }
.lbl-sat { position: absolute; left: 0; top: 0; white-space: nowrap; display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #cfe6ff; background: rgba(8, 20, 40, 0.8); border: 1px solid rgba(95, 168, 255, 0.7); border-radius: 3px; padding: 1px 6px; }
.lbl-sat i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.lbl-sat.sel { color: #fff; border-color: #fff; }
.lbl-float { font-family: var(--display); font-weight: 700; font-size: 15px; color: #d9f0c0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); letter-spacing: 0.02em; }
.lbl-zone { font: 600 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: #b6ecc7; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 4px rgba(0, 0, 0, 0.7); }
.lbl-float.big { font-size: 18px; color: #e9f6c9; }
.lbl-float.capital { font-size: 22px; color: #f2d98f; }
.lbl-float.kill { color: #f3c38a; font-size: 14px; }

#selbox { position: absolute; display: none; border: 1px solid #8dffa6; background: rgba(141, 255, 166, 0.08); pointer-events: none; z-index: 5; }

/* ───── buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px 11px; font-family: var(--display); font-weight: 600; font-size: 13.5px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); background: rgba(255, 255, 255, 0.05); white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { background: rgba(255, 255, 255, 0.14); }
.btn.big { font-size: 15px; padding: 9px 16px; }
.btn.red { background: rgba(229, 83, 75, 0.2); border-color: rgba(229, 83, 75, 0.6); color: #ffd7d3; }
.btn.red:hover { background: rgba(229, 83, 75, 0.32); }
.btn.green { background: rgba(111, 207, 142, 0.16); border-color: rgba(111, 207, 142, 0.55); color: #d8f6e1; }
.btn.green:hover { background: rgba(111, 207, 142, 0.26); }
.btn.blue { background: rgba(95, 168, 255, 0.16); border-color: rgba(95, 168, 255, 0.55); color: #d9e9ff; }
.btn.dim { color: var(--muted); }
.btn.on { box-shadow: inset 0 0 0 1px currentColor; background: rgba(255, 255, 255, 0.14); }
.btn.cooling { opacity: 0.5; }
.btn small { font-family: var(--body); text-transform: none; letter-spacing: 0; font-size: 11px; opacity: 0.8; }
.icon-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: #cfd6dd; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.icon-btn.off { opacity: 0.4; }
.mini-btn { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); padding: 0; }
.mini-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ───── top bar ───── */
#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: linear-gradient(180deg, rgba(9, 12, 16, 0.96), rgba(12, 16, 21, 0.92)); border-bottom: 1px solid var(--line);
  z-index: 10;
}
.brand { font-family: var(--display); line-height: 0.95; margin-right: 6px; display: flex; flex-direction: column; text-transform: uppercase; }
.brand span { color: var(--muted); font-size: 10px; letter-spacing: 0.42em; font-weight: 600; }
.brand b { font-size: 17px; letter-spacing: 0.14em; font-weight: 700; color: #f2f4f6; }
.chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r); padding: 4px 9px; height: 32px; font-family: var(--display); font-size: 15px; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, 0.025); cursor: default; }
.chip .ico { color: var(--muted); display: flex; }
.chip.nation { gap: 7px; padding-left: 5px; }
.chip.nation img { width: 27px; height: 18px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.chip.money #money { font-size: 18px; color: var(--gold); min-width: 58px; font-variant-numeric: tabular-nums; }
.chip.money .ico { color: var(--gold); }
.chip small { color: #9fc79a; font-size: 12.5px; font-weight: 500; }
.speed { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: var(--r); padding: 2px; }
.spd { display: flex; align-items: center; border: 0; background: transparent; color: var(--muted); padding: 5px 7px; border-radius: 3px; }
.spd .extra { margin-left: -4px; }
.spd:hover { color: #fff; }
.spd.on { background: rgba(95, 168, 255, 0.22); color: #fff; }
.tension-chip .meter { width: 72px; position: relative; }
.tension-chip .meter s { position: absolute; left: 25%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, 0.45); }
.meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); transition: width 0.4s; }
#tension.mid { background: #e6b04a; }
#tension.hi { background: var(--red); }
#tension-val { color: var(--muted); font-size: 13px; min-width: 30px; }
.wars { display: flex; align-items: center; gap: 6px; overflow: hidden; margin-left: 2px; height: 32px; padding: 0 9px; border: 1px solid rgba(229, 83, 75, 0.45); border-radius: var(--r); background: rgba(229, 83, 75, 0.08); color: #ff8f86; cursor: pointer; flex: none; }
.wars:hover { background: rgba(229, 83, 75, 0.16); border-color: rgba(229, 83, 75, 0.8); }
.wars.peace { border-color: var(--line); background: rgba(255, 255, 255, 0.025); color: var(--muted); }
.wars.peace:hover { background: rgba(255, 255, 255, 0.07); }
.wars-label { font-family: var(--display); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.wars-label em { font-style: normal; background: var(--red); color: #fff; border-radius: 7px; padding: 0 5px; margin-left: 2px; letter-spacing: 0; }
.wars-flags { display: flex; gap: 3px; }
.war-flag { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.wars-more { font-family: var(--display); font-size: 13px; font-weight: 600; }
.chip small.neg { color: #ff9d95; }
.chip.money.broke { border-color: rgba(229, 83, 75, 0.7); animation: broke 1.2s ease-in-out infinite; }
@keyframes broke { 50% { background: rgba(229, 83, 75, 0.18); } }
#tb-nation { cursor: pointer; }
.spacer { flex: 1; }

/* ───── hover tooltips ───── */
#hovertip {
  position: absolute; max-width: 280px; background: rgba(10, 13, 17, 0.97); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px;
  z-index: 60; pointer-events: none; opacity: 0; transition: opacity 0.1s; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
#hovertip.on { opacity: 1; }
#hovertip h5 { margin: 0 0 3px; font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
#hovertip p { margin: 0; font-size: 12.5px; line-height: 1.4; color: #b9c3cc; }

/* ───── arsenal ───── */
#arsenal {
  position: absolute; left: 10px; top: 58px; width: 318px; bottom: 214px; display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 6px; z-index: 6; overflow: hidden; transition: width 0.18s;
}
.arsenal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px 12px; }
.arsenal-title { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.3em; color: var(--muted); text-transform: uppercase; }
.tabs { display: grid; grid-template-columns: repeat(6, auto); gap: 3px; padding: 4px 8px; } /* one row: each branch as wide as its name needs */
.tab { border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); padding: 6px 2px 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab:hover { color: #fff; background: rgba(255,255,255,.05); }
.tab em { font-style: normal; font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.tab.on { color: #fff; border-color: rgba(95, 168, 255, 0.6); background: rgba(95, 168, 255, 0.14); }
.hint { font-size: 11.5px; color: var(--muted); padding: 4px 12px 6px; min-height: 22px; line-height: 1.3; }
.cards { flex: 1; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.cards::-webkit-scrollbar, .cp-body::-webkit-scrollbar, #news-list::-webkit-scrollbar, .setup-card::-webkit-scrollbar { width: 5px; }
.cards::-webkit-scrollbar-thumb, .cp-body::-webkit-scrollbar-thumb, #news-list::-webkit-scrollbar-thumb, .setup-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.card { display: flex; gap: 9px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 5px 8px 5px 5px; cursor: pointer; transition: border-color 0.1s, background 0.1s; }
.card:hover { border-color: rgba(95, 168, 255, 0.5); background: rgba(30, 38, 48, 0.95); }
.card.active { border-color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }
.card.poor { opacity: 0.55; }
.card.poor .cost { color: var(--red); }
.card.locked { opacity: 0.45; cursor: not-allowed; }
.card.locked .cost { font-family: var(--body); font-size: 11px; color: var(--muted); }
.thumb { width: 56px; height: 56px; flex: none; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #3a4654, #1b222b); position: relative; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb kbd { position: absolute; left: 3px; top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.thumb .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); color: #cfd6dd; }
.info { flex: 1; min-width: 0; }
.info b { display: block; font-size: 13px; font-weight: 600; line-height: 1.15; }
.cost { font-family: var(--display); color: var(--gold); font-size: 15px; font-weight: 600; line-height: 1.3; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; margin-top: 2px; }
.bar { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 9.5px; color: var(--dim); font-weight: 600; }
.bar span { width: 20px; }
.bar i { display: block; height: 3px; min-width: 2px; background: #6c9cc9; border-radius: 1px; }
.arsenal-foot { font-size: 10.5px; color: var(--dim); text-align: center; padding: 4px 0 7px; }
.upk { font-size: 11px; color: var(--muted); }
.tip-cost small { font-family: var(--body); font-size: 11.5px; color: var(--muted); font-weight: 500; }
#arsenal.collapsed { width: 56px; bottom: auto; }
#arsenal.collapsed .arsenal-head { flex-direction: column; gap: 6px; padding: 8px 0 4px; }
#arsenal.collapsed .arsenal-title { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: 0.25em; }
#arsenal.collapsed .tabs { grid-template-columns: 1fr; padding: 4px 6px 8px; }
#arsenal.collapsed .tab em, #arsenal.collapsed .hint, #arsenal.collapsed .cards, #arsenal.collapsed .arsenal-foot { display: none; }
#arsenal.collapsed .tab { padding: 8px 2px; }

#tip {
  position: absolute; width: 280px; background: rgba(10, 13, 17, 0.97); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; z-index: 30;
  pointer-events: none; opacity: 0; transform: translateX(-4px); transition: opacity 0.12s, transform 0.12s; box-shadow: 0 8px 26px rgba(0,0,0,.5);
}
#tip.on { opacity: 1; transform: none; }
#tip h4 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.03em; }
#tip .era { font-family: var(--display); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
#tip p { margin: 0 0 7px; font-size: 12.5px; color: #b9c3cc; line-height: 1.4; }
#tip .dmg { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
#tip .dm { border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; font-size: 11.5px; color: var(--muted); }
#tip .dm b { color: var(--ink); }
#tip .kv { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 11.5px; color: var(--muted); }
#tip .kv b { color: var(--ink); }
#tip .ex { font-size: 11.5px; color: #9ccbee; margin-top: 6px; }
.tip-cost { font-family: var(--display); color: var(--gold); font-size: 17px; font-weight: 700; margin-top: 5px; }
.tip-cost .bad { color: #ff9d95; font-size: 13px; }

/* ───── panels ───── */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
/* The header and the action row stay put (Declare war is always on screen); only the middle scrolls. */
#country { position: absolute; right: 10px; top: 58px; width: 340px; padding: 0; z-index: 6; max-height: calc(100% - 290px); display: flex; flex-direction: column; overflow: hidden; }
.cp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 12px; }
#country .x { position: absolute; right: 8px; top: 8px; }
#country .x, .x { border: 1px solid var(--line); background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; padding: 0; }
.cp-head { flex: none; display: flex; gap: 12px; align-items: center; padding: 12px 38px 10px 12px; }
.cp-flag { width: 78px; height: 52px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 3px 10px rgba(0,0,0,.35); }
.cp-head h2 { margin: 0 0 5px; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: 0.02em; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-s { font-family: var(--display); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--line-2); letter-spacing: 0.08em; text-transform: uppercase; color: #c3ccd5; }
.st-war { border-color: rgba(229, 83, 75, 0.7); color: #ffb4ab; background: rgba(229, 83, 75, 0.14); }
.st-allied { border-color: rgba(95, 211, 122, 0.6); color: #cff5d8; background: rgba(95, 211, 122, 0.1); }
.st-player { border-color: rgba(95, 168, 255, 0.7); color: #d9e9ff; background: rgba(95, 168, 255, 0.14); }
.st-defeated { color: var(--dim); }
.chip-s.nuke { border-color: rgba(214, 178, 94, 0.55); color: #ecd9a6; }
.chip-s.fighting { border-color: rgba(242, 207, 166, 0.5); color: #f2cfa6; }
.cp-rows { border-top: 1px solid var(--line); margin-bottom: 8px; }
.kv-row { display: flex; align-items: center; gap: 7px; padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kv-row .ic { color: var(--dim); }
.kv-row label { color: var(--muted); flex: none; width: 92px; }
.kv-row b { font-weight: 600; flex: 1; text-align: right; }
.kv-row em { font-style: normal; font-size: 11px; }
.kv-row em.bad, .bad { color: #ff9d95; }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars b, .stars i { width: 9px; height: 9px; transform: rotate(45deg) scale(0.75); background: var(--gold); display: inline-block; }
.stars i { background: rgba(255, 255, 255, 0.14); }
.cp-sec { margin-bottom: 8px; }
.cp-body .cp-rows { border-top: 1px solid var(--line); }
.cp-sec h4, .bounty h4 { margin: 0 0 5px; display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.flagrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.flagrow img { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.flagrow span { color: var(--muted); font-size: 11.5px; }
.bounty { border: 1px solid var(--line); border-left: 2px solid rgba(214, 178, 94, 0.6); border-radius: 4px; padding: 7px 9px; margin-bottom: 8px; background: rgba(255, 255, 255, 0.02); }
.brow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; color: #c8d0d8; }
.brow span { display: flex; align-items: center; gap: 5px; }
.brow .ic { color: var(--dim); }
.brow b { color: var(--gold); font-family: var(--display); font-weight: 600; font-size: 13.5px; }
.brow.dim { color: var(--dim); font-size: 11px; }
.surr { margin-bottom: 8px; }
.surr label { font-size: 11.5px; color: var(--muted); }
.surr .meter { height: 6px; margin-top: 4px; }
.surr .meter i { background: linear-gradient(90deg, #c49a45, #e5534b); }
.cp-note { font-size: 12px; color: #c3ccd5; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; margin-bottom: 8px; line-height: 1.4; }
.cp-note.cyber { color: #9fe7b4; }
.cp-note.ally { color: #cff5d8; border-color: rgba(95, 211, 122, 0.35); }
.cp-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 9px 12px 12px; border-top: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); }
.cp-actions .btn { justify-content: flex-start; min-width: 0; }
.cp-actions .btn small { margin-left: auto; }
.cp-actions .wide { grid-column: 1 / -1; }
.cp-body > :last-child { margin-bottom: 10px; }

#selection {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; padding: 8px 10px; z-index: 7;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 720px); min-width: 400px;
}
.sel-units { display: flex; gap: 4px; flex-wrap: wrap; max-width: 300px; }
.sel-u { width: 48px; height: 52px; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #3a4654, #1b222b); position: relative; cursor: pointer; border: 1px solid var(--line); }
.sel-u:hover { border-color: #8dffa6; }
.sel-u img { width: 46px; height: 42px; object-fit: contain; }
.sel-u .cnt { position: absolute; right: 3px; top: 1px; font-family: var(--display); font-weight: 700; font-size: 12px; text-shadow: 0 1px 2px #000; }
.sel-u .hp { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 3px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; }
.sel-u .hp i { display: block; height: 100%; }
.sel-info { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); min-width: 140px; gap: 1px; }
.sel-info b { color: #fff; font-size: 14px; font-weight: 600; }
.sel-info .hint { padding: 0; min-height: 0; font-size: 11px; color: var(--dim); }
.sel-actions { display: flex; gap: 5px; flex-wrap: wrap; }
/* Narrow windows (the centred column between the arsenal and the minimap is under 400 px): the panel keeps to that
   column instead of spreading over both, and the orders become a 3-column grid under the asset line. */
@media (max-width: 1120px) {
  #toast { max-width: calc(100% - 700px); text-align: center; } /* (clear of the arsenal and the minimap, wrapping if it must) */
  #selection { width: calc(100% - 720px); min-width: 264px; max-width: none; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
  #selection .sel-units { max-width: 100%; }
  #selection .sel-info { flex: 1 1 120px; min-width: 0; }
  #selection .sel-info > .hint { display: none; }
  #selection .sel-actions { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #selection .sel-actions .btn { padding: 5px 3px; gap: 4px; font-size: 11.5px; letter-spacing: 0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  #selection .sel-actions .btn svg { flex: none; width: 13px; height: 13px; }
}

/* ───── intel feed ───── */
/* Oct 3 fix [ui-polish]: the arsenal ends 214 px above the window's foot, so the feed (12 px up, header, list, padding) has to stay under 194 px or the arsenal covers its header: the list is 164 px, not 188. */
#news { position: absolute; left: 10px; bottom: 12px; width: 300px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
#news-head { display: flex; align-items: center; gap: 7px; padding: 7px 10px; cursor: pointer; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
#news-head:hover { color: #fff; }
#news-head span { flex: 1; }
#news-head em { font-style: normal; font-family: var(--body); letter-spacing: 0; background: var(--red); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 11px; }
#news-head em:empty { display: none; }
#news-head i { display: flex; }
#news-list { max-height: 164px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 0 6px 6px; }
#news.collapsed #news-list { display: none; }
.news-item { display: flex; gap: 7px; align-items: flex-start; border-left: 2px solid rgba(95, 168, 255, 0.6); padding: 4px 6px; font-size: 12px; line-height: 1.3; color: #c8d0d8; animation: newsIn 0.3s ease-out; }
.news-item .ic { margin-top: 1px; color: var(--dim); }
.news-item.link { cursor: pointer; }
.news-item.link:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.news-item .nd { color: var(--dim); font-size: 10.5px; margin-right: 6px; font-family: var(--display); letter-spacing: 0.05em; }
.k-war { border-left-color: var(--red); } .k-war .ic { color: #ff8f86; }
.k-bad { border-left-color: #e0894a; } .k-bad .ic { color: #e0894a; }
.k-good { border-left-color: var(--green); } .k-good .ic { color: var(--green); }
.k-capital, .k-landmark, .k-city { border-left-color: var(--gold); } .k-capital .ic, .k-landmark .ic { color: var(--gold); }
.k-surrender { border-left-color: #e6e9ec; }
.k-nuke { border-left-color: #d6e05a; } .k-nuke .ic { color: #d6e05a; }
.k-warn { border-left-color: #e6b04a; } .k-warn .ic { color: #e6b04a; }
.k-intl { border-left-color: #8c8f94; color: #aab2ba; }
@keyframes newsIn { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

#minimap-wrap { position: absolute; right: 10px; bottom: 12px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; z-index: 6; }
#minimap { display: block; width: 330px; height: 185px; border-radius: 3px; cursor: pointer; }
/* Map key: a strip along the bottom edge of the minimap (over the far south), saying what the relation colours and marks mean. */
#map-key { position: absolute; left: 5px; top: 172px; width: 330px; height: 18px; display: flex; align-items: center; justify-content: space-between; padding: 0 7px; background: rgba(9, 12, 16, 0.84); border-top: 1px solid var(--line); border-radius: 0 0 3px 3px; font: 600 10px/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: #a9b3bc; white-space: nowrap; }
#map-key span { display: flex; align-items: center; gap: 4px; }
#map-key i { width: 13px; height: 9px; border: 1.5px solid; box-sizing: border-box; }
#map-key .mk-you { background: color-mix(in srgb, var(--rel-player) 55%, #1c2a44); border-color: #f2f2ee; }
#map-key .mk-ally { background: color-mix(in srgb, var(--rel-ally) 45%, #4a6a4c); border-color: var(--rel-ally); }
#map-key .mk-war { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rel-enemy) 55%, #4a3430) 0 2.5px, color-mix(in srgb, var(--rel-enemy) 35%, #1a1210) 2.5px 3.5px); border-color: var(--rel-enemy); }
#map-key .mk-neutral { background: #a39a82; border-color: #15181b; }
#map-key .mk-contest { background: repeating-linear-gradient(45deg, #b2544a 0 3px, #4f7f55 3px 6px); border-color: #15181b; }
#hover-info { font-size: 11.5px; color: #b9c3cc; height: 16px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 330px; }

#tutorial {
  display: none; position: relative; width: min(460px, 100%); background: rgba(12, 20, 32, 0.95);
  border: 1px solid rgba(95, 168, 255, 0.5); border-left: 3px solid var(--blue); border-radius: 6px; padding: 10px 14px; pointer-events: none;
}
#tutorial.on { display: block; pointer-events: auto; animation: tutIn 0.25s ease-out; }
@keyframes tutIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#tutorial h3 { margin: 0 0 3px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; }
#tutorial p { margin: 0; font-size: 13px; line-height: 1.45; color: #c8d0d8; }
#tutorial .tut-step { position: absolute; right: 12px; top: 10px; font-size: 11px; color: var(--muted); font-family: var(--display); }
#tutorial .tut-btns { display: flex; gap: 6px; margin-top: 7px; }
#tutorial button { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 4px; padding: 3px 10px; font-size: 11px; }
#tutorial button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
#tutorial button.go { border-color: rgba(95, 168, 255, 0.55); color: #d9e9ff; background: rgba(95, 168, 255, 0.14); }

#banner {
  position: absolute; left: 50%; top: 150px; transform: translate(-50%, -12px); z-index: 12; display: flex; align-items: center; gap: 14px;
  background: rgba(10, 13, 17, 0.94); border: 1px solid var(--line-2); border-top: 2px solid var(--blue); border-radius: 6px; padding: 12px 22px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
#banner.on { opacity: 1; transform: translate(-50%, 0); }
#banner img { width: 60px; height: 40px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
#banner h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: 0.1em; line-height: 1; text-transform: uppercase; }
#banner p { margin: 4px 0 0; font-size: 13.5px; color: #b9c3cc; }
#banner.k-war { border-top-color: var(--red); } #banner.k-war h1 { color: #ff9d95; }
#banner.k-good { border-top-color: var(--green); } #banner.k-good h1 { color: #b6ecc7; }
#banner.k-gold { border-top-color: var(--gold); } #banner.k-gold h1 { color: #ecd9a6; }

#toast {
  position: absolute; left: 50%; bottom: calc(16px + var(--above-grp, 84px)); transform: translate(-50%, 8px); background: rgba(10, 13, 17, 0.95); border: 1px solid rgba(111, 207, 142, 0.5);
  border-radius: 5px; padding: 7px 14px; font-size: 13px; font-weight: 600; z-index: 20; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(229, 83, 75, 0.6); }
#cursor-tip { position: absolute; left: 0; top: 0; display: none; z-index: 25; pointer-events: none; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; background: rgba(10, 13, 17, 0.94); border: 1px solid rgba(111, 207, 142, 0.6); white-space: nowrap; }
#cursor-tip.bad { border-color: rgba(229, 83, 75, 0.7); color: #ffd0cc; }

/* ───── modal ───── */
#modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(4, 7, 11, 0.6); z-index: 40; backdrop-filter: blur(3px); }
#modal.on { display: flex; }
.modal-box {
  background: rgba(14, 18, 23, 0.98); border: 1px solid var(--line-2); border-radius: 8px; padding: 20px 24px; max-width: 520px; width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); text-align: center; animation: pop 0.18s ease-out; max-height: calc(100% - 40px); overflow-y: auto;
}
#modal.wide .modal-box { max-width: 880px; text-align: left; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-box h1 { font-family: var(--display); font-weight: 700; font-size: 36px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 8px; }
.modal-box h1.gold { color: #ecd9a6; }
.modal-box h1.red { color: #ff9d95; }
.modal-box h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 12px; }
.modal-box p { font-size: 14px; color: #c3ccd5; line-height: 1.5; }
.modal-box .warn { color: #ffc2bb; border: 1px solid rgba(229, 83, 75, 0.4); background: rgba(229, 83, 75, 0.08); border-radius: 4px; padding: 8px; }
.modal-box .good { color: #c9f5d4; border: 1px solid rgba(95, 211, 122, 0.4); background: rgba(95, 211, 122, 0.08); border-radius: 4px; padding: 8px; }
.modal-box .dim { color: var(--muted); font-size: 12px; }
.modal-flag { width: 120px; height: 80px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
/* Oct 3 fix [ui-polish]: the declare-war box is taller than a 720p window. The flag shrinks on short windows and the buttons stay pinned to the foot of the box while its body scrolls. */
@media (max-height: 800px) { .modal-flag { width: 60px; height: 40px; } }
#modal.coalition .modal-actions { position: sticky; bottom: -20px; z-index: 1; margin: 12px -24px -20px; padding: 12px 24px 20px; background: rgba(14, 18, 23, 0.98); border-top: 1px solid var(--line); }
.joiners { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 6px 0; max-height: 150px; overflow-y: auto; }
.joiners span { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px 3px 4px; font-size: 12px; }
.joiners img { width: 24px; height: 16px; border-radius: 2px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.menu-col { display: flex; flex-direction: column; gap: 7px; max-width: 280px; margin: 0 auto; }
.menu-col .btn { justify-content: flex-start; padding: 9px 14px; font-size: 14px; }
.settings { display: flex; flex-direction: column; gap: 12px; text-align: left; font-size: 14px; }
.settings label { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.settings input[type='range'] { width: 200px; accent-color: var(--blue); }
.settings input[type='checkbox'] { width: 16px; height: 16px; order: -1; accent-color: var(--blue); }
.settings label:has(input[type='checkbox']) { justify-content: flex-start; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stats-grid div { border: 1px solid var(--line); border-radius: 4px; padding: 8px; }
.stats-grid b { display: block; font-family: var(--display); font-weight: 700; font-size: 19px; color: #ecd9a6; }
.stats-grid label { font-size: 11px; color: var(--muted); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; }
.help-grid h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: #cfe3f7; }
.help-grid p { margin: 0; font-size: 13px; }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 50; transition: opacity 1.4s ease-out; }
#flash.on { opacity: var(--flash, 0.95); transition: none; }
#fps { position: absolute; right: 12px; top: 56px; z-index: 60; font-family: var(--display); font-size: 12px; color: #9fe7b4; background: rgba(0,0,0,.5); padding: 2px 7px; border-radius: 3px; pointer-events: none; }
#hud, #title, #modal { zoom: var(--ui-scale, 1); }

/* ───── small buttons, switches, segmented controls ───── */
.btn.sm { padding: 4px 9px; font-size: 12px; gap: 5px; }
.btn.sm img { width: 18px; height: 12px; border-radius: 1px; }
.switch { position: relative; width: 38px; height: 21px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 11px; background: rgba(255,255,255,.12); border: 1px solid var(--line-2); transition: background .15s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #c9d1d9; transition: transform .15s, background .15s; }
.switch input:checked + i { background: rgba(95, 168, 255, 0.55); border-color: rgba(95, 168, 255, 0.8); }
.switch input:checked + i::after { transform: translateX(17px); background: #fff; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 5px 10px; font-family: var(--display); font-weight: 600; font-size: 12.5px; letter-spacing: 0.04em; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: #fff; background: rgba(255,255,255,.06); }
.seg button.on { color: #fff; background: rgba(95, 168, 255, 0.28); }

/* ───── settings ───── */
#modal.settings-modal .modal-box { max-width: 760px; }
.set-wrap h2 { margin-bottom: 10px; }
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 6px; flex-wrap: wrap; }
.set-tabs button { display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 7px 12px; font-family: var(--display); font-weight: 600; font-size: 13.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.set-tabs button:hover { color: #fff; }
.set-tabs button.on { color: #fff; border-bottom-color: var(--blue); }
.set-body { min-height: 360px; max-height: min(520px, calc(100vh - 260px)); overflow-y: auto; padding-right: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.set-lbl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-lbl b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.set-lbl small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.set-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.set-ctl input[type='range'] { width: 180px; accent-color: var(--blue); }
.set-ctl output { width: 42px; text-align: right; font-family: var(--display); color: var(--muted); font-size: 13px; }
.set-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; padding: 10px 2px; width: 100%; }
.set-keys div { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #c3ccd5; }
.set-keys kbd { min-width: 96px; font-size: 12.5px; color: #fff; border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 6px; text-align: center; background: rgba(255,255,255,.04); }
.settings-modal .modal-actions { justify-content: space-between; }

/* ───── saved games ───── */
#title-saves { width: min(760px, calc(100vw - 40px)); }
.saves-panel { background: rgba(12, 16, 21, 0.96); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.saves-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.saves-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; }
.saves-list { display: flex; flex-direction: column; gap: 6px; max-height: min(520px, calc(100vh - 280px)); overflow-y: auto; text-align: left; }
.saves-empty { color: var(--muted); padding: 24px; text-align: center; }
.save-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; background: rgba(255,255,255,.02); }
.save-row:hover { border-color: var(--line-2); background: rgba(255,255,255,.04); }
.save-row img, .save-row .noflag { width: 42px; height: 28px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); flex: none; background: #2a3038; }
.save-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.save-info b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-info b em { font-style: normal; font-family: var(--display); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(214,178,94,.5); border-radius: 3px; padding: 0 5px; margin-left: 6px; }
.save-info span { font-size: 12px; color: #b9c3cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-info small { font-size: 11px; color: var(--dim); }
.save-acts { display: flex; gap: 5px; align-items: center; flex: none; }
.save-acts .confirm { font-size: 12px; color: #ffb4ab; margin-right: 4px; }
.save-name { width: 100%; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); color: var(--ink); font-family: var(--body); font-size: 14px; padding: 3px 6px; border-radius: 3px; outline: none; }
.save-new { display: flex; gap: 8px; margin-bottom: 10px; }
.save-new input { flex: 1; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); color: var(--ink); font-family: var(--body); font-size: 14px; padding: 7px 10px; border-radius: 4px; outline: none; }
.saves-dlg { text-align: left; }
.title-btn:disabled { opacity: 0.4; cursor: default; }
#btn-saves, #btn-settings { flex-direction: row; }
#btn-saves small { font-family: var(--display); color: var(--muted); font-size: 12px; }

/* ───── defense posts ───── */
.post-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 6px; border-left: 2px solid var(--green); margin-bottom: 3px; cursor: pointer; color: #c8d0d8; }
.post-row:hover { background: rgba(255,255,255,.05); }
.post-row.short { border-left-color: #e6b04a; }
.post-row.short b { color: #f1c94b; }
.post-hint { font-size: 11px; color: var(--dim); margin-top: 4px; line-height: 1.35; }

/* ───── war overview ───── */
#modal.war .modal-box { max-width: 1060px; }
.war-ov { display: flex; gap: 16px; text-align: left; }
.war-list { width: 230px; flex: none; display: flex; flex-direction: column; gap: 5px; max-height: min(600px, calc(100vh - 170px)); overflow-y: auto; }
.war-list h5 { margin: 8px 0 2px; font-family: var(--display); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.war-item { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); border-left: 2px solid var(--red); border-radius: 4px; background: rgba(255,255,255,.02); padding: 6px 8px; color: var(--ink); }
.war-item:hover { background: rgba(255,255,255,.06); }
.war-item.on { border-color: rgba(229, 83, 75, 0.7); background: rgba(229, 83, 75, 0.1); }
.war-item b { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.war-item small { font-size: 11px; color: var(--muted); }
.wi-flags { display: flex; gap: 3px; align-items: center; }
.wi-flags img { width: 21px; height: 14px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.wi-flags em { font-style: normal; font-size: 11px; color: var(--muted); }
.war-else div { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 2px 0; }
.war-else img { width: 18px; height: 12px; border-radius: 1px; }
.war-else span { font-size: 10.5px; }
.war-main { flex: 1; min-width: 0; }
.war-head h2 { margin: 0 0 3px; text-align: left; }
.war-head .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.war-score { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ws-side { display: flex; gap: 3px; flex: none; width: 170px; }
.ws-side.them { justify-content: flex-end; }
.ws-side img { width: 30px; height: 20px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.ws-bar { flex: 1; height: 16px; border-radius: 3px; background: rgba(229, 83, 75, 0.55); position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.ws-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #3f7de0, #5fa8ff); transition: width .4s; }
.ws-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: rgba(255,255,255,.7); }
.ws-bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 12.5px; color: #fff; text-shadow: 0 1px 2px #000; }
.war-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.war-cols h4 { margin: 0 0 6px; font-family: var(--display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.war-cols h4.us { color: #9cc7ff; }
.war-cols h4.them { color: #ff9d95; }
.war-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.war-table th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding: 3px 4px; border-bottom: 1px solid var(--line-2); }
.war-table td { padding: 4px; border-bottom: 1px solid var(--line); color: #c8d0d8; white-space: nowrap; }
.war-table td.nat { display: flex; align-items: center; gap: 6px; max-width: 150px; }
.war-table td.nat span { overflow: hidden; text-overflow: ellipsis; }
.war-table td.nat img { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.war-table tr.me td { color: #fff; font-weight: 600; }
.war-table tr.gone td { opacity: 0.5; }
.war-table td.pos { color: #9fe7b4; }
.war-table td.neg { color: #ff9d95; }
.share { width: 56px; height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.share i { display: block; height: 100%; background: var(--gold); }
.meter.sm { width: 60px; height: 5px; }
.meter.sm i { background: linear-gradient(90deg, #c49a45, #e5534b); }
.war-totals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.war-totals div { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; display: flex; flex-direction: column; }
.war-totals label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--display); }
.war-totals b { font-family: var(--display); font-size: 20px; color: #ecd9a6; }
.war-totals small { font-size: 11px; color: var(--dim); }
.war-peace { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ───── title & nation select ───── */
#title { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(6, 12, 20, 0.2), rgba(4, 8, 14, 0.8)); }
.title-inner { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.logo { text-align: center; line-height: 0.9; font-family: var(--display); text-transform: uppercase; }
.logo-top { font-size: 26px; font-weight: 600; letter-spacing: 0.9em; color: #9fb4c8; margin-right: -0.9em; }
.logo-bot { font-size: 84px; font-weight: 700; letter-spacing: 0.16em; color: #f2f4f6; margin-right: -0.16em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55); }
.logo-sub { margin-top: 14px; font-size: 13px; letter-spacing: 0.6em; color: var(--gold); font-weight: 600; margin-right: -0.6em; }
.title-menu { display: flex; flex-direction: column; gap: 9px; width: 320px; }
.title-btn { flex-direction: column; gap: 3px; padding: 12px 18px !important; font-size: 15px !important; }
.title-btn .lbl { display: flex; align-items: center; gap: 8px; }
.title-btn small { display: flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; }
.title-btn small img { width: 18px; height: 12px; border-radius: 1px; }
#btn-new, #btn-howto { flex-direction: row; }
.title-foot { max-width: 520px; text-align: center; font-size: 14px; color: #c3ccd5; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); }
.title-ver { margin-top: 6px; font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.setup-search { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(0, 0, 0, 0.25); color: var(--muted); }
.setup-search:focus-within { border-color: rgba(95, 168, 255, 0.55); }
.setup-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); font-family: var(--body); font-size: 14px; }
/* Nation select on the live map: the title overlay steps aside, the card docks on the right. */
#title.picking { background: none; pointer-events: none; }
#title.picking .logo { display: none; }
.setup { position: fixed; inset: 0; pointer-events: none; }
.pick-panel { pointer-events: auto; position: absolute; top: 16px; right: 16px; max-height: calc(100% - 32px); width: 404px; display: flex; flex-direction: column; background: rgba(12, 16, 21, 0.95); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.pick-top { position: relative; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pick-title small { display: block; font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.pick-title h2 { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; }
.pick-hits { position: absolute; left: 16px; right: 16px; top: calc(100% - 8px); z-index: 2; background: rgba(16, 21, 27, 0.98); border: 1px solid var(--line-2); border-radius: 4px; padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.pick-hits button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 5px 6px; border-radius: 3px; font-size: 13.5px; text-align: left; }
.pick-hits button:hover { background: rgba(95, 168, 255, 0.14); }
.pick-hits img { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.pick-hits span { flex: 1; }
.pick-hits em { font-style: normal; font-family: var(--display); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.pick-hits .none { padding: 7px 8px; color: var(--muted); font-size: 12.5px; }
.pick-empty { padding: 26px 24px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); }
.pick-empty .ic { color: var(--dim); }
.pick-empty p { margin: 0; font-size: 14px; color: #c3ccd5; line-height: 1.4; }
.pick-empty small { font-size: 12px; color: var(--dim); }
.pick-hint { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 14px; align-items: center; padding: 7px 12px; border-radius: 4px; background: rgba(12, 16, 21, 0.86); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; color: #e6e9ec; }
.pick-hint span { color: var(--muted); font-weight: 500; padding-left: 14px; border-left: 1px solid var(--line-2); }
#pick-tip { position: absolute; left: 0; top: 0; z-index: 31; display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 6px; border-radius: 4px; background: rgba(12, 18, 26, 0.92); border: 1px solid rgba(255, 255, 255, 0.18); pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
#pick-tip img { width: 27px; height: 18px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
#pick-tip b { display: block; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: #fff; }
#pick-tip small { display: block; font-size: 11px; color: var(--muted); }
.setup-card { flex: 1; min-height: 0; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.nc-head { display: flex; gap: 14px; align-items: center; }
.nc-head img { width: 84px; height: 56px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.nc-head h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; }
.nc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nc-grid div { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
.nc-grid label, .nc-sec > label { display: block; font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.nc-grid b { font-family: var(--display); font-size: 17px; font-weight: 600; }
.nc-grid b.gold { color: var(--gold); }
.nc-note { margin: 6px 0 0; font-size: 11px; line-height: 1.35; color: var(--dim); } /* (Oct 3 fix [ui-polish]: the pact rule under the partners, a note rather than a second row of names) */
.rate-Easy { color: #b6ecc7 !important; border-color: rgba(111,207,142,.5) !important; }
.rate-Moderate { color: #cfe3f7 !important; }
.rate-Hard { color: #f1d7a6 !important; border-color: rgba(214,178,94,.5) !important; }
.rate-Veryhard { color: #ffb4ab !important; border-color: rgba(229,83,75,.5) !important; }
.diff-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.diff-btn { border: 1px solid var(--line); background: transparent; border-radius: 4px; padding: 7px 9px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.diff-btn b { font-family: var(--display); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; }
.diff-btn small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.diff-btn.on { border-color: rgba(95, 168, 255, 0.6); background: rgba(95, 168, 255, 0.12); }
/* The way in stays pinned to the foot of the card, however far the card scrolls. */
.nc-actions { position: sticky; bottom: -16px; margin: auto -16px -16px; padding: 10px 16px; display: flex; justify-content: space-between; background: #0d1116; border-top: 1px solid var(--line); }
/* Scenarios: one card each, on the saved-games panel, or a note while there are none. */
.scen-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 24px 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 5px; }
.scen-empty .ic { color: var(--dim); }
.scen-empty b { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: #c3ccd5; }
.scen-empty p { margin: 0; max-width: 400px; font-size: 12.5px; line-height: 1.45; }
.scen-list { gap: 8px; }
.scen-card { display: flex; flex-direction: column; gap: 7px; border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; background: rgba(255, 255, 255, 0.02); }
.scen-card:hover { border-color: var(--line-2); }
.scen-top { display: flex; align-items: center; justify-content: space-between; }
.scen-top h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.scen-sides { display: flex; align-items: center; gap: 10px; }
.scen-sides .us, .scen-sides .them { display: flex; align-items: center; gap: 7px; }
.scen-sides img { width: 36px; height: 24px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.scen-sides b { font-family: var(--display); font-size: 16px; letter-spacing: 0.04em; }
.scen-sides .us b { color: #9cc7ff; }
.scen-sides .them b { color: #ff9d95; }
.scen-sides em { font-style: normal; font-family: var(--display); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.scen-odds { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.scen-card p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #c3ccd5; }
.scen-meta { flex: 1; display: flex; flex-wrap: wrap; gap: 3px 18px; font-size: 12.5px; }
.scen-meta label { margin-right: 7px; font-family: var(--display); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.scen-foot { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.seg { display: flex; gap: 4px; }
.seg .btn.on { box-shadow: none; border-color: rgba(95, 168, 255, 0.6); background: rgba(95, 168, 255, 0.12); }
/* Seven title buttons: on shorter windows the logo and the buttons tighten up so the menu still fits. */
#btn-scen { flex-direction: row; }
@media (max-height: 760px) {
  .title-inner { gap: 16px; }
  .logo-bot { font-size: 60px; }
  .logo-sub { margin-top: 8px; }
  .title-menu { gap: 6px; }
  .title-btn { padding: 8px 18px !important; }
}

#loading { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #0a1520; font-family: var(--display); font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.spinner { width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───── critical alerts: their own channel, top centre ───── */
/* The pause chip, the tutorial and the alerts share one column, so they stack instead of covering each other. */
#topstack { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); width: min(620px, calc(100% - 760px)); min-width: 380px; z-index: 11; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#alerts { width: 100%; display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
#pause-chip { display: flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 4px; background: rgba(13, 17, 22, 0.94); border: 1px solid var(--line-2); border-left: 2px solid #e6b04a; font-family: var(--display); font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #c3ccd5; }
#pause-chip .ic { color: #e6b04a; }
.alert { pointer-events: auto; display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px 8px 11px; border-radius: 5px; background: rgba(28, 10, 10, 0.95); border: 1px solid rgba(229, 83, 75, 0.55); border-left: 3px solid var(--red); color: #ffe1dc; font-size: 13px; font-weight: 600; line-height: 1.35; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); animation: alertIn 0.25s ease-out; transition: opacity 0.45s, transform 0.45s; }
.alert > .ic { flex: none; margin-top: 1px; color: #ff8f86; }
.alert > div { flex: 1; }
.alert .ad { color: #d69b94; font-family: var(--display); font-size: 11px; letter-spacing: 0.06em; margin-right: 7px; }
.alert.link { cursor: pointer; }
.alert.link:hover { background: rgba(44, 14, 14, 0.97); }
.alert .an { color: #fff; font-family: var(--display); }
.alert .ax { flex: none; border: 0; background: transparent; color: #d69b94; padding: 2px; display: flex; }
.alert .ax:hover { color: #fff; }
.alert.lv-war { border-left-color: #ff3b30; animation: alertIn 0.25s ease-out, alertPulse 1.2s ease-in-out 2; }
.alert.lv-nuke { background: rgba(34, 26, 6, 0.96); border-color: rgba(241, 201, 75, 0.6); border-left-color: #f1c94b; color: #fff1c7; }
.alert.lv-nuke > .ic { color: #f1c94b; }
.alert.out { opacity: 0; transform: translateY(-6px); }
@keyframes alertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes alertPulse { 50% { box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.55), 0 6px 20px rgba(0, 0, 0, 0.45); } }

/* ───── army groups ───── */
#groups { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--above-sel, 84px)); z-index: 7; display: flex; align-items: center; gap: 4px; padding: 3px 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
#groups.hidden { display: none; }
.grp-lbl { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); padding: 0 5px 0 3px; }
.grp { display: flex; align-items: center; gap: 3px; height: 28px; padding: 0 6px 0 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); color: var(--ink); }
.grp:hover { border-color: #8dffa6; }
.grp b { font-family: var(--display); font-size: 14px; color: var(--gold); min-width: 9px; }
.grp img { width: 26px; height: 22px; object-fit: contain; }
.grp span { font-family: var(--display); font-size: 12px; color: var(--muted); }

/* ───── orders in the selection panel ───── */
.sel-order { display: flex; flex-direction: column; margin-top: 3px; padding: 3px 7px; border-left: 2px solid #8dffa6; background: rgba(255, 255, 255, 0.035); border-radius: 0 3px 3px 0; max-width: 300px; }
.sel-order b { font-family: var(--display); font-size: 12px !important; letter-spacing: 0.1em; text-transform: uppercase; color: #cfeedd !important; }
.sel-order span { font-size: 11px; color: var(--muted); line-height: 1.3; }
.sel-order.o-hold { border-left-color: #c9cfd6; } .sel-order.o-guard, .sel-order.o-defend { border-left-color: #8fd0ff; }
.sel-order.o-retreat, .sel-order.o-fallback { border-left-color: #ffb347; } .sel-order.o-attack, .sel-order.o-auto { border-left-color: #ff7a6e; }
.sel-order.o-escort, .sel-order.o-observe { border-left-color: #7fe3ff; }
.sel-order.o-rest, .sel-order.o-rtb { border-left-color: #9fb3c8; } .sel-order.o-hide { border-left-color: #5d7fa3; } .sel-order.o-ferry, .sel-order.o-board { border-left-color: #8dffa6; }
.sel-order b em { font-style: normal; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--ink); margin-left: 7px; font-family: var(--body, inherit); font-size: 11.5px; }
.sel-info .parked { display: flex; align-items: center; gap: 5px; color: #cfe8ff; }
/* Directive chip on arsenal cards: what new assets of that type start doing. */
.card .dir { display: inline-flex; vertical-align: 2px; margin-left: 8px; align-items: center; gap: 3px; max-width: 120px; height: 16px; padding: 0 5px; border-radius: 3px; border: 1px solid rgba(143, 208, 255, 0.4); background: rgba(12, 20, 30, 0.7); color: #cfe8ff; font: 600 10px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; opacity: 0.85; }
.card .dir:hover { opacity: 1; border-color: #8fd0ff; }
.card .dir span { overflow: hidden; text-overflow: ellipsis; }
.grp { position: relative; }
.grp .gx { display: none; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; background: #3a2226; border: 1px solid #ef5350; color: #ffb4ab; }
.grp:hover .gx { display: flex; }
.grp .gx:hover { background: #ef5350; color: #fff; }
.grp-menu { position: fixed; z-index: 40; min-width: 210px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; gap: 2px; }
.grp-menu.hidden { display: none; }
.grp-menu h5 { margin: 2px 6px 4px; font-family: var(--display); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.grp-menu button { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 12.5px; text-align: left; cursor: pointer; }
.grp-menu button:hover:not([disabled]) { background: rgba(255, 255, 255, 0.07); }
.grp-menu button[disabled] { opacity: 0.4; cursor: default; }
.grp-menu button[data-a="delete"] { color: #ffb4ab; }
.sel-info .mix { font-size: 11px; color: #b9c3cc; }
.sel-info .bad { color: #ffb3aa; }
.sel-info .hunt { color: #ffc08a; }
.sel-info .sortie { display: flex; flex-wrap: wrap; gap: 1px 12px; }
.sel-info .sortie span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sel-info .sortie i { display: inline-block; width: 44px; height: 4px; background: rgba(0, 0, 0, 0.6); border-radius: 2px; overflow: hidden; }
.sel-info .sortie em { display: block; height: 100%; }
.chev { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; }
.chev i, .sel-u .vet i { display: block; width: 9px; height: 5px; background: var(--gold); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 45%, 50% 100%, 0 45%); }
.sel-u .vet { position: absolute; left: 3px; top: 3px; display: flex; flex-direction: column; gap: 1px; }
.sel-u .vet i { width: 8px; height: 4px; }

/* ───── arsenal ───── */
.card { position: relative; }
.card .quick { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 4px; border: 1px solid rgba(111, 207, 142, 0.45); background: rgba(111, 207, 142, 0.1); color: #b6ecc7; opacity: 0.75; }
.card .quick:hover { opacity: 1; background: rgba(111, 207, 142, 0.22); }
.card.poor .quick { display: none; }
#arsenal-hint.warn { color: #ffb3aa; }

/* ───── minimap viewport overlay ───── */
#minimap-wrap { position: absolute; }
#minimap-view { position: absolute; left: 5px; top: 5px; width: 330px; height: 185px; pointer-events: none; }

/* ───── coalition preview ───── */
#modal.coalition .modal-box { max-width: 760px; }
.coal-sum { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 4px 0 10px; }
.coal-sum > div { border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: rgba(255, 255, 255, 0.03); }
.coal-sum label { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--display); }
.coal-sum b { font-family: var(--display); font-size: 17px; }
.coal-sum small { display: block; font-size: 10.5px; color: var(--muted); }
table.coal { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 8px; }
table.coal th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 3px 6px; border-bottom: 1px solid var(--line); }
table.coal td { padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: #d3dae0; }
table.coal td.nat { display: flex; align-items: center; gap: 7px; }
table.coal td.nat img { width: 24px; height: 16px; border-radius: 1px; }
.front-land { color: #ff9d95 !important; font-weight: 600; } .front-ally { color: #f6c98f !important; } .front-near { color: #f1dca6 !important; } .front-far { color: var(--muted) !important; }

/* ───── surrender breakdown ───── */
.surr label b { color: #fff; }
.surr label em { font-style: normal; margin-left: 6px; }
.sr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 12px; margin-top: 6px; }
.sr-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 26px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.sr-row b { font-family: var(--display); color: #d3dae0; text-align: right; }
.meter.sm { height: 4px; }
.sr-need { font-size: 11.5px; color: #c8d0d8; margin-top: 6px; line-height: 1.35; }
.k-loss { border-left-color: rgba(229, 83, 75, 0.7); }

/* ───── sandbox ───── */
body.sandbox #tb-date, body.sandbox #tb-control, body.sandbox #tb-tension, body.sandbox #wars, body.sandbox #news, body.sandbox #alerts, body.sandbox #country { display: none !important; }
body.sandbox #arsenal { bottom: 238px; }
#btn-sandbox { flex-direction: row; }
#btn-sandbox small { color: var(--muted); font-size: 11.5px; margin-left: 2px; }
.chip.nation.sb-cmd.blu { border-color: rgba(95, 168, 255, 0.55); background: rgba(95, 168, 255, 0.1); }
.chip.nation.sb-cmd.opf { border-color: rgba(229, 83, 75, 0.55); background: rgba(229, 83, 75, 0.1); }
.sb-chip { gap: 7px; font-size: 14px; min-width: 112px; font-variant-numeric: tabular-nums; }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.sb-dot.ph-battle { background: var(--red); box-shadow: 0 0 6px rgba(229, 83, 75, 0.8); }
.sb-dot.ph-battle.paused { background: #e6b04a; box-shadow: none; }
.sb-dot.ph-over { background: var(--gold); }
.lbl-cap.town { font-size: 10.5px; font-weight: 500; color: rgba(236, 240, 244, 0.92); }
.lbl-cap.town i { width: 5px; height: 5px; border-width: 1px; }

#sandbox { position: absolute; right: 10px; top: 58px; width: 304px; max-height: calc(100% - 306px); overflow-y: auto; padding: 10px 12px 12px; z-index: 6; }
#sandbox::-webkit-scrollbar { width: 5px; }
#sandbox::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sb-title { display: flex; flex-direction: column; line-height: 1.1; }
.sb-title b { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.2em; text-transform: uppercase; }
.sb-title span { font-size: 11.5px; color: var(--muted); }
.sb-state { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--muted); }
.sb-state.ph-battle { color: #ffb4ab; border-color: rgba(229, 83, 75, 0.6); background: rgba(229, 83, 75, 0.1); }
.sb-state.ph-battle.paused, .sb-state.ph-over.paused { color: #f1d7a6; border-color: rgba(230, 176, 74, 0.55); background: rgba(230, 176, 74, 0.08); }
.sb-state.ph-over { color: #ecd9a6; border-color: rgba(214, 178, 94, 0.55); }
.sb-run { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 5px; margin-bottom: 10px; }
.sb-run .btn { padding: 7px 6px; font-size: 13px; }
.sb-run .btn:disabled { opacity: 0.38; cursor: default; }
.sb-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.sb-line > label, .sb-sides td:first-child, .sb-toggles label, .sb-terrain > label { font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sb-side button { display: flex; align-items: center; gap: 5px; padding: 5px 9px; letter-spacing: 0.08em; }
.sb-side button img { width: 18px; height: 12px; border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.sb-side button.blu.on { background: rgba(63, 125, 224, 0.4); }
.sb-side button.opf.on { background: rgba(198, 62, 52, 0.42); }
.sb-count button { min-width: 38px; }
.sb-sides { width: 100%; border-collapse: collapse; margin: 4px 0 8px; table-layout: fixed; }
.sb-sides th { font-family: var(--display); font-size: 11px; letter-spacing: 0.16em; font-weight: 700; padding: 3px 3px 5px; text-align: left; border-bottom: 1px solid var(--line-2); }
.sb-sides th:first-child { width: 88px; }
.sb-sides td { padding: 3px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sb-sides tr.sb-clear td { border-bottom: 0; padding-top: 5px; }
.sb-sides td:first-child { font-size: 10.5px; cursor: help; }
th.blu, .sbr th.blu { color: #9cc7ff; }
th.opf, .sbr th.opf { color: #ff9d95; }
.sb select { width: 100%; appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 18px 4px 7px; color: var(--ink); font: 600 12px var(--display); letter-spacing: 0.02em; cursor: pointer;
  background: rgba(255,255,255,.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238d98a3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 6px center; }
.sb select:hover { border-color: rgba(255,255,255,.3); }
.sb select:focus { outline: none; border-color: rgba(95, 168, 255, 0.6); }
.sb select option { background: #12171d; color: var(--ink); }
.sb-sides .btn.sm { width: 100%; padding: 3px 6px; font-size: 11px; }
.sb-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.sb-sec h4 { margin: 0 0 7px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.sb-toggles { display: flex; gap: 14px; margin-bottom: 8px; }
.sb-toggles label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.sb-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.sb-tools .btn { padding: 5px 4px; font-size: 11px; gap: 4px; }
.sb-foot { display: flex; gap: 6px; margin-top: 10px; }
.sb-foot .btn.blue { flex: 1; }

#sb-readout { position: absolute; left: 10px; bottom: 12px; width: 318px; padding: 8px 10px 6px; z-index: 6; }
.sbr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sbr-head span { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.sbr-head b { font-family: var(--display); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.sbr-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 5px; background: rgba(255,255,255,.06); }
.sbr-bar i { display: block; height: 100%; }
.sbr-bar i.blu { width: 50%; background: linear-gradient(90deg, #2f63b8, #5fa8ff); transition: width .4s; }
.sbr-bar i.opf { flex: 1; background: linear-gradient(90deg, #e5534b, #9a2d24); }
.sbr { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.sbr th { font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: 0.16em; text-align: right; padding: 1px 2px 3px; }
.sbr th:first-child { width: 46%; }
.sbr td { padding: 1.5px 2px; color: #c8d0d8; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--display); font-size: 13px; font-weight: 600; }
.sbr td:first-child { text-align: left; font-family: var(--body); font-size: 11.5px; font-weight: 500; color: var(--muted); }
.sbr tr.sep td { border-top: 1px solid var(--line); padding-top: 3px; }

#sb-result { position: absolute; left: 50%; top: 110px; transform: translate(-50%, -10px); width: min(480px, calc(100% - 40px)); z-index: 12; text-align: center; opacity: 0; pointer-events: none;
  background: rgba(10, 13, 17, 0.96); border: 1px solid var(--line-2); border-top: 2px solid var(--gold); border-radius: 6px; padding: 14px 20px 14px; box-shadow: 0 12px 34px rgba(0,0,0,.5); transition: opacity .3s, transform .3s; }
#sb-result.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#sb-result.k-blu { border-top-color: var(--blue); }
#sb-result.k-opf { border-top-color: var(--red); }
#sb-result .sbx-k { font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
#sb-result h1 { margin: 4px 0 6px; font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; }
#sb-result.k-blu h1 { color: #b9d7ff; }
#sb-result.k-opf h1 { color: #ffb4ab; }
#sb-result.k-draw h1 { color: #ecd9a6; }
#sb-result p { margin: 0 0 12px; font-size: 13px; color: #c3ccd5; line-height: 1.45; }
.sbx-act { display: flex; gap: 6px; justify-content: center; }

#modal.sb-modal .modal-box { max-width: 820px; }
.sb-mdesc { margin: -4px 0 12px; font-size: 13px !important; color: var(--muted) !important; }
.sb-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sb-preset { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); border-left: 2px solid rgba(95, 168, 255, 0.55); border-radius: 4px; background: rgba(255,255,255,.025); padding: 8px 10px; color: var(--ink); }
.sb-preset:hover { background: rgba(255,255,255,.06); border-color: rgba(95, 168, 255, 0.5); }
.sb-preset b { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.sb-preset span { font-size: 12px; color: #b9c3cc; line-height: 1.4; }
.sb-preset em { font-style: normal; font-family: var(--display); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.sb-terrain { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.sb-terrain small { flex-basis: 100%; font-size: 11.5px; color: var(--dim); }

/* ───── odds, goals and the report card ───── */
.odds { display: inline-flex; align-items: center; gap: 7px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 3px; font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; cursor: help; }
.odds span { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: none; font-variant-numeric: tabular-nums; opacity: 0.85; }
.odds-Overwhelming { color: #8fd6c4; border-color: rgba(72, 160, 140, 0.55); background: rgba(40, 115, 100, 0.2); }
.odds-Favourable { color: #a8d9b0; border-color: rgba(110, 175, 125, 0.5); background: rgba(95, 160, 110, 0.14); }
.odds-Even { color: #b7c6d6; border-color: rgba(125, 150, 178, 0.5); background: rgba(110, 135, 165, 0.14); }
.odds-Risky { color: #e3c88f; border-color: rgba(196, 154, 69, 0.5); background: rgba(196, 154, 69, 0.13); }
.odds-Suicidal { color: #eaa8a1; border-color: rgba(205, 92, 82, 0.55); background: rgba(205, 92, 82, 0.15); }
.odds-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); text-align: left; }
.odds-row > span:first-child { font-family: var(--display); font-weight: 600; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.odds-row .odds { font-size: 15px; padding: 2px 10px; }
.odds-row p { flex: 1 1 100%; margin: 0; font-size: 12.5px; line-height: 1.4; }

/* the goal chip in the top bar */
#tb-goal { cursor: pointer; gap: 7px; }
#tb-goal:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.06); }
#tb-goal .meter { width: 52px; }
#tb-goal .meter i { background: var(--blue); }
#tb-goal small { color: var(--muted); font-size: 12px; }
@media (max-width: 1360px) { #tb-goal .meter, #tb-goal small { display: none; } }
@media (max-width: 1240px) { .brand { display: none; } .tension-chip .meter { width: 40px; } } /* the bar still fits at 1100 */

/* the goal panel */
#modal.goal .modal-box { max-width: 600px; display: flex; flex-direction: column; overflow: hidden; }
#modal.goal h2 { margin-bottom: 4px; }
.gp-mode { margin: 0 0 6px; font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.gp-text { margin: 0 0 8px; }
.gp-prog, .rp-prog { display: flex; align-items: center; gap: 10px; }
.gp-prog .meter, .rp-prog .meter { flex: 1; height: 7px; }
.gp-prog .meter i, .rp-prog .meter i { background: var(--blue); }
.gp-prog b { font-family: var(--display); font-size: 16px; min-width: 110px; text-align: right; }
.gp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.goal h4, .report h4 { margin: 14px 0 5px; display: flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.gp-time b { font-family: var(--display); font-size: 16px; }
.gp-time .meter { margin-top: 6px; }
.gp-mark { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12.5px; color: var(--muted); }
.gp-mark.done { color: #c9f5d4; }
.gp-mark em { margin-left: auto; font-style: normal; font-family: var(--display); font-size: 12px; }
.gp-subs { display: flex; flex-direction: column; gap: 4px; }
.gp-sub { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 70px; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; }
.gp-sub img { width: 30px; height: 20px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
.gp-sub em { font-style: normal; font-size: 11.5px; color: var(--muted); grid-column: 3; }
.gp-sub .meter { grid-column: 4; width: 70px; }
.gp-sub.gone { opacity: 0.55; }
.gp-now { margin-left: auto; font-size: 14px; letter-spacing: 0; color: #ecd9a6; }

/* charts */
.spark { display: block; width: 100%; height: auto; margin: 3px 0; border-bottom: 1px solid var(--line); }
.spark polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .a { stroke: none; }
.spark .ref { stroke: rgba(255, 255, 255, 0.3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark.land .l0 { stroke: var(--blue); }
.spark.land .a { fill: rgba(95, 168, 255, 0.14); }
.spark.land .dot { fill: var(--blue); }
.spark.force .l0 { stroke: #7fb6ee; }
.spark.force .l1 { stroke: var(--red); }
.spark.force .dot { fill: #7fb6ee; }
.spark.cash .l0 { stroke: var(--gold); }
.spark.cash .a { fill: rgba(214, 178, 94, 0.12); }
.spark.cash .dot { fill: var(--gold); }

/* the report card */
#modal.report .modal-box { max-width: 900px; text-align: left; display: flex; flex-direction: column; overflow: hidden; }
#modal.report h1 { font-size: 30px; margin: 0 0 4px; }
.rp-sub { margin: 0 0 12px; }
.rp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 6px; margin-right: -6px; }
.rp-body::-webkit-scrollbar { width: 5px; }
.rp-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
#modal.report .modal-actions { flex: none; justify-content: flex-end; }
#modal.goal .modal-actions { flex: none; }
.rp-goal { display: flex; flex-direction: column; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-left: 2px solid rgba(95, 168, 255, 0.6); border-radius: 4px; background: rgba(255, 255, 255, 0.025); }
.rp-goal > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-goal b { font-family: var(--display); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; }
.rp-goal > div > span:not(.chip-s) { flex: 1; font-size: 12.5px; color: #b9c3cc; }
.rp-prog em { min-width: 120px; text-align: right; font-style: normal; font-size: 12px; color: #c3ccd5; }
.chip-s.win { border-color: rgba(111, 207, 142, 0.5); color: #c9f5d4; background: rgba(95, 211, 122, 0.08); }
.chip-s.lost { border-color: rgba(229, 83, 75, 0.55); color: #ffb4ab; background: rgba(229, 83, 75, 0.1); }
.rp-score { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: start; margin: 12px 0; }
.rp-big { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); }
.rp-big label { font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rp-big b { font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; color: #ecd9a6; font-variant-numeric: tabular-nums; }
.rp-big span { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: #cfd6dd; }
.rp-big small { font-size: 11px; color: var(--muted); }
.rp-parts { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-parts td { padding: 3px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: #d3dae0; }
.rp-parts td.nt { color: var(--muted); font-size: 11.5px; }
.rp-parts td.pt { width: 52px; text-align: right; font-family: var(--display); font-weight: 700; font-size: 14px; color: #cfe3f7; font-variant-numeric: tabular-nums; }
.rp-parts td.neg { color: #ff9d95; }
.rp-parts tr.nil td { opacity: 0.5; }
.rp-graphs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rp-g { padding: 6px 8px 5px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.02); }
.rp-gh { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rp-gh b { font-size: 15px; font-weight: 700; letter-spacing: 0; color: #ecd9a6; }
.rp-gh i { font-style: normal; }
.rp-gh .k { color: #9ec7f5; }
.rp-gh .l { color: #ff9d95; }
.rp-gf { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); }
.rp-wars { width: 100%; border-collapse: collapse; font-size: 12px; }
.rp-wars th { text-align: left; padding: 3px 4px; font-family: var(--display); font-weight: 600; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line-2); }
.rp-wars td { padding: 4px; white-space: nowrap; color: #c8d0d8; border-bottom: 1px solid var(--line); }
.rp-wars td.wn { white-space: normal; color: #fff; font-weight: 600; }
.rp-wars tr.now td { background: rgba(255, 255, 255, 0.04); }
.rp-wars td.pos { color: #9fe7b4; }
.rp-wars td.neg { color: #ff9d95; }
.rp-more { margin-top: 4px; font-size: 11px; color: var(--dim); }
.rp-tot { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 4px; }
.rp-tot div { padding: 6px 8px; }
.rp-tot b { font-size: 16px; }

/* ───── units tab (shares the arsenal's drawer) ───── */
.arsenal-title { display: flex; gap: 14px; }
.arsenal-title .av { border: 0; background: transparent; padding: 2px 0 3px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--dim); border-bottom: 1px solid transparent; display: inline-flex; align-items: baseline; gap: 6px; }
.arsenal-title .av:hover { color: #fff; }
.arsenal-title .av.on { color: #dfe5ea; border-bottom-color: rgba(95, 168, 255, 0.7); }
.arsenal-title .av em { font-style: normal; font-family: var(--body); font-weight: 500; font-size: 11px; letter-spacing: 0; color: var(--muted); }
.arsenal-title .av em:empty { display: none; }
#arsenal.collapsed .arsenal-title { gap: 10px; }
.units-view { display: none; flex: 1; min-height: 0; flex-direction: column; padding: 0 8px 8px; gap: 5px; }
#arsenal.view-units .units-view { display: flex; }
#arsenal.view-units .tabs, #arsenal.view-units .hint, #arsenal.view-units .cards, #arsenal.view-units .arsenal-foot, #arsenal.collapsed .units-view { display: none; }
.uv-tools { display: flex; gap: 5px; padding-top: 4px; }
.uv-find { flex: 1; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.uv-find:focus-within { border-color: rgba(95, 168, 255, 0.55); }
.uv-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 12px var(--body); user-select: text; -webkit-user-select: text; }
.uv-find input::placeholder { color: var(--dim); }
.uv-sort { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); color: var(--muted); font: 600 10.5px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.uv-sort:hover { color: #fff; border-color: var(--line-2); }
.uv-sort span { white-space: nowrap; }
.uv-sum { font-size: 11px; color: var(--muted); padding: 0 2px; min-height: 14px; }
.uv-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.uv-list::-webkit-scrollbar { width: 5px; }
.uv-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
.uv-br { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 4px 2px; font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.uv-br span { letter-spacing: 0.04em; font-weight: 500; color: var(--muted); }
.uv-t, .uv-u { content-visibility: auto; position: relative; cursor: pointer; border: 1px solid transparent; border-radius: 4px; }
.uv-t { display: grid; grid-template-columns: 12px 32px minmax(0, 1fr) auto 52px 22px; grid-template-areas: "ch im nm cn bar lc" "ch im sm sm sm lc"; align-items: center; column-gap: 7px; padding: 3px 4px 3px 3px; contain-intrinsic-size: auto 38px; background: rgba(255, 255, 255, 0.025); }
.uv-t:hover, .uv-u:hover { background: rgba(255, 255, 255, 0.06); }
.uv-t.sel, .uv-u.sel { border-color: rgba(95, 168, 255, 0.6); background: rgba(95, 168, 255, 0.12); }
.uv-t.part { border-color: rgba(95, 168, 255, 0.3); }
.uv-t .chev { grid-area: ch; display: flex; color: var(--dim); transition: transform 0.12s; }
.uv-t .chev:hover { color: #fff; }
.uv-t.open .chev { transform: rotate(90deg); }
.uv-t img { grid-area: im; width: 32px; height: 28px; object-fit: contain; border-radius: 3px; background: radial-gradient(circle at 50% 40%, #3a4654, #1b222b); }
.uv-t .nm { grid-area: nm; font-size: 12.5px; font-weight: 600; color: #e6e9ec; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-t .cn { grid-area: cn; font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--muted); }
.uv-t .uv-bar { grid-area: bar; }
.uv-t .sm { grid-area: sm; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-t .sm.low, .uv-t .sm.dmg { color: #f1c94b; } .uv-t .sm.out { color: #ff9d95; }
.uv-bar { display: block; height: 4px; background: rgba(0, 0, 0, 0.6); border-radius: 2px; overflow: hidden; }
.uv-bar em { display: block; height: 100%; width: 0; }
.uv-t .loc, .uv-u .loc { grid-area: lc; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--dim); opacity: 0; }
.uv-t:hover .loc, .uv-u:hover .loc { opacity: 1; }
.uv-t .loc:hover, .uv-u .loc:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.uv-u { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 22px; grid-template-areas: "id dr st lc" "id l2 l2 lc"; align-items: center; column-gap: 7px; margin-left: 22px; padding: 2px 3px 2px 4px; contain-intrinsic-size: auto 34px; }
.uv-u .id { grid-area: id; font-family: var(--display); font-size: 12px; color: var(--dim); }
.uv-u .dr { grid-area: dr; font-size: 12px; color: #cfd6dd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uv-u .st { grid-area: st; font-size: 10.5px; font-family: var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.uv-u .st-engaged { color: #ff9d95; } .uv-u .st-moving, .uv-u .st-air { color: #9fc9ff; }
.uv-u .st-low, .uv-u .st-damaged { color: #f1c94b; } .uv-u .st-out { color: #ff9d95; font-weight: 700; }
.uv-u .l2 { grid-area: l2; display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--dim); min-width: 0; }
.uv-u .l2 .uv-bar { width: 40px; flex: none; }
.uv-u .l2 span { white-space: nowrap; }
.uv-u .l2 .pl { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.uv-more, .uv-empty { padding: 8px 6px; font-size: 11.5px; color: var(--dim); margin-left: 22px; }
.uv-empty { margin: 0; text-align: center; padding: 18px 8px; }

/* ───── targeting ───── */
.btn.tgt small { font-family: var(--display); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #9fc9ff; margin-left: 2px; }
.btn.tgt.on { border-color: rgba(95, 168, 255, 0.6); background: rgba(95, 168, 255, 0.12); }
.sel-info .prio { font-size: 11px; color: #9fc9ff; }
.tgt-menu { position: fixed; z-index: 40; width: 408px; max-width: calc(100vw - 16px); overflow-y: auto; padding: 9px 10px 8px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.tgt-menu.hidden { display: none; }
.tgt-menu h5 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-family: var(--display); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.tgt-menu h5 small { margin-left: auto; letter-spacing: 0.04em; text-transform: none; font-family: var(--body); font-size: 11px; color: var(--dim); }
.tgt-menu p { margin: 0 0 7px; font-size: 11px; line-height: 1.35; color: var(--dim); }
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tg-c { position: relative; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 3px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.03); color: var(--ink); text-align: left; }
.tg-c:hover { border-color: var(--line-2); background: rgba(255, 255, 255, 0.07); }
.tg-c img { width: 26px; height: 24px; object-fit: contain; flex: none; border-radius: 3px; background: radial-gradient(circle at 50% 40%, #3a4654, #1b222b); }
.tg-c span { flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; line-height: 1.1; overflow: hidden; }
.tg-c b { flex: none; min-width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; border-radius: 2px; font-family: var(--display); font-size: 11px; line-height: 1; }
.tg-c.pref { border-color: rgba(95, 168, 255, 0.65); background: rgba(95, 168, 255, 0.14); }
.tg-c.pref b { background: #5fa8ff; color: #07131f; }
.tg-c.ign { border-color: rgba(229, 83, 75, 0.45); background: rgba(229, 83, 75, 0.08); color: var(--muted); }
.tg-c.ign span { text-decoration: line-through; text-decoration-color: rgba(229, 83, 75, 0.7); }
.tg-c.ign b { color: #ff8f86; }
.tg-pre { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.tg-p, .tg-foot button { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--muted); font: 600 10.5px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.tg-p:hover:not([disabled]), .tg-foot button:hover:not([disabled]) { color: #fff; border-color: var(--line-2); background: rgba(255, 255, 255, 0.06); }
.tg-p[disabled], .tg-foot button[disabled] { opacity: 0.35; cursor: default; }
.tg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.tg-foot span { font-size: 11px; color: #9fc9ff; min-width: 0; }

/* Website-only styles (tools/build-web.mjs appends this to web/styles.css; the desktop app never sees it). */

/* "Get the desktop app" under the title menu and the footer line under it. Both only show with the main menu (they follow .title-foot,
   which the game hides on every other title screen). Dark glass like the rest of the title. */
.web-get { width: 340px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 11px 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(10, 14, 19, 0.62); text-align: center; }
.web-get-title { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-right: -0.3em; }
.web-get-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.web-dl { padding: 8px 4px; min-width: 0; font-size: 12px; gap: 5px; text-decoration: none; letter-spacing: 0.03em; }
.web-dl svg { flex: none; width: 14px; height: 14px; }
.web-dl.mine { background: rgba(111, 207, 142, 0.16); border-color: rgba(111, 207, 142, 0.55); color: #d8f6e1; }
.web-dl.mine:hover { background: rgba(111, 207, 142, 0.26); }
.web-get-meta { font-size: 12px; color: #b9c3cc; }
.web-get-help { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.web-get-off { display: none; }
.title-foot.hidden ~ .web-get, .title-foot.hidden ~ .web-foot { display: none; }
.web-foot { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: -10px; }
.web-foot a { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(141, 152, 163, 0.6); }
.web-foot a:hover { color: #dfe5ea; border-bottom-color: #dfe5ea; }
/* Shorter windows: the title already tightens up (styles.css max-height 760); the block slims down with it. */
@media (max-height: 800px) {
  .web-get { width: 340px; padding: 7px 10px 7px; gap: 5px; }
  .web-get-title { font-size: 11px; }
  .web-dl { padding: 5px 4px; }
  .web-get-help { font-size: 11px; }
  .web-foot { margin-top: -6px; }
}
@media (max-height: 640px) { .web-get-help { display: none; } }
