/* SPL Stats — after-action-report aesthetic.
   Palette: dust field #16140e / panel #201c13 / text #e6dfc8
            khaki muted #8d8465 / fire accent #d07127 / win #7ea15a / loss #b0533b */

:root,
[data-theme="dust"] {
  --bg: #16140e;
  --panel: #201c13;
  --panel-edge: #2e2818;
  --text: #e6dfc8;
  --muted: #8d8465;
  --accent: #d07127;
  --accent-soft: rgba(208, 113, 39, 0.12);
  --accent-soft2: rgba(208, 113, 39, 0.03);
  --win: #7ea15a;
  --loss: #b0533b;
}

[data-theme="nightops"] {
  --bg: #0d1117;
  --panel: #141b24;
  --panel-edge: #1c2430;
  --text: #dbe3ec;
  --muted: #6b7a8f;
  --accent: #4ea3a0;
  --accent-soft: rgba(78, 163, 160, 0.16);
  --accent-soft2: rgba(78, 163, 160, 0.03);
  --win: #6fbf87;
  --loss: #d1604f;
}

[data-theme="coldsteel"] {
  --bg: #0b1015;
  --panel: #111820;
  --panel-edge: #1a232e;
  --text: #dde5ed;
  --muted: #63748a;
  --accent: #4f9ed9;
  --accent-soft: rgba(79, 158, 217, 0.17);
  --accent-soft2: rgba(79, 158, 217, 0.03);
  --win: #6fbf87;
  --loss: #d1604f;
}

[data-theme="ember"] {
  --bg: #101112;
  --panel: #191a1c;
  --panel-edge: #262829;
  --text: #e9eaec;
  --muted: #7a7d80;
  --accent: #cf5f3a;
  --accent-soft: rgba(207, 95, 58, 0.16);
  --accent-soft2: rgba(207, 95, 58, 0.03);
  --win: #7fc7a4;
  --loss: #cf5f3a;
}

[data-theme="deepteal"] {
  --bg: #0a1013;
  --panel: #0f1c1f;
  --panel-edge: #16262a;
  --text: #d9e8e7;
  --muted: #5d7a7d;
  --accent: #3fbfa8;
  --accent-soft: rgba(63, 191, 168, 0.18);
  --accent-soft2: rgba(63, 191, 168, 0.03);
  --win: #7fc78f;
  --loss: #d9705a;
}

[data-theme="gunmetal"] {
  --bg: #0e0f11;
  --panel: #16181c;
  --panel-edge: #23252a;
  --text: #eceef1;
  --muted: #71747a;
  --accent: #7fc7a4;
  --accent-soft: rgba(232, 233, 236, 0.10);
  --accent-soft2: rgba(232, 233, 236, 0.02);
  --win: #7fc7a4;
  --loss: #d1705f;
}

[data-theme="odgreen"] {
  --bg: #12140f;
  --panel: #1a1d14;
  --panel-edge: #262a1d;
  --text: #e4e6d9;
  --muted: #7d8470;
  --accent: #8fae4b;
  --accent-soft: rgba(143, 174, 75, 0.16);
  --accent-soft2: rgba(143, 174, 75, 0.03);
  --win: #cfd8a8;
  --loss: #c2603f;
}

[data-theme="ash"] {
  --bg: #0f0f10;
  --panel: #191919;
  --panel-edge: #272728;
  --text: #e6e6e7;
  --muted: #79797d;
  --accent: #b9bec4;
  --accent-soft: rgba(185, 190, 196, 0.13);
  --accent-soft2: rgba(185, 190, 196, 0.02);
  --win: #83bf94;
  --loss: #c9695a;
}

[data-theme="crimson"] {
  --bg: #120e0e;
  --panel: #1c1616;
  --panel-edge: #2a2020;
  --text: #ece1e1;
  --muted: #8a7676;
  --accent: #c0392b;
  --accent-soft: rgba(192, 57, 43, 0.17);
  --accent-soft2: rgba(192, 57, 43, 0.03);
  --win: #7fb08a;
  --loss: #c0392b;
}

[data-theme="glacier"] {
  --bg: #0c1114;
  --panel: #131b20;
  --panel-edge: #1e272e;
  --text: #dfe9ee;
  --muted: #6a7d88;
  --accent: #7ec8e3;
  --accent-soft: rgba(126, 200, 227, 0.16);
  --accent-soft2: rgba(126, 200, 227, 0.03);
  --win: #7fc7a4;
  --loss: #d1705f;
}

[data-theme="nightshade"] {
  --bg: #100e14;
  --panel: #191622;
  --panel-edge: #262032;
  --text: #e7e2ef;
  --muted: #7d7691;
  --accent: #9b7ede;
  --accent-soft: rgba(155, 126, 222, 0.17);
  --accent-soft2: rgba(155, 126, 222, 0.03);
  --win: #7fc7a4;
  --loss: #d1705f;
}

/* the one light scheme -- every color is inverted, not just swapped around,
   so borders stay visible and the accent still reads on a pale panel */
[data-theme="bone"] {
  --bg: #e9e3d5;
  --panel: #f3eee3;
  --panel-edge: #d2c9b5;
  --text: #2a2620;
  --muted: #766e5f;
  --accent: #a8541f;
  --accent-soft: rgba(168, 84, 31, 0.15);
  --accent-soft2: rgba(168, 84, 31, 0.03);
  --win: #4c7a37;
  --loss: #a33d2a;
}

:root {
  --display: "Big Shoulders Display", sans-serif;
  --cond: "Barlow Condensed", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--cond);
  font-size: 17px;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- chrome ---------- */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--panel-edge);
}

.brand { display: flex; align-items: baseline; gap: 10px; }

.topbar nav a {
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 2px;
}
.topbar nav a.active, .topbar nav a:hover { color: var(--text); }

main { flex: 1; width: min(980px, 100% - 32px); margin: 0 auto; padding: 34px 0 60px; }

footer {
  padding: 16px 28px;
  border-top: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- headings ---------- */

.page-head { margin-bottom: 26px; }
.player-head { display: flex; align-items: center; gap: 20px; }
.avatar {
  width: 96px;
  height: 96px;
  border: 1px solid var(--panel-edge);
  flex-shrink: 0;
}
.page-head h1 {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 44px);
  letter-spacing: 2px;
  line-height: 1.05;
  text-transform: uppercase;
}
.page-sub { color: var(--muted); margin-top: 6px; }
.eyebrow {
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mono { font-family: var(--mono); font-size: 0.85em; }

h2 {
  font-family: var(--cond);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* ---------- sort chips ---------- */

.sort-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sort-chip {
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  padding: 5px 14px;
}
.sort-chip.on { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.sort-chip:hover:not(.on) { color: var(--text); border-color: var(--muted); }

/* Range chips sit under the sort chips as a visually secondary axis: same
   shape, outlined instead of filled when active, so it's clear they're a
   different kind of choice rather than more sort options. */
.range-row { margin-top: -8px; }
.range-row .sort-chip { font-size: 13px; padding: 4px 12px; }
.range-row .sort-chip.on {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent);
}

.board-empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- leaderboard ---------- */

.board { border: 1px solid var(--panel-edge); }

.board-row {
  display: grid;
  grid-template-columns: 44px 1fr repeat(7, 76px);
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-edge);
  position: relative;
  isolation: isolate;
}
.board-row:last-child { border-bottom: 0; }

/* signature: kill-fill bar behind each row, scaled to the leader */
.board-row:not(.head)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--kfill, 0%);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-soft2));
  z-index: -1;
}

.board-row.head {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
}

.board-row:not(.head):hover { background: var(--panel); }

.c-rank { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.c-name { font-weight: 500; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-num { font-family: var(--mono); font-size: 14px; text-align: right; }
.accent { color: var(--accent); }

/* ---------- player page ---------- */

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--panel-edge);
  border: 1px solid var(--panel-edge);
  margin-bottom: 26px;
}
.stat { background: var(--panel); padding: 14px 12px 12px; }
.stat .v { display: block; font-family: var(--mono); font-size: 26px; font-weight: 600; }
.stat .l {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; margin-bottom: 26px; }

.panel { border: 1px solid var(--panel-edge); padding: 18px; }

.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 7px 0; border-bottom: 1px solid var(--panel-edge); }
.kv tr:last-child td { border-bottom: 0; }
.kv td:last-child { font-family: var(--mono); font-size: 14px; text-align: right; }
.dim { color: var(--muted); }

.weplist { display: flex; flex-direction: column; gap: 6px; }
.wep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  position: relative;
  isolation: isolate;
}
a.wep:hover { background: var(--panel-edge); }
/* name takes the slack so the kill count stays right-aligned with an icon
   present or absent */
.wep .wep-name { flex: 1; }
.wep::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--wfill, 0%);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-soft2));
  z-index: -1;
}
.wep-name { font-size: 16px; }
.wep-kills { font-family: var(--mono); font-size: 14px; }

.rounds { display: flex; flex-direction: column; }
.round-row {
  display: grid;
  grid-template-columns: 70px 1fr repeat(6, 66px);
  align-items: center;
  padding: 7px 4px;
  border-bottom: 1px solid var(--panel-edge);
  font-size: 15px;
}
.round-row:last-child { border-bottom: 0; }
/* one extra column when the map is known; rounds recorded before the mutator
   sent map names keep the original layout */
.rounds.withmap .round-row { grid-template-columns: 70px 116px 1fr repeat(7, 62px); }
.rr-map { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
@media (max-width: 720px) {
  /* .hide-sm drops Map, HS, Score and Best, leaving Server, When, K, D, A and
     Result -- six tracks, matching the plain .round-row rule below. This
     selector is more specific, so it has to restate the count or the grid
     keeps two phantom columns. */
  .rounds.withmap .round-row { grid-template-columns: 60px 1fr repeat(4, 44px); }
}
/* metres suffix rides small next to the number rather than competing with it */
.stat .unit { font-size: 0.5em; margin-left: 2px; opacity: 0.65; }
.round-row.head {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.win { color: var(--win); font-weight: 600; }
.loss { color: var(--loss); font-weight: 600; }

.empty { color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .board-row { grid-template-columns: 36px 1fr repeat(4, 52px); }
  .round-row { grid-template-columns: 60px 1fr repeat(4, 44px); }
  .hide-sm { display: none; }
  .cols { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .board-row:not(.head)::before, .wep::before {
    transition: width 0.4s ease;
  }
}

/* ---------- player header w/ avatar ---------- */

.phead {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.phead-text { min-width: 0; }
.phead h1 {
  font-family: var(--display);
  font-size: clamp(26px, 4.5vw, 40px);
  letter-spacing: 2px;
  line-height: 1.05;
  text-transform: uppercase;
}

.avatar {
  flex: none;
  width: 96px;
  height: 96px;
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.9); }
.avatar-mono {
  font-family: var(--display);
  font-size: 42px;
  color: var(--muted);
}

.ext { color: var(--accent); }
.ext:hover { text-decoration: underline; }

/* ---------- charts ---------- */

.h2-note {
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: none;
  /* was a brightened --panel-edge, which turns invisible on the light scheme */
  color: var(--muted);
  opacity: 0.75;
}

.charts .panel { display: flex; flex-direction: column; }

.chart {
  width: 100%;
  height: 120px;
  display: block;
  overflow: visible;
}
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2px; }
.chart .area { fill: var(--accent-soft); stroke: none; }
.chart .grid { stroke: var(--muted); opacity: 0.5; stroke-width: 1px; }

.barchart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}
.barchart .bar {
  flex: 1;
  min-width: 3px;
  height: max(2px, var(--bh));
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- admin ---------- */

.adm-row {
  display: grid;
  grid-template-columns: 106px 64px 60px 48px 56px minmax(0, 1fr) 220px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-edge);
}
.board .adm-row:last-child { border-bottom: 0; }
.adm-row.head {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
/* excluded rows stay visible but obviously inert */
.adm-row.off { opacity: 0.45; }
.adm-row .warn { color: var(--loss); }

.adm-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--panel-edge);
  color: var(--muted);
}
.tag.off { border-color: var(--loss); color: var(--loss); }

.adm-act { display: flex; gap: 6px; margin: 0; }
.adm-act input[type=text] {
  min-width: 0;
  flex: 1;
  padding: 4px 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 12px var(--mono);
}
.adm-act button, .bulk button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 11px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  cursor: pointer;
  white-space: nowrap;
}
.adm-act button:hover, .bulk button:hover { color: var(--text); border-color: var(--muted); }
.adm-act button.danger:hover, .bulk button.danger:hover {
  color: var(--bg); background: var(--loss); border-color: var(--loss);
}

/* ---------- admin shell ---------- */

.admcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.admcard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.admcard:hover { border-color: var(--accent); }
.admcard-t {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.admcard-d { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* The queue panel is rendered by the bot and injected here as a fragment.
   Its own classes (st_variable, field_boolean, seg, tabs...) are defined in
   the panel's stylesheet, which we don't load -- these rules re-home the few
   that matter so it matches the rest of the site. */
.panelframe .tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.panelframe .tabs button {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); background: none;
  border: 1px solid var(--panel-edge); padding: 6px 15px; cursor: pointer;
}
.panelframe .tabs button.on {
  color: var(--bg); background: var(--accent); border-color: var(--accent);
}
.panelframe section { display: none; }
.panelframe section.on { display: block; }
.panelframe .var {
  padding: 14px 16px; border: 1px solid var(--panel-edge); border-bottom: 0;
  background: var(--panel);
}
.panelframe section .var:last-of-type { border-bottom: 1px solid var(--panel-edge); }
.panelframe .var.changed { box-shadow: inset 3px 0 0 var(--accent); }
.panelframe .var .title {
  display: block; font-family: var(--cond); font-size: 17px; font-weight: 600;
}
.panelframe .desc {
  color: var(--muted); font-size: 13.5px; white-space: pre-line; margin: 2px 0 10px;
}
.panelframe .hint {
  color: var(--muted); font-family: var(--mono); font-size: 11px; margin: 5px 0 0;
}
.panelframe input[type=text], .panelframe input[type=number],
.panelframe select, .panelframe textarea {
  width: 100%; padding: 8px 10px; background: var(--bg); color: var(--text);
  border: 1px solid var(--panel-edge); font: 14px var(--mono);
}
.panelframe textarea { resize: vertical; line-height: 1.6; }
.panelframe .seg { display: inline-flex; border: 1px solid var(--panel-edge); }
.panelframe .seg input { position: absolute; opacity: 0; pointer-events: none; }
.panelframe .seg span {
  display: block; padding: 6px 16px; cursor: pointer; font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); border-right: 1px solid var(--panel-edge);
}
.panelframe .seg label:last-child span { border-right: 0; }
.panelframe .seg input:checked + span { background: var(--accent); color: var(--bg); }
.panelframe .bar {
  position: sticky; bottom: 0; margin-top: 22px; padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  display: flex; align-items: center; gap: 16px;
}
.panelframe button.save {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; padding: 12px 30px; background: var(--accent);
  color: var(--bg); border: 0; cursor: pointer;
}
.panelframe .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.panelframe .qgroup { margin-bottom: 22px; }
.panelframe .qgroup h2 {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.panelframe .qrow {
  display: flex; align-items: baseline; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--panel-edge); border-bottom: 0; background: var(--panel);
  text-decoration: none; color: var(--text);
}
.panelframe .qgroup .qrow:last-child { border-bottom: 1px solid var(--panel-edge); }
.panelframe .qrow:hover { background: var(--panel-edge); }
.panelframe .qrow .n { font-family: var(--cond); font-size: 19px; font-weight: 600; }
.panelframe .qrow .m {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: auto;
}
.panelframe .exp {
  margin-bottom: 16px; border: 1px solid var(--panel-edge); background: var(--panel);
}
.panelframe .exp-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--panel-edge);
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.panelframe .exp pre {
  margin: 0; padding: 13px 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono);
  color: var(--text); white-space: pre-wrap; word-break: break-all; max-height: 340px;
}
.panelframe .copy {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted); background: none;
  border: 1px solid var(--panel-edge); padding: 4px 12px; cursor: pointer;
}
.panelframe .copy.done { color: var(--bg); background: var(--win); border-color: var(--win); }
.panelframe .lede { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; max-width: 60ch; }
.panelframe h1 {
  font-family: var(--display); font-size: 34px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; margin: 0;
}
.panelframe .sub {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin: 6px 0 20px;
}

.loginwrap { max-width: 340px; margin: 40px auto; }
.loginwrap h1 {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.loginform { display: flex; flex-direction: column; gap: 12px; }
.loginform label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.loginform input {
  padding: 9px 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 14px var(--mono);
}
.loginform input:focus { outline: none; border-color: var(--accent); }
.loginform button {
  margin-top: 4px;
  padding: 11px;
  background: var(--accent);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  font: 600 13px var(--mono);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.usr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 120px 340px;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--panel-edge);
}
.board .usr-row:last-child { border-bottom: 0; }
.usr-row.head {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.usr-name { font-family: var(--cond); font-size: 16px; }
.usr-act { display: flex; gap: 8px; justify-content: flex-end; }
.usr-act form { display: flex; gap: 6px; margin: 0; }
.usr-act input {
  min-width: 0;
  width: 150px;
  padding: 4px 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 12px var(--mono);
}
.usr-act button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 11px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  cursor: pointer;
  white-space: nowrap;
}
.usr-act button:hover { color: var(--text); border-color: var(--muted); }
.usr-act button.danger:hover {
  color: var(--bg); background: var(--loss); border-color: var(--loss);
}

@media (max-width: 900px) {
  .usr-row { grid-template-columns: minmax(0, 1fr) auto; }
  .usr-row > :nth-child(2), .usr-row > :nth-child(3) { display: none; }
  .usr-act { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-start; }
}

.adm-find { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.adm-find input[type=search] {
  flex: 1;
  max-width: 360px;
  padding: 7px 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 13px var(--mono);
}
.adm-find button {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 7px 15px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  cursor: pointer;
}
.adm-find button:hover { color: var(--text); border-color: var(--muted); }
.adm-clear { font-family: var(--mono); font-size: 11.5px; }
.tag.focus { border-color: var(--accent); color: var(--accent); }

.bulk { display: flex; gap: 8px; margin-bottom: 6px; }
.bulk input[type=text] {
  flex: 1;
  max-width: 320px;
  padding: 6px 10px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 13px var(--mono);
}

.pager {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .adm-row { grid-template-columns: 96px 56px 48px 44px minmax(0, 1fr); }
  .adm-row > :nth-child(5), .adm-row > .adm-flags { display: none; }
  .adm-act { grid-column: 1 / -1; }
}

/* ---------- maps ---------- */

/* Banner slot: only rendered when art exists, and the card lays out the same
   without it, so dropping images into static/img/maps later needs no changes. */
.mc-art { line-height: 0; border-bottom: 1px solid var(--panel-edge); }
.mc-art img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
  opacity: 0.82;
}
.wcard:hover .mc-art img { opacity: 1; }

.mc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--panel-edge);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.mc-row {
  display: grid;
  grid-template-columns: 18px 20px minmax(0, 1fr) 58px 42px 40px;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  text-decoration: none;
  color: var(--text);
}
.mc-row:hover { background: var(--panel-edge); }
.mc-pic { width: 20px; height: 20px; object-fit: cover; border: 1px solid var(--panel-edge); }
.mc-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--cond);
  font-size: 12px;
  color: var(--muted);
}
.mc-kd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 560px) {
  .mc-row { grid-template-columns: 16px 20px minmax(0, 1fr) 40px 40px; }
  .mc-row .wc-bar { display: none; }
}

/* ---------- records ---------- *//* ---------- records ---------- */

h2.sec {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 30px 0 12px;
}
h2.sec.shame { color: var(--loss); }

.rbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.rb {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  display: flex;
  flex-direction: column;
}
.rb-head { padding: 13px 15px 11px; border-bottom: 1px solid var(--panel-edge); }
.rb-head h2 {
  font-family: var(--cond);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0;
  text-transform: none;
}
.rb-flavor { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

.rb-row {
  display: grid;
  /* sub column absorbs the slack so the value stays hard right */
  grid-template-columns: 16px 26px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--muted);
}
.rb-places .rb-row:last-child { border-bottom: 0; }
.rb-row:hover { background: var(--panel-edge); }
/* only first place gets full contrast -- second and third read as the chase */
.rb-row.first { color: var(--text); }

.rb-pos { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rb-row.first .rb-pos { color: var(--accent); }
.rb-pic { width: 26px; height: 26px; object-fit: cover; border: 1px solid var(--panel-edge); }
.rb-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--cond);
  font-size: 13px;
  color: var(--muted);
}
.rb-name {
  font-family: var(--cond);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 15ch;
}
.rb-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-val {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  min-width: 2ch;
  text-align: right;
}
.rb-row.first .rb-val { font-size: 32px; color: var(--accent); }
.rb.bad .rb-row.first .rb-val, .rb.bad .rb-row.first .rb-pos { color: var(--loss); }

.rb-more {
  display: block;
  padding: 8px 15px;
  border-top: 1px solid var(--panel-edge);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.rb-more:hover { color: var(--accent); background: var(--panel-edge); }

/* dedicated full-list page: one wide column instead of the card grid */
.rb-full { max-width: 640px; }

.record-jump {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.record-jump select {
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-edge);
  font: 13px var(--mono);
  max-width: 100%;
}

/* home page rail */
/* Inline sprite icons. Sized in em so they track whatever text they sit in,
   and stroked with currentColor so they follow the theme automatically. */
.ico {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
  margin-right: 7px;
  color: var(--accent);
  flex: none;
}
.stat .l { display: flex; align-items: center; }
.stat .l .ico { width: 13px; height: 13px; margin-right: 6px; opacity: 0.85; }
h2 .ico { color: var(--accent); }
h2.sec .ico { width: 13px; height: 13px; }

.frecs-wrap { margin-bottom: 26px; }
.frecs-head { display: flex; align-items: baseline; justify-content: space-between; }
.frecs-head h2.sec { margin: 0 0 12px; }
.frecs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }

.frec {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 3px solid var(--accent);
  padding: 11px 13px;
  margin-bottom: 10px;
  display: block;
  text-decoration: none;
  color: var(--text);
}
.frec:last-of-type { margin-bottom: 0; }
.frec:hover { border-color: var(--accent); }
.frec-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.frec-top { display: flex; align-items: baseline; gap: 9px; margin: 1px 0 3px; }
.frec-val {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}
.frec-name {
  font-family: var(--cond);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frec-pic {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border: 1px solid var(--panel-edge);
  align-self: center;
}
.frec-next { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

@media (max-width: 560px) {
  .rb-sub { display: none; }
  .rb-row { grid-template-columns: 16px 26px minmax(0, 1fr) auto; }
}

/* ---------- weapons ---------- */

.wgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.wcard { padding: 0; }
.wc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--panel-edge);
}
.wc-name {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
a.wc-name:hover { color: var(--accent); }
.wc-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }



.wc-row {
  display: grid;
  /* bar column absorbs the slack so names and counts stay aligned */
  grid-template-columns: 18px minmax(0, 1fr) 70px 44px;
  align-items: center;
  gap: 10px;
  padding: 7px 15px;
  text-decoration: none;
  color: var(--text);
}
.wc-row:hover { background: var(--panel-edge); }
.wc-rank { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.wc-who {
  font-family: var(--cond);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wc-bar { height: 7px; background: var(--panel-edge); }
.wc-bar::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--accent);
}
.wc-kills {
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  color: var(--muted);
}

@media (max-width: 560px) {
  .wc-row { grid-template-columns: 16px minmax(0, 1fr) 44px 40px; gap: 8px; }
  .rec-value { font-size: 34px; }
}

/* ---------- matches ---------- */

.match-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1.5fr) minmax(0, 1.1fr) 190px;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.board .match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--panel-edge); }
.match-row.head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.match-row.head:hover { background: none; }

.m-when { display: flex; flex-direction: column; line-height: 1.15; }
.m-when small { font-family: var(--mono); font-size: 11px; color: var(--muted);
                letter-spacing: 1px; white-space: nowrap; overflow: hidden;
                text-overflow: ellipsis; }
.m-res { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
         gap: 10px; min-width: 0; }
.m-res b { font-family: var(--cond); font-size: 16px; font-weight: 500;
           color: var(--muted); white-space: nowrap; overflow: hidden;
           text-overflow: ellipsis; }
/* names hug the score so a row reads as one scoreline, not three columns */
.m-res b { text-align: right; }
.m-res b.r { text-align: left; }
.m-res-h { text-align: center; }
/* only the winning side gets full contrast, so results scan at a glance */
.m-res b.w { color: var(--text); font-weight: 600; }
.m-score { font-family: var(--mono); font-size: 14px; font-weight: 600;
           color: var(--accent); white-space: nowrap; padding: 2px 8px;
           border: 1px solid var(--panel-edge); }
.m-score.draw { color: var(--muted); }
.m-mvp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-mvp-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-mvp-kd { font-family: var(--mono); font-size: 12px; color: var(--muted);
            white-space: nowrap; }
.m-maps { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.m-maps-h { text-align: right; }
.chip { font-family: var(--mono); font-size: 11px; padding: 2px 7px;
        border: 1px solid var(--panel-edge); color: var(--muted); white-space: nowrap; }
.chip.rounds { color: var(--text); border-color: transparent; background: var(--accent-soft); }

/* match facts strip */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
         gap: 1px; background: var(--panel-edge); border: 1px solid var(--panel-edge);
         margin-bottom: 26px; }
.fact { background: var(--panel); padding: 12px 12px 10px; min-width: 0; }
a.fact:hover { background: var(--panel-edge); }
.fact .v { display: block; font-family: var(--mono); font-size: 22px; font-weight: 600; }
.fact .v .unit { font-size: 0.5em; margin-left: 2px; opacity: 0.65; }
.fact .l { display: block; margin-top: 3px; font-size: 12px; letter-spacing: 2px;
           text-transform: uppercase; color: var(--muted); }
.fact .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact .sub b { color: var(--text); font-weight: 500; }

/* round timeline: same squares as the player page's form guide */
.tl .fbox.swap { margin-left: 14px; position: relative; }
.tl .fbox.swap::before { content: ""; position: absolute; left: -9px; top: -3px; height: 28px;
                         border-left: 1px dashed var(--muted); }
.fkey.swap { width: 0; height: 9px; border-left: 1px dashed var(--muted); }

@media (max-width: 720px) {
  .match-row { grid-template-columns: 76px minmax(0, 1fr); }
  .match-row.head { display: none; }
  .scoreline { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .sl-team, .sl-team.right { justify-content: center; }
  .sl-name { font-size: 24px; }
  .sl-score { font-size: 28px; }
}

.sb-row {
  display: grid;
  grid-template-columns: 22px 22px minmax(0, 1fr) 44px 44px 44px 56px 48px 44px 58px;
  position: relative;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.board .sb-row:last-child { border-bottom: 0; }
.sb-row:hover { background: var(--panel-edge); }
.sb-row.head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.sb-row.head:hover { background: none; }
.sb-name {
  font-family: var(--cond);
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}
/* kill share within the team, as a thin rule under the name */
.sb-row:not(.head) .sb-name::after {
  content: ""; position: absolute; left: 0; bottom: -3px; height: 2px;
  width: var(--share, 0%); background: var(--accent); opacity: 0.7;
}
.sb-rank { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.sb-mvp { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
          color: var(--accent); border: 1px solid var(--accent); padding: 1px 5px;
          margin-left: 8px; vertical-align: 2px; }

@media (max-width: 720px) {
  .sb-row { grid-template-columns: minmax(0, 1fr) 38px 38px 38px 50px; }
}

/* player page: recent matches */
.mh {
  display: grid;
  grid-template-columns: 30px 60px minmax(0, 1fr) 130px 44px 44px 56px 48px;
  align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--panel-edge); color: var(--text);
}
.board .mh:last-child { border-bottom: 0; }
.mh:hover { background: var(--panel-edge); }
.mh.head { font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
           text-transform: uppercase; color: var(--muted); }
.mh.head:hover { background: none; }
.mh-res { font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1; }
.mh-vs { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mh-vs b { font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden;
           text-overflow: ellipsis; }
.mh-vs b.w { font-weight: 600; color: var(--text); }
.mh-sc { font-family: var(--mono); font-size: 13px; color: var(--accent); white-space: nowrap; }
.mh-maps { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .mh { grid-template-columns: 26px 52px minmax(0, 1fr) 38px 38px 50px; gap: 6px; }
}

/* ---------- rivalries ---------- */

.rivals { display: flex; flex-direction: column; }

.rival {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 40px 200px 40px;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.rival:last-child { border-bottom: 0; }
.rival:hover { background: var(--panel-edge); }

.rival.head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.rival.head:hover { background: none; }
.rival.head .c-num { color: var(--muted); }

.rv-pic {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--panel-edge);
}
.rv-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--cond);
  font-size: 14px;
}

.rv-name {
  font-family: var(--cond);
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Diverging bar: deaths grow leftward from a shared centre axis, kills
   rightward. Both halves use the same scale (set server-side), so rows are
   comparable down the column. */
.rv-mid { display: flex; align-items: center; height: 14px; }
.rv-left, .rv-right { flex: 1; display: block; }
.rv-left { display: flex; justify-content: flex-end; }
.rv-left i, .rv-right i { display: block; height: 10px; }
.rv-left i { background: var(--loss); }
.rv-right i { background: var(--win); }
.rv-axis { width: 1px; height: 14px; background: var(--muted); flex: 0 0 1px; }

/* Rows past the visible limit ship with the page and are revealed by the
   toggle -- no second request, and the bar scale never shifts. */
.rival.extra { display: none; }
.rivals.open .rival.extra { display: grid; }

.rv-more {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.rv-more:hover { color: var(--text); border-color: var(--muted); }

.rival .rv-for { color: var(--win); }
.rival .rv-against { color: var(--loss); }

@media (max-width: 560px) {
  .rival {
    grid-template-columns: 24px minmax(0, 1fr) 30px 96px 30px;
    gap: 8px;
  }
  .rv-pic { width: 24px; height: 24px; }
}

/* ---------- form guide ---------- */

.form {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.fbox {
  width: 15px;
  height: 22px;
  background: var(--panel-edge);
  cursor: default;
}
.fbox.w { background: var(--win); }
.fbox.l { background: var(--loss); }
.fbox.d { background: var(--muted); opacity: 0.55; }
.fbox:hover { outline: 1px solid var(--text); }

.fkey {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  vertical-align: -1px;
}
.fkey.w { background: var(--win); }
.fkey.l { background: var(--loss); }
.fkey.d { background: var(--muted); opacity: 0.55; }

/* ---------- stance ---------- */

.stancecols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.st-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.st-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 44px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--panel-edge);
}
.st-row:last-child { border-bottom: 0; }
/* fill tinted by which half it's in: dealt reads as good, taken as bad */
.st-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--sw, 0%);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-soft2));
  z-index: -1;
}
.st-row.bad::before {
  background: linear-gradient(90deg, rgba(209, 112, 95, 0.20), rgba(209, 112, 95, 0.03));
}
.st-name { font-family: var(--cond); font-size: 15px; }
.st-n { font-family: var(--mono); font-size: 13px; text-align: right; }
.st-pct { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }

@media (max-width: 560px) {
  .stancecols { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- server split ---------- */

.srvlist { display: flex; flex-direction: column; }
.srv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--panel-edge);
}
.srvlist .srv:last-child { border-bottom: 0; }
/* fill sits behind the row, same treatment as the weapon bars */
.srv::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--sw, 0%);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-soft2));
  z-index: -1;
}
.srv-name { font-family: var(--mono); font-size: 14px; }
.srv-n { font-family: var(--mono); font-size: 13px; text-align: right; }
.srv-pct {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

@media (max-width: 560px) {
  .fbox { width: 12px; height: 18px; }
}

/* ---------- interactive chart hover ---------- */

.chart-host { position: relative; }
/* the SVG has overflow:visible so the dot isn't clipped at the edges */
.chart-host .crosshair {
  stroke: var(--muted);
  stroke-width: 1px;
  opacity: 0.6;
  pointer-events: none;
}
.chart-host .cursor-dot {
  fill: var(--accent);
  stroke: var(--panel);
  stroke-width: 2px;
  pointer-events: none;
}
/* SVG's own default `display` for shape elements beats the plain [hidden]
   attribute in most browsers -- the crosshair/dot sat visible at their
   unset (0,0) position on every load until hovered, same fix already used
   for .scheme-ask below. Without an explicit rule here they read as a
   stray blob in the corner of every line chart. */
.chart-host .crosshair[hidden], .chart-host .cursor-dot[hidden] { display: none; }

.chart-tip {
  position: absolute;
  top: 4px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  background: var(--bg);
  border: 1px solid var(--panel-edge);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}
/* Same cascade problem as the crosshair/dot above, different cause: this
   class's own `display: flex` has the same specificity as the UA
   stylesheet's `[hidden] { display: none }` and, being an author rule,
   wins the tie -- so tip.hidden = true was leaving an empty bordered box
   sitting in the corner of every chart even before any hover. */
.chart-tip[hidden] { display: none; }
.chart-tip .ct-when { color: var(--muted); }
.chart-tip .ct-v { color: var(--accent); }
.chart-tip .ct-c { color: var(--muted); }

/* rolling-form chart: faint career baseline under the accent rolling line */
.chart .line.base {
  stroke: var(--muted);
  stroke-width: 1px;
  opacity: 0.55;
}

/* per-round kill distribution */
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row {
  display: grid;
  grid-template-columns: 26px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.dist-k {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.dist-bar {
  height: 14px;
  width: var(--dw, 0%);
  min-width: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
}
.dist-n { font-family: var(--mono); font-size: 13px; text-align: right; }

/* short plain-language note under each chart heading */
.explain {
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  margin: -6px 0 14px;
}

/* hour-of-day + per-day activity bars */
.hours, .days { display: flex; align-items: flex-end; gap: 2px; height: 104px; }
.hours .hbar, .days .dbar {
  flex: 1;
  min-width: 2px;
  height: max(2px, var(--hh, var(--dh)));
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
}
.days .dbar { height: max(2px, var(--dh)); }
.hour-axis {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.hour-axis span { flex: 1; min-width: 2px; text-align: left; }

/* long/short header labels — full words on desktop, initials on mobile */
.board-row.head b { font-weight: inherit; }
.board-row.head .sm { display: none; }

@media (max-width: 720px) {
  .board-row.head { font-size: 12px; letter-spacing: 0.5px; }
  .board-row.head .lg { display: none; }
  .board-row.head .sm { display: inline; }
  .statgrid { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
  .explain { font-size: 13px; }
}

/* theme picker in the header */
.theme-pick {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
  font-family: var(--cond);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
}
.theme-pick:hover { color: var(--text); border-color: var(--muted); }
.theme-pick option { background: var(--panel); color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 16px; }

/* ---------- landing page ---------- */

.hero { margin-bottom: 30px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: 3px;
  line-height: 1.02;
  text-transform: uppercase;
}
.hero-sub {
  color: var(--muted);
  margin-top: 10px;
  max-width: 62ch;
  font-size: 18px;
}

.metrics { margin-top: 22px; }
.stat .v.sm { font-size: 17px; line-height: 1.9; }

/* ---------- search ---------- */

.search { display: flex; gap: 8px; }
.search input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  color: var(--text);
  font-family: var(--cond);
  padding: 8px 12px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
}
.search button {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  font-family: var(--cond);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
}
.search button:hover { filter: brightness(1.12); }

.search-lg { margin-top: 22px; max-width: 560px; font-size: 18px; }
.search-lg input { font-size: 17px; padding: 11px 14px; }

.search-sm { margin: 0; }
.search-sm input { width: 168px; font-size: 14px; padding: 4px 10px; }

/* ---------- live search dropdown ---------- */

.search { position: relative; }

.search-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.sd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.sd-row:last-child { border-bottom: 0; }
/* .on is keyboard selection, hover is mouse -- same treatment */
.sd-row:hover, .sd-row.on { background: var(--accent); color: var(--bg); }

.sd-pic {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--panel-edge);
}
.sd-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-family: var(--cond);
  font-size: 14px;
}
/* Keep the tile dark with a light letter in the highlighted state: the row
   background is the accent color, so a dark letter would disappear. */
.sd-row:hover .sd-mono, .sd-row.on .sd-mono { color: var(--text); background: var(--bg); }

.sd-name { font-family: var(--cond); font-size: 15px; flex: 1; }
.sd-alias { color: var(--muted); font-size: 13px; margin-left: 7px; }
.sd-row:hover .sd-alias, .sd-row.on .sd-alias { color: var(--bg); opacity: 0.75; }

.sd-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sd-row:hover .sd-meta, .sd-row.on .sd-meta { color: var(--bg); opacity: 0.85; }

.sd-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* the nav box is narrow; give its dropdown room to breathe */
.search-sm .search-drop { left: auto; width: 290px; }

/* ---------- mini boards on the landing page ---------- */

.mini { display: flex; flex-direction: column; }
.minirow {
  display: grid;
  grid-template-columns: 26px 22px 1fr 58px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-edge);
  position: relative;
  isolation: isolate;
}
.minirow:last-child { border-bottom: 0; }
.minirow::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--kfill, 0%);
  background: linear-gradient(90deg, var(--accent-soft), var(--accent-soft2));
  z-index: -1;
}
.minirow:hover { background: var(--panel); }
.mini-rank { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.mini-pic {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border: 1px solid var(--panel-edge);
}
.mini-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--cond);
  font-size: 12px;
  color: var(--muted);
}
.mini-name { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-num { font-family: var(--mono); font-size: 14px; text-align: right; }

.cols.even { grid-template-columns: 1fr 1fr; }

/* ---------- about / CTA ---------- */

.about p { color: var(--muted); max-width: 78ch; }
.about .cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 18px;
}
.btn:hover { background: var(--accent); color: var(--bg); }

/* ---------- search results ---------- */

.results .board-row { grid-template-columns: 44px 1fr repeat(3, 76px); }
.alias {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar nav { width: 100%; gap: 12px; }
  .search-sm { flex: 1; }
  .search-sm input { width: 100%; }
  .cols.even { grid-template-columns: 1fr; }
  .results .board-row { grid-template-columns: 36px 1fr repeat(2, 52px); }
  .alias { display: none; }
}

/* ---------- header fixes (search form in the nav row) ---------- */

/* baseline alignment breaks once a form control shares the row: the input's
   baseline is inside its border box, so the brand and links get shoved. */
.topbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.brand { flex: 0 0 auto; }
.topbar nav { flex-wrap: wrap; justify-content: flex-end; }
/* without min-width:0 a flex item refuses to shrink below its content width,
   which is what pushes the search box off the right edge on narrow viewports */
.search-sm { min-width: 0; }
.search-sm input { max-width: 100%; }

/* ---------- logo brand mark ---------- */

.brand-logo { display: block; height: 44px; width: auto; }
@media (max-width: 720px) { .brand-logo { height: 36px; } }

/* Big Shoulders is a lot narrower than Allerta Stencil was, so the display
   sizes get a touch more tracking to keep the same weight on the page. */
.hero h1, .page-head h1, .phead h1 { letter-spacing: 3px; }

/* ---------- theme picker (wider, was cramped at ~62px) ---------- */

.theme-pick {
  min-width: 132px;
  padding: 5px 10px;
  background-image: none;
}

/* ---------- first-visit scheme picker ---------- */

.scheme-ask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
.scheme-ask[hidden] { display: none; }

.scheme-box {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  padding: 26px 26px 22px;
  width: min(520px, 100%);
}
.scheme-box h2 {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 6px;
}
.scheme-box .explain { margin: 0 0 18px; }

.scheme-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px 4px;
  justify-items: center;
}
.scheme-row button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 62px;
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font-family: var(--cond);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}
/* the palette itself is the affordance: background, panel and accent
   sweeping across the circle */
.scheme-row .swatch {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--s1) 0%, var(--s2) 42%, var(--s3) 100%);
  box-shadow: inset 0 0 0 1px var(--panel-edge);
}
.scheme-row button:hover, .scheme-row button:focus-visible {
  color: var(--text);
  outline: none;
}
.scheme-row button:hover .swatch, .scheme-row button:focus-visible .swatch {
  box-shadow: inset 0 0 0 1px var(--s3), 0 0 0 2px var(--s3);
}

@media (prefers-reduced-motion: no-preference) {
  .scheme-row .swatch { transition: box-shadow 0.15s ease, transform 0.15s ease; }
  .scheme-row button:hover .swatch { transform: scale(1.08); }
}

@media (max-width: 560px) {
  .scheme-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 380px) {
  .scheme-row { grid-template-columns: repeat(3, 1fr); }
}

.cmp-search { max-width: 260px; margin: 4px 0 26px; }
.cmp-search input { width: 100%; }

/* ---------- weapon / map detail ---------- */

/* Full-width leaderboard row: rank, optional avatar, name, bar, value(s).
   Reuses .wc-bar's fill-by-css-var trick from the weapons/maps cards, just
   at full page width instead of inside a wcard. */
.wl-row {
  display: grid;
  grid-template-columns: 24px 22px minmax(0, 1fr) minmax(60px, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--panel-edge);
  text-decoration: none;
  color: var(--text);
}
.wl-row:last-child { border-bottom: 0; }
.wl-row:hover { background: var(--panel-edge); }
/* Map leaderboard needs a K/D + rounds column the plain weapon row doesn't. */
.wl-row.wide {
  grid-template-columns: 24px 22px minmax(0, 1fr) 84px minmax(60px, 1fr) 48px;
}
.wl-row.head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.wl-row.head:hover { background: none; }
.wl-rank { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.wl-who {
  font-family: var(--cond);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-extra {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.wl-val {
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
}

@media (max-width: 560px) {
  .wl-row, .wl-row.wide { grid-template-columns: 20px 20px minmax(0, 1fr) 40px; }
  .wl-row .wc-bar, .wl-extra { display: none; }
}

/* ---------- compare ---------- */

.cmp-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}
.cmp-side {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.cmp-side.right { flex-direction: row-reverse; text-align: right; }
.cmp-side .avatar { width: 56px; height: 56px; flex: 0 0 auto; }
.cmp-side .avatar-mono { font-size: 22px; }
.cmp-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmp-name:hover { color: var(--accent); }
.cmp-vs {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
}

.cmp-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--panel-edge);
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-a, .cmp-b {
  font-family: var(--mono);
  font-size: 14px;
}
.cmp-a { text-align: right; }
.cmp-a.ahead, .cmp-b.ahead { color: var(--accent); font-weight: 600; }
.cmp-label {
  font-family: var(--cond);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* Neutral split bar -- unlike the rivalries panel this isn't for/against, so
   it doesn't borrow --win/--loss; both halves get the same muted-to-accent
   treatment and only the "ahead" text color signals which side leads. */
.cmp-mid { display: flex; align-items: center; height: 14px; }
.cmp-left, .cmp-right { flex: 1; display: block; }
.cmp-left { display: flex; justify-content: flex-end; }
.cmp-left i, .cmp-right i { display: block; height: 10px; background: var(--muted); opacity: 0.55; }
.cmp-left i.ahead, .cmp-right i.ahead { background: var(--accent); opacity: 1; }
.cmp-axis { width: 1px; height: 14px; background: var(--muted); flex: 0 0 1px; }
.cmp-h2h {
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
  margin-bottom: 22px;
}

@media (max-width: 640px) {
  .cmp-head { grid-template-columns: 1fr 1fr; }
  .cmp-vs { display: none; }
  .cmp-row { grid-template-columns: 56px 1fr 90px; gap: 8px; }
}

/* ---------- badges ---------- */

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--panel-edge);
  background: var(--accent-soft2);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  cursor: default;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
