/* fonts served from here, not Google Fonts (players' IP addresses stay with us): assets/fonts, SIL OFL */
@font-face { font-family: 'Oxanium'; src: url('/assets/fonts/oxanium.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #0d1219;
  --bg2: #141c27;
  --panel: #18212e;
  --panel2: #1f2a39;
  --line: #2c3a4d;
  --ink: #ece4d1;
  --ink2: #a9b2bf;
  --dim: #6d7887;
  --accent: #e2b65a;
  --good: #6fcf73;
  --bad: #e86a5a;
  --energy: #4fc3f7;
  --fac: #4f86d8;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Oxanium', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); overflow: hidden; }
button { font: inherit; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); color: #1a1408; border-color: var(--accent); font-weight: 600; }
button.danger { border-color: #7a3a33; color: #f4b0a6; }
button.big { padding: 10px 22px; font-size: 16px; }
button.small { padding: 2px 8px; font-size: 12px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0 0 8px; letter-spacing: 0.02em; }
h3 { font-size: 13px; text-transform: uppercase; color: var(--ink2); margin-top: 14px; }
small { color: var(--dim); }
.hidden { display: none !important; }
.error { color: var(--bad); min-height: 1.2em; }
.hint { color: var(--dim); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.screen { position: fixed; inset: 0; }

/* ---------------------------------------------------------------- login & create */
#login, #create { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #1d2a3b 0%, var(--bg) 70%); }
.login-card { width: min(380px, 92vw); text-align: center; }
.logo { font-size: 44px; font-weight: 700; letter-spacing: 0.08em; line-height: 1; }
.logo span { display: block; color: var(--accent); font-size: 30px; letter-spacing: 0.4em; margin-top: 4px; }
.tag { color: var(--ink2); margin: 10px 0 24px; }
.auth-form { display: grid; gap: 10px; text-align: left; }
.auth-form.hidden { display: none; }
.auth-form h3 { margin: 0 0 4px; text-align: center; }
.auth-form p { margin: 0; }
.auth-form .hint { font-size: 12px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-top: 2px; }
.auth-links a:only-child { margin: 0 auto; }
#login a, .create-account a, .legal-links a { color: var(--accent); text-decoration: none; }
#login a:hover, .create-account a:hover, .legal-links a:hover { text-decoration: underline; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink2); line-height: 1.4; cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
#login-error { text-align: center; margin: 10px 0 0; }
.legal-links { font-size: 12px; color: var(--ink2); margin-top: 18px; }
.create-account { font-size: 12px; color: var(--ink2); margin-top: 14px; }
.modal-form { display: grid; gap: 8px; margin: 10px 0; }
.create-card { width: min(980px, 96vw); max-height: 94vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.create-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; }
.faction-pick { display: grid; gap: 8px; }
.faction-pick button { text-align: left; padding: 10px 12px; border-left: 6px solid var(--c); }
.faction-pick button.on { background: color-mix(in srgb, var(--c) 25%, var(--panel2)); border-color: var(--c); }
.faction-pick b { font-family: var(--display); font-size: 16px; }
.skin-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.skin-pick button { padding: 4px; height: 150px; display: grid; place-items: center; }
.skin-pick button.on { border-color: var(--accent); background: #2a2a22; }
.skin-pick canvas { max-width: 100%; max-height: 120px; }
#create-skins { grid-template-columns: repeat(7, 1fr); gap: 6px; }
#create-skins button { height: 124px; }
#create-skins canvas { max-height: 96px; }
#create-skins small { font-size: 10px; line-height: 1.1; }
.attr-list { display: grid; gap: 6px; }
.attr { display: grid; grid-template-columns: 110px 34px 1fr auto; gap: 8px; align-items: center; }
.attr b { font-family: var(--display); }
.attr .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.attr .bar { height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.attr .bar i { display: block; height: 100%; background: var(--accent); }
#create-go { margin-top: 14px; width: 100%; }

/* ---------------------------------------------------------------- world */
#world { display: grid; grid-template-columns: 132px 1fr; grid-template-rows: 54px 1fr; }
#topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 32px; padding: 0 20px; background: var(--bg2); border-bottom: 2px solid var(--fac); }
#tb-faction { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--fac); white-space: nowrap; }
#tb-hero { white-space: nowrap; display: flex; align-items: center; }
#tb-hero > * + * { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
#tb-hero .credits { color: var(--accent); font-weight: 600; }
#tb-hero .points { color: var(--good); }
#tb-war { flex: 1 1 auto; display: flex; gap: 22px; min-width: 240px; max-width: 760px; margin: 0 auto; }
#tb-war .wp { flex: 1; min-width: 0; font-size: 11px; color: var(--ink2); }
#tb-war .wp-h { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
#tb-war .wp-h span { overflow: hidden; text-overflow: ellipsis; }
#tb-war .wp-h b { font-weight: 600; color: var(--ink); }
#tb-war .wp-bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 3px; }
#tb-war .wp i { display: block; height: 100%; }
#tb-status { white-space: nowrap; display: flex; gap: 10px; align-items: center; margin-left: auto; }
#tb-status .joining { color: var(--accent); font-weight: 600; }
#menu { display: flex; flex-direction: column; gap: 6px; padding: 10px 8px; background: var(--bg2); border-right: 1px solid var(--line); }
#menu button { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 10px; text-align: left; }
#menu button b { font-family: var(--display); font-size: 15px; }
#menu button small { font-size: 11px; }
#menu button.on { border-color: var(--fac); background: color-mix(in srgb, var(--fac) 18%, var(--panel2)); }
#field-wrap { position: relative; overflow: hidden; background: #05080c; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
#f-mini { position: absolute; right: 12px; top: 12px; width: 260px; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: pointer; }
#f-hud { position: absolute; left: 12px; top: 12px; max-width: 340px; display: grid; gap: 4px; justify-items: start; padding: 8px 12px; background: #0d1219d8; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
#f-hud:empty { display: none; }
#f-hud .f-title { font-family: var(--display); font-size: 18px; font-weight: 700; }
#f-hud .f-battle { color: #ffb09a; font-weight: 600; }
/* the strategic map (F2): the map with its toggles and legend on the left, the province sidebar on the right */
#map-wrap { position: fixed; left: 132px; top: 54px; right: 0; bottom: 0; overflow: hidden; background: #0a1520; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr) 350px; }
body.in-battle #map-wrap { left: 0; top: 0; z-index: 20; }
#map-close { position: absolute; right: 12px; top: 10px; z-index: 6; }
#map-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#map-head { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; background: #0d1219; border-bottom: 1px solid var(--line); }
#map-head b { font: 700 14px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
#map-head small { color: var(--dim); }
#map { flex: 1; min-height: 0; width: 100%; cursor: grab; display: block; }
#map-bar { display: flex; gap: 10px; padding: 8px 10px; background: #0d1219; border-top: 1px solid var(--line); align-items: stretch; }
#map-bar h4, .map-show h4 { margin: 0 0 6px; font: 600 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.map-show, .map-legend { background: #121a25; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 8px; }
.map-legend { flex: 1; min-width: 0; }
.map-toggles { display: flex; flex-direction: column; gap: 5px; }
.map-toggle { display: flex; align-items: center; gap: 7px; padding: 4px 10px; font: 600 12px var(--display); letter-spacing: 0.04em; color: var(--dim); background: #0d1219; text-align: left; }
.map-toggle i { width: 10px; height: 10px; border-radius: 2px; opacity: 0.3; }
.map-toggle.on { color: var(--ink); border-color: #3c4d64; background: #1b2533; }
.map-toggle.on i { opacity: 1; box-shadow: 0 0 6px currentColor; }
.lg { display: flex; gap: 14px; flex-wrap: wrap; }
.lg-group { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; padding-right: 14px; border-right: 1px solid var(--line); }
.lg-group:last-child { border-right: none; }
.lg-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink2); cursor: help; }
.icon-cv { display: block; flex: none; }
#map-side { --c: var(--line); background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.ms-preview { padding: 44px 12px 8px; background: #0d1219; border-bottom: 1px solid var(--line); }
#map-preview { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; border: 1px solid #2c3a4d; border-top: 3px solid var(--c); background: #0a1520; }
.ms-title h2 { font-size: 19px; margin: 8px 0 0; }
.ms-title small { color: var(--ink2); }
.ms-tabs { display: flex; gap: 3px; padding: 8px 10px 0; background: #0d1219; border-bottom: 1px solid var(--line); }
.ms-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; font: 600 12px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); background: #121a25; border-radius: 6px 6px 0 0; border-bottom: none; }
.ms-tabs button.on { background: var(--panel); color: var(--good); border-color: #3c4d64; }
.ms-body { padding: 10px 12px; }
.ms-body h4 { margin: 12px 0 6px; font: 600 11px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); }
.ms-head { text-align: center; font: 600 13px var(--display); letter-spacing: 0.08em; color: var(--ink); margin-bottom: 8px; }
.ms-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 12.5px; }
.ms-dl dt { color: var(--ink2); }
.ms-dl dd { margin: 0; text-align: right; }
.ms-battle { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #121a25; border: 1px solid var(--line); font-size: 13px; }
.ms-battle .row { gap: 8px; margin-bottom: 6px; }
.ms-battle.open { border-color: #2e5f8f; } .ms-battle.closed { border-color: #7a3a33; } .ms-battle.full { border-color: #7a3a33; }
.ms-wbar { margin-bottom: 8px; font-size: 12.5px; }
.ms-wbar.mine b::after { content: ' (you)'; color: var(--dim); font-weight: 400; }
.ms-bar { height: 9px; margin: 3px 0 2px; border-radius: 4px; background: #3a1d1d; border: 1px solid #000; overflow: hidden; }
.ms-bar i { display: block; height: 100%; box-shadow: inset 0 3px 0 #ffffff30; }
.ms-users td, .ms-users th { font-size: 12.5px; }
.ms-orders { padding: 8px 12px 14px; border-top: 1px solid var(--line); background: linear-gradient(180deg, #161f2b, var(--panel)); }
#province-card .opts { display: grid; gap: 6px; margin-top: 8px; }
#province-card .opts button { text-align: left; display: flex; justify-content: space-between; }
#province-card .why { color: var(--accent); font-size: 12px; margin-top: 8px; }
.ms-mk { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ms-mk-row { display: flex; gap: 4px; margin: 4px 0 6px; flex-wrap: wrap; }
.mk-btn { padding: 3px; background: #0d1219; }
.ms-mk-here { gap: 6px; font-size: 12px; margin-top: 4px; }
@media (max-width: 1100px) { #map-wrap { grid-template-columns: minmax(0, 1fr) 300px; } .lg-group { border-right: none; } }

/* ---------------------------------------------------------------- panels */
#panel { position: fixed; left: 146px; top: 66px; right: 14px; bottom: 14px; max-width: 1180px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; z-index: 10; display: flex; flex-direction: column; box-shadow: 0 16px 50px #000a; }
.panel-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { flex: 1; margin: 0; font-size: 20px; }
body.in-battle #panel { left: 14px; top: 56px; bottom: 90px; z-index: 22; }
.panel-note { background: #3a2f12; border: 1px solid #7a6122; color: #f2dca0; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
#topbar .tokens { color: #d9e6f2; display: inline-flex; align-items: center; gap: 5px; }
.fx-ico { flex: none; display: inline-block; }
.fx-price { display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.shop-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.shop-head b { font-size: 20px; display: block; }
.shop-ico { display: inline-block; flex: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.shop-card { background: #0f161f; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.shop-card.on { border-color: #6fcf73; box-shadow: 0 0 0 1px #6fcf7355 inset; }
.shop-card h3 { margin: 0; }
.shop-card p { margin: 0; color: var(--ink2); font-size: 13px; flex: 1; }
.shop-top { display: flex; align-items: center; gap: 12px; }
.shop-state { font-size: 12px; color: var(--ink2); }
.shop-card.on .shop-state { color: #8fe393; }
.shop-buy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shop-buy button { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; }
.shop-buy small { font-size: 11px; opacity: .85; }
.sound-test { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 4px; }
#panel-close { background: none; border: none; font-size: 18px; color: var(--ink2); }
#panel-body { flex: 1; overflow: auto; padding: 16px; }
.cols { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: 100%; }
.cols > * { min-height: 0; overflow: auto; }
.card { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.factory-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* the conversion lines run down the columns */
.unit-card { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; cursor: pointer; }
.unit-card canvas { width: 74px; height: 74px; }
.unit-card.on { border-color: var(--accent); }
.unit-card .nm { font-family: var(--display); font-weight: 600; font-size: 15px; }
.unit-card .sub { color: var(--ink2); font-size: 12px; }
.unit-list { display: grid; gap: 4px; }
.unit-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.unit-row:hover { background: var(--panel2); }
.unit-row.on { border-color: var(--accent); background: var(--panel2); }
.unit-row canvas { width: 40px; height: 40px; }
.unit-row .hp { width: 46px; height: 4px; background: #000; border-radius: 2px; overflow: hidden; }
.unit-row .hp i { display: block; height: 100%; background: var(--good); }
.tagdiv { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 3px; background: var(--bg2); color: var(--ink2); }
.card.locked { opacity: 0.62; }
.card.locked .unit-card canvas { filter: grayscale(0.8); }
.hits { display: inline-flex; gap: 2px; margin: 0 4px; vertical-align: middle; }
.hits img { width: 16px; height: 16px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.stats dt { color: var(--ink2); }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 18px; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; font-size: 11px; }
.meter i { position: absolute; inset: 0 auto 0 0; background: #3b6b9a; }
.meter.over i { background: var(--bad); }
.meter span { position: relative; padding: 0 6px; line-height: 16px; }
.slots { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.slot label { color: var(--ink2); font-size: 12px; text-transform: uppercase; }
.slot select { width: 100%; }
.squad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.squad { min-height: 120px; }
.squad h4 { margin: 0 0 6px; font-family: var(--display); display: flex; justify-content: space-between; }
.squad.on { border-color: var(--accent); }
.squad .members { display: flex; flex-wrap: wrap; gap: 4px; }
.squad .members canvas { width: 38px; height: 38px; background: var(--bg2); border-radius: 4px; cursor: pointer; }
.div-row { display: grid; grid-template-columns: 110px 40px 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.xpbar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--accent); }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
table.list th { color: var(--ink2); font-weight: 500; font-size: 12px; text-transform: uppercase; }

/* ---------------------------------------------------------------- chat, toasts, modal */
#chat { position: fixed; left: 146px; bottom: 14px; width: 440px; z-index: 8; background: #0d1219e0; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
#chat.under-panel:not(.battle) { display: none; }
#chat.battle { left: 12px; bottom: 12px; width: 440px; background: #0d1219b8; }
#chat.battle #chat-log { height: 170px; }
#chat-tabs { display: flex; gap: 2px; padding: 4px 6px 0; }
#chat-tabs button { font-size: 11px; padding: 2px 8px; border-radius: 4px 4px 0 0; background: transparent; border: none; color: var(--dim); }
#chat-tabs button.on { color: var(--ink); background: var(--panel2); }
#chat-log { height: 140px; overflow-y: auto; padding: 6px 10px; font-size: 13px; }
#chat.collapsed #chat-log { height: 0; padding: 0 10px; }
#chat-log p { margin: 1px 0; overflow-wrap: anywhere; }
#chat-log .ch { color: var(--dim); font-size: 11px; margin-right: 4px; }
#chat-log .who { font-weight: 600; }
#chat-log .whisper { color: #d6a0f0; }
#chat-log .announce-line { color: #ffe08a; background: #e2b65a1c; padding: 2px 4px; border-left: 3px solid #e2b65a; }
.announce { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 60; min-width: 340px; max-width: 70vw; padding: 10px 18px; background: #1a1408f0; border: 2px solid #e2b65a; border-radius: 10px; color: #ffe9a8; font-size: 16px; font-weight: 600; text-align: center; box-shadow: 0 10px 30px #000a; }
.announce small { display: block; color: #e2b65a; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
#tb-hero .renown { color: var(--ink2); font-size: 12px; }
.elect-phases { display: flex; gap: 4px; margin: 6px 0; }
.elect-phases span { flex: 1; text-align: center; padding: 4px; border-radius: 4px; background: var(--panel2); color: var(--dim); font-size: 12px; }
.elect-phases span.on { background: var(--fac); color: #fff; font-weight: 600; }
.elect-clock { font-family: var(--display); font-size: 22px; }
.manifesto { white-space: pre-wrap; font-size: 12px; color: var(--ink2); margin: 4px 0; }
.req { font-size: 12px; } .req .ok { color: var(--good); } .req .no { color: var(--bad); }
.linkname { cursor: pointer; text-decoration: underline dotted; }
#chat-form { padding: 6px; }
#chat-input { width: 100%; font-size: 13px; padding: 5px 8px; }
#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 6px; justify-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ink2); padding: 8px 14px; border-radius: 6px; box-shadow: 0 6px 20px #0008; max-width: 640px; animation: toast-in 0.25s; }
.toast.error { border-left-color: var(--bad); }
.toast.alert { border-left-color: var(--bad); background: #3a1d1a; font-weight: 600; }
.toast.news { border-left-color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
#modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #0008; }
#modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(560px, 94vw); max-height: 90vh; overflow: auto; }

/* ---------------------------------------------------------------- battle */
#battle { background: #000; }
#bcanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#b-top { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: #0d1219d8; border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; }
#b-timer { font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 70px; text-align: center; }
#b-timer.locked { color: var(--accent); }
#b-stats { position: absolute; left: 12px; top: 12px; padding: 3px 8px; border-radius: 4px; background: #000b; color: #cfe; font: 600 11px/1.4 Inter, sans-serif; font-variant-numeric: tabular-nums; pointer-events: none; }
#b-pocs { display: flex; gap: 6px; }
#b-pocs .pip { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #555; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #000; }
#b-mode { color: var(--ink2); font-size: 12px; }
/* the Battle Commander line under the top bar, its flashing request indicator and the screening menu */
#b-cmd { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--ink2); white-space: nowrap; }
#b-cmd:empty { display: none; }
#b-cmd .bc-who { background: #0d1219d8; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; color: #ffd76a; }
#b-cmd .bc-portal { background: #0d1219d8; border-radius: 8px; padding: 3px 8px; }
#b-cmd button.on { border-color: var(--accent); color: var(--accent); }
#b-cmd .bc-flash { background: #ffd34d; color: #000; font-weight: 700; animation: bc-flash 0.8s steps(2) infinite; }
@keyframes bc-flash { 50% { background: #fff6c8; box-shadow: 0 0 14px #ffd34d; } }
#b-screen { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; background: #0d1219f0; border: 1px solid #ffd34d; border-radius: 10px; padding: 10px; display: grid; gap: 8px; z-index: 5; }
#b-screen .bc-h { display: flex; justify-content: space-between; align-items: center; }
#b-screen .bc-req { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 4px; }
#b-screen .bc-squad { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
#b-screen .bc-squad small { min-width: 52px; color: var(--ink2); }
#b-screen .row { display: flex; gap: 6px; }
#tb-status .waiting { animation: bc-flash 1.2s steps(2) infinite; color: #000; background: #ffd34d; padding: 2px 8px; border-radius: 6px; }
#b-mini { position: absolute; right: 12px; top: 12px; border: 1px solid var(--line); border-radius: 6px; background: #000; cursor: pointer; }
#b-sel { position: absolute; left: 464px; right: 260px; bottom: 12px; min-height: 60px; background: #0d1219d8; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; gap: 10px; align-items: center; }
#b-sel:empty { display: none; }
#b-sel .units { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
#b-sel .u { width: 54px; text-align: center; font-size: 10px; cursor: pointer; }
#b-sel .u canvas { width: 46px; height: 46px; }
#b-sel .u .bars i { display: block; height: 3px; margin-top: 1px; border-radius: 1px; }
#b-sel .abil { display: flex; gap: 4px; flex-wrap: wrap; max-width: 330px; }
#b-sel .abil button { font-size: 12px; padding: 4px 8px; position: relative; }
#b-sel .abil button .cd { position: absolute; inset: 0; background: #000a; border-radius: 6px; display: grid; place-items: center; }
#b-reinforce { position: absolute; right: 12px; top: 224px; width: 240px; background: #0d1219e8; border: 1px solid var(--accent); border-radius: 10px; padding: 10px; display: grid; gap: 6px; }
#b-reinforce .rf-t { font-size: 13px; }
#b-reinforce button { text-align: left; }
#b-actions { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 6px; width: 236px; grid-template-columns: 1fr 1fr 36px; }
#b-formation { position: absolute; right: 12px; bottom: 54px; color: var(--ink2); font-size: 12px; background: #0d1219c0; padding: 3px 8px; border-radius: 5px; }
#b-formation:empty { display: none; }
#b-help-box { position: absolute; right: 12px; top: 224px; width: 360px; background: #0d1219f0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13px; }
#b-help-box kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 11px; }

.away-note { margin-bottom: 12px; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel2)); }

/* the unit list (Squads, Factory, Lab): division tabs, chassis groups, squad badges */
.ub-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-bottom: 6px; }
.ub-tabs button { padding: 4px 2px; display: grid; justify-items: center; font-size: 11px; line-height: 1.25; }
.ub-tabs button small { font-size: 11px; }
.ub-tabs button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); }
.ub-free { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink2); margin: 2px 0 6px; cursor: pointer; }
.ub-group { display: flex; align-items: baseline; gap: 6px; padding: 6px 4px 3px; margin-top: 4px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
.ub-group b { font-family: var(--display); }
.ub-fold { width: 14px; color: var(--accent); font-weight: 700; }
.ub .unit-row { grid-template-columns: 40px 1fr auto auto; }
.ub-right { display: grid; justify-items: end; gap: 5px; }
.sq-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sq); color: #10151c; font-size: 12px; font-weight: 700; vertical-align: middle; }
.sq-badge.free { background: none; border: 1px dashed var(--line); }
.squad { border-top: 3px solid var(--sq); }
.squad .member { position: relative; display: inline-block; height: 38px; }
.squad .member i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--good); border-radius: 1px; }

/* Lab: saved loadouts */
.loadouts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; padding: 8px 12px; }
.loadouts input { width: 150px; padding: 4px 8px; }
.chip { display: inline-flex; }
.chip button:first-child { border-radius: 6px 0 0 6px; }
.chip button.x { border-radius: 0 6px 6px 0; border-left: none; color: var(--dim); padding: 2px 6px; }
.chip.on button { border-color: var(--accent); }
.chip.on button:first-child { background: color-mix(in srgb, var(--accent) 22%, var(--panel2)); }

/* Lab: the upgrade path (base chassis on top, its conversions below) and upgrade info */
.up-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.up-tree { --ln: #4f8fbf; display: grid; justify-items: center; margin: 4px 0 12px; }
.up-root { position: relative; }
.up-root.has-kids { padding-bottom: 18px; }
.up-root.has-kids::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 18px; border-left: 2px solid var(--ln); }
.up-kids { display: flex; justify-content: center; }
.up-branch { position: relative; padding: 18px 8px 0; }
.up-branch::before { content: ''; position: absolute; top: 0; left: 0; right: 0; border-top: 2px solid var(--ln); }
.up-branch:first-child::before { left: 50%; }
.up-branch:last-child::before { right: 50%; }
.up-branch::after { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--ln); }
.up-node { width: 140px; display: grid; justify-items: center; gap: 3px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); text-align: center; }
.up-node canvas { width: 72px; height: 72px; }
.up-node .nm { font-weight: 600; }
.up-node.current { border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.up-node.option { cursor: pointer; }
.up-node.option:hover, .up-node.sel { border-color: #4f8fbf; }
.up-node.sel { box-shadow: 0 0 12px #4f8fbf66; }
.up-node.past, .up-node.other { opacity: 0.55; }
.up-req .ok { color: var(--good); font-weight: 600; }
.up-req .no { color: var(--bad); font-weight: 600; }
.up-h { margin: 10px 0 4px; font-family: var(--display); }
.up-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; background: var(--bg2); border-radius: 6px; padding: 8px 10px; }
.up-info h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; color: var(--good); }
.up-info h4.loss { color: var(--bad); }
.mk-ladder { display: flex; gap: 3px; margin-bottom: 8px; }
.mk-ladder span { flex: 1; text-align: center; font-size: 12px; padding: 4px 0; border-radius: 4px; background: var(--bg2); color: var(--dim); border: 1px solid transparent; }
.mk-ladder .done { color: var(--ink2); background: color-mix(in srgb, var(--accent) 12%, var(--bg2)); }
.mk-ladder .cur { background: var(--accent); color: #1a1408; font-weight: 700; }
.mk-ladder .next { border: 1px dashed var(--accent); color: var(--ink); }

/* battle: the squads to bring in next, with what is in them */
#b-reinforce { width: 290px; max-height: calc(100vh - 380px); overflow: auto; }
#b-reinforce .rf-squad { display: grid; gap: 4px; }
.rf-h { font-weight: 600; }
.rf-units { display: flex; flex-wrap: wrap; gap: 2px; }
.rf-units span { position: relative; width: 30px; height: 30px; background: #0007; border-radius: 3px; }
.rf-units canvas { width: 30px; height: 30px; }
.rf-units i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--good); }
.squad[draggable=true] { cursor: grab; }
.squad.dragging { opacity: 0.4; }
.squad.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* scrollbars everywhere (panels, lists, chat): slim, no arrows, a rounded thumb in the panel line colour
   on a faint track; it brightens on hover and turns gold while dragged */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: color-mix(in srgb, var(--bg2) 70%, transparent); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: #3a4b63; border: 2px solid transparent; background-clip: padding-box; border-radius: 8px; min-height: 36px; }
::-webkit-scrollbar-thumb:hover { background-color: #536b8f; }
::-webkit-scrollbar-thumb:active { background-color: var(--accent); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #3a4b63 transparent; } }

/* Regiment panel: roster with ranks and labels, the rights table, side cards */
.reg-head h2 { margin: 0 0 2px; }
.reg-head { margin-bottom: 10px; }
.reg-notice { margin-bottom: 12px; border-left: 3px solid var(--accent); white-space: pre-wrap; }
.reg-notice b { display: block; font-size: 11px; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.reg-cols { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.reg-side { display: flex; flex-direction: column; gap: 10px; }
.reg-side .row input { flex: 1; min-width: 0; }
.reg-pending, .reg-requests { display: flex; flex-direction: column; gap: 6px; }
.reg-pending { margin-top: 10px; }
.reg-roster tr.me td, .reg-rights tr.me td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.reg-roster td:first-child { width: 110px; }
.reg-roster td:last-child { text-align: right; }
.reg-rights th { text-transform: none; font-size: 11px; text-align: center; }
.reg-rights th:first-child { text-align: left; }
.reg-rights td { text-align: center; }
.reg-rights td:first-child { text-align: left; }
.reg-rights input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.reg-rights .yes { color: var(--good); font-weight: 700; }
.rank { display: inline-block; min-width: 64px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; text-align: center; border: 1px solid currentColor; }
.rank.r-general { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rank.r-colonel { color: #e8925a; }
.rank.r-captain { color: #5aa9e2; }
.rank.r-sergeant { color: #6fcf73; }
.rank.r-private { color: var(--ink2); }
select.reg-rank { font-size: 12px; padding: 2px 4px; }
.reg-label { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #2c3b52; color: #cfe0f5; }
.reg-roster .reg-label { margin-left: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4a5568; margin-right: 7px; vertical-align: middle; }
.dot.on { background: var(--good); box-shadow: 0 0 6px var(--good); }
.reg-invites { margin-bottom: 12px; border-left: 3px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.reg-all summary { cursor: pointer; }
.reg-peek { padding: 6px 0 2px 4px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }

/* text boxes in panels grow downwards only, never out of their card */
#panel-body textarea { resize: vertical; width: 100%; max-width: 100%; min-height: 60px; max-height: 320px; box-sizing: border-box; }
.reg-side { min-width: 0; }
.reg-side .card { overflow: hidden; }

/* Profile (F4) and other commanders' profiles: Division, Political, Attributes, Accomplishments, Service */
.insig { display: inline-block; flex: none; line-height: 0; }
.insig svg { display: block; overflow: visible; }
.pf { display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 1.2fr) minmax(240px, 0.95fr); grid-template-areas: "div pol attr" "acc acc side"; gap: 12px; align-items: stretch; }
.pf.other { grid-template-columns: minmax(270px, 1fr) minmax(290px, 1.15fr); grid-template-areas: "div pol" "acc acc"; }
.pf-box { background: linear-gradient(180deg, #1c2736, #161f2b); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 12px; position: relative; min-width: 0; }
/* the gold line along the top: the top border of a strip with the box's own corners (masked to the border), so it follows the curve */
.pf-box::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 14px; border-top: 2px solid transparent; border-radius: 10px 10px 0 0; background: linear-gradient(90deg, var(--accent), transparent 70%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) border-box, linear-gradient(#000 0 0) padding-box; -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) border-box exclude, linear-gradient(#000 0 0) padding-box; opacity: 0.7; pointer-events: none; }
.pf-title { display: inline-block; margin: 0 0 10px -12px; padding: 7px 18px 6px 12px; font: 600 13px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); background: #0d1219; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 10px 0 10px 0; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.pf-div { grid-area: div; } .pf-pol { grid-area: pol; } .pf-attr { grid-area: attr; } .pf-acc { grid-area: acc; } .pf-side { grid-area: side; }
.pf-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.pf-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 4px; background: #0f151e; border: 1px solid var(--line); border-bottom: 2px solid transparent; border-radius: 6px 6px 2px 2px; }
.pf-tabs button b { font: 600 11px var(--display); letter-spacing: 0.08em; color: var(--ink2); }
.pf-tabs button small { font-size: 10px; color: var(--dim); }
.pf-tabs button.on { background: #1f2a39; border-bottom-color: var(--dc); }
.pf-tabs button.on b { color: var(--dc); }
.pf-divbody { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.pf-insig { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 10px 6px; border-radius: 10px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--dc) 22%, transparent), transparent 70%), repeating-linear-gradient(0deg, #ffffff06 0 2px, transparent 2px 5px); border: 1px solid color-mix(in srgb, var(--dc) 40%, var(--line)); }
.pf-insig small { font: 600 11px var(--display); letter-spacing: 0.1em; color: var(--dc); }
.pf-dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 13px; }
.pf-dl dt { color: var(--ink2); font: 600 11px var(--display); letter-spacing: 0.08em; text-transform: uppercase; align-self: center; }
.pf-dl dd { margin: 0; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.pf-div .xpbar { margin: 10px 0 8px; }
.pf-ladder { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; margin: 8px 0 6px; }
.pf-ladder span { text-align: center; font: 600 9px var(--display); padding: 2px 0; border-radius: 2px; background: #0f151e; color: var(--dim); border-bottom: 2px solid transparent; }
.pf-ladder span.done { color: var(--ink2); background: #1b2533; }
.pf-ladder span.cur { color: #0d1219; background: var(--accent); }
.pf-ladder span.pin { border-bottom-color: #b48a3a; }
.pf-who { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.pf-portrait { width: 132px; height: 132px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--fc) 30%, #1a2330), #0d1219 75%); border: 1px solid color-mix(in srgb, var(--fc) 45%, var(--line)); }
.pf-who label { display: block; font: 600 10px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.pf-name { font: 700 20px var(--display); color: var(--ink); overflow-wrap: anywhere; }
.pf-pol .pf-dl dd { text-align: left; }
.pf-points { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 10px; margin-bottom: 8px; background: #0f151e; border: 1px solid var(--line); border-radius: 6px; font: 600 12px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); }
.pf-points b { font-size: 18px; color: var(--good); }
.pf-attr-row { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto 4px; column-gap: 8px; align-items: center; padding: 6px 8px; margin-bottom: 6px; background: #121a25; border: 1px solid var(--line); border-radius: 6px; }
.pf-attr-row .nm { font: 600 13px var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.pf-attr-row .val { font: 700 18px var(--display); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.pf-attr-row .val.up { color: var(--good); }
.pf-attr-row .bar { grid-column: 1 / -1; height: 3px; margin-top: 4px; }
.pf-arrows { display: flex; flex-direction: column; gap: 1px; }
.pf-arrows button { padding: 0 5px; font-size: 8px; line-height: 12px; min-height: 0; }
.pf-acc-cols { display: grid; grid-template-columns: minmax(200px, 0.8fr) 1.4fr; gap: 12px; }
.pf-acc h4 { margin: 0 0 8px; font: 600 12px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); text-align: center; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.pf-hist, .pf-medals { background: #121a25; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.pf-honor { height: 8px; margin: 8px 0 4px; border-radius: 4px; background: #0d1219; border: 1px solid var(--line); overflow: hidden; }
.pf-honor i { display: block; height: 100%; background: linear-gradient(90deg, #a8322a, #e2b65a); }
.pf-medal-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 210px; overflow: auto; padding: 2px; }
.pf-medal { position: relative; display: grid; place-items: center; width: 54px; height: 62px; border-radius: 6px; background: #0f151e; border: 1px solid #263244; }
.pf-medal:hover { border-color: var(--accent); }
.pf-count { position: absolute; right: 2px; bottom: 1px; font: 700 11px var(--display); color: var(--accent); text-shadow: 0 1px 2px #000; }
.pf-how { margin-top: 8px; font-size: 12px; color: var(--ink2); }
.pf-how ul { margin: 6px 0 0; padding-left: 18px; }
.pf-how li { margin-bottom: 3px; }
#modal-box.wide { width: min(980px, 96vw); }
@media (max-width: 1100px) { .pf { grid-template-columns: 1fr 1fr; grid-template-areas: "div pol" "attr side" "acc acc"; } }
/* the medal pinning */
.medal-pin { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle, #000a, #000d); animation: mp-in 0.4s ease-out; cursor: pointer; }
.medal-pin.out { opacity: 0; transition: opacity 0.6s; }
.mp-card { text-align: center; padding: 26px 40px 20px; border-radius: 14px; background: linear-gradient(180deg, #1f2a39, #121a25); border: 1px solid var(--accent); box-shadow: 0 0 60px #e2b65a55; max-width: 460px; }
.mp-card small { font: 600 12px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.mp-card h2 { font: 700 24px var(--display); margin: 8px 0 4px; }
.mp-card p { color: var(--ink2); margin: 0; }
.mp-medal { margin: 14px auto 4px; width: max-content; animation: mp-drop 0.9s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 0 18px #e2b65a88); }
@keyframes mp-in { from { opacity: 0; } }
@keyframes mp-drop { from { transform: translateY(-120px) scale(1.6); opacity: 0; } 60% { opacity: 1; } }

.pf-attr-row .bar { background: var(--bg2); border-radius: 2px; overflow: hidden; }
.pf-attr-row .bar i { display: block; height: 100%; background: var(--accent); }
/* the quick map (F3): the world map in a panel, with the marker toggles */
.qm { display: flex; flex-direction: column; height: 100%; min-height: 420px; gap: 8px; }
.qm-top { display: flex; align-items: center; gap: 14px; }
.qm-top .map-toggles { flex-direction: row; }
.qm-wrap { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0a1520; }
.qm-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.qm-strip { display: flex; align-items: center; gap: 12px; min-height: 30px; font-size: 13px; }

/* Lab equipment: slots like drop-downs that open into a visual item list; gauges and stat tiles */
.ico { display: inline-block; flex: none; line-height: 0; vertical-align: -2px; }
.ico svg { display: block; }
.lab-equip { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.sockets { padding: 10px 12px; }
.sock-group h4 { margin: 8px 0 6px; font: 600 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); }
.sock-group:first-child h4 { margin-top: 0; }
.sock { display: grid; grid-template-columns: 40px minmax(110px, 1fr) auto 14px; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; margin-bottom: 5px; border-radius: 8px; background: #121a25; border: 1px solid var(--line); cursor: pointer; }
.sock:hover { border-color: #4a5d77; }
.sock.open { border-color: var(--accent); background: #1b2533; border-radius: 8px 8px 0 0; margin-bottom: 0; }
.sock.empty .sock-ico { color: var(--dim); border-style: dashed; }
.sock-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: radial-gradient(circle at 50% 35%, #2a374a, #121a25); border: 1px solid #2f3e54; }
.sock-main { display: flex; flex-direction: column; min-width: 0; }
.sock-main small { font: 600 10px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.sock-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sock-main .hits { margin-left: 0; }
.sock-chips, .opt-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sock-caret { color: var(--ink2); font-size: 11px; }
.ch { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 10px; font-size: 11.5px; background: #0d1219; border: 1px solid #263244; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ch i { font-style: normal; font-size: 8px; }
.ch.better { color: var(--good); border-color: #2f5a35; }
.ch.worse { color: var(--bad); border-color: #6a3530; }
.sock-wrap { margin-bottom: 5px; }
.picker { border: 1px solid var(--accent); border-top: none; border-radius: 0 0 8px 8px; background: #0f151e; max-height: 340px; overflow: auto; padding: 4px; }
.opt { display: grid; grid-template-columns: 34px minmax(130px, 1fr) auto 76px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: #1b2533; border-color: #3c4d64; }
.opt.on { background: #232f40; border-color: #4a5d77; }
.opt.locked { opacity: 0.45; cursor: not-allowed; }
.opt-ico { width: 32px; height: 32px; display: grid; place-items: center; color: var(--accent); border-radius: 6px; background: #161f2b; }
.opt.locked .opt-ico { color: var(--dim); }
.opt-main { min-width: 0; }
.opt-main small { display: block; color: var(--dim); font-size: 11px; line-height: 1.3; }
.opt .tl { margin-left: 6px; font: 600 10px var(--display); color: var(--dim); }
.opt .tl.no { color: var(--bad); }
.opt-cost { text-align: right; font-size: 12px; color: var(--accent); font-weight: 600; }
.opt-cost small { color: var(--dim); font-weight: 400; }
.opt-cost small.stash { color: var(--good); }
.apply-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.gauges { display: grid; gap: 7px; }
.gauge { display: grid; grid-template-columns: 18px 82px 1fr auto; gap: 6px; align-items: center; font-size: 12px; color: var(--ink2); }
.g-bar { height: 7px; border-radius: 4px; background: var(--bg2); overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--accent); }
.gauge.over { color: var(--bad); } .gauge.over .g-bar i { background: var(--bad); }
.g-v { font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile { position: relative; display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; background: #121a25; border: 1px solid var(--line); color: var(--ink2); }
.tile small { display: block; font-size: 10.5px; color: var(--dim); }
.tile b { color: var(--ink); font-size: 14px; display: flex; gap: 4px; }
.tile .dl { position: absolute; right: 6px; top: 4px; font-size: 10px; }
.tile.better { border-color: #2f5a35; } .tile.better .dl { color: var(--good); }
.tile.worse { border-color: #6a3530; } .tile.worse .dl { color: var(--bad); }
.lab-facts { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 2px; }
.lab-facts .ch b { color: var(--accent); font-family: var(--display); }
.up-line { display: flex; align-items: center; gap: 6px; }
@media (max-width: 1150px) { .lab-equip { grid-template-columns: 1fr; } }
body.map-open #chat:not(.battle) { bottom: calc(var(--map-bar-h, 140px) + 12px); }
body.map-open #chat:not(.battle) #chat-log { max-height: 130px; }
.medal-pin.compact { inset: 70px 0 auto 0; background: none; pointer-events: none; }
.medal-pin.compact .mp-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "m s" "m h" "m p"; column-gap: 14px; text-align: left; padding: 10px 18px; max-width: 420px; }
.medal-pin.compact .mp-medal { grid-area: m; margin: 0; }
.medal-pin.compact small { grid-area: s; } .medal-pin.compact h2 { grid-area: h; font-size: 17px; margin: 2px 0; } .medal-pin.compact p { grid-area: p; font-size: 12px; }
.sock-chips { flex-wrap: nowrap; }
.opt { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "i n c" "i h c"; row-gap: 3px; }
.opt-ico { grid-area: i; } .opt-main { grid-area: n; } .opt-chips { grid-area: h; justify-content: flex-start; } .opt-cost { grid-area: c; min-width: 64px; }
.opt .tl { white-space: nowrap; }
.opt.none { grid-template-areas: "i n c"; }

/* ---------------------------------------------------------------- the tutorial (client/js/tutorial.mjs) */
#tut { position: fixed; right: 14px; bottom: 14px; width: 370px; z-index: 30; background: #10161fef; border: 1px solid #ffd34d; border-radius: 10px; box-shadow: 0 10px 34px #000a; font-size: 13px; }
body.in-battle #tut { right: auto; bottom: auto; left: 12px; top: 12px; z-index: 21; }
#tut .tut-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); }
#tut .tut-head b { font-family: var(--display); font-size: 15px; color: #ffd34d; }
#tut .tut-fold { padding: 0 8px; line-height: 20px; }
#tut .tut-body { padding: 4px 12px 10px; display: grid; gap: 2px; }
#tut .tut-body p { margin: 6px 0; line-height: 1.45; }
#tut .tut-body > button.primary, #tut .tut-body .row { margin-top: 4px; }
#tut kbd, .tut-card kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 11px; }
#tut button.link { justify-self: end; background: none; border: none; color: var(--ink2); font-size: 11px; text-decoration: underline; padding: 2px 0; margin-top: 4px; cursor: pointer; }
.tut-ico { width: 18px; height: 18px; vertical-align: -4px; margin: 0 1px; }
.tut-card { margin-bottom: 12px; border-color: #ffd34d; background: color-mix(in srgb, #ffd34d 10%, var(--panel2)); line-height: 1.5; }
.tut-card > b:first-child { color: #ffd34d; }
.tut-glow { animation: tut-glow 1.2s ease-in-out infinite; }
@keyframes tut-glow { 50% { box-shadow: 0 0 0 3px #ffd34d, 0 0 18px #ffd34d88; } }
.train-card { margin-top: 10px; }
.train-card h3 { margin: 0 0 4px; }
.train-card.locked { opacity: .55; }
/* the Boost Pass; wars won in the top bar; a faction closed to new commanders */
.shop-card.pass { border-color: #c9a6ff88; }
.shop-buy small.save { color: #c9a6ff; font-weight: 700; }
.shop-buy button.primary small.save { color: #3d1f6e; }
#tb-war .wp-h small.wins { color: #e2c46a; font-size: 10px; font-weight: 600; margin-right: 3px; }
#create-factions button.locked { opacity: .5; cursor: not-allowed; }
#create-factions small.full { color: var(--bad); font-weight: 600; }
/* result screen: XP and credits as bars, the boosts' share in purple (greyed out: what a boost would have added) */
.gain { display: grid; grid-template-columns: 150px auto; align-items: center; gap: 8px; white-space: nowrap; }
.gain-bar { display: flex; height: 9px; border-radius: 5px; background: #ffffff10; overflow: hidden; }
.gain-bar i { display: block; height: 100%; }
.gain-bar.xp i.base { background: #5aa9e2; }
.gain-bar.cr i.base { background: #e2b65a; }
.gain-bar i.bonus { background: #c9a6ff; }
.gain-bar i.bonus.off { background: repeating-linear-gradient(135deg, #8a8f98 0 3px, #5b6068 3px 6px); opacity: .55; }
.gain small.bonus { color: #c9a6ff; font-weight: 700; }
.gain small.bonus.off { color: #7d828a; font-weight: 400; }
.gain-credits { display: grid; gap: 6px; margin: 12px 0 4px; }
.gain-credits .gain { grid-template-columns: 280px auto; }
.gain-credits .gain-bar { height: 12px; }
.gain-credits .boost-on { color: #c9a6ff; font-size: 13px; }
.gain-credits .boost-off { color: #7d828a; font-size: 13px; }
#modal-box.result { width: min(720px, 94vw); }
.list.result td { white-space: nowrap; }
/* the result screen: a row per division, click it for its units */
.res-divs { display: grid; gap: 6px; margin: 10px 0; }
.res-div { border: 1px solid var(--line); border-left: 3px solid var(--dc); border-radius: 8px; background: #ffffff06; }
.res-div.empty { opacity: .45; }
.res-sum { display: grid; grid-template-columns: 30px 1fr 230px 110px 70px 12px; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; list-style: none; white-space: nowrap; }
.res-div.empty .res-sum { cursor: default; grid-template-columns: 30px 1fr; }
.res-sum::-webkit-details-marker { display: none; }
.res-sum::after { content: '▸'; color: #8a93a0; transition: transform .15s; }
.res-div.empty .res-sum::after { content: none; }
details.res-div[open] > .res-sum::after { transform: rotate(90deg); }
.res-sum:hover { background: #ffffff08; }
.res-name { display: grid; min-width: 0; }
.res-name b { color: var(--dc); }
.res-name small { color: #9aa3ad; overflow: hidden; text-overflow: ellipsis; }
.res-sum .gain { grid-template-columns: 100px auto; }
.res-dxp { color: #c9d3de; font-size: 13px; }
.res-up { color: var(--good); }
.res-lv { color: #9aa3ad; }
.res-div > table.result { margin: 0 10px 8px; width: calc(100% - 20px); }

/* Fractium packs (Shop, F10) and purchases (Options > Account) */
.shop-packs { margin-bottom: 18px; }
.pack-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.pack { display: grid; gap: 4px; padding: 12px; text-align: left; }
.pack .price { font-family: var(--display); font-size: 18px; color: var(--accent); }
.shop-buy small.eur { color: var(--ink2); font-size: 11px; }
table.orders td, table.orders th { padding: 4px 8px; font-size: 13px; }
#modal-box a { color: var(--accent); }
table.orders td:nth-child(2) { white-space: nowrap; }
.pay-buttons { display: grid; gap: 8px; margin: 12px 0 4px; }
