/* ─────────────────────────────────────────────────────────────────────────────
   SCU statistics — shared design system for /stats and the player Stats tab.

   Global rather than scoped because the pieces (charts, bullet rows, usage bars,
   gauges) are separate components nested inside the pages, and Blazor's scoped
   CSS does not cross component boundaries. Everything is prefixed st-.

   Colours are theme tokens. The site's own --scu-* variables cover surfaces and
   text; the handful of data colours that are not themeable on their own (race,
   win/loss, the A/B comparison pair, good/bad) are declared once on .st and
   re-tuned for the cyan theme, so neither theme borrows the other's palette.
   ───────────────────────────────────────────────────────────────────────────── */

.st {
    --st-race-p: #d4a800;
    --st-race-t: #3b82d6;
    --st-race-z: #b8322a;
    --st-a: #e0574c;
    --st-b: #6fa8dc;
    --st-comm: #9a8888;
    --st-good: #52b374;
    --st-bad: #d0605a;
    --st-win: #52b374;
    --st-loss: #b04a4a;
    --st-grid: rgba(255, 225, 225, 0.07);
    --st-track: rgba(255, 225, 225, 0.06);
    --st-gap: 1.1rem;
    --st-radius: 6px;
}

[data-theme="cyan"] .st {
    --st-race-p: #e8bd2c;
    --st-race-t: #4f9cf0;
    --st-race-z: #e0524a;
    --st-a: #00e5ff;
    --st-b: #f5a524;
    --st-comm: #6f8fa0;
    --st-good: #34d399;
    --st-bad: #fb7185;
    --st-win: #34d399;
    --st-loss: #e0607a;
    --st-grid: rgba(0, 229, 255, 0.08);
    --st-track: rgba(0, 229, 255, 0.06);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

.st-dim { color: var(--scu-text-muted); }
.st-win { color: var(--st-win); }
.st-loss { color: var(--st-loss); }
.st-a { color: var(--st-a); }
.st-b { color: var(--st-b); }

.st-empty {
    color: var(--scu-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.st-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    color: var(--scu-text-muted);
    font-size: 0.85rem;
}

.st-footnote {
    display: block;
    color: var(--scu-text-muted);
    font-size: 0.72rem;
    margin: 0.6rem 0 0;
    line-height: 1.45;
}

.st-link {
    color: var(--scu-text-bright);
    text-decoration: none;
}

.st-link:hover { color: var(--scu-red); }
.st-link--dim { color: var(--scu-text-muted); }

.st-ellipsis {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-kicker {
    display: block;
    font-family: var(--scu-font-display);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--scu-red);
}

/* ── Page header, segmented switches, tabs ───────────────────────────────── */

/* Same shape as the other league pages: the site's h1 and a muted line, controls on the right. */
.st-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    margin-bottom: 1rem;
}

.st-header-scope {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.st-header-scope .form-select { width: auto; min-width: 11rem; }

.st-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 999px;
    background: var(--scu-bg-panel);
}

.st-seg--wide {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-bottom: var(--st-gap);
    border-radius: var(--st-radius);
}

.st-seg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--scu-text-muted);
    font-family: var(--scu-font-display);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    transition: color var(--scu-transition), background var(--scu-transition);
}

.st-seg--wide .st-seg-btn { border-radius: 4px; }
.st-seg-btn:hover { color: var(--scu-text-bright); }

.st-seg-btn.is-on {
    background: var(--scu-red-glow-md);
    color: var(--scu-text-bright);
    box-shadow: inset 0 0 0 1px var(--scu-red-dim);
}

.st-seg-count {
    font-family: var(--scu-font-body);
    font-size: 0.68rem;
    color: var(--scu-text-muted);
    letter-spacing: 0;
}

/* Matches the player page's section tabs. */
.st-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--scu-border-bright);
    overflow-x: auto;
    scrollbar-width: none;
}

.st-tabs::-webkit-scrollbar { display: none; }

.st-tab {
    padding: 0.6rem 1.1rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--scu-text-muted);
    font-family: var(--scu-font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--scu-transition), background var(--scu-transition), border-color var(--scu-transition);
}

.st-tab:hover { color: var(--scu-text-bright); background: var(--scu-red-glow); }

.st-tab.is-on {
    color: var(--scu-red);
    border-bottom-color: var(--scu-red);
}

/* ── Tiles, grid, panels ─────────────────────────────────────────────────── */

.st-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: var(--st-gap);
}

.st-tile {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
    border-top: 2px solid var(--scu-red-dim);
}

.st-tile strong {
    font-family: var(--scu-font-display);
    font-size: 1.55rem;
    line-height: 1.1;
    color: var(--scu-text-bright);
}

.st-tile span { font-size: 0.76rem; color: var(--scu-text); }
.st-tile em { font-style: normal; font-size: 0.7rem; color: var(--scu-text-muted); }

.st-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--st-gap);
    align-items: start;
    margin-bottom: var(--st-gap);
}

.st-panel {
    min-width: 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
}

.st-panel--wide { grid-column: 1 / -1; }

.st-panel-head { margin-bottom: 0.9rem; }

.st-panel-head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.st-panel-head h2 {
    font-family: var(--scu-font-display);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--scu-text-bright);
    margin: 0 0 0.3rem;
}

.st-panel-head p {
    color: var(--scu-text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
    max-width: 70ch;
    margin: 0;
}

.st-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.8rem;
    font-family: var(--scu-font-display);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--scu-text-bright);
    margin: 1.6rem 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--scu-border);
}

.st-section-title span {
    font-family: var(--scu-font-body);
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--scu-text-muted);
}

.st-sub {
    font-family: var(--scu-font-display);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
    margin: 1.1rem 0 0.55rem;
}

.st-lede {
    color: var(--scu-text);
    font-size: 0.85rem;
    max-width: 80ch;
    margin: 0 0 var(--st-gap);
}

.st-lede p { margin: 0 0 0.5rem; }
.st-lede p:last-child { margin-bottom: 0; }
.st-lede ol { margin: 0 0 0.5rem; padding-left: 1.25rem; }
.st-lede li { margin-bottom: 0.2rem; }
.st-lede li b { color: var(--scu-text-bright); font-weight: 600; }

.st-notice {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.95rem;
    border: 1px dashed var(--scu-border-bright);
    border-radius: var(--st-radius);
    color: var(--scu-text-muted);
    font-size: 0.82rem;
}

.st-notice-mark { color: var(--scu-red); }

.st-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 999px;
    background: var(--scu-bg-panel);
    color: var(--scu-text);
    font-size: 0.75rem;
}

button.st-chip:hover { border-color: var(--scu-red-dim); color: var(--scu-text-bright); }

.st-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.st-tag {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 4px;
    font-family: var(--scu-font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--scu-bg);
}

.st-tag--a { background: var(--st-a); }
.st-tag--b { background: var(--st-b); }

/* ── Tones (never the only signal: every toned value has its number) ─────── */

.st-tone-hi { --tone: var(--st-good); }
.st-tone-up { --tone: color-mix(in srgb, var(--st-good) 60%, var(--scu-text)); }
.st-tone-mid { --tone: var(--scu-text); }
.st-tone-down { --tone: color-mix(in srgb, var(--st-bad) 60%, var(--scu-text)); }
.st-tone-lo { --tone: var(--st-bad); }
.st-tone-none { --tone: var(--scu-text-muted); }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.st-table-wrap { overflow-x: auto; margin: 0 -0.2rem; }

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.st-table th {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--scu-border-bright);
    color: var(--scu-text-muted);
    font-family: var(--scu-font-display);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.st-table td {
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid var(--scu-border);
    color: var(--scu-text);
    vertical-align: middle;
}

.st-table tbody tr:hover td { background: var(--scu-red-glow); }
.st-table--compact td { padding: 0.4rem 0.5rem; }
.st-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table th.st-rank, .st-table td.st-rank { width: 2.5rem; }

.st-cell-sub {
    display: block;
    font-size: 0.68rem;
    color: var(--scu-text-muted);
}

.st-score-col { width: 5.2rem; }

.st-search input {
    width: 14rem;
    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 999px;
    background: var(--scu-bg-panel);
    color: var(--scu-text-bright);
    font-size: 0.8rem;
}

.st-search input:focus { outline: none; border-color: var(--scu-red-dim); }

/* A 0–100 score with a midline at 50, the typical game. */
/* Below the leaderboard minimum: the score is real, just not ranked on the boards. */
.st-minibar--short { opacity: 0.45; }

.st-minibar {
    position: relative;
    display: block;
    height: 1.15rem;
    min-width: 4rem;
    border-radius: 3px;
    background: var(--st-track);
    overflow: hidden;
}

.st-minibar > span {
    position: absolute;
    inset: 0 auto 0 0;
    background: color-mix(in srgb, var(--tone, var(--scu-text)) 38%, transparent);
    border-right: 2px solid var(--tone, var(--scu-text));
}

.st-minibar::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1px dashed var(--scu-text-muted);
    opacity: 0.6;
}

.st-minibar b {
    position: relative;
    z-index: 1;
    display: block;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    line-height: 1.15rem;
    font-weight: 600;
    color: var(--scu-text-bright);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Balance bars (results) ──────────────────────────────────────────────── */

.st-balance { display: flex; flex-direction: column; gap: 0.35rem; }

.st-balance-row {
    display: grid;
    grid-template-columns: 4.6rem 1fr 4.6rem;
    grid-template-areas: "l bar r" ". foot .";
    align-items: center;
    gap: 0.15rem 0.7rem;
    width: 100%;
    padding: 0.55rem 0.4rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--scu-text);
    text-align: left;
    transition: background var(--scu-transition);
}

.st-balance-row:hover { background: var(--scu-red-glow); }

.st-balance-side {
    grid-area: l;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.st-balance-side--r { grid-area: r; justify-content: flex-end; }
.st-balance-side strong { color: var(--scu-text-bright); font-size: 0.9rem; }

.st-balance-bar {
    grid-area: bar;
    position: relative;
    display: flex;
    height: 10px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--st-track);
}

.st-balance-bar > span:last-of-type { flex: 1; }
.st-balance-bar > span { opacity: 0.85; }
.st-balance-bar--big { height: 18px; width: 100%; }

.st-balance-mid {
    position: absolute;
    left: 50%;
    top: -2px;
    bottom: -2px;
    border-left: 2px solid var(--scu-bg-card);
}

.st-balance-foot {
    grid-area: foot;
    text-align: center;
    font-size: 0.7rem;
    color: var(--scu-text-muted);
}

.st-mirrors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    font-size: 0.78rem;
}

.st-stack {
    display: flex;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.st-stack span {
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--scu-font-display);
    font-size: 0.7rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.st-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.st-legend li {
    display: grid;
    grid-template-columns: auto 5rem 3.8rem 1fr;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.83rem;
}

.st-legend strong { color: var(--scu-text-bright); text-align: right; font-variant-numeric: tabular-nums; }

/* ── Game lengths ────────────────────────────────────────────────────────── */

.st-lengths {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.st-length-head {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.st-length-head strong {
    margin-left: auto;
    font-family: var(--scu-font-display);
    font-size: 0.85rem;
    color: var(--scu-text-bright);
}

.st-length-bars {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 64px;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--scu-border-bright);
}

.st-length-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(180deg, var(--scu-red), var(--scu-red-dim));
    opacity: 0.8;
}

.st-length-median {
    position: absolute;
    top: -4px;
    bottom: -4px;
    border-left: 2px solid var(--scu-text-bright);
}

.st-length-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 0.2rem;
    font-size: 0.64rem;
    color: var(--scu-text-muted);
}

/* ── Moments, records, rivalries ─────────────────────────────────────────── */

.st-moments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.7rem;
}

.st-moment {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--scu-border);
    border-left: 3px solid var(--race, var(--scu-red));
    border-radius: 4px;
    background: var(--scu-bg-panel);
}

.st-moment img {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 4px;
    image-rendering: auto;
}

.st-moment > div { display: flex; flex-direction: column; min-width: 0; font-size: 0.74rem; }

.st-moment strong {
    font-family: var(--scu-font-display);
    font-size: 1.15rem;
    line-height: 1.1;
    color: var(--scu-text-bright);
}

.st-moment-name { color: var(--scu-text); font-size: 0.8rem; }
.st-moment-top { margin-top: 0.2rem; color: var(--scu-text-muted); }
.st-moment-top a { color: var(--scu-text-bright); text-decoration: none; }
.st-moment-top a:hover { color: var(--scu-red); }

.st-records {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    column-gap: 1.75rem;
}

.st-record {
    display: grid;
    grid-template-columns: 1fr auto 1.5rem;
    grid-template-areas: "label value link" "who who link";
    gap: 0.1rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--scu-border);
}


.st-record-label { grid-area: label; font-size: 0.82rem; color: var(--scu-text); }

.st-record-value {
    grid-area: value;
    font-family: var(--scu-font-display);
    font-size: 0.95rem;
    color: var(--scu-text-bright);
    font-variant-numeric: tabular-nums;
}

.st-record-who { grid-area: who; display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.76rem; }
.st-record-who a { color: var(--scu-text-bright); text-decoration: none; }
.st-record-who a:hover { color: var(--scu-red); }

.st-record-link {
    grid-area: link;
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--scu-border-bright);
    color: var(--scu-text-muted);
    text-decoration: none;
}

.st-record-link:hover { color: var(--scu-red); border-color: var(--scu-red-dim); }

.st-rivals {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    column-gap: 1.75rem;
}

.st-rival {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "a score b" "bar bar bar" "maps maps maps";
    gap: 0.25rem 0.6rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--scu-border);
    font-size: 0.83rem;
}

.st-rival:last-child { border-bottom: 0; }
.st-rival a { color: var(--scu-text); text-decoration: none; }
.st-rival a:hover { color: var(--scu-red); }
.st-rival a.is-ahead { color: var(--scu-text-bright); font-weight: 600; }
.st-rival-a { grid-area: a; }
.st-rival-b { grid-area: b; text-align: right; }

.st-rival-score {
    grid-area: score;
    font-family: var(--scu-font-display);
    color: var(--scu-text-bright);
}

.st-rival-bar {
    grid-area: bar;
    display: block;
    height: 4px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--st-b) 55%, transparent);
    overflow: hidden;
}

.st-rival-bar span { display: block; height: 100%; background: var(--st-a); }
.st-rival-maps { grid-area: maps; text-align: center; font-size: 0.7rem; color: var(--scu-text-muted); }

/* ── Matchup explorer ────────────────────────────────────────────────────── */

.st-mu-hero {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 2fr) minmax(8rem, 1fr);
    align-items: center;
    gap: 1.25rem;
}

.st-mu-side {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 0.8rem;
    border-left: 3px solid var(--race);
    font-size: 0.78rem;
}

.st-mu-side--r {
    align-items: flex-end;
    text-align: right;
    padding: 0 0.8rem 0 0;
    border-left: 0;
    border-right: 3px solid var(--race);
}

.st-mu-race {
    font-family: var(--scu-font-display);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--race);
}

.st-mu-rate {
    font-family: var(--scu-font-display);
    font-size: 2rem;
    line-height: 1.1;
    color: var(--scu-text-bright);
}

.st-mu-apm { color: var(--scu-text); }

.st-mu-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    font-size: 0.76rem;
}

.st-mu-games {
    font-family: var(--scu-font-display);
    font-size: 2rem;
    color: var(--scu-text-bright);
}

.st-maprows { display: flex; flex-direction: column; gap: 0.2rem; }

.st-maprow {
    display: grid;
    grid-template-columns: minmax(7rem, 12rem) 2.6rem 1fr 2.6rem 3.4rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.st-maprow--tight { grid-template-columns: 4rem 1fr 3.2rem; }
.st-maprow-name { display: flex; align-items: center; gap: 0.2rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-maprow-pct { text-align: center; font-variant-numeric: tabular-nums; color: var(--scu-text-bright); }
.st-maprow-games { text-align: right; color: var(--scu-text-muted); font-variant-numeric: tabular-nums; }
.st-maprow .st-balance-bar { grid-area: auto; height: 8px; }

.st-chart-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem 1.5rem;
}

.st-sides {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.st-sides--one { grid-template-columns: minmax(0, 1fr); }

.st-side { min-width: 0; }

/* The divider belongs to the right-hand column only; a side that wraps to a new row starts flush. */
.st-sides > .st-side:nth-child(2n) {
    padding-left: 1.5rem;
    border-left: 1px solid var(--scu-border);
}

.st-sides--one > .st-side:nth-child(2n) { padding-left: 0; border-left: 0; }

.st-side-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--race, var(--scu-border-bright));
}

.st-side--a .st-side-head { border-bottom-color: var(--st-a); }
.st-side--b .st-side-head { border-bottom-color: var(--st-b); }

.st-side-head h3 {
    margin: 0;
    font-family: var(--scu-font-display);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--scu-text-bright);
}

.st-side-head > .st-dim { margin-left: auto; font-size: 0.74rem; }

/* ── Line chart ──────────────────────────────────────────────────────────── */

.st-chart { margin: 0; min-width: 0; }
.st-chart + .st-chart { margin-top: 0.9rem; }
.st-chart-pair .st-chart + .st-chart { margin-top: 0; }
.st-chart-title {
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
}
.st-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-chart-grid { stroke: var(--st-grid); stroke-width: 1; }

/* Hover readout. The hit area is invisible but catches the pointer; the rest appears on hover. */
.st-chart-hit-area { fill: transparent; }
.st-chart-hover { opacity: 0; pointer-events: none; transition: opacity 0.08s ease-out; }
.st-chart-hit:hover .st-chart-hover { opacity: 1; }
.st-chart-guide { stroke: var(--scu-text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.st-chart-dot { stroke: var(--scu-bg-card); stroke-width: 1.5; }
.st-chart-tip { fill: var(--scu-bg-elevated); stroke: var(--scu-border-bright); stroke-width: 1; }
.st-chart-tip-time { fill: var(--scu-text-bright); font-size: 7.5px; font-weight: 600; font-family: var(--scu-font-body); }
.st-chart-tip-name { fill: var(--scu-text); font-size: 7px; font-family: var(--scu-font-body); }
.st-chart-tip-value { fill: var(--scu-text-bright); font-size: 7px; font-weight: 600; font-family: var(--scu-font-body); font-variant-numeric: tabular-nums; }
.st-chart-axis { stroke: var(--scu-border-bright); stroke-width: 1; }
.st-chart-tick { fill: var(--scu-text-muted); font-size: 10px; font-family: var(--scu-font-body); }

.st-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 0.35rem;
    font-size: 0.74rem;
    color: var(--scu-text);
}

.st-chart-key { display: inline-flex; align-items: center; gap: 0.35rem; }

.st-chart-swatch {
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 3px solid var(--swatch);
    border-radius: 2px;
}

.st-chart-swatch--dash { border-top: 2px dashed var(--swatch); }
.st-chart-note { color: var(--scu-text-muted); }

/* ── Tech timeline ───────────────────────────────────────────────────────── */

.st-tl {
    --st-tl-lane: 4.1rem;
    position: relative;
    height: calc(var(--lanes) * var(--st-tl-lane) + 2rem);
    margin: 0.3rem 1.2rem 0.4rem 0.8rem;
}

.st-tl-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 0.9rem;
    height: 1px;
    background: var(--scu-border-bright);
}

.st-tl-tick {
    position: absolute;
    top: -0.9rem;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: var(--scu-text-muted);
}

.st-tl-tick::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.9rem;
    height: calc(var(--lanes) * var(--st-tl-lane) + 0.9rem);
    border-left: 1px dashed var(--st-grid);
}

.st-tl-item {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 0;
}

.st-tl-icon {
    position: relative;
    z-index: 1;
    width: var(--size);
    height: var(--size);
    object-fit: contain;
    opacity: var(--strength);
    filter: drop-shadow(0 0 6px var(--scu-red-glow-md));
}

.st-tl-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 6.5rem;
    margin-top: 0.1rem;
    text-align: center;
    line-height: 1.15;
}

.st-tl-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.66rem;
    color: var(--scu-text-bright);
}

.st-tl-meta { font-size: 0.6rem; color: var(--scu-text-muted); font-variant-numeric: tabular-nums; }

/* Positioned on the timeline (left/top set inline); centred on that point, drawn over icons. */
.st-tl-ghost {
    position: absolute;
    z-index: 2;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-top: -5px;
    border: 2px solid var(--st-comm);
    border-radius: 2px;
    transform: rotate(45deg);
    background: var(--scu-bg-card);
}

.st-tl-ghostline {
    position: absolute;
    height: 0;
    border-top: 1px dashed var(--st-comm);
}

.st-tl-ghost--inline {
    position: relative;
    display: inline-block;
    top: 1px;
    margin: 0 0.4rem 0 0.2rem;
}

.st-tl-key { font-size: 0.72rem; color: var(--scu-text-muted); margin: 0.2rem 0 0; }

/* ── Score gauges ────────────────────────────────────────────────────────── */

.st-gauges {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.st-gauges--compact { grid-template-columns: repeat(4, 4.6rem); gap: 0.35rem; }

.st-gauge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.st-gauge-svg { width: 100%; max-width: 96px; height: auto; overflow: visible; }
.st-gauge-track { fill: none; stroke: var(--st-track); stroke-width: 9; stroke-linecap: round; }

.st-gauge-fill {
    fill: none;
    stroke: var(--tone);
    stroke-width: 9;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--tone) 45%, transparent));
}

.st-gauge-value {
    margin-top: -1.6rem;
    font-family: var(--scu-font-display);
    font-size: 1.2rem;
    color: var(--scu-text-bright);
}

.st-gauge-label {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
}

.st-gauge--compact .st-gauge-value { margin-top: -1.25rem; font-size: 0.9rem; }
.st-gauge--compact .st-gauge-label { font-size: 0.56rem; }

/* ── Metric bullet rows ──────────────────────────────────────────────────── */

.st-mgroups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 0.4rem 1.5rem;
}

.st-mgroup .st-sub { margin-top: 0.4rem; }
.st-mrows { display: flex; flex-direction: column; }

.st-mrow {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "head values" "track track" "foot foot";
    gap: 0.2rem 0.7rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--scu-border);
}

.st-mrow:last-child { border-bottom: 0; }

.st-mrow-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; }
.st-mrow-label { font-size: 0.83rem; color: var(--scu-text-bright); cursor: help; }
.st-mrow-at { font-size: 0.66rem; color: var(--scu-text-muted); }

.st-mrow-dir {
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
    border: 1px solid var(--scu-border-bright);
    border-radius: 3px;
    padding: 0 0.25rem;
}

.st-mrow-values {
    grid-area: values;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.st-mrow-value { font-size: 0.95rem; color: var(--tone, var(--scu-text-bright)); }
.st-mrow-value--a { color: var(--st-a); }
.st-mrow-value--b { color: var(--st-b); }
.st-mrow-comm { font-size: 0.72rem; color: var(--scu-text-muted); }

.st-mrow-track {
    grid-area: track;
    position: relative;
    height: 8px;
    margin: 0.3rem 0.5rem;
    border-radius: 4px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--st-bad) 22%, transparent),
        var(--st-track) 45%, var(--st-track) 55%,
        color-mix(in srgb, var(--st-good) 22%, transparent));
}

.st-mrow--neutral .st-mrow-track { background: var(--st-track); }

.st-mrow-mid {
    position: absolute;
    left: 50%;
    top: -3px;
    bottom: -3px;
    border-left: 1px dashed var(--scu-text-muted);
}

.st-mrow-marker {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--tone, var(--scu-text-bright));
    box-shadow: 0 0 0 3px var(--scu-bg-card), 0 0 10px color-mix(in srgb, var(--tone, #fff) 50%, transparent);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--scu-bg);
}

.st-mrow-marker--neutral { --tone: var(--st-comm); }
.st-mrow-marker--a { --tone: var(--st-a); width: 17px; height: 17px; }
.st-mrow-marker--b { --tone: var(--st-b); width: 17px; height: 17px; }

.st-mrow-foot {
    grid-area: foot;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--scu-text);
}

/* ── Usage bars and openers ──────────────────────────────────────────────── */

.st-usage { list-style: none; margin: 0; padding: 0; }

.st-usage-row {
    display: grid;
    grid-template-columns: 28px minmax(6rem, 9rem) 1fr 2.8rem 4.2rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0.28rem 0;
    font-size: 0.8rem;
}

.st-usage--wide .st-usage-row { grid-template-columns: 28px minmax(8rem, 18rem) 1fr 2.8rem 4.2rem; }

.st-usage-row--sig .st-usage-name { color: var(--scu-text-bright); font-weight: 600; }

.st-usage-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.st-usage-icon--blank { display: block; border-radius: 4px; background: var(--st-track); }

.st-usage-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--scu-text);
}

.st-sig {
    flex: none;
    padding: 0 0.3rem;
    border-radius: 3px;
    background: var(--scu-red-glow-md);
    color: var(--scu-red);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Heavy use sits beside signature, outlined so the two read apart. */
.st-sig--heavy { background: transparent; border: 1px solid var(--scu-border-bright); color: var(--scu-text); }

.st-usage-bar {
    position: relative;
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--st-track);
}

.st-usage-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--fill, var(--st-a));
    opacity: 0.85;
}

.st-usage-tick {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 0;
    border-left: 2px solid var(--scu-text-bright);
    transform: translateX(-1px);
}

.st-usage-tick--inline {
    position: relative;
    display: inline-block;
    height: 0.85rem;
    top: 2px;
    margin-right: 0.3rem;
}

.st-usage-pct { text-align: right; color: var(--scu-text-bright); font-variant-numeric: tabular-nums; }
.st-usage-extra { text-align: right; font-size: 0.7rem; color: var(--scu-text-muted); white-space: nowrap; }
.st-usage-key { margin: 0.35rem 0 0; font-size: 0.7rem; color: var(--scu-text-muted); }

.st-openers { list-style: none; margin: 0; padding: 0; }

.st-opener {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "steps name record" "steps share share";
    gap: 0.15rem 0.7rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--scu-border);
}

.st-opener:last-child { border-bottom: 0; }
.st-opener-steps { grid-area: steps; display: flex; align-items: center; gap: 0.15rem; }
.st-opener-arrow { color: var(--scu-text-muted); font-size: 0.9rem; }
.st-opener-step { position: relative; display: inline-block; }
.st-opener-step img { width: 34px; height: 34px; object-fit: contain; }

.st-opener-supply {
    position: absolute;
    right: -3px;
    bottom: -3px;
    min-width: 1.05rem;
    padding: 0 0.2rem;
    border-radius: 3px;
    background: var(--scu-bg-elevated);
    border: 1px solid var(--scu-border-bright);
    color: var(--scu-text-bright);
    font-size: 0.6rem;
    line-height: 1rem;
    text-align: center;
}

.st-opener-proxy {
    position: absolute;
    left: -2px;
    top: -4px;
    padding: 0 0.2rem;
    border-radius: 3px;
    background: var(--st-bad);
    color: #fff;
    font-size: 0.5rem;
    text-transform: uppercase;
}

.st-opener-name { grid-area: name; font-size: 0.8rem; color: var(--scu-text-bright); min-width: 0; }
.st-opener-share { grid-area: share; display: grid; grid-template-columns: 1fr 2.6rem; align-items: center; gap: 0.5rem; }
.st-opener-pct { text-align: right; font-size: 0.76rem; color: var(--scu-text); font-variant-numeric: tabular-nums; }
.st-opener-record { grid-area: record; font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* Where the opening went next — its third key building, as a share of the opening. */
.st-opener-next {
    grid-column: 1 / -1;
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0 0 0 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.st-opener-next li {
    display: grid;
    grid-template-columns: 0.9rem 1.4rem minmax(7rem, 13rem) 1fr 2.6rem 4.4rem;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.74rem;
    color: var(--scu-text);
}

.st-opener-next-turn { color: var(--scu-text-muted); }
.st-opener-next-icon { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; }
.st-opener-next-icon img { width: 22px; height: 22px; object-fit: contain; }
.st-opener-next-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-opener-next-bar { height: 5px; }
.st-opener-next li .st-usage-fill { opacity: 0.7; }
.st-opener-next-record { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Unit performance ─────────────────────────────────────────────────────── */

.st-units td { vertical-align: middle; }
.st-units-name { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--scu-text-bright); white-space: nowrap; }
.st-units-name img { width: 24px; height: 24px; object-fit: contain; }
.st-units-share { min-width: 9rem; }
.st-units-share .st-usage-bar { display: inline-block; vertical-align: middle; width: calc(100% - 3.2rem); }
.st-units-pct { display: inline-block; width: 2.9rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.76rem; }
.st-units-better { color: var(--st-good); font-weight: 600; }
.st-units-worse { color: var(--st-bad); font-weight: 600; }

.st-murecord-length { display: block; margin-top: 0.15rem; }

/* ── Distributions ───────────────────────────────────────────────────────── */

.st-dist { display: flex; flex-direction: column; gap: 0.2rem; }
.st-dist-row { padding: 0.45rem 0; border-bottom: 1px solid var(--scu-border); }
.st-dist-row:last-child { border-bottom: 0; }
.st-dist-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; margin-bottom: 0.3rem; }

.st-dist-line {
    display: grid;
    grid-template-columns: 1.4rem 1fr 4.2rem;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.76rem;
}

.st-dist-group { color: var(--scu-text-muted); font-family: var(--scu-font-display); font-size: 0.64rem; }

.st-dist-track {
    position: relative;
    height: 12px;
    border-radius: 3px;
    background: var(--st-track);
}

.st-dist-band {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--band) 50%, transparent);
}

.st-dist-median {
    position: absolute;
    top: -2px;
    bottom: -2px;
    border-left: 3px solid var(--band);
    transform: translateX(-1px);
}

.st-dist-value { text-align: right; color: var(--scu-text-bright); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Radar ───────────────────────────────────────────────────────────────── */

.st-radar { margin: 0 auto; max-width: 340px; }
.st-radar-svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-radar-ring { fill: none; stroke: var(--st-grid); stroke-width: 1; }
.st-radar-ring--mid { stroke: var(--scu-text-muted); stroke-dasharray: 4 3; opacity: 0.7; }
.st-radar-spoke { stroke: var(--st-grid); }
.st-radar-label { fill: var(--scu-text); font-size: 10px; font-family: var(--scu-font-display); letter-spacing: 0.06em; }

.st-radar-area {
    fill: color-mix(in srgb, var(--series) 22%, transparent);
    stroke: var(--series);
    stroke-width: 2;
    stroke-linejoin: round;
}

/* ── Leaders ─────────────────────────────────────────────────────────────── */

.st-boards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    gap: var(--st-gap);
}

.st-boards--small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

/* Each board spans two rows of the shared grid (header, then list), so a long caption in one
   board pushes every list in that row down together and the rankings line up across boards. */
.st-board {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
    padding: 1rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
}

.st-board--big { border-top: 2px solid var(--scu-red-dim); }

.st-board header h3 {
    font-family: var(--scu-font-display);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--scu-text-bright);
    margin: 0 0 0.25rem;
}

.st-board header p { font-size: 0.72rem; color: var(--scu-text-muted); margin: 0 0 0.7rem; line-height: 1.4; }
.st-board-list { list-style: none; margin: 0; padding: 0; }

.st-board-list li {
    display: grid;
    grid-template-columns: 1.3rem auto 1fr auto 4.4rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0;
    font-size: 0.82rem;
}

.st-board-rank { font-family: var(--scu-font-display); font-size: 0.72rem; color: var(--scu-text-muted); text-align: right; }
.st-board-list li:first-child .st-board-rank { color: var(--scu-red); }
.st-board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-board-games { font-size: 0.68rem; }
.st-board-caster { display: inline-flex; justify-content: center; width: 1.15rem; color: var(--scu-text-muted); }
.st-board-caster svg { width: 0.95rem; height: 0.95rem; fill: currentColor; }
.st-board-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--scu-text-bright); }
.st-board-value > b { font-weight: 600; }

/* A bar's figure behind the percentile, shown the moment the pointer arrives (no title delay). */
.st-hovertip { position: relative; display: block; outline: none; }

.st-hovertip-body {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    z-index: 10;
    transform: translateX(-50%);
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 3px;
    background: var(--scu-bg-elevated);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.35);
    font-size: 0.68rem;
    line-height: 1.3;
    color: var(--scu-text-muted);
    font-family: var(--scu-font-body);
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    pointer-events: none;
    visibility: hidden;
}

.st-hovertip-body::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 6px;
    height: 6px;
    border: solid var(--scu-border-bright);
    border-width: 0 1px 1px 0;
    background: var(--scu-bg-elevated);
    transform: translate(-50%, -50%) rotate(45deg);
}

.st-hovertip-body b { color: var(--scu-text-bright); font-weight: 600; font-variant-numeric: tabular-nums; }

/* On a board the figure sits at the card's right edge, so its tip opens leftward. */
.st-board-list .st-hovertip-body { left: auto; right: 0; transform: none; }
.st-board-list .st-hovertip-body::after { left: auto; right: 1rem; transform: translate(50%, -50%) rotate(45deg); }
.st-hovertip--inline { display: inline-block; vertical-align: -0.15em; }

/* The globe marking a board rated on one scale for every player. */
.st-universal { color: var(--scu-text-muted); cursor: help; }
.st-universal:hover { color: var(--scu-text-bright); }
.st-universal .st-hovertip-body { width: 13rem; white-space: normal; text-align: center; }
.st-universal svg { display: block; width: 0.9em; height: 0.9em; fill: none; stroke: currentColor; stroke-width: 1.3; }

.st-hovertip:hover .st-hovertip-body,
.st-hovertip:focus-visible .st-hovertip-body { visibility: visible; }

/* ── Compare ─────────────────────────────────────────────────────────────── */

.st-compare-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: var(--st-gap);
}

.st-pick { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 14rem; }

.st-pick > label {
    font-family: var(--scu-font-display);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.st-pick--a > label { color: var(--st-a); }
.st-pick--b > label { color: var(--st-b); }
.st-pick-field { position: relative; display: flex; }
.st-pick-field input { flex: 1; min-width: 0; padding-right: 2.2rem; }

/* Player search box: suggestions show flex award · name · team badge. */
.st-picker { position: relative; display: flex; flex: 1; min-width: 0; }
.st-picker input { width: 100%; }

.st-picker-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 19rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--scu-bg-card);
    border: 1px solid var(--scu-border-bright);
    border-radius: var(--st-radius);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.st-picker-none { padding: 0.65rem 0.8rem; color: var(--scu-text-muted); font-size: 0.8rem; }

.st-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.38rem 0.55rem;
    border-radius: calc(var(--st-radius) - 2px);
    color: var(--scu-text-bright);
    font-size: 0.85rem;
    cursor: pointer;
}

.st-picker-option.is-active { background: var(--scu-red-glow-md); }
.st-picker-option.is-selected .st-picker-name { color: var(--scu-red); }

.st-picker-award { flex: none; width: 20px; height: 20px; object-fit: contain; }

.st-picker-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.st-team-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 11rem;
    padding: 0.1rem 0.5rem 0.1rem 0.2rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 999px;
    background: var(--scu-bg-panel);
    color: var(--scu-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.st-team-badge img { flex: none; width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.st-team-badge span { overflow: hidden; text-overflow: ellipsis; }
.st-team-badge:not(:has(img)) { padding-left: 0.5rem; }

.st-pick input {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: var(--st-radius);
    background: var(--scu-bg-panel);
    color: var(--scu-text-bright);
}

.st-pick--a input { border-left: 3px solid var(--st-a); }
.st-pick--b input { border-left: 3px solid var(--st-b); }
.st-pick input:focus { outline: none; border-color: var(--scu-red-dim); }

.st-swap {
    height: 2.4rem;
    width: 2.4rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: 50%;
    background: var(--scu-bg-panel);
    color: var(--scu-text);
}

.st-swap:hover:not(:disabled) { color: var(--scu-red); border-color: var(--scu-red-dim); }
.st-swap:disabled { opacity: 0.4; }

.st-pick-clear {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.6rem;
    height: 1.6rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--scu-text-muted);
    font-size: 1.1rem;
    line-height: 1;
}

.st-pick-clear:hover { color: var(--scu-red); background: var(--scu-red-glow); }

.st-pick-reset {
    height: 2.4rem;
    padding: 0 0.95rem;
    border: 1px solid var(--scu-border-bright);
    border-radius: var(--st-radius);
    background: var(--scu-bg-panel);
    color: var(--scu-text);
    font-size: 0.78rem;
    white-space: nowrap;
}

.st-pick-reset:hover { color: var(--scu-red); border-color: var(--scu-red-dim); }
.st-compare-empty { text-align: center; padding: 2rem 1rem; }
.st-compare-empty .st-chips { justify-content: center; }

.st-compare-head {
    display: grid;
    grid-template-columns: 1fr minmax(12rem, 1fr) 1fr;
    gap: var(--st-gap);
    margin-bottom: var(--st-gap);
}

.st-pcard {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
}

.st-pcard--a { border-top: 3px solid var(--st-a); }
.st-pcard--b { border-top: 3px solid var(--st-b); }

.st-pcard-name {
    font-family: var(--scu-font-display);
    font-size: 1.1rem;
    color: var(--scu-text-bright);
    text-decoration: none;
}

.st-pcard-name:hover { color: var(--scu-red); }

.st-pcard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0.4rem 0 0;
}

.st-pcard-stats dt,
.st-team-stats dt {
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
}

.st-pcard-stats dd,
.st-team-stats dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--scu-text-bright);
    font-variant-numeric: tabular-nums;
}

.st-h2h {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background:
        radial-gradient(80% 90% at 0% 50%, color-mix(in srgb, var(--st-a) 12%, transparent), transparent 70%),
        radial-gradient(80% 90% at 100% 50%, color-mix(in srgb, var(--st-b) 12%, transparent), transparent 70%),
        var(--scu-bg-card);
    text-align: center;
    font-size: 0.76rem;
}

.st-h2h-score { font-family: var(--scu-font-display); font-size: 2.2rem; line-height: 1.1; }
.st-h2h-list { list-style: none; margin: 0.4rem 0 0; padding: 0; width: 100%; }

.st-h2h-list a {
    display: grid;
    grid-template-columns: minmax(0, 7rem) 2.4rem 1fr;
    gap: 0.5rem;
    padding: 0.15rem 0;
    text-align: left;
    color: var(--scu-text);
    text-decoration: none;
}

.st-h2h-list a:hover { color: var(--scu-text-bright); }
.st-h2h-list .st-dim,
.st-h2h-winner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-score-compare { display: flex; flex-direction: column; margin-top: 0.6rem; }

.st-score-compare-row {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--scu-border);
    font-size: 0.8rem;
    text-align: center;
}

.st-score-compare-row strong { font-family: var(--scu-font-display); font-size: 0.95rem; }

/* ── Teams and maps ──────────────────────────────────────────────────────── */

/* ── Teams tab ────────────────────────────────────────────────────────────── */

/* Team picker: one card per team, doubling as the at-a-glance view. */
.st-teampick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 0.6rem;
    margin-bottom: var(--st-gap);
}

.st-teampick-card {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
    color: var(--scu-text);
    text-align: left;
    transition: border-color 0.12s, background 0.12s;
}

.st-teampick-card:hover { border-color: var(--scu-border-bright); }
.st-teampick-card.is-on { border-color: var(--scu-red-dim); background: var(--scu-red-glow); box-shadow: inset 3px 0 0 var(--scu-red); }
.st-teampick-card img { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; }
.st-teampick-rank { font-family: var(--scu-font-display); font-size: 0.75rem; color: var(--scu-text-muted); }
.st-teampick-id { display: flex; flex-direction: column; min-width: 0; font-size: 0.72rem; }
.st-teampick-id strong { font-family: var(--scu-font-display); font-size: 0.92rem; color: var(--scu-text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-teampick-score {
    display: grid;
    place-items: center;
    min-width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 2px solid var(--tone, var(--scu-border-bright));
    font-family: var(--scu-font-display);
    font-size: 0.8rem;
    color: var(--scu-text-bright);
}

/* Selected team hero. */
.st-team-hero { margin-bottom: var(--st-gap); }
.st-team-logo--big { width: 64px; height: 64px; }
.st-team-name--big { font-size: 1.4rem; }
.st-team-herobody { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem 1.5rem; align-items: center; }
.st-team-hero .st-team-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.st-team-stat-sub { font-size: 0.68rem; }



.st-team-gauges { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* Strongest and weakest measurements, side by side. */
.st-team-sw { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0.4rem 1.5rem; }
.st-team-sw-list { list-style: none; margin: 0; padding: 0; }
.st-team-sw-list li { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; align-items: center; gap: 0.6rem; padding: 0.28rem 0; font-size: 0.8rem; }

.st-team-mus {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 0.25rem 1.25rem;
}

.st-team-mus li {
    display: grid;
    grid-template-columns: 3.4rem 1fr 2.6rem 3.4rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.78rem;
}

.st-team-mu-code { display: inline-flex; align-items: center; gap: 0.15rem; }

.st-team-maps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 0.25rem 1.5rem;
}

.st-team-maps li {
    display: grid;
    grid-template-columns: minmax(6rem, 9rem) 1fr 2.6rem 3.6rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.78rem;
}

.st-team-map-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--scu-text-bright); }
.st-team-mu-pct { text-align: right; color: var(--scu-text-bright); font-variant-numeric: tabular-nums; }
.st-team-mu-rec { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.st-team-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.st-team-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 4px; }
.st-team-id { display: flex; flex-direction: column; min-width: 0; font-size: 0.74rem; }

.st-team-name {
    font-family: var(--scu-font-display);
    font-size: 0.92rem;
    color: var(--scu-text-bright);
    text-decoration: none;
}

.st-team-name:hover { color: var(--scu-red); }
.st-title-badge { color: var(--scu-warning); margin-right: 0.4rem; }
.st-team-points { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 0.66rem; }
.st-team-points strong { font-family: var(--scu-font-display); font-size: 1.4rem; color: var(--scu-text-bright); }
.st-team-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; margin: 0 0 0.6rem; }

.st-maps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--st-gap);
}

.st-map {
    overflow: hidden;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-panel);
}

.st-map-art {
    position: relative;
    height: 110px;
    background: var(--scu-bg-elevated);
}

.st-map-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }

.st-map-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, var(--scu-bg-panel));
}

.st-map-name,
.st-map-count {
    position: absolute;
    z-index: 1;
    bottom: 0.45rem;
    font-size: 0.75rem;
}

.st-map-name {
    left: 0.75rem;
    font-family: var(--scu-font-display);
    font-size: 0.85rem;
    color: var(--scu-text-bright);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.st-map-count { right: 0.75rem; color: var(--scu-text); }
.st-map-count strong { color: var(--scu-text-bright); }
.st-map-body { padding: 0.7rem 0.8rem 0.8rem; }

/* ── Player tab ──────────────────────────────────────────────────────────── */

.st-pstrip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: var(--st-gap);
    margin-bottom: var(--st-gap);
}

.st-pstrip-results,
.st-pstrip-play {
    padding: 1rem 1.1rem;
    border: 1px solid var(--scu-border);
    border-radius: var(--st-radius);
    background: var(--scu-bg-card);
}

.st-pstrip-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    align-content: start;
}

.st-pfact { display: flex; flex-direction: column; gap: 0.05rem; min-width: 0; }

.st-pfact > span:first-child {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--scu-text-muted);
}

.st-pfact strong {
    font-family: var(--scu-font-display);
    font-size: 1.35rem;
    color: var(--scu-text-bright);
    font-variant-numeric: tabular-nums;
}

.st-pfact em { font-style: normal; font-size: 0.7rem; color: var(--scu-text-muted); }
.st-pfact--form { grid-column: 1 / -1; }
.st-form { display: flex; gap: 0.25rem; margin: 0.25rem 0 0.1rem; }

.st-form-pip {
    display: grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform var(--scu-transition);
}

.st-form-pip:hover { transform: translateY(-2px); }

.st-form-pip.is-w {
    background: color-mix(in srgb, var(--st-win) 22%, transparent);
    color: var(--st-win);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-win) 55%, transparent);
}

.st-form-pip.is-l {
    background: color-mix(in srgb, var(--st-loss) 18%, transparent);
    color: var(--st-loss);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-loss) 50%, transparent);
}

.st-murecord { display: flex; align-items: center; gap: 1rem; }
.st-murecord > div { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; font-size: 0.76rem; }

.st-murecord-rate {
    font-family: var(--scu-font-display);
    font-size: 2rem;
    color: var(--scu-text-bright);
}

.st-winbar {
    display: block;
    height: 10px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--st-loss) 45%, transparent);
    overflow: hidden;
}

.st-winbar span { display: block; height: 100%; background: var(--st-win); }
.st-winbar--thin { height: 6px; }

.st-pmaps { list-style: none; margin: 0; padding: 0; }

.st-pmaps li {
    display: grid;
    grid-template-columns: minmax(6rem, 11rem) 1fr 3.5rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0;
    font-size: 0.8rem;
}

.st-pmaps-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-pmaps-rec { text-align: right; font-variant-numeric: tabular-nums; }

.st-result {
    display: inline-grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--scu-text-muted);
    background: var(--st-track);
}

.st-result--win { color: var(--st-win); background: color-mix(in srgb, var(--st-win) 18%, transparent); }
.st-result--loss { color: var(--st-loss); background: color-mix(in srgb, var(--st-loss) 16%, transparent); }

/* ── Small screens ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .st-team-herobody { grid-template-columns: minmax(0, 1fr); }
    .st-grid { grid-template-columns: minmax(0, 1fr); }
    .st-pstrip { grid-template-columns: 1fr; }
    .st-compare-head { grid-template-columns: 1fr; }
    .st-mu-hero { grid-template-columns: 1fr 1fr; }
    .st-mu-center { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 700px) {
    .st-opener-next li { grid-template-columns: 0.9rem 1.4rem 1fr 2.6rem 4.4rem; }
    .st-opener-next-bar { display: none; }
    .st-lengths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-sides { grid-template-columns: 1fr; }
    .st-sides > .st-side + .st-side { padding-left: 0; border-left: 0; padding-top: 1rem; border-top: 1px solid var(--scu-border); }
    .st-hide-sm { display: none; }
    .st-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .st-usage-row { grid-template-columns: 24px minmax(5rem, 7rem) 1fr 2.6rem; }
    .st-usage-extra { display: none; }
    .st-maprow { grid-template-columns: minmax(5rem, 8rem) 2.4rem 1fr 2.4rem; }
    .st-maprow .st-maprow-games { display: none; }
    .st-pstrip-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-tl { --st-tl-lane: 3.7rem; margin-right: 0.8rem; }
    .st-tl-label { width: 4.6rem; }
}
