/* Tactical HUD theme, shared with the public site (see DESIGN.md).
   Light: daylight HUD with a dark-amber accent. Dark: the site's night HUD. */
:root {
  color-scheme: light;
  --bg: #e9edf0;
  --surface: #f7f9fa;
  --surface-2: #eef2f4;
  --sunken: #e1e7eb;
  --line: #cfd8de;
  --line-strong: #a9b6bf;
  --text: #11171c;
  --muted: #4d5b66;
  --faint: #56636e;
  --accent: #8f5600;
  --accent-ink: #ffffff;
  --accent-soft: #f6e7c8;
  --ok: #13703f;
  --ok-soft: #dcf1e4;
  --warn: #9a4d00;
  --warn-soft: #fae6cf;
  --bad: #b8261d;
  --bad-soft: #f9dfdc;
  --shadow: none;
  --radius: 8px;
  --radius-sm: 5px;
  --sidebar: 224px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0e11; --surface: #10161b; --surface-2: #141c22; --sunken: #0d1216;
    --line: #24303a; --line-strong: #3a4955; --text: #e8eef2; --muted: #a3b1bc; --faint: #8f9eaa;
    --accent: #ffb21a; --accent-ink: #160f00; --accent-soft: #2a2312;
    --ok: #4fe08e; --ok-soft: #12281c; --warn: #ff9f43; --warn-soft: #2e2213;
    --bad: #ff5a4e; --bad-soft: #33181a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0e11; --surface: #10161b; --surface-2: #141c22; --sunken: #0d1216;
  --line: #24303a; --line-strong: #3a4955; --text: #e8eef2; --muted: #a3b1bc; --faint: #8f9eaa;
  --accent: #ffb21a; --accent-ink: #160f00; --accent-soft: #2a2312;
  --ok: #4fe08e; --ok-soft: #12281c; --warn: #ff9f43; --warn-soft: #2e2213;
  --bad: #ff5a4e; --bad-soft: #33181a; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.svg-sprite { display: none; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.auth-art { position: relative; overflow: hidden; background: #12151c; color: #e9ecf3; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 75% 35%, rgb(141 164 255 / 28%), transparent 45%),
  repeating-linear-gradient(0deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 40px),
  repeating-linear-gradient(90deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 40px); }
.auth-art > * { position: relative; }
.auth-art h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 700; }
.auth-art p { margin: 0; max-width: 420px; color: #aab2c3; }
.reticle { width: 180px; height: 180px; border: 1px solid rgb(141 164 255 / 45%); border-radius: 50%; display: grid; place-items: center; margin: 40px 0; }
.reticle::before { content: ""; width: 96px; height: 96px; border-radius: 50%; border: 1px dashed rgb(141 164 255 / 55%); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.auth-form h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }

/* Shell */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-size: 13px; letter-spacing: -.04em; }
.logo-text strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.logo-text span { display: block; font-size: 11px; color: var(--muted); }
.nav-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.side-foot .btn { justify-content: flex-start; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-weight: 700; font-size: 12px; text-transform: uppercase; }
.who small { display: block; color: var(--muted); font-size: 11px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }
.stamp { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pulse.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.topbar .menu-btn { display: none; }
.content { padding: 28px 32px 56px; display: grid; gap: 24px; max-width: 1600px; width: 100%; margin: 0 auto; }
.view-intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.view-intro p { margin: 0; color: var(--muted); max-width: 640px; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); background: var(--accent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--sunken); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.icon { padding: 0; width: 36px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
label.field small { font-weight: 400; color: var(--muted); }
.input { width: 100%; min-height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { padding-right: 28px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input { width: auto; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--sunken); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 22px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.error { color: var(--bad); font-size: 13px; min-height: 1em; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 14px; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.card-h > .grow { flex: 1; min-width: 0; }
.card-b { padding: 18px; }
.card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.card-f[data-pager] { flex-wrap: wrap; }
.page-size { display: inline-flex; align-items: center; gap: 8px; }
.page-size .input { width: auto; min-width: 66px; padding: 5px 8px; }
.page-buttons { justify-content: flex-end; }
@media (max-width: 640px) { .page-buttons { flex-basis: 100%; justify-content: center; } }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; display: grid; gap: 6px; }
.kpi .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi .note { font-size: 12px; color: var(--muted); }
.meter { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .3s; }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--sunken); color: var(--muted); white-space: nowrap; text-decoration: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.list .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; text-decoration: none; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
.cell-main { font-weight: 600; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Reports, matches, clans */
.feed { display: grid; }
.report { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.report:last-child { border-bottom: 0; }
.report-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.report-meta strong { color: var(--text); }
.report-meta .grow { flex: 1; }
.report-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
details.expand { border-bottom: 1px solid var(--line); }
details.expand:last-child { border-bottom: 0; }
details.expand > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
details.expand > summary::-webkit-details-marker { display: none; }
details.expand > summary:hover { background: var(--surface-2); }
details.expand > summary .chev { transition: transform .15s; color: var(--faint); }
details.expand[open] > summary .chev { transform: rotate(90deg); }
details.expand .inner { padding: 0 18px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--sunken); color: var(--muted); font-family: var(--mono); }

/* Settings */
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; }
.setting-aside { display: grid; gap: 10px; align-content: start; }
.setting-aside .big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
.form-grid .full { grid-column: 1 / -1; }
.release-form { max-width: 880px; }
.release-form .release-help { margin: 0; color: var(--muted); font-size: 12px; }
.release-form textarea.input { padding: 10px 12px; resize: vertical; }

/* Dialogs and toasts */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
dialog::backdrop { background: rgb(10 12 18 / 55%); }
dialog form { display: grid; gap: 14px; padding: 22px; }
dialog h3 { margin: 0; font-size: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px; box-shadow: var(--shadow); max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }
.scrim { display: none; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgb(10 12 18 / 45%); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }
  .grid.two, .setting, .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 220px; padding: 28px; }
  .reticle { display: none; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .value { font-size: 22px; }
  .stamp span { display: none; }
  .toolbar .input, .toolbar .seg { width: 100%; }
  .card-h { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Overview: HUD look ---------- */
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.ov > *:nth-child(2) { animation-delay: .06s; }
.ov > *:nth-child(3) { animation-delay: .12s; }
.ov > *:nth-child(4) { animation-delay: .18s; }
.ov > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Use the selected theme throughout the overview. */
.hero { --hud: var(--accent); --hud-2: var(--ok); position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 32px; border-radius: var(--radius); color: var(--text); border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow); }
.hero.down { --hud: var(--bad); --hud-2: var(--warn); }
.hero.down .hero-state { background: var(--warn-soft); }
.hero-grid { position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 32px), repeating-linear-gradient(90deg, rgb(255 255 255 / 4%) 0 1px, transparent 1px 32px);
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.hero-scan, .hero-grid { display: none; }
.corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--hud); opacity: .8; }
.corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.hero-main { min-width: 0; display: grid; gap: 8px; }
.hero-state { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 4px 10px; border-radius: 20px;
  font: 700 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hud-2); background: var(--ok-soft); border: 1px solid var(--line); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hud-2); box-shadow: 0 0 0 0 var(--hud-2); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hud-2) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hero-title { margin: 0; font-size: clamp(25px, 2.5vw, 34px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800;
  color: var(--text); }
.hero-sub { margin: 0; color: var(--muted); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hero-stats > div { display: grid; gap: 2px; padding: 8px 14px; min-width: 110px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.hs-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.hero .hs-label { color: var(--muted); }
.hs-value { font-size: 15px; font-weight: 700; color: var(--text); }
.ring { position: relative; width: 168px; height: 168px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--line); }
.ring-bar { stroke: var(--hud); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .7, .2, 1), stroke .3s; }
.ring::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 1px dashed rgb(141 164 255 / 30%); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font-size: 38px; line-height: 1; font-weight: 800; color: var(--text); }
.ring-text span { font-size: 12px; color: var(--muted); }

/* KPI tiles */
.kpi { position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--k, var(--accent)); }
.kpi:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--k, var(--accent)) 45%, var(--line)); box-shadow: 0 8px 28px color-mix(in srgb, var(--k, var(--accent)) 18%, transparent); }
.kpi:nth-child(1) { --k: #6d8bff; } .kpi:nth-child(2) { --k: #2fbf8a; } .kpi:nth-child(3) { --k: #f0a33a; } .kpi:nth-child(4) { --k: #ef6b62; }
.ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--k); background: color-mix(in srgb, var(--k) 15%, transparent); }
.ico svg.i { width: 16px; height: 16px; }

/* Leaderboard */
.board li { position: relative; }
.rank { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-size: 13px; background: var(--sunken); color: var(--muted); }
.rank.r1 { background: linear-gradient(135deg, #ffd76a, #e3a41b); color: #3b2a00; box-shadow: 0 0 14px rgb(240 179 58 / 45%); }
.rank.r2 { background: linear-gradient(135deg, #eef1f6, #aab3c2); color: #2a2f38; }
.rank.r3 { background: linear-gradient(135deg, #f0b98a, #b8733e); color: #2e1a08; }
.xp { height: 4px; border-radius: 4px; background: var(--sunken); margin-top: 6px; overflow: hidden; }
.xp > span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #4ce0b3); transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.board .stat { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.board .stat strong { display: block; color: var(--text); font-size: 13px; }

/* Economy and matches */
.econ { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.econ > div { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.econ strong { font-size: 22px; letter-spacing: -.02em; }
.mvp { color: #e3a41b; font-weight: 700; }

@media (max-width: 1180px) { .grid.three { grid-template-columns: 1fr 1fr; } .grid.three > :last-child { grid-column: 1 / -1; } }
@media (max-width: 900px) { .grid.three { grid-template-columns: 1fr; } .grid.three > :last-child { grid-column: auto; } }
@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: stretch; padding: 22px 20px; }
  .ring { width: 140px; height: 140px; align-self: center; }
  .hero-stats > div { flex: 1 1 90px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ov > *, .hero-scan, .live-dot, .ring::after { animation: none !important; }
  .hero-scan { display: none; }
}

/* Match teams */
.teams { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 8px; }
.team { --team: var(--faint); border: 1px solid var(--line); border-top: 3px solid var(--team); border-radius: 10px; overflow: hidden; background: var(--surface); }
.team.blue { --team: #4f8cff; }
.team.red { --team: #ef5b5b; }
.team-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: color-mix(in srgb, var(--team) 8%, var(--surface)); }
.team-h .grow { flex: 1; }
.team-name { font-weight: 800; letter-spacing: .02em; }
.team-name.blue { color: #4f8cff; }
.team-name.red { color: #ef5b5b; }
@media (max-width: 520px) { .teams { grid-template-columns: 1fr; } }

/* Items */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.item-card { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.item-pic { height: 72px; display: grid; place-items: center; background: var(--sunken, var(--surface-2)); border-radius: var(--radius-sm); }
.item-pic img { width: 128px; height: 64px; object-fit: contain; image-rendering: auto; }
.item-none { color: var(--faint, var(--muted)); font-size: 12px; }
.item-body { display: grid; min-width: 0; }
.item-body .cell-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.give-item { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.give-item img { background: var(--sunken, var(--surface-2)); border-radius: var(--radius-sm); }
.give-item p { margin: 0; }

/* Shared administration layout */
.side { background: #10191c; color: #edf1f2; border-color: #29363a; overflow-y: auto; }
.side .logo { padding: 8px 10px 28px; }
.logo-mark { background: #b72924; color: #fff; border-radius: 4px; }
.side .logo-text span, .side .who small { color: #9dadaf; }
.side .nav-label { color: #91a3a8; font-size: 10px; letter-spacing: .12em; padding-top: 20px; }
.side .nav a { min-height: 40px; color: #b8c5c8; border-radius: 4px; margin: 2px 0; }
.side .nav a:hover, .side .btn:hover { background: #1d2b30; color: #fff; }
.side .nav a[aria-current="page"] { background: #2d2222; color: #ffb2a9; box-shadow: inset 3px 0 #e75347; }
.side .badge, .side .avatar { background: #233238; color: #dce5e8; }
.side-foot { border-color: #29363a; margin-top: 28px; }
.side-foot .btn { color: #b8c5c8; }
.topbar { min-height: 84px; padding: 16px 32px; background: var(--bg); backdrop-filter: none; }
.page-heading { min-width: 0; }
.eyebrow { display: block; margin-bottom: 3px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.topbar h2 { font-size: 24px; font-weight: 650; letter-spacing: -.035em; }
.view-intro { padding: 0 0 2px; }
.view-intro p { max-width: 760px; }
.card { overflow: hidden; }
.card-h { padding: 20px 22px; }
.card-h h3 { font-size: 15px; font-weight: 650; }
.card-h p { margin-top: 5px; line-height: 1.6; }
.card-b { padding: 24px; }
.card-f { background: var(--surface-2); padding: 14px 22px; }
.btn { min-height: 40px; color: var(--text); }
.btn.icon { width: 40px; }
.btn.sm { min-height: 34px; }
.input { min-height: 44px; background: var(--surface-2); }
textarea.input { padding: 12px; resize: vertical; line-height: 1.6; }
.field { min-width: 0; }
.form-grid { gap: 20px; }
.form-grid p { margin: 0; color: var(--muted); font-size: 13px; }
.setting { grid-template-columns: minmax(180px, .65fr) minmax(0, 1.4fr); gap: 40px; }
.setting-aside { padding-right: 24px; border-right: 1px solid var(--line); line-height: 1.7; }
.setting-aside small { font-size: 12px; }
.release-form { max-width: 100%; }
.settings-jump { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
[data-panel="settings"] > .card { scroll-margin-top: 104px; }
.hero { padding: 28px; background: var(--surface); gap: 32px; }
.corner, .ring::after { display: none; }
.hero-state { border: 0; padding: 4px 8px; font: 600 11px/1.5 var(--sans); letter-spacing: .06em; }
.live-dot, .ov > * { animation: none; }
.hero-stats { gap: 28px; margin-top: 18px; }
.hero-stats > div { background: none; border: 0; border-radius: 0; padding: 0; min-width: 100px; }
.hs-label { letter-spacing: .08em; }
.ring { width: 148px; height: 148px; }
.ring circle { stroke-width: 4; }
.ring-bar { stroke: var(--ok); }
.ring-text strong { font-weight: 600; }
.ring-text span { margin-top: 5px; }
.kpis { gap: 16px; }
.kpi { padding: 22px; gap: 12px; }
.kpi::before, .kpi .ico { display: none; }
.kpi:hover { transform: none; border-color: var(--line-strong); box-shadow: none; }
.kpi .label { font-weight: 500; font-size: 13px; }
.kpi .note { line-height: 1.6; }
.kpi .meter { height: 3px; }
.rank { border-radius: 4px; }
.rank.r1, .rank.r2, .rank.r3 { background: var(--sunken); color: var(--text); box-shadow: none; }
.xp > span { background: var(--accent); }
.xp { height: 2px; }
.board .stat { white-space: normal; }
.list li { padding: 15px 22px; }
.econ > div { border: 0; border-radius: 4px; }
details.expand > summary { padding: 18px 22px; }
details.expand[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--line); }
details.expand .inner { padding: 20px; }
.report { padding: 20px 22px; gap: 12px; }
.auth-art { background: #10191c; padding: 56px; }
.auth-art::before { background: none; border-left: 4px solid #b72924; inset: 48px auto 48px 0; }
.reticle { border-color: #526267; border-radius: 4px; width: 100px; height: 100px; transform: rotate(45deg); }
.reticle::before { border-radius: 0; border-color: #b72924; width: 50px; height: 50px; }
dialog { border-radius: 8px; }
dialog form { padding: 28px; gap: 20px; }
dialog::backdrop { backdrop-filter: blur(3px); }
@media (max-width: 1100px) {
  .setting { grid-template-columns: 1fr; gap: 24px; }
  .setting-aside { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 20px; }
}
@media (max-width: 900px) {
  .side { height: 100dvh; visibility: hidden; }
  .app.nav-open .side { visibility: visible; }
  .topbar { padding: 12px 16px; min-height: 76px; gap: 8px; }
  .content { padding: 20px 16px 40px; }
  .topbar h2 { font-size: 21px; }
  .eyebrow { font-size: 9px; letter-spacing: .06em; }
}
@media (max-width: 600px) {
  .hero { padding: 22px; }
  .hero-stats { gap: 16px; }
  .ring { align-self: stretch; width: auto; height: auto; border-top: 1px solid var(--line); padding-top: 20px; }
  .ring svg { display: none; }
  .ring-text { position: static; display: flex; align-items: baseline; justify-content: flex-start; gap: 8px; text-align: left; }
  .ring-text strong { font-size: 30px; }
  .card-h, .card-b { padding: 18px; }
  .kpi { padding: 16px; gap: 10px; }
  .settings-jump { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .settings-jump .btn { justify-content: flex-start; }
  details.expand > summary { flex-wrap: wrap; gap: 8px; padding: 16px; }
  details.expand > summary > .grow { flex: 1 1 calc(100% - 38px); min-width: 0; }
  details.expand .inner { padding: 12px; }
  .board .stat { max-width: 120px; }
  .list li { padding: 14px 16px; gap: 8px; }
  .row-actions { flex-wrap: wrap; }
  .seg { max-width: 100%; flex-wrap: wrap; }
  .toasts { right: 12px; left: 12px; }
  .toast { max-width: none; }
  .toolbar .input { font-size: 16px; }
  .field .input { font-size: 16px; }
}

/* Weekly activity heatmap (overview): 7 weekdays x 24 hours. */
.activity-peaks { margin: 0 0 12px; color: var(--muted); }
.activity-peaks strong { color: var(--text); }
.activity-scroll { overflow-x: auto; }
.activity-grid { display: grid; grid-template-columns: 40px repeat(24, minmax(22px, 1fr)); gap: 3px; min-width: 640px; }
.activity-grid .ah { font-size: 11px; color: var(--faint); text-align: center; line-height: 18px; }
.activity-grid .ad { font-size: 12px; color: var(--muted); line-height: 24px; }
.activity-grid .ac { height: 24px; border-radius: 3px; background: var(--sunken);
  background: color-mix(in srgb, var(--accent) calc(var(--v, 0) * 100%), var(--sunken)); }
.activity-grid .ac[data-v="0"] { background: var(--sunken); }
.activity-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.activity-ramp { width: 120px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--sunken), var(--accent)); }

/* ==========================================================================
   Tactical HUD layer: the public site's look (DESIGN.md) on the admin console.
   Visual only: every class, id and behaviour above is unchanged.
   ========================================================================== */
@font-face { font-family: "Teko"; src: url("fonts/teko-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Teko"; src: url("fonts/teko-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rajdhani"; src: url("fonts/rajdhani-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("fonts/share-tech-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  /* HUD amber fills the primary action in both themes; --accent is its text-safe shade. */
  --amber: #ffb21a;
  --amber-hi: #ffc54d;
  --on-amber: #160f00;
  --display: "Teko", "Bahnschrift Condensed", "Arial Narrow", sans-serif;
  --sans: "Rajdhani", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --mono: "Share Tech Mono", "Cascadia Mono", Consolas, monospace;
  --radius: 2px;
  --radius-sm: 2px;
  --chamfer: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  --brackets:
    linear-gradient(var(--accent) 0 0) top left / 12px 2px, linear-gradient(var(--accent) 0 0) top left / 2px 12px,
    linear-gradient(var(--accent) 0 0) top right / 12px 2px, linear-gradient(var(--accent) 0 0) top right / 2px 12px,
    linear-gradient(var(--accent) 0 0) bottom left / 12px 2px, linear-gradient(var(--accent) 0 0) bottom left / 2px 12px,
    linear-gradient(var(--accent) 0 0) bottom right / 12px 2px, linear-gradient(var(--accent) 0 0) bottom right / 2px 12px;
}
body { font: 500 15px/1.5 var(--sans); caret-color: var(--accent); scrollbar-color: var(--line-strong) var(--bg); }
::selection { background: var(--amber); color: var(--on-amber); }
:focus-visible { outline-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }

/* Display voice: Teko, uppercase, like the in-game HUD. */
.topbar h2, .card-h h3, .hero-title, .kpi .value, .auth-art h1, .auth-form h2, dialog h3,
.setting-aside .big, .ring-text strong, .econ strong, .team-name, .logo-text strong {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.topbar h2 { font-size: 36px; font-weight: 600; letter-spacing: .01em; }
.card-h h3 { font-size: 24px; font-weight: 600; }
.hero-title { font-size: clamp(36px, 3.6vw, 52px); }
.kpi .value { font-size: 42px; font-weight: 600; letter-spacing: 0; }
.setting-aside .big, .econ strong { font-size: 36px; }
.ring-text strong { font-size: 52px; }
.logo-text strong { font-size: 22px; }
.auth-form h2 { font-size: 40px; }
dialog h3 { font-size: 30px; }
/* Readout voice: Share Tech Mono for labels, headers and status. */
th, .nav-label, .hs-label, .eyebrow, .kpi .label, .stamp, .badge, .chip, .hero-state, .activity-grid .ah, .activity-grid .ad, .report-meta {
  font-family: var(--mono); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
th { font-size: 12px; color: var(--accent); }
.kpi .label { font-size: 12px; }
.badge { border-radius: 0; font-size: 11px; }

/* Shell: the sidebar is the HUD frame in both themes. */
.side { background: #0b0e11; border-right: 1px solid #24303a; color: #e8eef2; }
.logo-mark { background: var(--amber); color: var(--on-amber); border-radius: 0; clip-path: var(--chamfer); font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: 0; padding-top: 3px; }
.side .logo-text span, .side .who small { color: #a3b1bc; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.side .nav-label { color: #8f9eaa; font-size: 11px; letter-spacing: .14em; }
.side .nav a { color: #b8c4cc; font-weight: 600; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; border-radius: 0; }
.side .nav a:hover, .side .btn:hover { background: #141c22; color: #fff; }
.side .nav a[aria-current="page"] { background: rgba(255, 178, 26, .12); color: var(--amber); box-shadow: inset 3px 0 var(--amber); }
.side .badge, .side .avatar { background: #1b252d; color: #e8eef2; }
.side .nav a[aria-current="page"] .badge { background: var(--amber); color: var(--on-amber); }
.avatar { border-radius: 0; clip-path: var(--chamfer); font-family: var(--display); font-size: 17px; padding-top: 2px; }
.side-foot { border-color: #24303a; }
.side-foot .btn { color: #b8c4cc; }
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); }
.eyebrow { font-size: 11px; color: var(--muted); }
.pulse { border-radius: 0; }

/* Panels carry the amber corner brackets. */
.card, .hero { position: relative; border-radius: var(--radius); }
.card::after, .hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--brackets); background-repeat: no-repeat; z-index: 1; }
.card-h { border-bottom-color: var(--line); }
.card-f { background: var(--surface-2); }
.hero { background: var(--surface); }
.hero-state { border-radius: 0; font-family: var(--mono); letter-spacing: .1em; }
.ring-bar { stroke: var(--accent); stroke-linecap: butt; }
.ring circle { stroke-width: 6; }
.kpi .meter, .meter, .xp { border-radius: 0; }
.meter > span, .xp > span { border-radius: 0; }
.rank { border-radius: 0; font-family: var(--display); font-size: 18px; padding-top: 2px; }
.rank.r1 { background: var(--amber); color: var(--on-amber); }
.mvp { color: var(--accent); }

/* Controls. */
.btn { border-radius: 0; font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); clip-path: var(--chamfer); }
.btn.primary:hover:not(:disabled) { background: var(--amber-hi); filter: none; }
.btn.danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn.icon { clip-path: none; }
.input { border-radius: 0; font-weight: 600; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { border-radius: 0; }
.seg button { border-radius: 0; font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--on-amber); }
.switch input { border-radius: 0; }
.switch input::after { border-radius: 0; }
.chip { border-radius: 0; }
label.field { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
tbody tr:hover td { background: var(--accent-soft); }
.team { border-radius: 0; }
.item-card, .item-pic, .econ > div, .report-body { border-radius: 0; }

/* Sign-in: a HUD scope over the night ground. */
.auth-art { background: #0b0e11; color: #e8eef2; }
.auth-art::before { border-left: 0; inset: 0; background:
  radial-gradient(60% 70% at 70% 40%, rgba(255, 178, 26, .10), transparent 70%), var(--brackets);
  background-repeat: no-repeat; margin: 24px; }
.auth-art h1 { font-size: clamp(48px, 5vw, 76px); }
.auth-art h1 + p, .auth-art p { color: #a3b1bc; }
.reticle { width: 150px; height: 150px; border-radius: 50%; border: 2px solid var(--amber); transform: none; position: relative;
  background: linear-gradient(var(--amber) 0 0) center top / 2px 34px no-repeat, linear-gradient(var(--amber) 0 0) center bottom / 2px 34px no-repeat,
    linear-gradient(var(--amber) 0 0) left center / 34px 2px no-repeat, linear-gradient(var(--amber) 0 0) right center / 34px 2px no-repeat; }
.reticle::before { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--amber); }
.auth-form { background: var(--surface); }

/* Dialogs and toasts. */
dialog { border-radius: 0; border: 1px solid var(--accent); }
.toast { border-radius: 0; background: #10161b; color: #e8eef2; border: 1px solid var(--amber); font-family: var(--sans); font-weight: 700; }
.toast.bad { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Rajdhani runs small: lift secondary text so it stays readable. */
.card-h p, .kpi .note, .cell-sub, .list .sub, .release-form .release-help, label.field small, .card-f, .report-meta { font-size: 14px; }
td { font-size: 14px; }

/* Activity heatmap in amber. */
.activity-grid .ac { border-radius: 0; }
.activity-ramp { border-radius: 0; }

@media (prefers-reduced-motion: reduce) { .ring-bar, .xp > span, .meter > span { transition: none; } }
