/* ET: Legacy web platform — components. Tokens live in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg-1); color: var(--fg);
  font: 400 var(--t-15)/1.5 var(--font-body); overflow-x: hidden;
}
/* Faint grain on the page background only (never on the stage). */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-route="play"]::before { display: none; }
body[data-route="play"] { overflow: hidden; background: var(--bg-0); }

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; line-height: 1.15; }
h1 { font-size: var(--t-28); }
h2 { font-size: var(--t-22); }
h3 { font-size: var(--t-18); }
p { margin: 0 0 var(--s-3); }
a { color: var(--olive-hi); text-underline-offset: 3px; }
a:hover { color: var(--khaki); }
img { max-width: 100%; display: block; }
code, kbd, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg-3); font-size: var(--t-13); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--olive); color: var(--fg); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#canvas:focus-visible { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: var(--s-2); top: -60px; z-index: 100; padding: var(--s-2) var(--s-3); background: var(--brass); color: var(--on-brass); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--s-2); }

/* ------------------------------------------------------------------ header */
.site-header {
  position: fixed; inset: 0 0 auto; height: var(--header-h); z-index: 40;
  display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-4);
  background: var(--bg-0); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--s-2); color: var(--fg); text-decoration: none; flex: none; }
.brand:hover { color: var(--fg); }
.brand svg { color: var(--brass); }
.brand-word { font: 700 var(--t-18)/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.brand-word span { color: var(--khaki); font-weight: 600; }

.main-nav { display: flex; align-self: stretch; }
.main-nav a {
  display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3); color: var(--fg-muted); text-decoration: none;
  font: 600 var(--t-15)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: color var(--t-fast), border-color var(--t-fast);
}
.main-nav a:hover { color: var(--fg); }
.main-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--olive-hi); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.net-status { display: flex; align-items: center; gap: var(--s-2); color: var(--fg-muted); font-size: var(--t-13); white-space: nowrap; }
.net-status .dot { width: 8px; height: 8px; background: var(--fg-dim); flex: none; }
.net-status[data-state="online"] .dot { background: var(--ok); }
.net-status[data-state="offline"] .dot { background: var(--red-hi); }
.net-status b { color: var(--fg); font-family: var(--font-mono); font-weight: 500; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: var(--s-2); height: var(--control-h); padding: 0 var(--s-2) 0 var(--s-1); background: transparent; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.user-btn:hover { background: var(--bg-3); }
.user-btn .callsign { font: 600 var(--t-15)/1 var(--font-display); letter-spacing: .04em; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 60; padding: var(--s-1) 0;
  background: var(--bg-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-overlay);
}
.menu a, .menu button {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 40px; padding: 0 var(--s-4);
  background: none; border: 0; color: var(--fg); text-decoration: none; text-align: left; cursor: pointer; font-size: var(--t-15);
}
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--bg-3); color: var(--fg); outline-offset: -2px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-1) 0; }
.menu .menu-head { padding: var(--s-2) var(--s-4); color: var(--fg-dim); font-size: var(--t-12); text-transform: uppercase; letter-spacing: .08em; }

.site-header .nav-toggle { display: none; }

@media (max-width: 1100px) {
  .net-status .label-long { display: none; }
}
/* Five nav items + status + account do not fit with icons on narrower desktops: text labels only. */
@media (min-width: 960px) and (max-width: 1279px) {
  .main-nav a svg { display: none; }
}
/* The header holds brand + 5 nav items + status + account; below 960px the nav folds into a menu. */
@media (max-width: 959px) {
  .site-header .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; background: var(--bg-0);
    border-bottom: 1px solid var(--line-strong); box-shadow: var(--shadow-overlay); display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 48px; border: 0; border-left: 3px solid transparent; padding: 0 var(--s-4); }
  .main-nav a[aria-current="page"] { border-left-color: var(--olive-hi); background: var(--bg-2); }
  .brand-word span { display: none; }
  .user-btn .callsign { display: none; }
  .site-header { gap: var(--s-2); padding: 0 var(--s-3); }
}

/* ------------------------------------------------------------------ layout */
.app-main { position: relative; z-index: 1; padding-top: var(--header-h); }
.view { max-width: 1440px; margin: 0 auto; padding: var(--s-5) var(--s-5) var(--s-6); animation: route-in var(--t-route) var(--ease-out); }
.view.narrow { max-width: 480px; }
@keyframes route-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767px) { .view { padding: var(--s-4) var(--s-3) var(--s-5); } }
body[data-route="play"] .app-main { pointer-events: none; }
body[data-route="play"] .app-main > * { pointer-events: auto; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.page-head h1 { margin-right: auto; }
.page-head > div:first-child { margin-right: auto; }
/* Full row under the heading; padding keeps the measure near 70ch on wide screens. */
.page-head .sub { flex: 0 0 100%; margin: 0; color: var(--fg-muted); padding-right: max(0px, calc(100% - 70ch)); }
.eyebrow { display: block; margin-bottom: var(--s-1); color: var(--khaki); font: 600 var(--t-13)/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; }

.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; }
@media (max-width: 1099px) { .col-8, .col-7, .col-6, .col-5, .col-4 { grid-column: span 12; } }
@media (min-width: 768px) and (max-width: 1099px) { .grid .col-6.pair { grid-column: span 6; } }

.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.muted { color: var(--fg-muted); } .dim { color: var(--fg-dim); } .small { font-size: var(--t-13); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ------------------------------------------------------------------ panel */
.panel { background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.panel-head {
  display: flex; align-items: center; gap: var(--s-2); min-height: 32px; padding: 0 var(--s-3);
  border-bottom: 1px solid var(--line); border-left: 3px solid var(--olive);
}
.panel-head h2, .panel-head h3, .panel-title {
  margin: 0; color: var(--khaki); font: 600 var(--t-13)/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase;
}
.panel-head .actions { margin-left: auto; display: flex; gap: var(--s-1); }
.panel-body { padding: var(--s-4); }
.panel-body.flush { padding: 0; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--control-h); padding: 0 var(--s-4);
  border: 1px solid var(--line-strong); border-radius: var(--r); background: transparent; color: var(--fg); cursor: pointer;
  font: 600 14px/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--bg-3); color: var(--fg); }
.btn:active { background: var(--line); }
.btn svg { flex: none; }
.btn-primary {
  background: var(--brass); border-color: var(--brass); color: var(--on-brass); border-radius: 0;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  padding: 0 var(--s-5);
}
.btn-primary:hover { background: var(--brass-hi); border-color: var(--brass-hi); color: var(--on-brass); }
.btn-primary:active { background: #B8913E; }
.btn-primary:focus-visible { outline-offset: 3px; }
.btn-olive { background: var(--olive); border-color: var(--olive); }
.btn-olive:hover { background: #63743F; }
.btn-ghost { border-color: transparent; }
.btn-danger { border-color: var(--red); color: var(--red-hi); }
.btn-danger:hover { background: rgb(158 59 46 / .18); color: var(--red-hi); }
.btn-lg { height: 44px; font-size: var(--t-15); }
.btn-sm { height: 30px; padding: 0 var(--s-3); font-size: var(--t-13); }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--fg) transparent var(--fg) transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary.is-busy::after { border-color: var(--on-brass) transparent var(--on-brass) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) { .btn-sm { height: 44px; } .btn-icon.btn-sm { width: 44px; } }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; margin-bottom: var(--s-4); }
.field label, .label { color: var(--khaki); font: 600 var(--t-13)/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 var(--s-3); background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r);
  color: var(--fg); transition: border-color var(--t-fast);
}
textarea.input { height: auto; min-height: 80px; padding: var(--s-2) var(--s-3); resize: vertical; }
.input:hover { border-color: #5A6349; }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--red-hi); }
.input::placeholder { color: var(--fg-dim); }
.input.mono { font-family: var(--font-mono); letter-spacing: .04em; }
.help { margin: 0; color: var(--fg-dim); font-size: var(--t-13); }
.error-text { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--red-hi); font-size: var(--t-13); }
.error-text svg { flex: none; margin-top: 2px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .reveal { position: absolute; right: 2px; top: 2px; height: 36px; width: 40px; border: 0; background: transparent; color: var(--fg-muted); cursor: pointer; display: grid; place-items: center; }
.input-wrap .reveal:hover { color: var(--fg); }
.check { display: flex; align-items: center; gap: var(--s-2); min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--olive-hi); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }

.alert { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); margin-bottom: var(--s-4); border: 1px solid var(--line-strong); border-left-width: 3px; background: var(--bg-1); }
.alert svg { flex: none; margin-top: 2px; }
.alert p:last-child { margin-bottom: 0; }
.alert-error { border-color: var(--red); color: var(--fg); }
.alert-error > svg { color: var(--red-hi); }
.alert-warn { border-color: var(--warn); }
.alert-warn > svg { color: var(--warn); }
.alert-ok { border-color: var(--ok); }
.alert-ok > svg { color: var(--ok); }
.alert-info > svg { color: var(--khaki); }

/* ------------------------------------------------------------------ tabs / segmented */
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.tabs button {
  height: 34px; padding: 0 var(--s-3); border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--fg-muted); cursor: pointer;
  font: 600 var(--t-13)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; transition: background-color var(--t-fast), color var(--t-fast);
}
.tabs button:last-child { border-right: 0; }
.tabs button:hover { background: var(--bg-3); color: var(--fg); }
.tabs button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--olive); color: var(--fg); }
.tabs button:focus-visible { outline-offset: -2px; }
@media (pointer: coarse) { .tabs button { height: 44px; } }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-bottom: var(--s-4); }
.toolbar .grow { flex: 1 1 200px; min-width: 0; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg-dim); pointer-events: none; }
.search .input { padding-left: 36px; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--r);
  font: 500 var(--t-12)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; color: var(--fg-muted);
}
.badge .dot { width: 6px; height: 6px; background: currentColor; }
.badge-ok { border-color: var(--ok); color: var(--ok); }
.badge-warn { border-color: var(--warn); color: var(--warn); }
.badge-bad { border-color: var(--red); color: var(--red-hi); }
.badge-axis { border-color: var(--axis); color: #D57B69; }
.badge-allies { border-color: var(--allies); color: #93AECA; }
.badge-brass { border-color: var(--brass); color: var(--brass); }

/* ------------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-15); }
table.data caption { caption-side: bottom; padding: var(--s-2) var(--s-3); color: var(--fg-dim); font-size: var(--t-13); text-align: left; }
table.data th {
  position: sticky; top: 0; z-index: 1; height: 34px; padding: 0 var(--s-3); background: var(--bg-2); border-bottom: 1px solid var(--line-strong);
  color: var(--khaki); font: 600 var(--t-12)/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; text-align: left; white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; }
table.data th button { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
table.data th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
table.data td { height: var(--row-h); padding: var(--s-1) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { transition: background-color var(--t-fast); }
table.data tbody tr:hover { background: var(--bg-3); }
table.data tbody tr.is-selected { background: #262C1D; box-shadow: inset 3px 0 0 var(--olive-hi); }
table.data tbody tr.is-me { box-shadow: inset 3px 0 0 var(--brass); }
table.data tr[tabindex] { cursor: pointer; }
table.data tr[tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.data td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.data .cell-main { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
table.data .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.thumb { width: 40px; height: 30px; object-fit: cover; background: var(--bg-3); border: 1px solid var(--line); flex: none; }

/* ------------------------------------------------------------------ states */
.state {
  display: grid; justify-items: start; gap: var(--s-2); padding: var(--s-5); border: 1px dashed var(--line-strong); background: var(--bg-1);
}
.state svg.state-icon { color: var(--khaki); }
.state h3 { font-size: var(--t-18); }
.state p { margin: 0; color: var(--fg-muted); max-width: 60ch; }
.state .row { margin-top: var(--s-2); }
.state-error svg.state-icon { color: var(--red-hi); }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.loading-block { min-height: 160px; }

/* ------------------------------------------------------------------ dialog / toast */
dialog.dlg { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--fg); box-shadow: var(--shadow-overlay); }
dialog.dlg::backdrop { background: var(--scrim); }
dialog.dlg .dlg-body { padding: var(--s-4); }
dialog.dlg .dlg-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }

.toasts { position: fixed; left: var(--s-4); bottom: var(--s-4); z-index: 90; display: grid; gap: var(--s-2); max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); background: var(--bg-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--olive-hi); box-shadow: var(--shadow-overlay); animation: toast-in var(--t-panel) var(--ease-out); }
.toast.error { border-left-color: var(--red-hi); }
.toast svg { flex: none; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ stage (game) */
/* overflow: clip (not hidden): the off-screen drawer must never make the stage scrollable, or focus() shifts the canvas sideways. */
.stage { position: fixed; inset: var(--header-h) 0 0; z-index: 2; background: var(--bg-0); overflow: clip; }
body:not([data-route="play"]) .stage { visibility: hidden; pointer-events: none; }
.stage:fullscreen { inset: 0; }
#canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-overlay { position: absolute; inset: 0; z-index: 3; overflow: auto; background: var(--bg-0); }
.stage-overlay[hidden] { display: none; }
/* Friends panel (header button on every page). */
.user-menu { display: flex; align-items: center; gap: var(--s-2); }
.friends-btn { position: relative; padding: 0 var(--s-2); gap: 6px; color: var(--fg-muted); }
.friends-btn .friends-count { font: 600 var(--t-13)/1 var(--font-mono); color: var(--ok); }
.friends-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; background: var(--red); color: #fff; font: 700 11px/1 var(--font-body); border-radius: 9px; }
.friends-badge[hidden] { display: none; }
.friends-panel { position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(380px, 100%); z-index: 45; overflow-y: auto; overscroll-behavior: contain;
  background: rgb(18 20 15 / .98); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-overlay);
  transform: translateX(100%); transition: transform var(--t-panel) var(--ease-in); }
.friends-panel.open { transform: none; transition: transform var(--t-panel) var(--ease-out); }
.friends-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 var(--s-2) 0 var(--s-4); background: var(--bg-0); border-bottom: 1px solid var(--line); }
.friends-head h2 { margin: 0; }
.friend-add { display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.friend-add .input { flex: 1; min-width: 0; height: 36px; }
.friends-sec { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.friends-sec h3 { margin: 0 0 var(--s-2); color: var(--khaki); font-size: var(--t-13); letter-spacing: .1em; text-transform: uppercase; }
.friends-sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-2); }
.friends-sec-head h3 { margin: 0; }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.friend { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-3); align-items: center; padding: 6px 0; }
.friend-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; padding-left: 40px; }
.friend-av { position: relative; display: inline-flex; }
.presence-dot { position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-0); background: var(--fg-dim); }
.presence-dot.on { background: var(--ok); }
.presence-dot.ingame { background: var(--brass); }
.friend-main { min-width: 0; }
.friend-name { font: 600 var(--t-15)/1.2 var(--font-display); letter-spacing: .04em; color: var(--fg); text-decoration: none; }
.friend-name:hover { text-decoration: underline; }
.friend-sub { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend.is-off { opacity: .6; }
.friend.is-leader .friend-name::after { content: " ★"; color: var(--brass); }
.toast-social .row .btn { height: 32px; }
@media (max-width: 620px) { .friends-btn .friends-count { display: none; } }

/* Lobby squad: name tags above the soldiers, party card. */
.squad-tag { position: absolute; z-index: 2; left: 0; top: 0; visibility: hidden; pointer-events: none; white-space: nowrap; padding: 2px 8px;
  background: rgb(10 11 8 / .72); border: 1px solid var(--line-strong); font: 600 var(--t-13)/1.3 var(--font-display); letter-spacing: .05em; text-transform: uppercase; color: var(--fg); }
.squad-tag .dim { font-weight: 400; text-transform: none; letter-spacing: 0; }
.squad-tag.lead::before { content: "★ "; color: var(--brass); }
.lobby-party { display: grid; gap: var(--s-2); padding: var(--s-3); }
.lobby-party-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.lobby-party-list { display: flex; flex-wrap: wrap; gap: 4px; }
.lobby-party-list span { padding: 2px 8px; border: 1px solid var(--line); font-size: var(--t-13); }
.lobby-party-list span.lead { border-color: var(--brass); }
.lobby-invite { width: 100%; justify-content: center; }
.lobby-wait { padding: var(--s-3); border: 1px dashed var(--line-strong); text-align: center; color: var(--fg-muted); }

/* Lobby (Play start screen): soldier in the middle, cards around him. */
.stage-overlay.lobby-on { background: var(--bg-0); overflow: hidden auto; }
.lobby { position: relative; min-height: 100%; isolation: isolate; display: grid; }
.lobby-bg { position: absolute; inset: -24px; background: var(--bg-1) center / cover no-repeat; filter: blur(14px) saturate(.65) brightness(.42); z-index: -2; transition: background-image var(--t-panel) var(--ease-out); }
.lobby::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 60% 70% at 50% 55%, transparent 0, rgba(10, 11, 8, .55) 70%, rgba(10, 11, 8, .9) 100%), linear-gradient(to top, rgba(10, 11, 8, .85), transparent 40%); }
.lobby-grid { display: grid; grid-template-columns: minmax(250px, 330px) 1fr minmax(270px, 350px); grid-template-rows: auto 1fr auto; gap: var(--s-4); padding: var(--s-5); }
.lobby-card { background: color-mix(in srgb, var(--bg-2) 86%, transparent); border: 1px solid var(--line); padding: var(--s-4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lobby-player { position: relative; z-index: 1; grid-column: 1; grid-row: 1; display: grid; gap: var(--s-2); align-content: start; }
.lobby-id { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3); }
.lobby-name { font: 600 var(--t-18)/1.1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-xp { height: 4px; margin-top: 6px; }
.lobby-soldier { grid-column: 2; grid-row: 1 / -1; position: relative; min-height: 420px; display: grid; place-items: center; }
.lobby-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline-offset: -2px; }
.lobby-canvas.dragging { cursor: grabbing; }
/* Desktop: the squad may stand wider than the middle column, behind the cards. */
@media (min-width: 901px) and (min-height: 521px) { .lobby-canvas { left: -30%; width: 160%; } }
.lobby-plinth { position: absolute; left: 50%; bottom: 6%; width: min(46%, 300px); aspect-ratio: 4 / 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .65) 0, rgba(0, 0, 0, .35) 45%, transparent 70%); box-shadow: 0 0 0 1px rgba(201, 162, 39, .12) inset; }
.lobby-soldier.squad .lobby-plinth { display: none; }
.lobby-note { position: relative; max-width: 300px; text-align: center; color: var(--fg-muted); }
.lobby-loadout { position: relative; z-index: 1; grid-column: 1; grid-row: 3; align-self: end; display: grid; gap: var(--s-3); }
.lobby-loadout h2, .lobby-mode h2 { margin: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); }
.seg-btn { min-height: 40px; background: transparent; border: 0; color: var(--fg-muted); font: 600 var(--t-15)/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn[aria-checked="true"].faction-axis { background: color-mix(in srgb, var(--axis) 34%, transparent); color: var(--fg); }
.seg-btn[aria-checked="true"].faction-allies { background: color-mix(in srgb, var(--allies) 34%, transparent); color: var(--fg); }
.class-list { display: grid; gap: 4px; }
.class-btn { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); min-height: 40px; padding: 6px var(--s-3); text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--fg); }
.class-btn strong { font: 600 var(--t-15)/1.2 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }
.class-btn span { color: var(--fg-dim); font-size: var(--t-12); text-align: right; }
.class-btn:hover { background: var(--bg-3); }
.class-btn[aria-checked="true"] { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, transparent); }
.lobby-mode { position: relative; z-index: 1; grid-column: 3; grid-row: 3; align-self: end; display: grid; gap: var(--s-3); }
.lobby-mode-head { display: flex; gap: var(--s-3); align-items: flex-start; justify-content: space-between; }
.lobby-mode-title { font: 600 var(--t-22)/1.15 var(--font-display); letter-spacing: .03em; text-transform: uppercase; overflow-wrap: anywhere; }
.quick-modes { display: grid; gap: 4px; }
.quick-mode { display: flex; justify-content: space-between; gap: var(--s-2); min-height: 36px; padding: 6px var(--s-3); background: transparent; border: 1px solid var(--line); color: var(--fg); cursor: pointer; text-align: left; }
.quick-mode[aria-checked="true"] { border-color: var(--olive-hi); background: color-mix(in srgb, var(--olive) 22%, transparent); }
.lobby-play { width: 100%; min-height: 60px; font-size: var(--t-22); letter-spacing: .12em; }
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(300px, 46vh) auto; padding: var(--s-3); gap: var(--s-3); height: auto; }
  .lobby-player { grid-column: 1 / -1; grid-row: 1; }
  .lobby-soldier { grid-column: 1 / -1; grid-row: 2; min-height: 0; }
  .lobby-soldier.squad .lobby-canvas { top: 26px; height: calc(100% - 26px); }
  .lobby-loadout { grid-column: 1; grid-row: 3; }
  .lobby-mode { grid-column: 2; grid-row: 3; }
}
@media (max-width: 620px) {
  .lobby-grid { grid-template-columns: 1fr; grid-template-rows: auto minmax(260px, 40vh) auto auto; }
  .lobby-loadout, .lobby-mode { grid-column: 1; }
  .lobby-loadout { grid-row: 3; }
  .lobby-mode { grid-row: 4; }
  /* Classes as one row of chips, so the loadout stays short above Play. */
  .class-list { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .class-btn { flex: 0 0 auto; border-color: var(--line); }
  .class-btn span { display: none; }
}
/* Landscape phones: soldier left, cards right. */
@media (max-height: 520px) and (orientation: landscape) {
  .lobby-grid { grid-template-columns: 1fr minmax(240px, 300px) minmax(240px, 300px); grid-template-rows: auto 1fr; padding: var(--s-2); gap: var(--s-2); }
  .lobby-player { grid-column: 2 / -1; grid-row: 1; }
  .lobby-soldier { grid-column: 1; grid-row: 1 / -1; min-height: 0; }
  .lobby-loadout { grid-column: 2; grid-row: 2; }
  .lobby-mode { grid-column: 3; grid-row: 2; }
  .class-btn span { display: none; }
  .lobby-play { min-height: 48px; }
}

/* Pause menu: the match keeps running behind it, so let it show through. */
.stage-overlay.pause { background: color-mix(in srgb, var(--bg-0) 76%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pause-menu { width: min(440px, 100%); }
.pause-actions { display: grid; gap: var(--s-2); }
.pause-actions .btn { width: 100%; justify-content: flex-start; }
.pause-settings { display: grid; gap: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-3); }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); align-items: center; }
.range-row input[type="range"] { grid-column: 1 / -1; width: 100%; min-height: 32px; accent-color: var(--olive-hi); }

/* Voice chat: who is talking (it grows upwards, below it the game writes its own hints), and the settings in the pause menu (js/voice/panel.js). */
.voice-hud { position: absolute; left: max(var(--s-2), env(safe-area-inset-left)); bottom: 67%; z-index: 4; display: grid; gap: var(--s-1); justify-items: start; max-width: min(240px, 45vw); pointer-events: none; }
.stage-overlay:not([hidden]) ~ .voice-hud { display: none; }
.voice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); justify-items: start; max-width: 100%; }
.voice-row { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 8px; background: var(--stage-chrome); border-left: 3px solid var(--olive-hi); color: var(--fg); font-size: var(--t-13); line-height: 1.3; }
.voice-row svg { flex: none; }
.voice-self { border-left-color: var(--brass); color: var(--brass-hi); }
.voice-note { margin: 0; padding: var(--s-2); background: var(--stage-chrome); border: 1px solid var(--line-strong); color: var(--fg); font-size: var(--t-13); }
.voice-row[hidden], .voice-note[hidden] { display: none; }
.voice-controls { display: grid; gap: var(--s-3); }
.voice-controls[hidden], .voice-settings .field[hidden], .voice-meter[hidden] { display: none; }
.voice-settings .field { margin: 0; }
.voice-key .btn { min-width: 120px; justify-content: center; }
.voice-meter { height: 6px; background: var(--bg-3); overflow: hidden; }
.voice-meter > div { height: 100%; background: var(--ok); transform: scaleX(0); transform-origin: left; }
.voice-people { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.voice-people li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 44px; }

.stage-toolbar {
  position: absolute; top: var(--s-2); right: var(--s-2); z-index: 5; display: flex; gap: 2px; padding: 2px;
  background: var(--stage-chrome); border: 1px solid var(--line); opacity: .6; transition: opacity var(--t-fast);
}
.stage-toolbar:hover, .stage-toolbar:focus-within { opacity: 1; }
.stage.locked .stage-toolbar { display: none; }
.stage-toolbar .btn { border-color: transparent; }

.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 100%); z-index: 6; overflow-y: auto;
  background: var(--stage-chrome); background: rgb(18 20 15 / .96); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-overlay);
  transform: translateX(100%); visibility: hidden; transition: transform var(--t-panel) var(--ease-in), visibility 0s linear var(--t-panel);
}
.drawer.open { transform: none; visibility: visible; transition: transform var(--t-panel) var(--ease-out), visibility 0s; }
.drawer-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 var(--s-2) 0 var(--s-4); background: var(--bg-0); border-bottom: 1px solid var(--line); z-index: 1; }
.drawer section { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.drawer h3 { margin-bottom: var(--s-2); color: var(--khaki); font-size: var(--t-13); letter-spacing: .1em; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-13); }
.feed li { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.feed .w { color: var(--fg-dim); }

/* briefing */
.briefing { max-width: 1240px; margin: 0 auto; padding: var(--s-5); }
.briefing-grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1023px) { .briefing-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .briefing { padding: var(--s-4) var(--s-3); } }
.map-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.map-card {
  position: relative; display: grid; padding: 0; text-align: left; background: var(--bg-1); border: 1px solid var(--line); cursor: pointer; color: var(--fg);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.map-card:hover { border-color: var(--line-strong); background: var(--bg-3); }
.map-card[aria-checked="true"] { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.map-card img, .map-card .no-shot { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-3); }
.map-card .no-shot { display: grid; place-items: center; color: var(--fg-dim); font-size: var(--t-13); }
.map-card .meta { padding: var(--s-2) var(--s-3); }
.map-card .meta strong { display: block; font: 700 var(--t-15)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .05em; }
.map-card .meta span { color: var(--fg-dim); font-size: var(--t-12); font-family: var(--font-mono); }
.map-card .tick { position: absolute; top: var(--s-2); right: var(--s-2); width: 24px; height: 24px; display: none; place-items: center; background: var(--brass); color: var(--on-brass); }
.map-card[aria-checked="true"] .tick { display: grid; }
.deploy-card .shot { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-3); border-bottom: 1px solid var(--line); }
.briefing-text { color: var(--fg-muted); font-size: var(--t-13); white-space: pre-line; max-height: 9.5em; overflow: auto; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s-3); margin: 0 0 var(--s-3); font-size: var(--t-13); }
.facts dt { color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em; font-size: var(--t-12); padding-top: 2px; }
.facts dd { margin: 0; }

.progress { height: 6px; background: var(--bg-3); border: 1px solid var(--line); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--olive-hi); transition: width var(--t-panel) linear; }
.progress.indeterminate > div { width: 30%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress.indeterminate > div { animation: none; width: 100%; opacity: .5; } }
.boot { display: flex; flex-direction: column; justify-content: center; gap: var(--s-3); min-height: 100%; padding: var(--s-5); width: min(560px, 100%); margin: 0 auto; }
.boot > * { margin: 0; }
.boot .status-line { color: var(--fg-muted); font-family: var(--font-mono); font-size: var(--t-13); min-height: 1.5em; }

/* ------------------------------------------------------------------ servers */
.status-strip { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; padding: var(--s-2) var(--s-3); margin-bottom: var(--s-3); background: var(--bg-2); border: 1px solid var(--line); font-size: var(--t-13); color: var(--fg-muted); }
.status-strip b { color: var(--fg); font-family: var(--font-mono); font-weight: 500; }
.split { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1099px) { .split { grid-template-columns: 1fr; } }
.split .detail { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
@media (max-width: 1099px) { .split .detail { position: static; } }
.fav-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--fg-dim); cursor: pointer; }
.fav-btn:hover { color: var(--khaki); }
.fav-btn[aria-pressed="true"] { color: var(--brass); }
@media (pointer: coarse) { .fav-btn { width: 44px; height: 44px; } }
.roster { list-style: none; margin: 0; padding: 0; font-size: var(--t-13); }
.roster li { display: flex; justify-content: space-between; gap: var(--s-2); padding: 4px 0; border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ leaderboards */
.podium { display: grid; gap: var(--s-3); grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--s-4); }
@media (max-width: 767px) { .podium { grid-template-columns: 1fr; } }
.podium-card { display: flex; align-items: center; gap: var(--s-3); max-height: 120px; padding: var(--s-3); background: var(--bg-2); border: 1px solid var(--line); border-top: 3px solid var(--line-strong); text-decoration: none; color: var(--fg); }
.podium-card:hover { background: var(--bg-3); color: var(--fg); }
.podium-card.p1 { border-top-color: var(--brass); }
.podium-card.p2 { border-top-color: #A9A595; }
.podium-card.p3 { border-top-color: #9A6A3E; }
.podium-card .pos { font: 700 var(--t-28)/1 var(--font-display); color: var(--fg-dim); width: 1.5ch; }
.podium-card.p1 .pos { color: var(--brass); }
.podium-card .who { min-width: 0; }
.podium-card .who strong { display: block; font: 700 var(--t-18)/1.2 var(--font-display); letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-card .val { margin-left: auto; font: 500 var(--t-22)/1 var(--font-mono); }
.me-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-3); background: #1E2216; border: 1px solid var(--line-strong); border-left: 3px solid var(--brass); font-size: var(--t-13); }
.me-bar b { font-family: var(--font-mono); font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--line); font-size: var(--t-13); color: var(--fg-muted); }

/* ------------------------------------------------------------------ dossier */
.insignia { width: 32px; height: 32px; object-fit: contain; flex: none; }
.insignia-lg { width: 56px; height: 56px; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: none; background: var(--bg-3); border: 1px solid var(--line-strong); color: var(--khaki); }
.avatar.sm { width: 28px; height: 28px; }
.avatar.lg { width: 88px; height: 88px; }
.avatar[data-accent="olive"] { color: var(--olive-hi); border-color: var(--olive); }
.avatar[data-accent="khaki"] { color: var(--khaki); border-color: #7D7357; }
.avatar[data-accent="brass"] { color: var(--brass); border-color: #8A6E33; }
.avatar[data-accent="steel"] { color: #93AECA; border-color: var(--allies); }
.avatar[data-accent="rust"] { color: #D57B69; border-color: var(--axis); }
.dossier-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); margin-bottom: var(--s-4);
  background: var(--bg-2); border: 1px solid var(--line-strong);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
}
@media (max-width: 767px) { .dossier-head { grid-template-columns: auto minmax(0, 1fr); padding: var(--s-4); } .dossier-head .rank-box { grid-column: 1 / -1; } }
.dossier-head .callsign { font: 700 var(--t-28)/1.1 var(--font-display); letter-spacing: .03em; overflow-wrap: anywhere; }
.dossier-head .motto { color: var(--fg-muted); font-style: italic; margin: 2px 0 var(--s-2); }
.rank-box { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s-3); align-items: center; min-width: 240px; }
.rank-box .progress { grid-column: 1 / -1; margin-top: var(--s-2); }
.rank-box .rank-name { font: 700 var(--t-18)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; margin-bottom: var(--s-4); background: var(--line); border: 1px solid var(--line); }
.kpi { padding: var(--s-3); background: var(--bg-2); min-width: 0; }
.kpi .k { color: var(--khaki); font: 600 var(--t-12)/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.kpi .v { margin-top: 6px; font: 500 var(--t-22)/1.1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .s { color: var(--fg-dim); font-size: var(--t-12); }
.ach-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ach { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s-3); padding: var(--s-3); background: var(--bg-1); border: 1px solid var(--line); }
.ach .ic { grid-row: span 3; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--fg-dim); }
.ach.done { border-color: #5E5131; }
.ach.done .ic { color: var(--brass); border-color: var(--brass); }
.ach strong { font: 700 var(--t-15)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.ach p { margin: 0; color: var(--fg-muted); font-size: var(--t-13); }
.ach .progress { margin-top: 6px; height: 4px; }
.ach.done .progress > div { background: var(--brass); }

/* charts */
.chart-summary { margin: 0 0 var(--s-3); color: var(--fg-muted); font-size: var(--t-13); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--fg-dim); font: 11px var(--font-mono); }
.chart .series { fill: none; stroke: var(--olive-hi); stroke-width: 2; }
.chart .pt { fill: var(--bg-2); stroke: var(--olive-hi); stroke-width: 2; }
.chart .pt.best { fill: var(--brass); stroke: var(--brass); }
.chart .ref { stroke: var(--line-strong); stroke-dasharray: 4 4; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.bars li { display: grid; grid-template-columns: 24px minmax(90px, 9rem) minmax(0, 1fr) 4.5rem; gap: var(--s-2); align-items: center; font-size: var(--t-13); }
.bars .bar { height: 14px; background: var(--bg-3); }
.bars .bar > span { display: block; height: 100%; background: var(--olive); }
.bars li:first-child .bar > span { background: var(--brass); }
.bars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .val { text-align: right; font-family: var(--font-mono); }
.bars img { width: 24px; height: 24px; object-fit: contain; }
.view-toggle { margin-left: auto; }

.result-win { color: var(--ok); } .result-loss { color: var(--red-hi); } .result-draw { color: var(--fg-muted); }

/* community */
.match-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3); border-bottom: 1px solid var(--line); }
.match-card:last-child { border-bottom: 0; }
.match-card img { width: 96px; height: 72px; object-fit: cover; background: var(--bg-3); border: 1px solid var(--line); }
.match-card .top { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--t-13); }

/* settings */
.settings-nav { display: grid; gap: 2px; align-content: start; }
.settings-nav a { display: flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-3); color: var(--fg-muted); text-decoration: none; border-left: 3px solid transparent; }
.settings-nav a:hover { background: var(--bg-3); color: var(--fg); }
.settings-nav a[aria-current="true"] { color: var(--fg); border-left-color: var(--olive-hi); background: var(--bg-2); }
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 var(--s-2); border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--fg-muted); cursor: pointer; }
.choice input:checked + span { border-color: var(--brass); color: var(--fg); box-shadow: inset 0 0 0 1px var(--brass); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3); background: var(--bg-1); border: 1px dashed var(--brass); }
.code-box code { font-size: var(--t-28); letter-spacing: .2em; color: var(--brass); }
.key-box code { font-size: var(--t-18); letter-spacing: .06em; color: var(--brass); word-break: break-all; }

/* ET colour codes, slightly muted for contrast on dark */
.etc { white-space: pre-wrap; }
.user-menu > .row { flex-wrap: nowrap; }
/* Headings receive focus programmatically on route change; they are not controls, so no ring. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main:focus { outline: none; }

/* ---------------------------------------------------------------- touch controls (js/touch.js)
   Over the canvas, under the stage toolbar. Thumbstick left, look anywhere right, actions bottom-right.
   Buttons are chamfered (the system's CTA shape); only the stick is round, as a stick is. */
.t-ui {
  --sl: max(12px, env(safe-area-inset-left)); --sr: max(12px, env(safe-area-inset-right)); --sb: max(10px, env(safe-area-inset-bottom));
  --b: 56px; --fire: 80px; --gap: 10px;
  position: absolute; inset: 0; z-index: 4; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; overflow: hidden;
}
.t-ui[hidden] { display: none; }
.stage.touch-on .stage-toolbar { opacity: .85; top: max(6px, env(safe-area-inset-top)); right: var(--sr, 12px); }
.t-top { position: absolute; top: max(6px, env(safe-area-inset-top)); left: var(--sl); display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 200px); }
.t-pill, .t-top .t-btn {
  position: static; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; height: 40px; width: auto; padding: 0 12px;
  background: var(--stage-chrome); border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--fg);
  font: 600 var(--t-13)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; clip-path: none;
}
.t-pill:active, .t-top .t-btn.is-down { border-color: var(--brass); color: var(--brass-hi); }
.t-hint { position: absolute; left: 50%; bottom: calc(var(--sb) + 4px); transform: translateX(-50%); color: var(--fg-muted); font-size: var(--t-12); text-shadow: 0 1px 2px #000; pointer-events: none; opacity: .8; white-space: nowrap; }
.t-stick { position: absolute; left: calc(var(--sl) + 28px); bottom: calc(var(--sb) + 28px); width: 112px; height: 112px; border-radius: 50%;
  border: 2px solid rgb(232 227 211 / .35); background: rgb(11 12 9 / .30); pointer-events: none; }
.t-stick.is-active { left: 0; top: 0; bottom: auto; border-color: rgb(201 161 74 / .7); will-change: transform; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: rgb(232 227 211 / .35); border: 2px solid rgb(232 227 211 / .6); }
.t-stick.is-active .t-knob { background: rgb(201 161 74 / .45); border-color: var(--brass); }
.t-sprint { position: absolute; left: calc(var(--sl) + 28px); top: max(56px, calc(env(safe-area-inset-top) + 50px)); padding: 2px 8px; background: var(--brass); color: var(--bg-0);
  font: 700 var(--t-12)/1.4 var(--font-display); text-transform: uppercase; letter-spacing: .08em; pointer-events: none; }
.t-sprint[hidden] { display: none; }
.t-btn {
  position: absolute; width: var(--b); height: var(--b); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgb(11 12 9 / .55); border: 1px solid rgb(232 227 211 / .35); color: var(--fg); padding: 0;
  font: 700 11px/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; touch-action: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
/* Above the weapon buttons, so it can be held while the other thumb moves. */
.t-talk   { right: calc(var(--sr) + 16px + (var(--fire) - var(--b)) / 2); bottom: calc(var(--sb) + 22px + var(--fire) + var(--gap) * 3 + var(--b) + 44px); height: 48px; }
.t-btn[hidden] { display: none; }
.t-btn.is-down, .t-btn[aria-pressed="true"] { background: rgb(201 161 74 / .45); border-color: var(--brass); color: #fff; }
.t-btn svg { pointer-events: none; }
.t-btn span:empty { display: none; }
.t-fire { width: var(--fire); height: var(--fire); right: calc(var(--sr) + 16px); bottom: calc(var(--sb) + 22px); background: rgb(158 59 46 / .55); border-color: rgb(208 106 85 / .8); font-size: 12px; }
.t-fire.is-down { background: rgb(208 106 85 / .75); }
/* Bottom row left of Fire, then a second row above it, weapons on top: thumb reach on the right. */
.t-jump   { right: calc(var(--sr) + 16px + var(--fire) + var(--gap)); bottom: calc(var(--sb) + 12px); }
.t-crouch { right: calc(var(--sr) + 16px + var(--fire) + var(--gap) * 2 + var(--b)); bottom: calc(var(--sb) + 12px); }
.t-prone  { right: calc(var(--sr) + 16px + var(--fire) + var(--gap) * 3 + var(--b) * 2); bottom: calc(var(--sb) + 12px); }
.t-reload { right: calc(var(--sr) + 16px + (var(--fire) - var(--b)) / 2); bottom: calc(var(--sb) + 22px + var(--fire) + var(--gap)); }
.t-alt    { right: calc(var(--sr) + 16px + var(--fire) + var(--gap)); bottom: calc(var(--sb) + 12px + var(--b) + var(--gap)); }
.t-use    { right: calc(var(--sr) + 16px + var(--fire) + var(--gap) * 2 + var(--b)); bottom: calc(var(--sb) + 12px + var(--b) + var(--gap)); }
.t-wnext  { right: calc(var(--sr) + 16px + (var(--fire) - var(--b)) / 2); bottom: calc(var(--sb) + 22px + var(--fire) + var(--gap) * 2 + var(--b)); width: var(--b); height: 44px; }
.t-wprev  { right: calc(var(--sr) + 16px + (var(--fire) - var(--b)) / 2 + var(--b) + var(--gap)); bottom: calc(var(--sb) + 22px + var(--fire) + var(--gap) * 2 + var(--b)); width: var(--b); height: 44px; }
/* Short landscape phones (about 360px tall): smaller buttons so the weapon row still fits. */
@media (max-height: 420px) { .t-ui { --b: 48px; --fire: 68px; --gap: 8px; } .t-hint { display: none; } }
.t-sheet {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-overlay); z-index: 6; touch-action: pan-y;
}
.t-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line);
  font: 700 var(--t-15)/1 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.t-sheet-body { padding: var(--s-3); }
.t-label { display: block; margin: var(--s-2) 0 var(--s-1); color: var(--khaki); font: 600 var(--t-12)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .1em; }
.t-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.t-choice { min-height: 44px; }
.t-choice[aria-pressed="true"] { border-color: var(--brass); color: var(--brass-hi); background: rgb(201 161 74 / .12); }
.t-range { width: 100%; height: 44px; accent-color: var(--brass); }
/* Portrait phone: the game needs landscape. */
.t-rotate { display: none; }
@media (orientation: portrait) {
  .t-rotate { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
    background: rgb(11 12 9 / .94); color: var(--fg); text-align: center; padding: var(--s-5); font-size: var(--t-15); }
  .t-rotate svg { color: var(--brass); }
  .t-rotate strong { font: 700 var(--t-22)/1.2 var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
  .t-rotate span { color: var(--fg-muted); }
}
.portrait-only { display: none; }
@media (orientation: portrait) and (pointer: coarse) { .portrait-only { display: flex; align-items: center; gap: 6px; color: var(--brass-hi); } }
@media (prefers-reduced-motion: reduce) { .t-btn, .t-pill { transition: none; } }

/* ---------------------------------------------------------------- phones (mobile audit 2026-12-05) */
.m-only, .panel-head .actions.m-only { display: none; }
.m-deploy-bar { display: none; }
body.sheet-lock { overflow: hidden; }
/* Touch screens: 16px text in fields (iOS zooms into anything smaller), 44px targets. */
@media (pointer: coarse), (max-width: 639px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .brand { min-height: 44px; }
  .input, select.input { height: 44px; }
  .input-wrap .reveal { width: 44px; height: calc(100% - 4px); }
  .tabs button { min-width: 44px; }
  table.data th button { min-height: 44px; }
}
@media (max-width: 1023px) {
  /* The Orders card sits below the maps and servers here: keep its Deploy button in reach. */
  .m-deploy-bar { display: block; position: sticky; bottom: 0; z-index: 2; margin: var(--s-3) calc(var(--s-3) * -1) 0; padding: var(--s-3);
    padding-bottom: max(var(--s-3), env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgb(11 12 9 / 0), var(--bg-0) 35%); }
  .m-deploy-bar .btn { width: 100%; }
}
@media (max-width: 639px) {
  span.m-only { display: inline; }
  .panel-head .actions.m-only { display: flex; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  /* Server list: star, name (map in the second line), players, ping. Details open as a sheet. */
  .srv-table th:nth-child(2), .srv-table td:nth-child(2), .srv-table th:nth-child(4), .srv-table td:nth-child(4),
  .srv-table th:nth-child(n+7), .srv-table td:nth-child(n+7) { display: none; }
  .srv-table { table-layout: fixed; width: 100%; }
  .srv-table th:nth-child(1) { width: 44px; } .srv-table th:nth-child(5) { width: 64px; } .srv-table th:nth-child(6) { width: 56px; }
  .srv-table td:nth-child(3) .cell-main, .srv-table td:nth-child(3) .clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .split > .detail { display: none; }
  .split > .detail.sheet-open { display: block; position: fixed; inset: var(--header-h) 0 0; z-index: 45; overflow: auto; background: var(--bg-0);
    padding: var(--s-3); padding-bottom: max(var(--s-3), env(safe-area-inset-bottom)); overscroll-behavior: contain; }
}

/* Touch play, part 2. On phones the stage covers the whole screen in landscape (iPhones have no
   fullscreen API; this plus "Add to Home Screen" is the closest thing). */
@media (orientation: landscape) {
  .stage.touch-on { inset: 0; z-index: 50; height: 100vh; height: 100dvh; }
}
.t-deploy-row { margin-top: var(--s-3); }
.t-deploy { min-height: 48px; min-width: 160px; justify-content: center; }
.t-debug { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 8; margin: 0; padding: 4px 6px; max-width: 60%;
  background: rgb(0 0 0 / .7); color: #9f9; font: 10px/1.3 var(--font-mono, monospace); white-space: pre-wrap; pointer-events: none; }
.ios-tip { display: flex; gap: var(--s-2); align-items: flex-start; text-align: left; max-width: 46ch; margin-inline: auto; }

/* Performance meter and tuning switches (perf.js). */
.perf-meter { position: absolute; left: 50%; top: max(52px, calc(env(safe-area-inset-top) + 46px)); transform: translateX(-50%); z-index: 3; margin: 0; padding: 4px 8px;
  background: rgb(0 0 0 / .72); color: #b7f7a0; font: 11px/1.35 var(--font-mono, monospace); white-space: pre; pointer-events: none; }
/* Under the touch layer (z 4) so its panels cover it; hidden while the briefing is open. */
.stage-overlay:not([hidden]) ~ .perf-meter { display: none; }
.t-switches { display: grid; gap: var(--s-1); }
.t-switch { display: flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; }
.t-switch input { width: 22px; height: 22px; accent-color: var(--brass); flex: none; }

/* ---------------------------------------------------------------- loading screen (js/loading.js)
   Full bleed, from Play until the player is in the match. All motion is transform/opacity so it keeps
   running while the engine holds the main thread inside a loading step. */
.stage-overlay.loading-on { overflow: hidden; background: var(--bg-0); }
.ld {
  position: absolute; inset: 0; isolation: isolate; overflow: hidden; color: var(--fg);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 24vw); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "head soldier" "foot foot"; gap: var(--s-4) var(--s-5);
  padding: max(var(--s-5), env(safe-area-inset-top)) max(clamp(16px, 4vw, 56px), env(safe-area-inset-right)) max(var(--s-5), env(safe-area-inset-bottom)) max(clamp(16px, 4vw, 56px), env(safe-area-inset-left));
  animation: ld-in .5s var(--ease-out) both;
  transition: opacity .4s var(--ease-in);
}
.ld.leaving { opacity: 0; }
.ld-bg {
  position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; z-index: -2;
  opacity: 0; transform: scale(1.04); transition: opacity 1.2s var(--ease-out);
  filter: saturate(.9) contrast(1.05);
}
.ld.has-bg .ld-bg { opacity: 1; animation: ld-pan 38s ease-in-out infinite alternate; }
.ld-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, var(--bg-0) 0%, color-mix(in srgb, var(--bg-0) 88%, transparent) 26%, transparent 62%),
    linear-gradient(to right, color-mix(in srgb, var(--bg-0) 90%, transparent) 0%, color-mix(in srgb, var(--bg-0) 40%, transparent) 46%, transparent 72%),
    radial-gradient(120% 80% at 70% 30%, transparent 40%, color-mix(in srgb, var(--bg-0) 70%, transparent) 100%);
}
.ld[data-faction="allies"] .ld-shade { box-shadow: inset 0 -3px 0 var(--allies); }
.ld[data-faction="axis"] .ld-shade { box-shadow: inset 0 -3px 0 var(--axis); }

.ld-head { grid-area: head; align-self: end; display: flex; flex-direction: column; gap: var(--s-2); max-width: 46rem; min-width: 0; }
.ld-eyebrow { color: var(--khaki); font: 600 var(--t-13)/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.ld-map { font-size: clamp(2.6rem, 8vw, 6.5rem); line-height: .9; letter-spacing: .02em; text-shadow: 0 2px 24px rgb(0 0 0 / .5); overflow-wrap: anywhere; outline: none; }
.ld-server { margin: 0; font: 600 var(--t-18)/1.3 var(--font-display); letter-spacing: .03em; }
.ld-meta { margin: 0; color: var(--fg-muted); font-size: var(--t-15); }
.ld-meta:empty, .ld-server:empty { display: none; }
.ld-party { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ld-party[hidden] { display: none; }
.ld-party li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-1) 70%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: var(--t-13); }
.ld-pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-dim); }
.ld-party li.on .ld-pdot { background: var(--ok); }

.ld-soldier { grid-area: soldier; align-self: end; justify-self: end; margin: 0; width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: var(--s-2); }
.ld-soldier-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 40%; filter: drop-shadow(0 12px 30px rgb(0 0 0 / .55)); animation: ld-float 6s ease-in-out infinite alternate; }
.ld-soldier figcaption { display: flex; flex-direction: column; gap: 6px; padding: var(--s-2) var(--s-3); border-left: 3px solid var(--olive-hi); background: color-mix(in srgb, var(--bg-1) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ld-soldier figcaption strong { font: 700 var(--t-18)/1.1 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }

.ld-foot { grid-area: foot; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: end; gap: var(--s-5); }
.ld-tip { display: flex; flex-direction: column; gap: var(--s-2); max-width: 34rem; }
.ld-tip-text { margin: 0; color: var(--fg-muted); line-height: 1.5; min-height: 3em; }
.ld-tip-text.in { animation: ld-tip .6s var(--ease-out) both; }
.ld-progress { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.ld-status-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.ld-status { margin: 0; font: 600 var(--t-15)/1.2 var(--font-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-pct { color: var(--fg-muted); font-size: var(--t-13); }
.ld-bar { position: relative; height: 6px; background: color-mix(in srgb, var(--fg) 14%, transparent); overflow: hidden; }
.ld-bar > i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--olive), var(--olive-hi)); transform: scaleX(0); transform-origin: left center; transition: transform .45s var(--ease-out); }
/* a light sweep that keeps moving even when the page itself is frozen for a moment */
.ld-bar::after { content: ""; position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent); transform: translateX(-100%); animation: ld-sweep 1.6s linear infinite; }
.ld-bar.busy > i { transform: scaleX(1); opacity: .25; }
.ld-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px var(--s-3); flex-wrap: wrap; color: var(--fg-dim); font: 600 var(--t-12)/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.ld-steps li { display: inline-flex; align-items: center; gap: 6px; }
.ld-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.ld-steps li.done { color: var(--fg-muted); }
.ld-steps li.done .ld-dot { background: var(--olive-hi); border-color: var(--olive-hi); }
.ld-steps li.now { color: var(--fg); }
.ld-steps li.now .ld-dot { background: var(--khaki); border-color: var(--khaki); animation: ld-pulse 1.1s ease-in-out infinite alternate; }
.ld-cancel { align-self: end; }
.ld-cancel[hidden] { display: none; }

@keyframes ld-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ld-pan { from { transform: scale(1.04) translate3d(-1.5%, 0, 0); } to { transform: scale(1.12) translate3d(1.5%, -1.5%, 0); } }
@keyframes ld-float { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes ld-sweep { to { transform: translateX(340%); } }
@keyframes ld-pulse { from { opacity: .45; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
@keyframes ld-tip { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* tablets and narrow windows: soldier beside the map name, footer stacked */
@media (max-width: 900px) {
  .ld-foot { grid-template-columns: minmax(0, 1fr) auto; }
  .ld-tip { grid-column: 1 / -1; }
}
/* phones upright: one column, small soldier */
@media (max-width: 620px) {
  .ld { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "soldier" "head" "foot"; gap: var(--s-3); }
  .ld-soldier { justify-self: center; align-self: end; width: auto; max-width: 100%; align-items: center; }
  .ld-soldier-img { height: min(34vh, 300px); width: auto; }
  .ld-soldier figcaption { flex-direction: row; align-items: baseline; gap: var(--s-2); padding: 6px 10px; }
  .ld-soldier figcaption strong { font-size: var(--t-15); }
  .ld-server { font-size: var(--t-15); }
  .ld-steps { gap: var(--s-2); font-size: 10px; }
  .ld-tip-text { font-size: var(--t-13); min-height: 0; }
}
/* phones sideways: little height, no soldier picture */
@media (max-height: 500px) and (orientation: landscape) {
  .ld { grid-template-columns: minmax(0, 1fr) auto; padding-top: max(var(--s-3), env(safe-area-inset-top)); padding-bottom: max(var(--s-3), env(safe-area-inset-bottom)); gap: var(--s-2) var(--s-4); }
  .ld-map { font-size: clamp(2rem, 9vh, 3.4rem); }
  .ld-soldier-img { display: none; }
  .ld-tip { display: none; }
  .ld-foot { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ld, .ld.has-bg .ld-bg, .ld-soldier-img, .ld-bar::after, .ld-steps li.now .ld-dot, .ld-tip-text.in { animation: none; }
  .ld-bar > i { transition: none; }
}

/* ---------------------------------------------------------------- admin panel (js/views/admin/) */
.admin-tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-4); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: thin; }
.admin-tabs a { display: flex; align-items: center; gap: var(--s-2); flex: none; height: 44px; padding: 0 var(--s-3); border-bottom: 3px solid transparent; color: var(--fg-muted); text-decoration: none;
  font: 600 var(--t-15)/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; transition: color var(--t-fast), border-color var(--t-fast); }
.admin-tabs a:hover { color: var(--fg); }
.admin-tabs a:focus-visible { outline-offset: -2px; }
.admin-tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--olive-hi); background: var(--bg-2); }
.split-admin { grid-template-columns: minmax(0, 1fr) 400px; }
.filter { display: flex; align-items: center; gap: var(--s-2); }
.filter select.input { width: auto; }
.detail-actions { margin: var(--s-3) 0 var(--s-4); }
.detail-name { margin-bottom: var(--s-3); text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.panel-title.detail-h { margin: var(--s-4) 0 var(--s-2); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.roster li > :first-child { min-width: 0; overflow-wrap: anywhere; }
.roster li > :last-child:not(:first-child) { flex: none; max-width: 60%; }
.roster-acts li { align-items: center; padding: var(--s-2) 0; }
.roster .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-foot { padding: var(--s-3); border-top: 1px solid var(--line); }
.audit-table strong { overflow-wrap: anywhere; }
a.kpi { color: var(--fg); text-decoration: none; transition: background-color var(--t-fast); }
a.kpi:hover { background: var(--bg-3); color: var(--fg); }
a.kpi:focus-visible { outline-offset: -2px; }
.pre { white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.log { margin: 0; padding: var(--s-3); height: min(60vh, 560px); overflow: auto; background: var(--bg-0); color: var(--fg-muted); font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.log-short { height: auto; margin-bottom: var(--s-2); border: 1px solid var(--line); }
dialog.dlg-wide { width: min(640px, calc(100vw - 32px)); }
dialog.dlg-log { width: min(960px, calc(100vw - 32px)); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-4); align-items: start; }
.field label.check-plain { color: var(--fg); font: inherit; letter-spacing: 0; text-transform: none; }
.code-box.secret code { flex: 1 1 260px; min-width: 0; font-size: var(--t-15); letter-spacing: .04em; overflow-wrap: anywhere; }
@media (max-width: 1099px) { .split-admin { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) {
  .admin-tabs { scrollbar-width: none; }
  /* Only the first column (with its second line) and the last one (state). */
  .adm-table { table-layout: fixed; }
  .adm-table th:not(:first-child, :last-child), .adm-table td:not(:first-child, :last-child) { display: none; }
  .adm-table th:last-child { width: 136px; }
  .adm-table td:last-child .row { flex-wrap: wrap !important; }
  .adm-table .clip { max-width: none; }
  /* The log reads as a list: when and who, then what happened. */
  .audit-table thead { display: none; }
  .audit-table tr { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s-3); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); }
  .audit-table td { height: auto !important; padding: 2px 0 !important; border: 0 !important; }
  .audit-table td:nth-child(n+3) { grid-column: 1 / -1; }
  .filter { flex: 1 1 140px; }
  .filter select.input { width: 100%; min-width: 0; }
  .field-pair { grid-template-columns: 1fr; }
}
