/* 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%); }
/* the owner's battle painting behind the login card (assets/screens/login-bg.png, sent as WebP), darkened toward the middle so the form stays readable */
#login { background: radial-gradient(ellipse at 50% 50%, rgba(13, 18, 25, 0.55) 0%, rgba(13, 18, 25, 0.25) 60%, rgba(13, 18, 25, 0.6) 100%), url(assets/screens/login-bg.png) center / cover no-repeat, var(--bg); overflow-y: auto; }
#login .login-card { background: rgba(13, 18, 25, 0.82); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 26px 24px 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); margin: 16px 0; }
.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; }
#login.phone-link .auth-links { display: none; }   /* a mail link on a phone: nothing leads to the login (account.mjs phoneLink) */
.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; }
/* the owner's painting of the three factions (assets/screens/create-bg.png, sent as WebP): the card sits on its dark middle */
#create { background: radial-gradient(ellipse at 50% 50%, rgba(13, 18, 25, 0.35) 0%, rgba(13, 18, 25, 0.12) 60%, rgba(13, 18, 25, 0.5) 100%), url(assets/screens/create-bg.png) center / cover no-repeat, var(--bg); }
#create .create-card { background: rgba(21, 27, 36, 0.9); backdrop-filter: blur(4px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55); }
.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 button { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%), var(--panel2); }
.faction-pick button.on { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 34%, transparent), color-mix(in srgb, var(--c) 12%, transparent)), var(--panel2); }
.faction-pick b { font-family: var(--display); font-size: 16px; color: color-mix(in srgb, var(--c) 70%, #fff); }
.fp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fp-col { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 5px; border-radius: 999px; background: #0008; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 60%, #fff); }
.fp-col i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.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-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; }
#tb-status .founders { color: #f3d27a; border-color: #8a6a2a; background: #2a2010; font-weight: 600; letter-spacing: 0.04em; }
#menu { display: flex; flex-direction: column; gap: 6px; padding: 10px 8px 52px; background: var(--bg2); border-right: 1px solid var(--line); overflow-y: auto; }
#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; }
@media (max-height: 800px) { #menu { gap: 3px; padding: 6px 8px 52px; } #menu button { padding: 3px 10px; flex-shrink: 0; line-height: 1.15; } #menu button b { font-size: 14px; } #menu button small { font-size: 10px; } }   /* (fourteen buttons on a 720 px laptop screen, Report a bug under them) */
#menu button[data-panel="factory"], #menu button[data-panel="regiment"], #menu button[data-panel="profile"], #menu button[data-panel="polls"] { position: relative; }
#menu-repair { position: absolute; top: -7px; right: -5px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23201608' d='M21.7 6.3l-3.5 3.5-3-1-1-3 3.5-3.5a6 6 0 0 0-7.6 7.6L3 17a2.8 2.8 0 0 0 4 4l7.1-7.1a6 6 0 0 0 7.6-7.6z'/%3E%3C/svg%3E") center / 16px no-repeat; box-shadow: 0 0 8px var(--accent); animation: repair-pulse 1.6s ease-in-out infinite; }
#menu-reg { position: absolute; top: -7px; right: -5px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23201608' stroke-width='2.2' stroke-linejoin='round' d='M3 6h18v12H3z M3 6l9 7 9-7'/%3E%3C/svg%3E") center / 16px no-repeat; box-shadow: 0 0 8px var(--accent); animation: repair-pulse 1.6s ease-in-out infinite; }
#menu-points { position: absolute; top: -7px; right: -5px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23201608' d='M10 4h4v6h6v4h-6v6h-4v-6H4v-4h6z'/%3E%3C/svg%3E") center / 15px no-repeat; box-shadow: 0 0 8px var(--accent); animation: repair-pulse 1.6s ease-in-out infinite; }
@keyframes repair-pulse { 50% { transform: scale(1.12); box-shadow: 0 0 14px var(--accent); } }
#update-bar { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 10px; background: #10161fef; border: 1px solid var(--accent); box-shadow: 0 8px 24px #000a; font-size: 14px; }
.reg-seen { color: var(--ink2); white-space: nowrap; }
.reg-seen.on { color: #8fe393; }
.reg-seen.week { color: #e2b65a; }
.reg-seen.long { color: #ff8a70; font-weight: 600; }   /* three weeks or more: a candidate for a clear-out */
#menu button.tut-locked { opacity: 0.35; cursor: not-allowed; }   /* shut until the tutorial reaches it (tutorial.mjs) */
#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; }
/* the world map's two sizes share one tab (owner, 2026-12-01): ⤡ here for the quick map, the panel's ⤢ back to this */
#map-small { position: absolute; right: 52px; top: 10px; z-index: 6; }
html.app #map-small { display: none; }
#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; }
/* the facelift (owner, 2026-12-02: "we are wasting so much space left and right of the map"): the map gets the whole height,
   the legend and the filters float in a card on the left, the zoom buttons on the right; the map fits between them */
#map-stage { position: relative; flex: 1; min-height: 0; display: flex; }
#map-bar { position: absolute; left: 10px; top: 10px; width: 216px; max-height: calc(100% - 20px); display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 2; }
#map-bar > * { pointer-events: auto; }
#map-bar.closed .map-show, #map-bar.closed .map-legend { display: none; }
.map-key { margin-left: auto; align-self: center; flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px; font: 600 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink2); background: #0d1219e8; box-shadow: 0 4px 16px #0008; }
.map-key .mk-caret { width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid currentColor; border-bottom: none; transition: transform 0.15s; }
#map-wrap:has(#map-bar.closed) .map-key .mk-caret { transform: rotate(-90deg); }
#map-bar .lg-emblem { width: 20px; height: 20px; justify-self: center; }
#map-bar .map-show, #map-bar .map-legend { background: #0d1219e6; backdrop-filter: blur(6px); box-shadow: 0 4px 18px #0009; }
#map-bar .map-legend { min-height: 0; overflow: auto; padding: 8px 10px; }
#map-bar .lg { flex-direction: column; gap: 8px; }
#map-bar .lg-group { flex-direction: column; align-items: stretch; gap: 2px; padding: 0 0 8px; border-right: none; border-bottom: 1px solid var(--line); }
#map-bar .lg-group:last-child { border-bottom: none; padding-bottom: 0; }
#map-bar .lg-group h5 { margin: 0 0 3px; font: 600 10px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
#map-bar .lg-item { display: grid; grid-template-columns: 36px 1fr; gap: 6px; line-height: 1.25; }
#map-bar .lg-item > canvas { justify-self: center; }
#map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
#map-zoom button { width: 34px; height: 34px; padding: 0; font: 700 18px/1 var(--display); color: var(--ink); background: #0d1219e8; box-shadow: 0 4px 16px #0008; }
#map-zoom .mz-all { font-size: 16px; margin-top: 4px; }
html.app #map-zoom { display: none; }
#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-title .ms-tl { margin-left: 10px; font: 500 12px Inter, sans-serif; color: var(--ink2); white-space: nowrap; }
.ms-title .ms-tl .ms-clock { color: var(--ink); font-variant-numeric: tabular-nums; }
.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: 6px; padding: 11px 4px; font: 700 14px 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: 6px 12px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #161f2b, var(--panel)); }
.ms-orders.empty, .ms-extra.empty { display: none; }
.ms-extra { padding: 8px 12px 14px; border-top: 1px solid var(--line); }
.ms-extra > .row:first-child { margin-top: 2px; }
#province-card .opts { display: grid; gap: 6px; margin-top: 8px; }
#province-card .opts button { text-align: left; display: flex; justify-content: space-between; }
/* the way into a fight: big and glowing (owner, 2026-11-17: they need to be more prominent) */
#province-card .opts button.ms-go { padding: 13px 14px; font: 700 15px var(--display); letter-spacing: 0.04em; align-items: center; border-width: 2px; animation: ms-go-glow 1.8s ease-in-out infinite; }
#province-card .opts button.ms-go small { font: 600 13px var(--body, inherit); opacity: 0.9; }
#province-card .opts button.ms-go:disabled { animation: none; }
#province-card .opts button.ms-more { justify-content: center; padding: 3px 6px; background: none; border: none; color: var(--ink2); font-size: 12.5px; }
#province-card .opts button.ms-more:hover { color: var(--accent); }
#province-card .opts button.ms-alt { font-size: 13px; padding: 7px 12px; }
#province-card .opts button.ms-way { gap: 10px; white-space: nowrap; }
#province-card .opts button.ms-way span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#province-card .opts button.ms-way small { flex: none; }
@keyframes ms-go-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 182, 90, 0); } 50% { box-shadow: 0 0 14px 2px rgba(226, 182, 90, 0.45); } }
@media (prefers-reduced-motion: reduce) { #province-card .opts button.ms-go { animation: none; } }
#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: 1500px; 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: 96px; 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); }
/* full view (owner, 2026-11-27): a panel can fill the screen like the strategic map; remembered per panel (panels.mjs) */
#panel-full { background: none; border: none; font-size: 18px; color: var(--ink2); margin-right: 4px; }
#panel-full:hover, #panel-close:hover { color: var(--ink); }
#panel.full { left: 132px; top: 54px; right: 0; bottom: 0; max-width: none; border-radius: 0; }
body.in-battle #panel.full { left: 0; top: 0; right: 0; bottom: 0; }
html.app #panel-full { display: none; }
#panel-body { flex: 1; overflow: auto; padding: 16px; }
/* the patch notes: the page buttons stay in view while a long page scrolls */
.pn-head { position: sticky; top: calc(var(--tabs-h, 0px) - 16px); z-index: 1; margin: -16px -16px 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.pn-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pn-tabs button { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-weight: 600; border-bottom: 2px solid transparent; border-radius: 6px 6px 2px 2px; }
.pn-tabs button.on { border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); color: var(--ink); }
.pn-tabs .ev-live { background: var(--good, #5fd38a); }
.ev-list { display: grid; gap: 12px; }
.ev-card { padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.ev-card.live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ev-card.over { opacity: 0.55; }
.ev-card p { margin: 6px 0; line-height: 1.45; }
.ev-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ev-head h3 { margin: 0; font-family: var(--display); }
.ev-state { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--ink2); }
.ev-card.live .ev-state { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 700; }
.ev-rate { margin-left: auto; font: 700 15px var(--display); color: var(--accent); }
.ev-count b { font-variant-numeric: tabular-nums; color: var(--ink); }
.event-chip b { color: var(--accent); font-size: 13px; }
.event-chip.soon { opacity: 0.75; }
.event-on { color: var(--accent); }
.pn-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink2); font-size: 13px; }
.pn-title { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; font-family: var(--display); }
.pn-new { padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--bg); font: 700 11px var(--font); text-transform: uppercase; letter-spacing: 0.04em; }
.pn-list { margin: 6px 0; padding-left: 20px; }
.pn-list li { margin-bottom: 6px; line-height: 1.45; }
/* the language rail on the right of a patch page (owner, 2026-11-11): one button per language, more fit below */
.pn-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.pn-langs { position: sticky; top: calc(var(--tabs-h, 0px) + 96px); display: flex; flex-direction: column; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.pn-langs button { min-width: 52px; font-weight: 700; letter-spacing: 0.04em; }
.pn-langs button.on { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.pn-langs button.none { opacity: 0.45; }
/* Chinese text: system CJK fonts behind the game's Latin ones */
html[data-lang="zh"] { --font: 'Inter', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', 'Source Han Sans SC', system-ui, sans-serif; --display: 'Oxanium', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif; }
:lang(zh) { line-break: strict; }
#menu button small.pn-unread { color: var(--accent); font-weight: 700; }
.cols { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: 100%; }
.cols > * { min-height: 0; overflow: auto; }
/* A page whose columns scroll on their own (the Lab, the Factory, Squads): it fills the panel and the columns take what the notes above leave.
   On a short window the whole page scrolls as one again. */
@media (min-height: 560px) {
  #panel-body:has(> .cols-page) { display: flex; flex-direction: column; overflow: hidden; }
  .cols-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .cols-page > .cols { flex: 1; min-height: 0; height: auto; }
  .cols-page > .cols > * { padding-right: 4px; }
  /* the Lab's Stash tab: one card, no columns, so it scrolls itself (the panel doesn't here: owner, 2026-12-02 "why can't I
     scroll in the stash tab") */
  .cols-page > .stash-page { flex: 1; 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; }
/* The Factory's and Squads' cards: as many columns as the space beside the unit list holds (a container query on
   .cards-col). Three Factory columns keep each conversion line in one column; fewer stack them. */
.cards-col { container-type: inline-size; }
/* (not in full view: as specific as #panel.full and later, this kept those panels at 1500px there: owner, 2026-11-28) */
#panel:not(.full):has(.cards-col), #panel:not(.full):has(.lab-equip) { max-width: 1500px; }
/* F3 (owner, 2026-11-27): a window in the top right of at most about a third of the screen, the whole map in a square
   that fits it on any screen (--qm: its side), the war points above it */
#panel:has(.qm) { --qm: min(34vw, calc(100vh - 360px)); left: auto; right: 14px; bottom: auto; width: calc(var(--qm) + 34px); max-width: none; }
body.in-battle #panel:has(.qm) { top: 96px; --qm: min(34vw, calc(100vh - 410px)); }
@media (max-width: 1450px) { .lab-equip { grid-template-columns: minmax(0, 1fr) 330px !important; } }
/* (the Factory, Squads and Lab take a big screen's width) */
.factory-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 860px) { .factory-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 540px) { .factory-cards { grid-template-columns: minmax(0, 1fr); } }
.unit-card { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; cursor: pointer; }
.unit-card :is(canvas, .uicon) { 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 :is(canvas, .uicon) { 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 :is(canvas, .uicon) { filter: grayscale(0.8); }
.hits { display: inline-flex; gap: 2px; margin: 0 4px; vertical-align: middle; }
.hits img { width: 22px; height: 22px; }
.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%; }
/* two squads a row, filling the column's height (owner, 2026-11-17: was four, eight on wide screens) */
.squad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.squads-col { display: flex; flex-direction: column; }
.squads-col > .squad-grid { flex: 1 0 auto; grid-auto-rows: minmax(120px, 1fr); }
@container (max-width: 340px) { .squad-grid { grid-template-columns: minmax(0, 1fr); } }
.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(--sq, var(--accent)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sq, var(--accent)) 55%, transparent) inset; }   /* (its own squad colour: Ellimister, 2026-11-30, squad 1 gold looked selected) */
.squad .members { display: flex; flex-wrap: wrap; gap: 4px; }
.squad .members :is(canvas, .uicon) { width: 54px; height: 54px; 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 5px; white-space: nowrap; 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 !important; padding: 0 10px; }   /* (over a size the player dragged it to) */
/* moved and resized by the player (chat.mjs boxHandles): the tab row is the handle, a grip in each corner */
#chat-tabs { cursor: move; user-select: none; touch-action: none; }
#chat-tabs button { cursor: pointer; }
#chat.moving, #chat.moving * { user-select: none; }
.chat-corner { position: absolute; width: 14px; height: 14px; z-index: 2; touch-action: none; }
.chat-corner.nw { left: -3px; top: -3px; cursor: nwse-resize; } .chat-corner.ne { right: -3px; top: -3px; cursor: nesw-resize; }
.chat-corner.sw { left: -3px; bottom: -3px; cursor: nesw-resize; } .chat-corner.se { right: -3px; bottom: -3px; cursor: nwse-resize; }
.chat-corner::after { content: ''; position: absolute; inset: 3px; border: 0 solid var(--ink2); opacity: 0; transition: opacity 0.15s; }
#chat:hover .chat-corner::after { opacity: 0.55; }
.chat-corner.nw::after { border-width: 2px 0 0 2px; border-top-left-radius: 8px; } .chat-corner.ne::after { border-width: 2px 2px 0 0; border-top-right-radius: 8px; }
.chat-corner.sw::after { border-width: 0 0 2px 2px; border-bottom-left-radius: 8px; } .chat-corner.se::after { border-width: 0 2px 2px 0; border-bottom-right-radius: 8px; }
/* names answer a click (whisper) and a right-click (profile); @Name picked out, a line calling me lit up */
#chat-log .who.clickable { cursor: pointer; }
#chat-log .who.clickable:hover { text-decoration: underline; }
#chat-log .mention { color: #8fc8ff; font-weight: 600; }
#chat-log .mention.me { color: #ffd65a; }
#chat-log p.mention-me { background: #e2b65a26; border-left: 3px solid #e2b65a; padding: 1px 4px; border-radius: 2px; }
#chat.pinged { animation: chat-ping 1.6s ease-out; }
@keyframes chat-ping { 0%, 30% { border-color: #e2b65a; box-shadow: 0 0 0 2px #e2b65a88; } 100% { border-color: var(--line); box-shadow: none; } }
.online-list.below { bottom: auto; top: calc(100% + 6px); }
#chat-log p { margin: 1px 0; overflow-wrap: anywhere; }
/* guest mode (owner, 2026-11-27) */
.auth-guest { display: grid; gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.auth-guest small { color: var(--ink2); font-size: 12px; }
.guest-faction { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--c); border-left: 4px solid var(--c); border-radius: 10px; background: #0f161f; }
.guest-faction b { color: var(--c); font-size: 16px; }
.pledge-form { display: grid; gap: 8px; margin: 10px 0; }
.pledge-factions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pledge-factions button { display: grid; gap: 2px; border-color: var(--c); }
.pledge-factions button.on { background: color-mix(in srgb, var(--c) 30%, transparent); }
.pledge-factions button b { color: var(--c); }
.pf-name .pf-rename { margin-left: 8px; vertical-align: middle; }
.pledge-err { color: var(--bad); min-height: 1em; margin: 0; }
#restart-clock { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 60; pointer-events: auto; padding: 4px 14px; border-radius: 6px;
  background: #3a1d12e6; border: 1px solid #e2795a; color: #ffd8c8; font: 600 13px var(--display); letter-spacing: 0.05em; white-space: nowrap; }   /* (main.mjs restartClock) */
#chat-log p.chat-mark { color: var(--ink2); font-style: italic; text-align: center; margin: 4px 0; }   /* a battle started or ended (chat.mjs mark) */
#chat-log .ch { color: var(--dim); font-size: 11px; margin-right: 4px; }
#chat-log .ts { color: var(--dim); font-size: 10px; margin-right: 5px; font-variant-numeric: tabular-nums; opacity: 0.8; }
#chat-log .who { font-weight: 600; }
#chat-log .whisper { color: #d6a0f0; }
#chat-log .tr-mark { color: var(--dim); font-size: 10px; margin-right: 4px; cursor: pointer; opacity: 0.75; }
#chat-log .tr-mark:hover { opacity: 1; color: var(--text, #fff); }
#chat-log .tr-mark.orig { color: #e0b050; opacity: 1; }
#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; }
#notices { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 200; display: grid; gap: 10px; width: min(560px, calc(100vw - 32px)); }
.notice { padding: 14px 20px 16px; background: #10161ff5; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 12px 36px #000c; text-align: center; }
.notice small { display: block; color: var(--accent); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.notice p { margin: 8px 0 12px; font-size: 17px; font-weight: 600; color: #f1e8d4; white-space: pre-wrap; overflow-wrap: anywhere; }
.announce small { display: block; color: #e2b65a; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.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-tabs .online-btn { color: var(--ink2); }
.online-list { position: absolute; right: 0; bottom: calc(100% + 6px); width: 240px; max-height: 320px; overflow-y: auto; padding: 6px; background: #0d1219f2; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.ol-head { padding: 2px 6px 6px; color: var(--dim); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.ol-head .ol-all { margin-left: auto; padding: 1px 7px; font-size: 11px; border-radius: 4px; }
.ol-row { padding: 3px 6px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.ol-row:hover { background: var(--panel2); }
.ol-row.me { color: var(--dim); cursor: default; }
.ol-hint { display: block; padding: 4px 6px; color: var(--dim); font-size: 11px; }
.ctx-menu { position: fixed; z-index: 300; display: grid; min-width: 160px; padding: 4px; background: #10161ff5; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px #000a; }
.ctx-menu button { padding: 5px 10px; border: none; border-radius: 4px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.ctx-menu button:hover { background: var(--panel2); }
#chat-input { width: 100%; font-size: 13px; padding: 5px 8px; }
#bug-btn { position: fixed; left: 8px; bottom: 10px; width: 116px; z-index: 23; padding: 7px 6px; font-family: var(--display); font-weight: 600; color: #ffc9a8; background: #3a1c12; border-color: #d9734a; }
#bug-btn:hover:not(:disabled) { background: #54281a; border-color: #ff9a6e; }
#b-actions #bug-btn { position: static; width: 36px; height: 34px; padding: 0; display: inline-grid; place-items: center; }   /* in battle: a bug icon on the second line top left (2026-11-24) */
.gift-box { display: grid; gap: 4px; max-width: 480px; }
.gift-box b { color: var(--accent); }
.bug-box { display: grid; gap: 8px; width: min(520px, 100%); }
.bug-box textarea { width: 100%; resize: vertical; font: inherit; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
body:has(#restart-clock) #toasts { top: 92px; }   /* (below the restart clock while it shows) */
#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: 4px 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); }
/* (under the Retreat / Swap squad row, not over it: Manson, 2026-11-21; the arrivals move down for it) */
#b-stats { position: absolute; left: 12px; top: 94px; 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: 7px; }
#b-pocs .pip { min-width: 34px; height: 34px; padding: 0 4px; box-sizing: border-box; border-radius: 17px; cursor: pointer; border: 2px solid #555; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 0 3px #000, 0 0 1px #000; }
#b-pocs .pip.taking { border-width: 3px; }
#b-mode { color: var(--ink2); font-size: 12px; }
#b-mode.two { display: grid; text-align: center; line-height: 1.2; white-space: nowrap; }
#b-mode .sep { margin-left: 4px; }
/* Victory battles: both sides' points beside the timer (yours first) */
/* Possession Score battles (owner's mockup, 2026-11-29): the two flags beside the top bar, and under it a bar that tapers to
   both ends, each side filling outward from the label in the middle by its score (battle.mjs showPs). #b-ps covers the
   top bar's own box, so all of it moves and shrinks with the bar (fitTop, ui-fit). */
#b-top { --ps-flag: 58px; --ps-gap: 14px; }
#b-ps { position: absolute; inset: 0; pointer-events: none; }
#b-ps.hidden { display: none; }
#b-ps .ps-flag { position: absolute; top: 50%; width: var(--ps-flag); height: 36px; transform: translateY(-50%); display: grid; place-items: center; border: 1px solid #000; border-radius: 3px; box-shadow: inset 0 0 0 1px #ffffff2e, inset 0 -10px 14px #0000003a, 0 2px 6px #0009; }
#b-ps .ps-flag.l { right: calc(100% + var(--ps-gap)); }
#b-ps .ps-flag.r { left: calc(100% + var(--ps-gap)); }
#b-ps .ps-flag img { width: 30px; height: 30px; filter: drop-shadow(0 1px 1px #0008); }
#b-ps .ps-bar { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); width: calc(100% + 2 * (var(--ps-flag) + var(--ps-gap))); display: flex; align-items: flex-start; pointer-events: none; }   /* (clicks go through to the map: a player's report, 2026-11-29; only the label explains on hover) */
#b-ps .ps-side { position: relative; flex: 1; height: 28px; background: #000; }
#b-ps .ps-side.l { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 56%); }
#b-ps .ps-side.r { clip-path: polygon(0 0, 100% 0, 100% 56%, 0 100%); }
#b-ps .ps-track { position: absolute; inset: 2px 2px 2px 2px; background: #7c8188; overflow: hidden; }
#b-ps .ps-side.l .ps-track { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 52%); right: 0; }
#b-ps .ps-side.r .ps-track { clip-path: polygon(0 0, 100% 0, 100% 52%, 0 100%); left: 0; }
#b-ps .ps-fill { position: absolute; top: 0; bottom: 0; width: 0; transition: width 0.6s ease-out; }
#b-ps .ps-side.l .ps-fill { right: 0; }
#b-ps .ps-side.r .ps-fill { left: 0; }
#b-ps .ps-label { flex: 0 0 auto; width: 86px; height: 28px; margin: 0 -1px; z-index: 1; pointer-events: auto; cursor: help; display: grid; place-items: center; text-align: center; padding: 0 4px; font: 600 11px/1.15 var(--display); color: var(--ink); background: #0d1219; border: 1px solid #000; outline: 1px solid var(--line); outline-offset: -2px; }
#b-ps .ps-n { position: absolute; top: 2px; font: 700 18px/24px var(--display); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
#b-ps .ps-n.l { right: calc(50% + 49px); }
#b-ps .ps-n.r { left: calc(50% + 49px); }
#b-ps .ps-gain { position: absolute; top: calc(100% + 4px); font: 700 13px/16px var(--display); color: #8ff09a; text-shadow: 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; animation: ps-gain 3s ease-out forwards; }
#b-ps .ps-gain.l { right: calc(50% + 49px); }
#b-ps .ps-gain.r { left: calc(50% + 49px); }
@keyframes ps-gain { 0% { opacity: 0; transform: translateY(-6px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px); } }
/* the Battle Commander line under the top bar, its flashing request indicator and the screening menu */
/* (at the bottom middle, over the selected units and moving up with them, --b-sel-h: the notices keep the top; Boondoggle,
   2026-11-18, the buttons sat under them) */
#b-cmd { position: absolute; bottom: calc(var(--b-sel-h, 0px) + 18px); left: 50%; z-index: 4; 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; bottom: calc(var(--b-sel-h, 0px) + 54px); 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; }
/* the Registry (registry.mjs) */
.rg-tools { flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.rg-online { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.rg-search { flex: 1 1 220px; max-width: 340px; }
.rg-count { color: var(--dim); }
.rg-wrap { overflow-x: auto; }
/* the facelift (owner, 2026-11-20): a bay with the 32 px grid, rows as dark strips with their faction's colour at the left */
.rg-bay { margin-top: 12px; min-height: max(480px, calc(100vh - 250px)); padding: 14px 16px 44px; }
html.app .rg-bay { min-height: 0; }
.rg-stats { margin: 4px 0 6px; }
.rg-bay .rg-lead { margin: 2px 0 10px; }
.rg-table { border-collapse: separate; border-spacing: 0 3px; }
.rg-table th { cursor: pointer; white-space: nowrap; user-select: none; font: 600 11px var(--display); letter-spacing: 0.12em; border-bottom: 1px solid var(--line); padding: 6px 10px; }
.rg-table th:hover, .rg-table th.on { color: var(--ink); }
.rg-table th.num, .rg-table td.num { text-align: right; }
.rg-table td { white-space: nowrap; border-bottom: 0; padding: 7px 10px; background: color-mix(in srgb, #0b1017 72%, transparent); font-variant-numeric: tabular-nums; }
.rg-table td:first-child { border-left: 3px solid var(--rc, transparent); border-radius: 6px 0 0 6px; }
.rg-table td:last-child { border-radius: 0 6px 6px 0; }
.rg-table tr:hover td { background: color-mix(in srgb, var(--fac) 10%, #0b1017d0); }
.rg-table tr.me td { background: color-mix(in srgb, var(--fac) 24%, #0b1017d0); }
.rg-table tr.me td:first-child { box-shadow: inset 2px 0 0 var(--fac); }
.rg-arrow { font-style: normal; font-size: 10px; }
.rg-pct { color: var(--dim); }
.rg-fac { display: inline-flex; align-items: center; gap: 6px; }
.rg-fac::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--fc); flex: none; }
.rg-honour th { cursor: default; }
.rg-place { color: var(--ink2); font-weight: 700; width: 2.5em; }
.rg-pod { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 700 13px var(--display); color: #0d1219; }
.rg-pod.p1 { background: radial-gradient(circle at 35% 30%, #fff1b8, #e2b65a 55%, #8a6a2a); box-shadow: 0 0 10px #e2b65a70; }
.rg-pod.p2 { background: radial-gradient(circle at 35% 30%, #ffffff, #c4ccd6 55%, #6d7682); }
.rg-pod.p3 { background: radial-gradient(circle at 35% 30%, #ffd9b0, #c07a43 55%, #6e3f1c); }
/* the Factions tab's cards */
.rg-facs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.rg-faccard { position: relative; overflow: hidden; padding: 0 14px 12px; border: 1px solid color-mix(in srgb, var(--fc) 45%, var(--line)); border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--fc) 24%, #0b1017d8), #0b1017e0 55%); }
.rg-faccard.me { box-shadow: 0 0 0 1px var(--fc), 0 0 18px color-mix(in srgb, var(--fc) 35%, transparent); }
.rg-faccard h4 { display: flex; align-items: baseline; gap: 8px; margin: 0 -14px 12px; padding: 11px 14px 9px; font: 700 16px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); border-bottom: 2px solid var(--fc); }
.rg-yours { margin-left: auto; font: 600 10px var(--display); letter-spacing: 0.1em; color: var(--fc); }
.rg-facnums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rg-facnums div { text-align: center; padding: 7px 2px 6px; background: #0b101799; border: 1px solid var(--line); border-radius: 6px; }
.rg-facnums b { display: block; font: 700 20px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.rg-facnums small { font: 600 10px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); }
.rg-facnums .rg-marshal { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); min-width: 0; }
.rg-facnums .rg-marshal b { font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.rg-facnums .rg-marshal small { color: var(--accent); }
.rg-warhead { margin: 14px 0 8px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--fc) 40%, var(--line)); font: 600 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fc); }
.rg-facnums.rg-war div { background: color-mix(in srgb, var(--fc) 8%, #0b1017b0); }
.rg-facnums .rg-named { min-width: 0; }
.rg-facnums .rg-named b { font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.rg-facnums .rg-named i { display: block; font: 600 10px var(--display); font-style: normal; color: var(--dim); }
.rg-cards { margin-top: 14px; gap: 8px; flex-wrap: wrap; }
/* the Wardrobe (wardrobe.mjs): two bays, cards to wear */
.wd { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.wd-bay { min-height: 420px; padding-bottom: 44px; }
.wd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.wd-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, #0b1017 72%, transparent); }
.wd-card:hover:not(:disabled) { border-color: color-mix(in srgb, var(--fac) 60%, var(--line)); }
.wd-card.on { border-color: var(--fac); background: color-mix(in srgb, var(--fac) 18%, #0b1017d0); box-shadow: 0 0 12px color-mix(in srgb, var(--fac) 35%, transparent); }
.wd-card b { font: 700 13px var(--display); letter-spacing: 0.04em; color: var(--ink); text-align: center; }
.wd-card small { color: var(--dim); font-size: 11px; }
.wd-card canvas { max-width: 100%; }
.wd-card.locked { opacity: 0.55; cursor: not-allowed; }
.wd-worn { position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 4px; font: 600 10px var(--display); font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: #0d1219; background: var(--fac); }
.wd-lock { position: absolute; top: 6px; right: 8px; font-style: normal; }
.wd-noart { display: grid; place-items: center; width: 150px; height: 110px; border: 1px dashed var(--line); border-radius: 6px; color: var(--dim); }
.wd-noart span { font-size: 34px; line-height: 1; }
.wd-noart.wd-foot { border-style: solid; border-color: transparent; }
.wd-foot img { height: 104px; image-rendering: pixelated; }
.wd-status { margin: 8px 0 0; padding: 7px 10px; border-radius: 6px; background: #0b101799; border: 1px solid var(--line); color: var(--ink2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wd-status.on { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.wd-cap { display: block; margin-top: 12px; color: var(--ink2); }
@media (max-width: 760px) { .wd { grid-template-columns: 1fr; } }
/* a timed war's time left (main.mjs renderTop; worldmap.mjs) */
.ms-ends { margin: 6px 0 2px; color: var(--accent); font-weight: 600; }

/* a war's numbers (warcard.mjs): a framed card per faction, arrows between them */
#modal-box.warcard { width: min(620px, 96vw); padding: 14px; background: #0a0e14; }
.wc-card { position: relative; padding: 26px 30px 20px; border-radius: 10px; text-align: center; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--fc) 55%, #3a3226); outline: 1px solid color-mix(in srgb, var(--fc) 25%, transparent); outline-offset: -8px;
  background: linear-gradient(#ffffff08 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, #ffffff08 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--fc) 34%, #1a1f27), #0b1017 75%); }
.wc-card.won { box-shadow: inset 0 0 40px color-mix(in srgb, #e2b65a 22%, transparent); }
.wc-corner { position: absolute; width: 22px; height: 22px; border: 2px solid color-mix(in srgb, var(--fc) 70%, #e2b65a); }
.wc-corner.tl { left: 12px; top: 12px; border-right: 0; border-bottom: 0; } .wc-corner.tr { right: 12px; top: 12px; border-left: 0; border-bottom: 0; }
.wc-corner.bl { left: 12px; bottom: 12px; border-right: 0; border-top: 0; } .wc-corner.br { right: 12px; bottom: 12px; border-left: 0; border-top: 0; }
.wc-page { position: absolute; right: 42px; top: 18px; padding: 2px 9px; border-radius: 10px; background: #000a; font: 600 12px var(--display); color: var(--ink2); }
.wc-crest { font: 700 13px var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--fc); }
.wc-title { margin-top: 4px; font: 700 34px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.wc-sub { font: 600 14px var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink2); }
.wc-sub::before, .wc-sub::after { content: ''; display: inline-block; width: 46px; height: 1px; margin: 0 10px; vertical-align: middle; background: color-mix(in srgb, var(--fc) 60%, transparent); }
.wc-placed { margin-top: 10px; font: 600 14px var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink2); }
.wc-placed span { margin-left: 8px; }
.wc-placed b { font: 700 30px var(--display); letter-spacing: 0.04em; vertical-align: -3px; }
.wc-placed b.p1 { color: #ffe08a; text-shadow: 0 0 12px #e2b65a90; } .wc-placed b.p2 { color: #dfe6ee; } .wc-placed b.p3 { color: #d99a63; }
.wc-won { display: block; width: max-content; margin-left: auto; margin-right: auto; margin-top: 10px; padding: 3px 14px; border-radius: 4px; font: 700 12px var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: #1a1406; background: linear-gradient(90deg, #a77a26, #ffe08a, #a77a26); }
.wc-big { display: grid; gap: 10px; margin: 16px 0 12px; }
.wc-big div { padding: 8px 10px 6px; border: 1px solid color-mix(in srgb, var(--fc) 35%, var(--line)); border-radius: 6px; background: #05080cb8; }
.wc-big b { display: block; font: 700 40px/1.05 var(--display); color: #f2ead8; font-variant-numeric: tabular-nums; }
.wc-big span, .wc-grid span, .wc-people > div > span { font: 600 11px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in srgb, var(--fc) 55%, #cfe3f0); }
.wc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wc-grid div, .wc-people div { padding: 7px 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #05080c99; min-width: 0; }
.wc-grid b { display: block; font: 700 20px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.wc-grid span { font-size: 9px; letter-spacing: 0.08em; }
.wc-people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.wc-people b { display: block; margin: 2px 0; font: 700 17px var(--display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-people small { color: var(--dim); font-size: 11px; }
.wc-foot { margin-top: 14px; font: italic 600 15px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); }
.wc-foot::before { content: '▸ '; color: var(--fc); font-style: normal; }
.wc-nav { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.wc-nav .wc-dot { width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--fc) 30%, #0b1017); border: 1px solid var(--fc); }
.wc-nav .wc-dot.on { background: var(--fc); box-shadow: 0 0 8px var(--fc); }
@media (max-width: 520px) { .wc-card { padding: 22px 16px 16px; } .wc-big b { font-size: 30px; } .wc-title { font-size: 26px; } }
.rg-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.rg-stats button.on { border-color: var(--fac); color: var(--ink); background: color-mix(in srgb, var(--fac) 22%, var(--panel)); }
.rg-me { margin-top: 8px; font-weight: 600; }
#b-sel { position: absolute; left: 464px; right: 260px; bottom: 12px; min-height: 60px; max-height: 40vh; overflow: hidden; 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: 0 0 calc(var(--sel-cols, 8) * var(--sel-card, 66px)); min-width: 0; align-content: flex-start; }   /* (whole cards: battle.mjs renderSel) */
#b-sel .u { width: 54px; text-align: center; font-size: 10px; cursor: pointer; padding: 2px; border: 2px solid transparent; border-radius: 6px; }
#b-sel .u.on { border-color: #ffd34d; background: #ffd34d1a; }
/* the mine counter (battle.mjs renderSel; owner, 2026-11-21): pips on each mine layer's card, a chip with the total */
#b-sel .mpips { display: flex; justify-content: center; gap: 2px; margin-top: 2px; flex-wrap: wrap; }
#b-sel .mpips i { width: 5px; height: 5px; border-radius: 1px; transform: rotate(45deg); background: #2a3442; border: 1px solid #4a5668; }
#b-sel .mpips i.on { background: #e8b84a; border-color: #ffd98a; }
.mine-count { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #0b1017; white-space: nowrap; }
.mine-count .mc-ico { color: #e8b84a; font-size: 13px; line-height: 1; }
.mine-count b { font: 700 16px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.mine-count small { font: 600 10px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.mine-count.full { border-color: #e8a13a; } .mine-count.full small, .mine-count.full b { color: #ffc56a; }
.mine-count.flash { animation: mc-flash 0.9s ease-out; }
@keyframes mc-flash { 0% { background: #6a4a10; box-shadow: 0 0 14px #ffc56a; } 100% { background: #0b1017; box-shadow: none; } }
#b-sel .u { position: relative; }
#b-sel .u .ukey { position: absolute; right: 1px; top: 1px; padding: 0 3px; font: 700 11px/14px var(--display); color: #fff; background: #000b; border-radius: 3px; pointer-events: none; }
#b-sel .u .grp { position: absolute; left: 1px; top: 1px; padding: 0 3px; font: 700 11px/14px var(--display); color: #ffd34d; background: #000b; border-radius: 3px; pointer-events: none; }
#b-sel .u :is(canvas, .uicon) { width: 46px; height: 46px; }
/* a cloaked unit (its own cloak or a cloak field): see-through, a pale dashed frame and a tag (owner, 2026-11-20) */
#b-sel .u.cloaked :is(canvas, .uicon) { opacity: 0.38; filter: saturate(0.4) brightness(1.25); }
#b-sel .u.cloaked:not(.on) { border-style: dashed; border-color: #9fd8ff77; }
#b-sel .u .ucloak { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); padding: 0 3px; font: 700 9px/12px var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: #bfe8ff; background: #000a; border-radius: 3px; pointer-events: none; }
#b-sel .u .bars i { display: block; height: 3px; margin-top: 1px; border-radius: 1px; }
/* a selected Porter's riders: click one to unload just that unit (2026-11-16) */
#b-sel .riders { display: flex; align-items: center; gap: 4px; padding: 0 8px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
#b-sel .riders > small { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 10px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted, #9aa); }
#b-sel .u.rider { border-color: #ffffff22; }
#b-sel .u.rider:hover { border-color: #ffd34d; background: #ffd34d14; }
#b-sel .abil { flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, min-content); grid-auto-columns: max-content; gap: 4px; max-width: 55%; overflow-x: auto; align-content: center; }   /* (at most three rows, more go sideways: Blunky 2026-11-24, many abilities grew it up the screen) */
#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; }
/* (the reinforcements and the controls start under the minimap; Report a bug is in the top-left row in battle since 2026-11-23) */
#b-reinforce { position: absolute; right: 12px; top: 222px; 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; left: 12px; top: 12px; display: grid; gap: 6px; justify-items: start; }
#b-actions .b-row { display: flex; gap: 6px; }
#b-help { width: 36px; }
/* fullscreen (js/main.mjs): in the top bar, beside the battle's "?", in the corner of the login and enlist screens */
.fs-btn { width: 36px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.fs-btn svg { width: 18px; height: 18px; }
.fs-corner { position: absolute; top: 14px; right: 14px; z-index: 2; }
/* the Formation button (bottom right) and its pad, which slides up laid out like the keys */
#b-formation { position: absolute; right: 12px; bottom: 12px; width: 236px; z-index: 6; }
/* the order buttons over it (Manson, 2026-12-02: "controls on the bottom right similar to RTS games") */
#b-cmds { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px; }
#b-cmds button { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12px; text-align: left; }
#b-cmds button small { margin-left: auto; font: 700 10px var(--display); color: var(--ink2); }
#b-cmds button.on { border-color: #ffd34d; color: #ffd34d; }
#fm-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; font-size: 12px; }
#fm-btn .fm-i { color: #ffd34d; display: grid; }
#fm-btn small { margin-left: auto; color: var(--ink2); transition: transform 0.15s; }
#b-formation.open #fm-btn small { transform: rotate(180deg); }
#fm-pad { position: absolute; right: 0; bottom: calc(100% + 6px); width: 100%; box-sizing: border-box; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px; background: #0d1219f0; border: 1px solid var(--line); border-radius: 10px;
  opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s; }
#b-formation.open #fm-pad { opacity: 1; visibility: visible; transform: none; }
#fm-pad .fm-c { position: relative; display: grid; justify-items: center; gap: 1px; padding: 5px 2px 4px; font-size: 10px; color: #cfe3ff; }
#fm-pad .fm-c b { position: absolute; left: 5px; top: 2px; font: 700 10px var(--display); color: var(--ink2); }
#fm-pad .fm-off { grid-column: 1 / -1; font-size: 11px; }
#fm-pad .on { border-color: #ffd34d; background: #ffd34d1f; color: #ffd34d; }
#b-help-box { position: absolute; right: 12px; top: 222px; width: 360px; max-height: calc(100vh - 290px); overflow: auto; background: #0d1219f0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13px; }
#b-help-box .hb-close { float: right; width: 28px; height: 28px; margin: -6px -6px 0 8px; padding: 0; font-size: 18px; line-height: 1; }
#b-help-box kbd { background: var(--panel2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 11px; }
/* the scoreboard: held Tab in battle (battle.mjs scoreTables), and on the result screen */
#b-score { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); width: min(1400px, calc(100vw - 32px)); max-height: calc(100vh - 230px); overflow: auto;
  background: #0d1219f2; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; z-index: 30; pointer-events: none; }
.sb-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-family: var(--display); font-size: 16px; }
.sb-head small { color: var(--dim); font-family: var(--font); font-size: 11px; }
.sb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: start; }   /* a column per side, yours on the left */
.sb-side { border-left: 3px solid var(--sc); padding-left: 8px; min-width: 0; }
.sb-side h4 { margin: 2px 0 4px; color: var(--sc); font-size: 13px; }
.sb-side h4 small { color: var(--dim); font-weight: normal; }
table.sb { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
table.sb th { color: var(--dim); font-weight: 600; text-align: right; padding: 2px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.sb td { text-align: right; padding: 2px 6px; white-space: nowrap; }
table.sb th:first-child, table.sb td:first-child { text-align: left; width: 99%; white-space: normal; }
table.sb td:first-child small { color: var(--dim); }
table.sb tr.me td { background: #e2b65a1f; color: var(--accent); }
table.sb tr.gone td { opacity: 0.45; }
table.sb .sb-bot { color: var(--ink2); font-style: italic; }
/* players, then bots under their own heading (owner, 2026-11-20) */
table.sb tr.sb-group td { padding: 7px 6px 3px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
table.sb tr.sb-group.players td { color: #d6c48a; }
table.sb tr.sb-group.bots td { color: #9fb3c8; padding-top: 10px; }
table.sb tr.sb-botrow td { opacity: 0.6; }
table.sb tr.sb-botrow td:first-child { font-style: italic; }
.sb-result { margin: 8px 0 12px; }
#modal-box.result.board { width: min(1400px, 96vw); }   /* the result screen's scoreboard: both sides side by side */
.res-tab.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); }
.sb-hls { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sb-hl { flex: 1 1 96px; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--line); border-top: 3px solid var(--sc); border-radius: 6px; padding: 5px 8px; background: #ffffff06; min-width: 0; }
.sb-hl small { color: var(--dim); font-size: 11px; }
.sb-hl > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* one line each: title, name, number */
.sb-hl span { color: var(--ink2); font-size: 12px; }
@media (max-width: 1100px) { .sb-sides { grid-template-columns: 1fr; } }   /* too narrow for two: one above the other */
@media (max-width: 640px) { table.sb { font-size: 11px; } table.sb th, table.sb td { padding: 2px 3px; } }

.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 */
/* the division tabs and the filter, fixed at the top of the scrolling column (Squads, Factory, Lab) */
.ub-head { position: sticky; top: -12px; z-index: 3; background: var(--panel); padding-top: 2px; box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.6); }
.card .ub-head { background: var(--panel2); }
.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: 54px; }
.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 :is(canvas, .uicon) { 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 - 330px); 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 :is(canvas, .uicon) { width: 30px; height: 30px; }
.rf-units i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--good); }
.rf-next { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--accent); border-radius: 8px; background: #0005; }
.rf-next .row { gap: 6px; }
.rf-slot { display: block; border: 1px dashed #fff3; box-sizing: border-box; background: none !important; }
.rf-pick { cursor: pointer; }
.rf-pick:hover { outline: 1px solid var(--accent); }
.rf-group { display: grid; gap: 2px; }
.rf-gh { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.rf-gh button { padding: 1px 8px; }
.next-card { margin-bottom: 10px; cursor: pointer; }
.next-card.on { border-color: var(--accent); }
.next-card h4 { display: flex; justify-content: space-between; margin: 0 0 8px; }
.next-card .hint { display: block; margin-top: 6px; }
.next-card .members { display: flex; flex-wrap: wrap; gap: 4px; }
.next-card .members :is(canvas, .uicon) { width: 38px; height: 38px; background: var(--bg2); border-radius: 4px; }
.next-card .member { position: relative; display: inline-block; height: 38px; }
.next-card .member.empty { width: 38px; border: 1px dashed #fff3; border-radius: 4px; box-sizing: border-box; }
.ub-group .ub-fill { margin-left: auto; padding: 1px 8px; }
.unit-row.lost { opacity: 0.4; }
/* benched: over what the commander's attributes allow (after a reset), sits out until the points are back */
.unit-row.benched > .icon, .unit-row.benched canvas { opacity: 0.5; }
.bench-why { color: var(--bad); font-size: 11px; line-height: 1.3; }
.bench-note { margin-top: 8px; padding: 6px 10px; border: 1px solid var(--bad); border-radius: 4px; color: var(--bad); font-size: 13px; }
.member.benched { outline: 1px solid var(--bad); outline-offset: -1px; }
.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" "rec rec rec" "notes notes notes"; gap: 12px; align-items: stretch; }
/* recent battles (owner, 2026-11-19): a W / L / D per battle, newest first; click: its scoreboard, other names hidden */
.pf-rec { grid-area: rec; }
.pf-notes { grid-area: notes; }   /* (Profile > Notes: your own only, panels.mjs notesBox) */
.pf-notes-text { width: 100%; height: 180px; min-height: 90px; resize: vertical; box-sizing: border-box; font: inherit; line-height: 1.45; padding: 8px 10px; }
.pf-rec-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 6px; }
.pf-wl { width: 30px; height: 30px; padding: 0; border-radius: 6px; font: 700 14px var(--display); border: 1px solid; cursor: pointer; }
.pf-wl.W { color: #bff0c1; background: #1f4a2a; border-color: #4f9e5c; }
.pf-wl.L { color: #ffc9c0; background: #4d1f1c; border-color: #a5483f; }
.pf-wl.D { color: #d9dde3; background: #2a3039; border-color: #5d6673; }
.pf-wl.left { opacity: 0.6; border-style: dashed; }
.pf-wl:hover { filter: brightness(1.25); }
.sb-redacted { color: var(--ink2); font-style: italic; letter-spacing: 0.04em; }
.pf-board h3 { margin: 0 0 4px; }
.pf.other { grid-template-columns: minmax(270px, 1fr) minmax(290px, 1.15fr); grid-template-areas: "div pol" "acc acc" "rec rec"; }
.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: grid; gap: 10px; max-height: 250px; overflow: auto; padding: 2px; }
.pf-medal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.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); }
/* a medal (not a division pin): taller, a gold rim and glow */
.pf-medal.big { width: 66px; height: 80px; border-color: #7a6232; background: radial-gradient(circle at 50% 42%, #3a2e14 0%, #17130b 62%, #0f151e 100%); box-shadow: 0 0 10px #e2b65a40, inset 0 0 0 1px #e2b65a30; }
.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); }
/* the reincarnation (panels.mjs reincarnateEls): the button and a short line, the rewards as tiles (the one you'd get now lit) */
.rc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 6px; }
.rc-head button { margin-top: 0 !important; }
.rc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rc-tile { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 3px; text-align: center; background: #0f151e; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.rc-tile .rc-ico { color: var(--dim); font-size: 13px; line-height: 1.1; }
.rc-tile b { font: 700 12px var(--display); color: var(--ink2); }
.rc-tile small { font-size: 10px; color: var(--dim); line-height: 1.2; }
.rc-tile.on { border-color: #b48a3a; background: linear-gradient(180deg, #2a2210, #0f151e); }
.rc-tile.on .rc-ico, .rc-tile.on b { color: #ffe08a; }
.rc-now { display: block; margin: 5px 0 2px; color: #ffe08a; font-weight: 600; }
/* the bonus-level bank under the reincarnation button (panels.mjs bankEl) */
.pf-bank { margin: 4px 0 10px; padding: 8px 10px; background: #0f151e; border: 1px solid var(--line); border-radius: 6px; }
.pf-bank-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 12px; color: var(--ink2); }
.pf-bank-row b { font: 700 15px var(--display); color: #ffe08a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-bank-row.sub { margin-top: 6px; } .pf-bank-row.sub b { font-size: 12px; color: #8fd0ff; }
.pf-bank-bar { height: 8px; margin: 4px 0 2px; border-radius: 4px; background: #0b1017; border: 1px solid var(--line); overflow: hidden; }
.pf-bank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a77a26, #ffe08a); }
.pf-bank-bar.thin { height: 4px; } .pf-bank-bar.thin i { background: linear-gradient(90deg, #3a6a8a, #8fd0ff); }
.pf-bank .hint { display: block; margin-top: 6px; }
.pf-bank-title { font: 600 11px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.pf-bank-total { margin-top: 6px; } .pf-bank-total b { color: #ffe08a; font-size: 12px; } .pf-bank-total small { color: var(--dim); }
.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: 1000px) { .cols { grid-template-columns: 280px minmax(0, 1fr) !important; } }
@media (max-width: 1100px) { .pf { grid-template-columns: 1fr 1fr; grid-template-areas: "div pol" "attr side" "acc acc" "rec rec" "notes notes"; } }
/* 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; gap: 8px; }
.qm-war { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qm-war .wp-h { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.qm-war .wp-bar { height: 5px; border-radius: 3px; background: #ffffff14; overflow: hidden; }
.qm-war .wp-bar i { display: block; height: 100%; }
.qm-top { display: flex; align-items: center; gap: 14px; }
.qm-top .map-toggles { flex-direction: row; }
.qm-wrap { width: var(--qm, 400px); height: var(--qm, 400px); 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) 410px; gap: 14px; align-items: start; }
/* the unit on the bench, its slots around it */
.lab-stage { --wire: color-mix(in srgb, var(--accent) 65%, transparent); position: relative; display: grid; grid-template-columns: 112px 1fr 112px; min-height: 480px; padding: 14px 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 55%, color-mix(in srgb, var(--fac) 30%, #16202d), #0b1017 74%); }
.lab-stage::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#ffffff0a 1px, transparent 1px), linear-gradient(90deg, #ffffff0a 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.lab-stage-name { position: absolute; left: 0; right: 0; top: 10px; text-align: center; font: 700 24px var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: #ffffff1c; pointer-events: none; }
.lab-portrait { position: absolute; left: 50%; top: 52%; width: min(58%, 400px); transform: translate(-50%, -50%); filter: drop-shadow(0 14px 18px #000b); animation: lab-float 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes lab-float { 50% { transform: translate(-50%, calc(-50% - 7px)); } }
.lab-stage.applied .lab-portrait { animation: lab-applied 0.7s ease-out; }
@keyframes lab-applied { 0% { transform: translate(-50%, -50%) scale(1); filter: brightness(1); } 30% { transform: translate(-50%, -50%) scale(1.06); filter: brightness(1.9) drop-shadow(0 0 24px var(--accent)); } 100% { transform: translate(-50%, -50%) scale(1); filter: brightness(1) drop-shadow(0 14px 18px #000b); } }
.lab-col { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.lab-slot { position: relative; width: 104px; cursor: pointer; text-align: center; transition: transform 0.12s; }
.lab-slot:hover { transform: translateY(-2px); }
.lab-slot-tile { width: 76px; height: 76px; margin: 0 auto 3px; display: grid; place-items: center; border-radius: 10px; color: var(--dim); background: linear-gradient(#1f2c3d, #0f1620); border: 1px solid #4a5d77; box-shadow: inset 0 0 14px #000a; transition: transform 0.12s, box-shadow 0.12s; }
.lab-slot:hover .lab-slot-tile { box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 14px #000a; }
.lab-slot.filled .lab-slot-tile { border-color: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 14px #000a; }
.lab-slot.empty .lab-slot-tile { border-style: dashed; background: #0c121ab0; }
.lab-slot.open .lab-slot-tile { outline: 2px solid var(--accent); outline-offset: 2px; }
.lab-slot.can-drop .lab-slot-tile { border-color: var(--good); }
.lab-slot.drop .lab-slot-tile { outline: 2px solid var(--good); outline-offset: 2px; transform: scale(1.1); }
.lab-slot.snap .lab-slot-tile { animation: lab-snap 0.35s ease-out; }
@keyframes lab-snap { 0% { transform: scale(1.4); filter: brightness(2.2); } 60% { transform: scale(0.93); } 100% { transform: none; filter: none; } }
.lab-slot small { display: block; font: 600 9.5px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-slot b { display: block; font-size: 11.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-col.left .lab-slot::after, .lab-col.right .lab-slot::after { content: ''; position: absolute; top: 38px; width: 40px; height: 1.5px; pointer-events: none; }
.lab-col.left .lab-slot::after { left: calc(50% + 39px); background: linear-gradient(90deg, var(--wire), transparent); }
.lab-col.right .lab-slot::after { right: calc(50% + 39px); background: linear-gradient(270deg, var(--wire), transparent); }
.lab-slot.empty::after { opacity: 0.3; }
.item-pic { position: relative; display: inline-block; flex: none; }
.item-pic img { width: 100%; height: 100%; display: block; image-rendering: pixelated; filter: drop-shadow(0 2px 2px #0009); }
.item-h { position: absolute; right: -3px; bottom: -3px; padding: 0 3px; border-radius: 3px; font: 700 10px/13px var(--display); font-style: normal; color: #201608; background: var(--accent); }
#v-cursor { position: fixed; left: 0; top: 0; z-index: 100000; display: none; pointer-events: none; will-change: transform; }
#v-menu { position: fixed; z-index: 99998; overflow-y: auto; padding: 3px 0; font-size: 13px; background: var(--bg2); border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 6px 18px #000a; }
#v-menu .v-opt { padding: 4px 12px; white-space: nowrap; }
#v-menu .v-opt.on { color: var(--accent); }
#v-menu .v-opt.hl { background: #2a3a52; }
#v-menu .v-opt.off { opacity: .4; }
#v-tip { position: fixed; z-index: 99999; display: none; max-width: 320px; padding: 4px 8px; border-radius: 4px; pointer-events: none; font-size: 12px; white-space: pre-line; background: #10161ff2; border: 1px solid var(--line); }
.item-tier { position: absolute; left: -3px; top: -3px; padding: 0 3px; border-radius: 3px; font: 700 10px/13px var(--display); font-style: normal; color: #e8eef6; background: #2f4258; border: 1px solid #5d7694; }
.lab-toggles { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--ink2); }
.lab-toggles label { gap: 5px; cursor: pointer; }
.lab-hint p { margin: 4px 0 0; }
.admin-bugs { display: grid; gap: 8px; }   /* (the whole panel, which scrolls itself: owner, 2026-11-27, "no reason to make it only take up half the panel") */
.admin-bug-text { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-bug-data { margin: 8px 0 0; max-height: 300px; overflow: auto; font-size: 11px; background: #0d1219; padding: 8px; border-radius: 6px; }
.lab-picker { padding: 10px; margin-bottom: 10px; }
.lab-picker .picker { margin-top: 8px; max-height: 330px; border: 1px solid var(--line); border-radius: 8px; }
.lab-picker .opt { grid-template-columns: 48px minmax(0, 1fr) 62px; }
.lab-picker .opt-ico { width: 46px; height: 46px; background: #161f2b; }
.lab-picker .opt-chips { justify-content: flex-start; margin-top: 3px; }
.lab-picker .opt[draggable=true] { cursor: grab; }
.lab-hint { margin-bottom: 10px; }
.g-bar i { animation: gauge-fill 0.28s ease-out; }
@keyframes gauge-fill { from { width: var(--from); } }
.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 { display: none; }   /* F2 is the full map; the chat stays with F3 */
.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: 96px; 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 result screen: units at their top level earn no XP (owner, 2026-12-01: "a clear indicator") */
.res-maxed { color: var(--warn, #e2b65a); font-weight: 700; }
/* the Message Board: the shared board and your faction's own (client/js/board.mjs) */
.bd-tabs { gap: 6px; margin-bottom: 8px; }
.bd-tabs .bd-new { color: #ffd34d; }
/* 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(980px, 96vw); }   /* (wider: Boondoggle 2026-11-24, "after-battle units screen isn't wide enough") */
.list.result td { white-space: nowrap; }
.list.result td:nth-child(2) { white-space: normal; min-width: 120px; }   /* (a long unit name wraps instead of pushing the table out) */
.res-div { overflow-x: auto; }
/* 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; }
/* (fixed columns for the Div XP and the level: each row is a grid of its own, and "auto" ones moved the bars between rows when one had no Div XP or a level-up: owner, 2026-11-27) */
.res-sum { display: grid; grid-template-columns: 30px minmax(90px, 1fr) minmax(140px, 230px) 150px 78px 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; text-align: right; }
/* (the units at their top level under it, a line of its own: on the same line it ran into the level column, owner 2026-12-02) */
.res-dxp .res-maxed { display: block; font-size: 11px; line-height: 1.2; }
.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; }
.shop-closed { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 6px; background: rgba(0, 0, 0, 0.25); }
.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; }
/* on the gold buttons: dark text (the global small grey and --ink2 vanish on gold; owner, 2026-11-11) */
.shop-buy button.primary small { color: #1a1408; opacity: 1; font-weight: 600; }
.shop-buy button.primary small.eur { color: #4a3a14; font-weight: 500; }
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; }

/* the game's developer (FF_ADMINS): a small gold badge before the name in chat */
.dev { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 3px; background: #e2b65a; color: #0d1219; font-size: 10px; font-weight: 700; line-height: 15px; vertical-align: 1px; letter-spacing: .04em; }
.bot-tag { color: #9fb3c8; font-weight: 700; letter-spacing: 0.05em; }
/* the world map's Users tab: players, then the bots under their own heading (owner, 2026-11-19) */
.ms-users .ms-users-head th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #d6c48a; padding-top: 8px; border-bottom: 1px solid rgba(214, 196, 138, 0.35); }
.ms-users .ms-users-head.bots th { color: #9fb3c8; border-bottom-color: rgba(159, 179, 200, 0.35); padding-top: 14px; }
.ms-users tr.ms-bot td { opacity: 0.62; }
.ms-users tr.ms-bot td .linkname { font-style: italic; }
/* the boosts running, in the top bar: icon and time left */
.boost-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 3px; margin-left: 4px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff0d; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.boost-chip small { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.boost-chip:hover { border-color: var(--accent); }
/* reinforcements coming in (battle.mjs arrivals): who joined, for everyone in the battle, in their side's colour */
/* the unit under the cursor (battle.mjs drawOwner): page text, sharp at any graphics level */
#b-hover { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; background: #000c; border-left: 3px solid var(--side, #fff); padding: 3px 7px 4px 5px; display: grid; line-height: 14px; white-space: nowrap; }
#b-hover b { font: 700 12px Inter, sans-serif; color: #fff; }
#b-hover small { font: 500 11px Inter, sans-serif; color: #b9c2cc; }
#battle.stats-on #b-arrivals { top: 122px; }
#b-arrivals { position: absolute; left: 12px; top: 96px; width: 270px; display: grid; gap: 6px; pointer-events: none; z-index: 5; }
#b-arrivals .arr { background: #0d1219e8; border: 1px solid var(--line); border-left: 4px solid var(--side); border-radius: 8px; padding: 6px 10px 7px; box-shadow: 0 6px 18px #0008; animation: arr-in 0.3s ease-out; transition: opacity 0.7s, transform 0.7s; }
#b-arrivals .arr.gone { opacity: 0; transform: translateX(-16px); }
#b-arrivals .arr-h { font: 700 11px/1.4 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--side); margin-bottom: 2px; }
#b-arrivals .arr-row { display: flex; gap: 6px; align-items: baseline; font-size: 13px; white-space: nowrap; overflow: hidden; }
#b-arrivals .arr-row span { font-weight: 600; color: var(--ink); }
#b-arrivals .arr-tag { color: var(--side); font-size: 12px; }
#b-arrivals .arr-row small { color: var(--ink2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
@keyframes arr-in { from { opacity: 0; transform: translateX(-16px); } }

/* Factory (owner, 2026-11-15): small cards, a glow in your faction's colour on hover, details in a pop-out */
.fac-card { cursor: pointer; padding: 10px 12px; transition: border-color 0.15s, box-shadow 0.15s; }
.fac-card .unit-card { grid-template-columns: 64px 1fr; }
.fac-card .unit-card :is(canvas, .uicon) { width: 64px; height: 64px; }
.fac-card .fac-buy { margin-top: 6px; align-items: center; }
.fac-card:hover { border-color: var(--fc); box-shadow: 0 0 0 1px var(--fc), 0 0 16px color-mix(in srgb, var(--fc) 55%, transparent); }
/* the Factory's details: the Lab's bench (grid, portrait, slotted gear) with the chassis' facts beside it */
#modal-box:has(.fac-info) { width: min(1120px, 96vw); padding: 16px; }
.fac-info-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.fac-stage { min-height: 470px; }
.fac-slot { cursor: default; }
.fac-slot:hover { transform: none; }
.fac-info-side { display: flex; flex-direction: column; gap: 10px; }
.fac-info-title h2 { margin: 0 0 6px; font-size: 26px; }
.fac-info-title small { display: block; margin-top: 6px; color: var(--ink2); }
.fac-info-text { margin: 0; color: var(--ink2); line-height: 1.45; }
.fac-info-side .tiles { grid-template-columns: 1fr 1fr; }
.fac-info-buy { margin-top: auto; display: grid; gap: 6px; padding: 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--fac) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--fac) 14%, transparent), transparent); }
.fac-info-buy > b { font: 700 24px var(--display); color: var(--accent); }
@media (max-width: 900px) { .fac-info-main { grid-template-columns: 1fr; } }

/* the Warehouse (owner, 2026-11-15): two bays on the Lab's grid, capacity gauges, unit tiles to select or drag across */
#panel:not(.full):has(.wh-page) { max-width: 1500px; }
.wh-bays { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.wh-bay { --wire: color-mix(in srgb, var(--accent) 65%, transparent); position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 520px; max-height: calc(100vh - 290px); padding: 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--fac) 22%, #16202d), #0b1017 78%); transition: border-color 0.15s, box-shadow 0.15s; }
.wh-bay::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#ffffff0a 1px, transparent 1px), linear-gradient(90deg, #ffffff0a 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.wh-bay[data-side="wh"]::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(-45deg, #e8b84a 0 10px, #1a1f27 10px 20px); opacity: 0.8; pointer-events: none; }
.wh-bay > * { position: relative; z-index: 1; }
.wh-bay-name { position: absolute !important; left: 0; right: 0; bottom: 14px; text-align: center; font: 700 30px var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: #ffffff12; pointer-events: none; z-index: 0 !important; }
.wh-bay.can-drop { border-color: color-mix(in srgb, var(--good) 60%, var(--line)); }
.wh-bay.drop { border-color: var(--good); box-shadow: 0 0 0 1px var(--good), 0 0 22px color-mix(in srgb, var(--good) 40%, transparent) inset; }
.wh-gauge { display: grid; gap: 4px; }
.wh-gauge-l { display: flex; align-items: baseline; gap: 6px; }
.wh-gauge-l small { font: 700 12px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink2); margin-right: auto; }
.wh-gauge-l b { font: 700 22px var(--display); }
.wh-gauge-l span { color: var(--ink2); }
.wh-gauge-bar { display: flex; gap: 2px; height: 10px; padding: 1px; border-radius: 4px; background: #0008; border: 1px solid #ffffff14; }   /* one segment per place */
.wh-gauge-bar.dense { gap: 1px; }
.wh-gauge-bar i { flex: 1 1 0; min-width: 0; border-radius: 1px; background: #ffffff12; transition: background 0.2s; }
.wh-gauge-bar i.on { background: var(--fac); box-shadow: 0 0 5px color-mix(in srgb, var(--fac) 70%, transparent); }
.wh-gauge.full .wh-gauge-bar i.on { background: var(--bad); box-shadow: 0 0 5px color-mix(in srgb, var(--bad) 70%, transparent); }
.wh-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wh-actions .ub-free { margin-left: auto; }
.wh-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; align-content: start; padding: 2px 2px 40px; }
.wh-tile { position: relative; display: grid; justify-items: center; gap: 1px; padding: 6px 6px 7px; border-radius: 10px; cursor: pointer; user-select: none; text-align: center;
  background: linear-gradient(#1f2c3d, #0f1620); border: 1px solid #4a5d77; box-shadow: inset 0 0 14px #000a; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.wh-tile:hover { transform: translateY(-2px); border-color: var(--fac); box-shadow: 0 0 12px color-mix(in srgb, var(--fac) 45%, transparent), inset 0 0 14px #000a; }
.wh-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 14px #000a; }
.wh-tile-pic { width: 58px; height: 58px; filter: drop-shadow(0 6px 6px #000a); }
.wh-tile-pic :is(canvas, .uicon) { width: 58px; height: 58px; }
.wh-tile b { font-size: 11.5px; line-height: 1.2; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-tile small { font-size: 10.5px; color: var(--ink2); }
.wh-tile .sq-badge { position: absolute; top: 4px; left: 4px; }
.wh-tile-mk { position: absolute; top: 4px; right: 4px; font: 700 9px var(--display); letter-spacing: 0.06em; padding: 1px 4px; border-radius: 4px; background: #000a; color: var(--accent); border: 1px solid #ffffff1a; }
.wh-hp { width: 100%; height: 4px; margin-top: 3px; border-radius: 2px; background: #0009; overflow: hidden; }
.wh-hp i { display: block; height: 100%; background: var(--good); }
.wh-empty { grid-column: 1 / -1; text-align: center; padding: 40px 10px; }
.wh-conveyor { display: grid; place-items: center; border-radius: 10px; background: repeating-linear-gradient(180deg, #ffffff10 0 2px, transparent 2px 12px); border: 1px solid var(--line); }
.wh-conveyor span { font-size: 22px; color: var(--accent); text-shadow: 0 0 10px var(--accent); }
@media (max-width: 1000px) { .wh-bays { grid-template-columns: 1fr; } .wh-conveyor { display: none; } .wh-bay { max-height: none; } }
/* Options (F1): the donate button, top right in gold (owner, 2026-11-17) */
.opts { position: relative; }
.opts-support { position: absolute; top: 0; right: 0; }
@media (max-width: 760px) { .opts-support { position: static; margin-bottom: 12px; } }

/* ---- Mail (client/js/mail.mjs) */
#menu button[data-panel="mail"] { position: relative; }
#menu-mail { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #201608; font: 700 12px/22px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 8px var(--accent); animation: repair-pulse 1.6s ease-in-out infinite; }
#menu-mail.hidden { display: none; }
.mail { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; min-height: 420px; }
.mail-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mail-tabs { display: flex; gap: 6px; align-items: center; }
.mail-tabs > button:not(.primary) { display: flex; gap: 6px; align-items: center; }
.mail-tabs > button.on { border-color: var(--fac); background: color-mix(in srgb, var(--fac) 18%, var(--panel2)); }
.mail-count { background: var(--accent); color: #201608; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.mail-rows { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); max-height: 62vh; min-height: 200px; }
.mail-row { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mail-row:hover { background: var(--panel2); }
.mail-row.on { background: color-mix(in srgb, var(--fac) 16%, var(--panel2)); }
.mail-row-main { flex: 1; min-width: 0; }
.mail-row-main .row { gap: 6px; }
.mail-subj { color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-row.unread .mail-subj { color: var(--ink); font-weight: 600; }
.mail-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; }
.mail-row.unread .mail-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.mail-ico { flex: none; display: flex; }
.mail-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 4px; padding: 1px 5px; }
.mail-tag.staff { background: linear-gradient(180deg, #ffe08a, #c8932f); color: #2a1d06; }
.mail-tag.game { border: 1px solid var(--accent); color: var(--accent); }
.mail-pager { gap: 8px; }
.mail-empty { padding: 14px; }
.mail-pane { min-width: 0; background: linear-gradient(180deg, #1c2736, #161f2b); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow: auto; max-height: 72vh; }
.mail-blank { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink2); gap: 4px; padding: 30px; }
.mail-blank .hint { max-width: 420px; }
.mail-env { display: inline-block; }
.mail-letter header { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.mail-letter h3 { margin: 0 0 6px; font-family: var(--display); }
.mail-letter header .row { gap: 6px; align-items: center; }
.mail-who { cursor: pointer; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; min-height: 80px; }
.mail-quote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--bg2); border-radius: 0 6px 6px 0; color: var(--ink2); white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-quote small { display: block; color: var(--dim); margin-bottom: 4px; }
.mail-reward { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 10px 14px; border: 1px solid #6b5426; border-radius: 10px; background: radial-gradient(circle at 10% 50%, #3a2c10, #1c1810 70%); }
.mail-reward .row { gap: 14px; }
.mail-reward .cr { color: var(--accent); }
.mail-reward .fr { color: #c9a6ff; display: inline-flex; align-items: center; gap: 4px; }
.mail-actions { margin-top: 18px; gap: 8px; }
.mail-compose { display: grid; gap: 10px; }
.mail-compose h3 { margin: 0; font-family: var(--display); }
.mail-compose label { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; color: var(--ink2); }
.mail-compose textarea { width: 100%; resize: vertical; min-height: 180px; line-height: 1.5; }
.mail-compose .row { gap: 8px; align-items: center; }
.mail-left { color: var(--dim); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .mail { grid-template-columns: 1fr; } .mail-rows { max-height: 32vh; } }

/* ---- Recruits (client/js/recruits.mjs) */
.reg-ref { display: grid; gap: 4px; font-size: 13px; color: var(--ink2); }
.reg-ref small { color: var(--dim); }
#create-recruiter { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #6b5426; border-radius: 8px; background: #241d0f; }
#create-recruiter.hidden { display: none; }
.ms-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ms-ico img { width: 100%; height: 100%; image-rendering: pixelated; }
.ms-ico.dim { filter: grayscale(1) brightness(0.45); opacity: 0.7; }
.rc { display: grid; gap: 16px; }
.rc section { background: linear-gradient(180deg, #1c2736, #161f2b); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.rc h3 { margin: 0 0 10px; font-family: var(--display); }
.rc h3 small { font-family: var(--font); font-weight: 400; color: var(--ink2); }
.rc section.rc-banner { display: flex; gap: 20px; align-items: stretch; flex-wrap: wrap; background: radial-gradient(circle at 0% 0%, #3a2c10, #1a1f29 60%); border-color: #6b5426; }
.rc-banner-text { flex: 1 1 420px; display: grid; gap: 8px; }
.rc-banner-text p { margin: 0; color: var(--ink2); }
.rc-banner h3 { font-size: 20px; color: var(--accent); margin: 0; }
.rc-linkrow { gap: 8px; }
.rc-link { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--accent); }
.rc-stats { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 8px; flex: 0 1 280px; }
.rc-stats > div { background: #0f1520aa; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; align-content: center; }
.rc-stats b { font: 700 22px var(--display); display: flex; gap: 6px; align-items: center; }
.rc-stats small { color: var(--ink2); }
.rc-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.rc-step { position: relative; text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px 10px; display: grid; justify-items: center; gap: 4px; grid-template-rows: auto auto 1fr auto; }   /* (icon, name, text, reward: the text row stretches, so every reward sits on the same bottom line) */
.rc-step:last-child { border-color: #8a6b2c; background: radial-gradient(circle at 50% 20%, #33280e, var(--bg2) 70%); }
.rc-step b { font-family: var(--display); }
.rc-step p { margin: 0; font-size: 12px; color: var(--ink2); }
.rc-n { position: absolute; top: 6px; left: 8px; color: var(--dim); font-weight: 700; }
.rc-pay { color: var(--accent); font-weight: 700; font-size: 13px; }
.rc-title { margin-top: 12px; display: grid; gap: 6px; }
.rc-bar { height: 10px; border-radius: 5px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.rc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a77a26, #ffe08a); }
.rc-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.rc-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rc-row:last-child { border-bottom: 0; }
.rc-who b { cursor: pointer; }
.rc-who small { color: var(--ink2); }
.rc-marks { display: flex; gap: 4px; }
.rc-prog { grid-column: 1 / -1; color: var(--dim); }
.rc-me .row { gap: 8px; align-items: center; }
.rc-me .rc-marks { margin: 8px 0; }
.recruit-on { color: #9be89f; }
@media (max-width: 1100px) { .rc-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rc-cols { grid-template-columns: 1fr; } }
.mail-tr { display: flex; gap: 8px; align-items: center; margin: -4px 0 12px; padding: 5px 10px; border-radius: 6px; background: color-mix(in srgb, var(--energy) 10%, var(--bg2)); color: var(--ink2); }
.mail-tr .tr-mark { color: var(--energy); font-weight: 700; }
.mail-tr .tr-mark.orig { color: var(--dim); }
.mail-tr button { margin-left: auto; }

/* ---- panels that share a menu button: their tabs on top (Factory + Storage, Messages = Mail + Dispatches) */
.group-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; flex: none; margin: -16px -16px 16px; border-bottom: 2px solid var(--line); background: var(--bg2); position: sticky; top: -16px; z-index: 6; }
/* (sticky: the tabs stay at the top while a long page scrolls under them, Dispatches' patch notes most of all: owner, 2026-11-18.
   top -16px: #panel-body's padding, so they sit flush with its top edge as they did before scrolling) */
.group-tabs button { display: flex; gap: 8px; align-items: center; justify-content: center; font: 700 17px var(--display); letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 16px 12px; border: 0; border-radius: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: transparent; color: var(--ink2); }
.group-tabs button + button { border-left: 1px solid var(--line); }
/* the tab a popup tutorial is about (client/js/tutorial.mjs TIPS) */
.group-tabs button.tip-glow { color: #ffd34d; animation: tip-glow 1.4s ease-in-out infinite; }
@keyframes tip-glow { 0%, 100% { box-shadow: inset 0 0 0 2px #ffd34d55; } 50% { box-shadow: inset 0 0 0 2px #ffd34d, inset 0 0 18px #ffd34d44; } }
.group-tabs button:hover:not(.on) { color: var(--ink); background: color-mix(in srgb, var(--fac) 8%, transparent); }
.group-tabs button.on { color: var(--ink); border-bottom-color: var(--fac); background: linear-gradient(180deg, color-mix(in srgb, var(--fac) 10%, transparent), color-mix(in srgb, var(--fac) 26%, var(--panel))); }

/* The bay look of the Warehouse and the Lab's Equipment (a dark faction-tinted stage, a 32 px grid; the hazard stripe
   only on the Warehouse: owner, 2026-11-17) for the Lab's Marks and conversion and the Factory's buy and sell columns (owner, 2026-11-17). Drawn as
   backgrounds that scroll with the content (local), so it works on the columns that scroll themselves. */
.bay { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background:
    linear-gradient(#ffffff0a 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, #ffffff0a 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--fac, var(--accent)) 20%, #16202d), #0b1017 80%);
  background-attachment: local; }
.bay > h3:first-child, .bay > .bay-title { margin-top: 0; font: 700 15px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.bay .card, .bay .up-node, .bay .up-info { background: color-mix(in srgb, #0b1017 70%, transparent); }
.bay .fac-card { background: color-mix(in srgb, #0b1017 62%, transparent); backdrop-filter: blur(2px); }
.bay-mark { position: absolute; right: 14px; bottom: 10px; font: 700 28px var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: #ffffff10; pointer-events: none; }
.up-cols > .bay { min-height: 420px; }

/* Options (owner, 2026-11-17: a facelift): cards in the bays' look, as many across as fit */
.opts-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.opts-title { margin: 0; font: 700 22px var(--display); letter-spacing: 0.2em; text-transform: uppercase; }
.opts .opts-top .opts-support { position: static; }
.opts-grid { columns: 2 400px; column-gap: 14px; }
.opt-card { display: block; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.opts-grid > .opt-card { break-inside: avoid; margin: 0 0 14px; }
.opt-card.opt-wide { margin: 10px 0 14px; }
.opt-card .row h3 { margin: 0; }
.opt-card h3 { margin: 0 0 10px; font: 700 15px var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
/* the Notices card (owner, 2026-11-19): Mute all, then each kind in a folded list */
.notice-kinds { margin: 6px 0 4px; }
.notice-kinds > summary { cursor: pointer; padding: 4px 0; }
.notice-kinds .notice-kind { align-items: flex-start; margin: 6px 0 0 4px; }
.notice-kinds .notice-kind input { margin-top: 3px; }
.notice-kinds .notice-kind > span { display: flex; flex-direction: column; gap: 1px; }
.notice-kinds .notice-kind small { font-size: 11px; }
.opt-card h3 ~ h3 { margin-top: 16px; }
.opt-card label.row { min-height: 30px; padding: 3px 6px; border-radius: 6px; }
.opt-card label.row:hover { background: #ffffff08; }
.opt-card input[type="range"] { flex: 1; accent-color: var(--accent); }
.opt-card input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.opt-card select { max-width: 100%; }
.cc-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.cc-row:hover { background: #ffffff08; }
.cc-row input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.cc-name { width: 110px; font-size: 12px; font-weight: 700; }
.cc-sample { font-size: 13px; }
.opts-foot { margin-top: 18px; gap: 8px; }
@media (max-width: 760px) { .opts-grid { columns: 1; } }

/* the Lab's Equipment: the unit's column on the big grid (owner, 2026-11-17); Limits under the picture */
.lab-right { padding: 14px; }
.lab-limits { margin-top: 10px; }
/* Admin in cards: its rows of fields wrap inside a card instead of running past it */
.admin .opt-card .row { flex-wrap: wrap; }
.admin .opt-card .row input:not([type="checkbox"]) { flex: 1 1 100px; min-width: 0; width: auto !important; }
.admin .opt-card .row select { flex: 1 1 140px; min-width: 0; }
/* a squad's units: six across, as big as the card allows (owner, 2026-11-17: two squads a row, filling the space) */
.squads-col .squad .members { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.squads-col .squad .member { height: auto; display: block; }
.squads-col .squad .members :is(canvas, .uicon) { width: 100%; height: auto; aspect-ratio: 1; max-width: 72px; display: block; }

/* ---------------------------------------------------------------- the phone app (owner, 2026-11-19; client/js/appmode.mjs)
   The game page at /app: the menu becomes a tab bar at the bottom, a panel or the war map fills the screen above it, and
   with neither open the chat does. No field, no battle. */
.app-only { display: none !important; }
html.app .app-only { display: flex !important; }
.ol-app { font-size: 12px; }
html.app body { overscroll-behavior: none; }
html.app #world { display: block; }
html.app #field-wrap, html.app #menu [data-panel="quickmap"], html.app .fs-btn, html.app #tut { display: none !important; }
html.app #topbar { position: fixed; left: 0; right: 0; top: 0; height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; gap: 12px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; z-index: 25; font-size: 13px; }
html.app #tb-war { display: none; }
html.app #menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: calc(58px + env(safe-area-inset-bottom)); flex-direction: row; gap: 4px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; z-index: 25; scrollbar-width: none; }
html.app #menu button { flex: 0 0 auto; min-width: 76px; align-items: center; justify-content: center; padding: 4px 8px; text-align: center; }
html.app #menu button b { font-size: 13px; }
html.app #menu button small { display: none; }
html.app #menu-chat { order: -2; } html.app #menu-map { order: -1; }
/* what fills the screen between the bars */
html.app #panel, html.app #map-wrap, html.app #chat { left: 0 !important; right: 0 !important; top: calc(48px + env(safe-area-inset-top)) !important; bottom: calc(58px + env(safe-area-inset-bottom)) !important; width: auto !important; max-width: none; border-radius: 0; border-left: none; border-right: none; }
html.app #panel { box-shadow: none; }
html.app #chat { position: fixed; display: flex; flex-direction: column; background: var(--bg2); }
html.app #chat.under-panel, html.app body.map-open #chat { display: none; }
html.app #chat-log { flex: 1; height: auto !important; font-size: 15px; }
html.app #chat.collapsed #chat-log { height: auto !important; padding: 6px 10px; }
html.app #chat-tabs { overflow-x: auto; scrollbar-width: none; cursor: default; }
html.app #chat-tabs button { font-size: 13px; padding: 6px 8px; }
html.app #chat-input { font-size: 16px; padding: 9px 10px; }   /* (16 px: iOS doesn't zoom into it) */
html.app .online-list { left: 0; right: 0; width: auto; top: 40px; bottom: auto; max-height: 60vh; }
html.app #bug-btn { display: none; }
/* panels: one column, the whole page scrolls */
html.app #panel-body { padding: 12px; }
html.app #panel-body:has(> .cols-page) { display: block; overflow: auto; }
html.app .cols-page, html.app .cols-page > .cols { display: block; height: auto; }
html.app .cols { display: block !important; height: auto; }
html.app .cols > * { overflow: visible; margin-bottom: 14px; }
html.app .group-tabs button { font-size: 13px; padding: 10px 6px 8px; letter-spacing: 0.04em; }
html.app .group-tabs:not(.up-tabs) { margin: -12px -12px 12px; top: -12px; }   /* (the panel's 12 px here, not 16: the bar stuck out 4 px each side) */
html.app .pf, html.app .opts-grid { display: block; columns: 1; }
/* the war map: the map above, its card under it */
html.app #map-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
html.app #map-bar, html.app #map-head small { display: none; }   /* (the legend and the filters: no room on a phone) */
html.app #map-main { min-height: 0; }
html.app #topbar { scrollbar-width: none; } html.app #topbar::-webkit-scrollbar, html.app #menu::-webkit-scrollbar { display: none; }
html.app #map-side { max-height: 40vh; overflow: auto; border-left: none; border-top: 1px solid var(--line); }
html.app #map-close { display: none; }   /* (the tab bar closes it) */
/* the war map by touch (step 4): the page doesn't scroll or zoom under the fingers; the map's own gestures do */
#map { touch-action: none; }
html.app #map-side .ms-mk-row .mk-btn { min-width: 40px; min-height: 40px; }
/* the phone notice links to the phone app */
#login a.app-link { display: inline-block; background: var(--accent); color: #1a1408; border-radius: 6px; padding: 10px 22px; font-size: 16px; font-weight: 600; text-decoration: none; }
#login a.app-link:hover { text-decoration: none; filter: brightness(1.1); }
/* ---- the phone app, first feedback round (owner, 2026-11-19) */
/* the tab bar's arrow, where one more tab would be */
html.app #menu { right: 52px; }
#menu-more { position: fixed; right: 0; bottom: 0; width: 52px; height: calc(58px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom); z-index: 26; border-radius: 0; border: none; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel); font: 700 28px var(--display); color: var(--accent); }
/* nothing wider than the phone: wide tables scroll inside their card */
html.app #panel-body { overflow-x: hidden !important; }
html.app .opt-card, html.app .card, html.app .bay { min-width: 0; max-width: 100%; overflow-x: auto; }
html.app .opts-grid > * { margin-bottom: 12px; }
html.app .opt-gfx { display: none; }
/* the war map alone; a tapped province's card floats over its foot */
html.app #map-head { display: none; }
html.app #map-wrap { grid-template-rows: minmax(0, 1fr); }
html.app #map-side { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 62%; overflow: auto; display: none; z-index: 6; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px #000c; }
html.app #map-side.app-open { display: block; }
html.app #map-side #map-preview { display: none; }   /* (the Battle and Users tabs stay, the map preview goes: owner, 2026-11-19) */
html.app #map-side .ms-preview { height: auto; min-height: 0; padding: 10px 44px 4px 12px; }
html.app #map-side .ms-preview .ms-title, html.app #map-side .ms-title { position: static; background: none; padding: 0; }
html.app #province-card { max-height: none; }
.ms-app-close { position: absolute; right: 6px; top: 6px; z-index: 2; width: 34px; height: 34px; padding: 0; }
/* squads: the cards big enough to tap */
html.app .app-squads > * { margin-bottom: 12px; }
html.app .app-squads .squad-grid { grid-template-columns: minmax(0, 1fr); }
/* the Lab's equipment in one column: the unit, the open slot's items, Apply, the result, the limits */
html.app .lab-equip { display: flex !important; flex-direction: column; align-items: stretch; gap: 12px; }
html.app .lab-equip > div { display: contents; }
html.app .lab-stage { order: 1; grid-template-columns: 92px 1fr 92px; min-height: 420px; padding: 34px 4px 10px; }
html.app .lab-equip .lab-hint, html.app .lab-equip .lab-picker { order: 2; scroll-margin-top: 8px; }
html.app .lab-equip .apply-bar { order: 3; position: sticky; bottom: 0; z-index: 4; background: var(--bg2); padding: 8px 4px; border-top: 1px solid var(--line); }
html.app .lab-equip .lab-stats { order: 4; }
html.app .lab-equip .lab-limits { order: 5; }
html.app .lab-slot { width: 88px; }
html.app .lab-slot-tile { width: 62px; height: 62px; }
html.app .lab-col.left .lab-slot::after, html.app .lab-col.right .lab-slot::after { display: none; }
html.app .lab-portrait { width: 52%; }
html.app .lab-stage { scroll-margin-top: 8px; }
html.app .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.app .loadouts input { width: 120px; }
html.app .up-tabs { margin-bottom: 10px; }
html.app #province-card .opts:empty { display: none; }
html.app .lab-right > *, html.app .lab-equip > * { min-width: 0; }
/* the phone app's chat tabs: they swipe sideways (the PC's drag-to-move is off here), Online always in view at their end */
html.app #chat-tabs { touch-action: pan-x; user-select: none; }
html.app #chat-tabs > * { flex: 0 0 auto; }
/* the chat tabs scroll in their own row (a fade and an arrow while more are hidden); Online fixed beside them (chat.mjs appTabBar) */
html.app .chat-tabbar { display: flex; align-items: center; gap: 2px; padding-right: 6px; }
html.app .chat-tabbar #chat-tabs { flex: 1 1 auto; min-width: 0; }
html.app #chat-tabs.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
html.app #chat-tabs.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
html.app #chat-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 40px), transparent); }
.chat-more { flex: 0 0 34px; height: 34px; padding: 0; border: none; background: none; font: 700 24px var(--display); color: var(--accent); }
html.app .chat-tabbar .online-btn { flex: 0 0 auto; margin-top: 4px; padding: 6px 10px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--panel2); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 6px; }

/* the Steam app's login card (client/js/account.mjs steamSetup) */
#auth-login .steam-go { width: 100%; }
#auth-login .steam-note { margin: 2px 0 10px; font-size: 13px; line-height: 1.4; }
#auth-login .steam-web { width: 100%; margin-top: 8px; }
#auth-steamnew button { width: 100%; }
#auth-steamnew .hint { margin: 14px 0 6px; font-size: 13px; line-height: 1.4; }

/* The Regiment Forum (Comrades > Forum, client/js/forum.mjs; owner, 2026-11-19) */
.fo { max-width: 980px; display: flex; flex-direction: column; gap: 10px; }
.fo-head { align-items: center; gap: 10px; }
.fo-head h3 { margin: 0; }
.fo-rows { border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); overflow: hidden; }
.fo-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fo-row:last-child { border-bottom: 0; }
.fo-row:hover { background: color-mix(in srgb, var(--fac, #e2b65a) 10%, transparent); }
.fo-row.pinned { background: rgba(226, 182, 90, 0.06); }
.fo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fo-row.unread .fo-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.fo-row.unread .fo-title { color: #fff; }
.fo-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fo-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink2); }
.fo-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; text-align: right; }
.fo-flag { margin-right: 4px; }
.fo-empty { padding: 16px; margin: 0; }
.fo-pager { justify-content: center; gap: 10px; align-items: center; }
.fo-thread-title { margin: 0; overflow-wrap: anywhere; }
.fo-modtools { gap: 6px; align-items: center; }
.fo-posts { display: flex; flex-direction: column; gap: 8px; }
.fo-post { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.fo-post.mine { border-left: 3px solid var(--accent); }
.fo-post-head { align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.fo-who.gone { color: var(--ink2); font-style: italic; font-weight: 400; }
.fo-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.fo-compose, .fo-edit { display: flex; flex-direction: column; gap: 6px; }
.fo-compose h4 { margin: 0; }
.fo-compose input, .fo-compose textarea, .fo-edit input, .fo-edit textarea { width: 100%; box-sizing: border-box; }
html.app .fo-row-side { display: none; }

/* the Message Board (client/js/board.mjs): every faction, under Messages */
.bd { max-width: 980px; display: flex; flex-direction: column; gap: 10px; }
.bd-write { display: flex; flex-direction: column; gap: 6px; }
.bd-top { align-items: center; gap: 10px; }
.bd-title-in { width: 100%; box-sizing: border-box; font-weight: 600; }
.bd-write h3 { margin: 0; }
.bd-text { width: 100%; box-sizing: border-box; resize: vertical; }
.bd-list { display: flex; flex-direction: column; gap: 8px; }
.bd-post { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--pf); border-radius: 8px; padding: 0; }
.bd-post.pinned { background: color-mix(in srgb, #e2b65a 8%, var(--panel2)); border-color: #e2b65a66; border-left-color: var(--pf); }
.bd-post.new { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.bd-head { align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; min-width: 0; }
.bd-head:hover { background: color-mix(in srgb, var(--pf) 9%, transparent); }
.bd-caret { color: var(--dim); width: 12px; flex: none; }
.bd-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.bd-post.new .bd-title { color: #fff; }
.bd-by { flex: none; white-space: nowrap; }
.bd-open { padding: 2px 12px 10px 32px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.bd-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; margin: 8px 0 0; }
html.app .bd-by .hint { display: none; }

.pf-board .sb-sides { gap: 14px 18px; }   /* both sides side by side (owner, 2026-11-23), one above the other only on narrow screens (.sb-sides) */
#modal-box.pfboard { width: min(1280px, 96vw); }
table.sb td.sb-none { color: var(--dim); font-style: italic; }

/* the teleport window (joinpop.mjs; owner, 2026-11-20): over the map, under the panels so Change squad opens Squads over it */
#join-pop { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9; width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto; background: var(--panel); border: 2px solid #e2b65a; border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 18px 60px #000d, 0 0 24px #e2b65a33; }
#join-pop h3 { margin: 0; font: 700 20px var(--display); letter-spacing: 0.04em; }
#join-pop .jp-head small { color: var(--ink2); }
#join-pop h4 { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; font: 600 12px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); }
#join-pop h4 small { text-transform: none; letter-spacing: 0; color: var(--accent); font-size: 12.5px; }
.jp-time { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.jp-clock { display: flex; align-items: baseline; gap: 6px; flex: none; }
.jp-clock small { color: var(--ink2); }
.jp-clock b { font: 700 26px var(--display); color: #ffe9a8; font-variant-numeric: tabular-nums; }
.jp-bar { flex: 1; height: 8px; border-radius: 4px; background: #121a25; border: 1px solid #000; overflow: hidden; }
.jp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a2a, #e2b65a); transition: width 0.5s linear; }
.jp-ask { margin: 8px 0 0; font-size: 13px; color: var(--accent); }
.jp-ask.ok { color: var(--good); }
.jp-units { display: flex; flex-wrap: wrap; gap: 6px; }
.jp-unit { display: grid; justify-items: center; gap: 2px; width: 62px; padding: 4px 2px 5px; border-radius: 8px; background: #121a25; border: 1px solid var(--line); }
.jp-unit small { font-size: 11px; color: var(--ink2); }
.jp-hp { display: block; width: 48px; height: 4px; border-radius: 2px; background: #3a1d1d; overflow: hidden; }
.jp-hp b { display: block; height: 100%; background: var(--good); }
.jp-squads { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.jp-squads small { color: var(--ink2); }
.jp-squads button { display: inline-flex; align-items: center; gap: 3px; }
.jp-squads button.on { border-color: #e2b65a; box-shadow: inset 0 0 0 1px #e2b65a; }
.jp-btns { margin-top: 12px; gap: 8px; }
span.joining[title] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* ---- 2026-11-22 (owner): sell several at once, Interface options, own chat colour, the chat lock, copying text */
.sell-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.sell-tip { margin: 0 0 6px; font-size: 12px; }
.ts-row { display: flex; gap: 6px; }
.ts-row button.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.chat-lock.on { color: var(--accent); }
html.ui-locked .chat-corner { display: none; }
html.ui-locked #chat-tabs { cursor: default; }
/* chat lines and panel text can be selected and copied (main.mjs lets the browser's menu open over a selection) */
#chat-log p { user-select: text; }
/* Options > Interface, Text size (gfx.mjs TEXT_ZOOM: 1, 1.12, 1.25): the panels, dialogs and messages scale as a whole, the chat's text grows */
html.text-big:not(.app) #panel-body, html.text-big:not(.app) #toasts, html.text-big:not(.app) #modal-box > * { zoom: var(--ui-zoom); }
html.text-big:not(.app) #chat-log, html.text-big:not(.app) #chat-input { font-size: calc(13px * var(--ui-zoom)); }
html.text-big:not(.app) #chat-tabs button { font-size: calc(11px * var(--ui-zoom)); }
.res-xp-legend { margin: 0 0 8px; font-size: 12px; }
.gain-bar i.was { background: #7d8694; }
.res-xph th { font: 600 10px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink2); text-align: left; padding: 2px 6px; }
.rg-onbar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.rg-onbar > small { font: 600 11px var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); }
.rg-ontotal { font-size: 16px; }
.rg-on { display: inline-flex; align-items: center; gap: 4px; }
.rg-on i { width: 9px; height: 9px; border-radius: 50%; background: var(--fc); }
.sell-bar button { white-space: nowrap; }

/* the Lab's Stash tab (owner, 2026-11-22): full width, one column per slot kind */
.group-tabs button .tab-n { font: 700 12px var(--body, inherit); letter-spacing: 0; background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--ink); border-radius: 9px; padding: 1px 7px; }
.stash-page { max-width: 1400px; }
.stash-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; margin-top: 10px; }
/* the stash facelift (owner, 2026-11-27): filters, search, compact tiles */
.stash-bar { display: grid; gap: 8px; margin: 8px 0; }
.stash-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stash-chips button small { opacity: .7; }
.stash-q { flex: 1 1 220px; min-width: 160px; }
.stash-tiles { display: grid; gap: 4px; }
.stash-tile { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 8px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #0f161f; cursor: pointer; }
.stash-tile:hover { border-color: #3a4a5c; }
.stash-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.stash-tile .st-main { min-width: 0; }
.stash-tile .st-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.stash-tile .st-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink2); }
.stash-tile .st-n { font: 700 13px var(--display); color: var(--accent); }
.stash-tile .st-sell { white-space: nowrap; }
.stash-tile.hidden, .stash-group.hidden { display: none; }
/* batch selling in sight (owner, 2026-12-02): the filters and the sell bar pinned to the top of the scrolling stash (top -12px:
   the card's padding), a tick on every picked item */
.stash-head { position: sticky; top: -12px; z-index: 2; margin: 0 -12px; padding: 4px 12px 2px; background: #0d1219f2; backdrop-filter: blur(4px); border-bottom: 1px solid var(--line); }
.stash-head .sell-bar { margin: 0 0 6px; }
.sell-bar.sell-none { opacity: 0.75; }
.stash-tile { position: relative; }
.stash-tile.on::before { content: '✓'; position: absolute; left: -6px; top: -6px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #1a1206; font: 800 11px/1 sans-serif; box-shadow: 0 0 0 2px #0d1219; }
.stash-group h4 { margin: 0 0 6px; font: 700 13px var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); }
.stash-group h4 small { font-weight: 400; letter-spacing: 0; }

/* Options > Key bindings (owner, 2026-11-22) */
.kb-page { display: flex; flex-direction: column; gap: 10px; }
.kb-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: -16px; z-index: 5; background: var(--bg2); padding: 8px 0; margin-top: -8px; }
.kb-search { width: 260px; max-width: 100%; }
.kb-count { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }
.kb-count.none { background: transparent; color: var(--ink2); }
.kb-lead { margin: 0; }
.kb-card h3 { display: flex; align-items: center; gap: 8px; }
.kb-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-size: 14px; }
.kb-sub { margin-left: auto; font: 400 11px var(--body, inherit); letter-spacing: 0; text-transform: none; color: var(--ink2); }
.kb-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 6px; border-left: 3px solid transparent; transition: background .15s; }
.kb-row + .kb-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.kb-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.kb-row.changed { border-left-color: var(--accent); }
.kb-row.listen { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.kb-row.flash { animation: kb-flash 1.2s ease-out; }
.kb-row.bad .kb-note { color: var(--bad, #ff6b6b); }
@keyframes kb-flash { from { background: color-mix(in srgb, var(--good, #6fdc8c) 28%, transparent); } to { background: transparent; } }
.kb-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kb-name { font-weight: 600; }
.kb-help { color: var(--ink2); font-size: 11.5px; line-height: 1.3; }
.kb-note { color: var(--good, #6fdc8c); font-size: 11.5px; }
.kb-side { display: flex; align-items: center; gap: 6px; flex: none; }
.kb-key { display: inline-flex; align-items: center; gap: 3px; min-width: 64px; justify-content: center; padding: 3px 6px; background: transparent; border: 1px dashed transparent; border-radius: 7px; cursor: pointer; }
.kb-key:hover { border-color: var(--line); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.kb-key.listening { border: 1px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); animation: kb-pulse 1.1s ease-in-out infinite; min-width: 120px; }
@keyframes kb-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); } }
.kb-wait { font-size: 12px; color: var(--accent); font-style: italic; white-space: nowrap; }
.kb-cap { display: inline-block; min-width: 26px; padding: 3px 8px 4px; text-align: center; font: 700 12px/1.2 ui-monospace, Consolas, monospace; color: var(--ink); white-space: nowrap;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--ink) 14%, var(--bg2)), color-mix(in srgb, var(--ink) 6%, var(--bg2)));
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-bottom-width: 3px; border-radius: 5px; }
.kb-cap.sm { min-width: 20px; padding: 1px 6px 2px; font-size: 11px; border-bottom-width: 2px; }
.kb-cap.fixed { opacity: .7; font-weight: 600; }
.kb-plus { color: var(--ink2); font-size: 11px; }
.kb-none { color: var(--ink2); font-size: 12px; font-style: italic; }
.kb-reset { padding: 2px 7px; font-size: 14px; line-height: 1; background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--ink2); }
.kb-reset:hover { color: var(--ink); border-color: var(--accent); }
.kb-fixed .kb-name { font-weight: 400; color: var(--ink2); }
.kb-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 10px; }
.kb-mini-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.kb-mini-keys { display: inline-flex; gap: 2px; align-items: center; }
.pt-key { color: var(--ink2); font-weight: 400; }
#menu .mk:empty { display: none; }
#menu .mk:not(:empty) + span::before { content: ' · '; }
.hb-rebind { margin: 8px 0 0; }


/* the Factory's cards: the starting weapons and what they hit (2026-11-22) */
.fac-gear { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0 2px; align-items: center; }
.fac-wpn { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 7px 2px 4px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, transparent); white-space: nowrap; }
.fac-wpn .hits img { width: 15px; height: 15px; }
.fac-wpn.none { color: var(--ink2); padding-left: 7px; }
.fac-air { font-size: 11px; padding: 2px 7px; border-radius: 10px; color: #9fd8ff; border: 1px solid #9fd8ff66; }
.fac-wpn .hits { margin: 0; }

/* Key bindings: Automatic or Individual ability keys (owner, 2026-11-22) */
.kb-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 2px 0 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg2); }
.kb-mode-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink2); text-align: left; }
.kb-mode-opt + .kb-mode-opt { border-left: 1px solid var(--line); }
.kb-mode-opt b { font-size: 13px; color: var(--ink); }
.kb-mode-opt small { font-size: 11px; }
.kb-mode-opt.on { background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: inset 0 -3px 0 var(--accent); }
.kb-mode-opt:hover:not(.on) { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.kb-ab-lead { margin: 0 0 6px; font-size: 12px; }
.kb-auto { font-size: 11.5px; color: var(--ink2); padding: 3px 9px; border: 1px dashed var(--line); border-radius: 5px; font-style: italic; }

/* one look for every checkbox: the Options panel's (owner, 2026-11-22: "Only units not in a squad" looked off) */
html input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; accent-color: var(--accent); width: 16px; height: 16px; min-width: 16px; padding: 0; border: 0; border-radius: 3px; background: none; flex: none; cursor: pointer; vertical-align: middle; box-shadow: none; }
html input[type="checkbox"]:disabled { cursor: default; opacity: .5; }

/* Key bindings, packed (owner, 2026-11-22): two columns that fill top to bottom, the abilities one wide panel below */
.kb-cols { columns: 2 380px; column-gap: 14px; }
.kb-cols > .kb-card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 14px; }
.kb-abil-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.kb-abil-head h3 { margin: 0; }
.kb-abil-head .kb-mode { margin: 0; flex: 0 1 460px; margin-left: auto; }
.kb-sub-h { margin: 12px 0 4px; font: 700 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.kb-sub-h small { font: 400 11px var(--body, inherit); letter-spacing: 0; text-transform: none; }
.kb-abil-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 28px; }
.kb-abil-rows .kb-row + .kb-row { border-top: 0; }
.kb-abil-rows .kb-row { border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.kb-abil-rows.each { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Polls (owner, 2026-11-22; client/js/polls.mjs) */
#menu-poll { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #201608; font: 700 12px/22px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 8px var(--accent); }
#menu-poll.hidden { display: none; }
.pl { display: flex; flex-direction: column; gap: 12px; max-width: 980px; margin: 0 auto; }
.pl-lead { margin: 0; }
.pl-sec { margin: 6px 0 0; }
.pl-poll { display: flex; flex-direction: column; gap: 10px; }
.pl-poll.open { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pl-poll.draft { border-style: dashed; }
.pl-head { display: flex; align-items: baseline; gap: 10px; }
.pl-head h3 { margin: 0; font-size: 18px; }
.pl-when { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.pl-poll.open .pl-when { color: var(--accent); font-weight: 700; }
.pl-text { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.pl-meta { margin-top: -4px; }
.pl-q { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 8px; background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.pl-qhead { display: flex; align-items: flex-start; gap: 10px; }
.pl-qn { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 700; font-size: 12px; }
.pl-qtext { margin: 2px 0 0; flex: 1; white-space: pre-wrap; font-weight: 600; }
.pl-choice { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 34px; }
.pl-opt { min-width: 84px; }
.pl-opt.yes.on { background: #2f7d4a; border-color: #49b36b; color: #fff; }
.pl-opt.no.on { background: #8a3434; border-color: #c95454; color: #fff; }
.pl-opt.skip.on { background: color-mix(in srgb, var(--ink) 25%, transparent); border-color: var(--ink2); color: var(--ink); }
.pl-mine { padding-left: 34px; color: var(--ink2); }
.pl-res { padding-left: 34px; display: flex; flex-direction: column; gap: 4px; }
.pl-bar { position: relative; display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pl-bar i.yes { background: linear-gradient(#55c27a, #2f8a4f); }
.pl-bar i.no { background: linear-gradient(#d86464, #9c3838); }
.pl-line { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px #000a; }
.pl-nums { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.pl-verdict { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 9px; }
.pl-verdict.pass { color: #6fdc8c; background: #6fdc8c22; }
.pl-verdict.fail { color: #ff8a8a; background: #ff8a8a1f; }
.pl-status { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 9px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.pl-status.planned { color: #9fd8ff; } .pl-status.progress { color: #ffd27a; } .pl-status.done { color: #6fdc8c; } .pl-status.no { color: var(--ink2); }
.pl-setstatus { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; padding-left: 34px; }
.pl-setstatus button.on { outline: 2px solid var(--accent); }
.pl-foot { align-items: center; }
.pl-cannot { margin: 0; }
.pl-admin { border-top: 1px dashed var(--line); padding-top: 8px; }
.pl-editor { display: flex; flex-direction: column; gap: 8px; }
.pl-editor h3, .pl-editor h4 { margin: 0; }
.pl-edq { display: flex; gap: 8px; align-items: flex-start; }
.pl-edq textarea { flex: 1; }
.pl-th { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink2); }
.pl-th input { width: 64px; padding: 5px 6px; }

/* a squad's own name (owner, 2026-11-22) */
.squad h4 { display: flex; align-items: center; gap: 6px; }
.sq-rename { padding: 0 6px; font-size: 13px; line-height: 20px; background: transparent; border: 1px solid transparent; color: var(--ink2); opacity: .6; }
.squad:hover .sq-rename, .sq-rename:focus { opacity: 1; border-color: var(--line); }
.sq-rename:hover { color: var(--ink); border-color: var(--accent); }

/* profile country flag (2026-11-23) */
img.flag { display: inline-block; vertical-align: middle; border-radius: 2px; box-shadow: 0 0 0 1px #0006; object-fit: cover; }
.pf-country { display: flex; align-items: center; gap: 6px; }
.pf-country select { max-width: 170px; font-size: 12px; }
.lab-stats > .lab-energy:first-child { margin-top: 0 !important; }

/* a profile's battle scoreboard: the title with Back and Close, kept at the top while it scrolls (2026-11-23) */
.pf-board-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -20px; margin: -20px -20px 4px; padding: 14px 20px 10px; background: var(--panel); z-index: 2; border-bottom: 1px solid var(--line); }
.pf-board-head h3 { margin: 0; }
/* Medium / Large text (Options): the dialogs grow with it, as far as the screen allows, so what is in them keeps its room
   (owner, 2026-11-23: the battle results overlapped with Large text) */
html.text-big:not(.app) #modal-box { width: min(calc(560px * var(--ui-zoom)), 94vw); }
html.text-big:not(.app) #modal-box.result { width: min(calc(720px * var(--ui-zoom)), 96vw); }
html.text-big:not(.app) #modal-box.wide { width: min(calc(980px * var(--ui-zoom)), 96vw); }
html.text-big:not(.app) #modal-box.warcard { width: min(calc(620px * var(--ui-zoom)), 96vw); }
html.text-big:not(.app) #modal-box.result.board { width: min(1400px, 96vw); }
html.text-big:not(.app) #modal-box.pfboard { width: min(1280px, 96vw); }

.fac-inf { margin: -2px 0 6px; }   /* the Factory: the open division's Influence under the tabs (2026-11-23) */
.fac-inf b { color: var(--accent); }

/* ---- the interface fits the window (gfx.apply, owner 2026-11-23). ui-fit: a window smaller than 1280 x 720 (browser zoom, a
   small screen): the bars and the battle's boxes shrink with it (--fit); panels and dialogs shrink their content through
   --ui-zoom (text-big). --side: on a screen wider than 16:9 the battle's boxes sit in a 16:9 frame in the middle. */
html.ui-fit:not(.app) #world { grid-template-columns: calc(132px * var(--fit)) 1fr; grid-template-rows: calc(54px * var(--fit)) 1fr; }
html.ui-fit:not(.app) :is(#topbar, #menu, #chat, #f-hud, #f-mini, #tut, #notices, #b-top, #b-actions, #b-sel, #b-reinforce, #b-arrivals, #b-formation, #b-help-box, #b-mini, #b-hover, #b-score),
html.ui-fit:not(.app) body > #bug-btn { zoom: var(--fit); }
html.ui-fit:not(.app) #panel { left: calc(146px * var(--fit)); top: calc(66px * var(--fit)); }
html:not(.app) #b-actions { left: calc((12px + var(--side, 0px)) / var(--fit, 1)); }
html:not(.app) #b-arrivals { left: calc((12px + var(--side, 0px)) / var(--fit, 1)); }
html:not(.app) #chat.battle { left: calc((12px + var(--side, 0px)) / var(--fit, 1)); }
html:not(.app) :is(#b-mini, #b-reinforce, #b-help-box, #b-formation) { right: calc((12px + var(--side, 0px)) / var(--fit, 1)); }
html:not(.app) #b-sel { left: calc((464px + var(--side, 0px)) / var(--fit, 1)); right: calc((260px + var(--side, 0px)) / var(--fit, 1)); }
/* the game's own tooltips (client/js/tooltip.mjs, 2026-11-23) */
#tip { position: fixed; z-index: 200; max-width: 340px; padding: 6px 9px; background: #0b1017f2; color: var(--ink, #dfe6ee); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px #000a; font-size: 12.5px; line-height: 1.35; pointer-events: none; white-space: pre-line; }
#tip[hidden] { display: none; }
html.text-big:not(.app) #tip { font-size: calc(12.5px * var(--ui-zoom)); max-width: calc(340px * var(--ui-zoom)); }

/* mercenaries (2026-11-24) */
.merc-card { margin-top: 10px; padding: 8px 10px; border: 1px dashed #c9a24a; border-radius: 8px; background: #c9a24a12; }
.merc-card p { margin: 4px 0 8px; }
/* (a disabled button gets no hover: the reason's tooltip on its wrapper; panels.mjs mercCard) */
.merc-why { display: inline-block; cursor: not-allowed; }
.merc-why button:disabled { pointer-events: none; opacity: 0.5; }
.merc-card p.merc-no { margin: 6px 0 0; color: #e0a070; }
b.merc-tag { display: inline-block; padding: 0 5px; margin-right: 4px; border-radius: 4px; background: #c9a24a; color: #1a1408; font-size: 11px; letter-spacing: .5px; }

/* the Watch (Admin tab, 2026-11-24) */
.w-list { width: 100%; font-size: 13px; }
.w-list td.num { text-align: right; white-space: nowrap; }
.w-row { cursor: pointer; }
.w-row:hover, .w-row.on { background: #ffffff10; }
.w-flags { display: grid; gap: 3px; }
.w-flag { padding: 2px 8px; border-radius: 6px; font-size: 12px; border-left: 3px solid; }
.w-flag.red { border-color: #e0524a; background: #e0524a1f; }
.w-flag.amber { border-color: #d9a43c; background: #d9a43c1a; }
small.w-on { color: #6fcf7a; }
small.w-sus { color: #e0524a; }
.w-detail { margin: 12px 0; padding: 12px; border: 1px solid #ffffff22; border-radius: 10px; background: #0006; display: grid; gap: 8px; }
.w-detail h4 { margin: 0; }
.w-grid { display: grid; gap: 2px; overflow-x: auto; }
.w-line { display: grid; grid-template-columns: 48px repeat(24, minmax(14px, 1fr)); gap: 2px; align-items: center; }
.w-date, .w-hr { font-size: 11px; color: #ffffff99; }
.w-cell { height: 16px; border-radius: 3px; background: rgb(201 162 74 / calc(0.06 + var(--a, 0) * 0.94)); }
.w-cell.idle { outline: 2px solid #e0524a; outline-offset: -2px; }
.w-record { font-size: 12px; }
.presence-num { display: block; margin: 0 auto 10px; background: #0008; border-radius: 8px; }
.presence-picks { display: flex; gap: 10px; justify-content: center; margin-bottom: 6px; }
.presence-picks button { min-width: 64px; font-size: 18px; }
.notice.warning-box { border-color: #e0524a; }
.notice.warning-box small { color: #e0524a; }
.notice.warning-box p.hint { font-size: 13px; font-weight: 400; color: #ffffffb0; }

/* a mercenary's badge in front of the name, like DEV (owner, 2026-11-24) */
.merc { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 3px; background: #ff8a4c; color: #1a0d05; font-size: 10px; font-weight: 800; line-height: 15px; vertical-align: 1px; letter-spacing: .04em; }

/* the Warehouse's Swap, on the conveyor between the bays (owner, 2026-11-24); a full-width bar on narrow screens */
.wh-bays { grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); }
.wh-conveyor { align-content: center; }
.wh-swap { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 50px; padding: 10px 2px; white-space: normal; line-height: 1.15; }
.wh-swap span { font-size: 22px; color: inherit; text-shadow: none; }
.wh-swap small { font-size: 10px; }
@media (max-width: 1000px) { .wh-conveyor { display: grid; background: none; border: 0; } .wh-swap { flex-direction: row; justify-content: center; width: 100%; padding: 8px; } }
/* Warehouse: pick a whole squad (owner, 2026-11-24) */
.wh-squads { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.wh-squads > small { color: var(--muted); margin-right: 2px; }
.wh-sq { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-color: color-mix(in srgb, var(--sq) 55%, transparent); }
.wh-sq .sq-badge { position: static; }
.wh-sq.on { background: color-mix(in srgb, var(--sq) 28%, transparent); border-color: var(--sq); }

/* Tabs inside Options and Admin (owner, 2026-11-24): the Lab's tab bar; a tab with one card uses one column */
.inner-tabs button { font-size: 15px; padding: 12px 10px 10px; white-space: nowrap; }
/* (too many tabs for the width, as on a phone: the bar scrolls sideways instead of squeezing them; owner, 2026-11-25) */
.inner-tabs { grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.inner-tabs::-webkit-scrollbar { display: none; }
.opts-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
