:root {
  --bg: #111214;
  --panel: #1a1c1f;
  --raised: #202327;
  --seam: #2a2d32;
  --row: #222529;
  --ink: #e6e6e6;
  --ink-2: #c4c7cc;
  --muted: #9a9fa8;
  --dim: #8a8f98;
  --sel: #7aa2f7;
  --sel-tint: #232a3a;
  --row-hot: #1f2533;
  --up: #9ece6a;
  --dn: #f7768e;
  --idle: #e0af68;
  --heat-0: #202327;
  --heat-1: #33373d;
  --heat-2: #4f545c;
  --heat-3: #80868f;
  --heat-4: #c9ccd1;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", ui-monospace, monospace;
  --r: 4px;
  color-scheme: dark;
  scrollbar-color: var(--seam) transparent;
}

* { box-sizing: border-box; }
/* `hidden` always wins over component display rules (.btn is inline-flex), so viewer-only hiding can't leak. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: #2f4366; color: #fff; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
input, textarea, button, select { font: inherit; color: inherit; caret-color: var(--sel); }
a { color: var(--sel); text-underline-offset: 3px; }
code { font: 12.5px var(--mono); color: var(--ink-2); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .dn { color: var(--dn); } .muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -40px; z-index: 50; background: var(--sel); color: #0d1017; padding: 6px 10px; border-radius: var(--r); }
.skip:focus { top: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.link {font-size: 20px;}

/* ---------- Bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; height: 48px; display: flex; align-items: center; gap: 24px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--seam); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.brand svg { width: 16px; height: 16px; fill: var(--sel); }
.tabs { display: flex; align-self: stretch; }
.tabs a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--sel); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.stamp { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stamp .num { color: var(--ink); }

.seg { display: inline-flex; border: 1px solid var(--seam); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: none; padding: 4px 10px; font: 12px var(--mono); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--seam); }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--sel-tint); color: var(--sel); }
.seg[hidden] { display: none; }
.seg button[aria-disabled="true"] { color: #5d626b; cursor: not-allowed; }
.seg button[aria-disabled="true"]:hover { color: #5d626b; }
.ph-end { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ph-end .btn { font-variant: normal; letter-spacing: 0; font-weight: 400; }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--seam); border-radius: var(--r); background: var(--panel); color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a3f47; background: var(--raised); }
.btn.primary { border-color: var(--sel); color: var(--sel); background: var(--sel-tint); }
.btn.primary:hover { background: #2a3550; }
.btn.danger { border-style: dashed; border-color: #6b3540; color: var(--dn); background: none; }
.btn.danger:hover { border-style: solid; border-color: var(--dn); background: #2a1c21; }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: progress; }
.btn .ico, .ico { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn.busy .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { border: 0; background: none; padding: 0; color: var(--sel); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout ---------- */
main { outline: none; }
.view[hidden] { display: none; }
main { min-height: calc(100vh - 48px - 33px); display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; }
.view > .grid { flex: 1; }
.statusline { position: sticky; bottom: 0; z-index: 15; height: 33px; display: flex; align-items: center; gap: 18px; padding: 0 16px; background: var(--bg); border-top: 1px solid var(--seam); font-size: 12px; color: var(--muted); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.statusline .num { color: var(--ink-2); }
.statusline .ok i, .statusline .ro i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: var(--up); vertical-align: 1px; }
.statusline .ro i { background: var(--idle); }
.statusline kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--seam); border-radius: 3px; color: var(--ink-2); }
.statusline .keys { margin-left: auto; }
.grid { display: grid; gap: 1px; background: var(--seam); border-bottom: 1px solid var(--seam); }
.overview { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.players { grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.reports { grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.versus { grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - 48px); }
.settings { grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 48px); }
.panel { background: var(--panel); min-width: 0; display: flex; flex-direction: column; }
.ph { margin: 0; height: 38px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--seam); font-size: 13px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--ink-2); }
.ph small { font-size: 12.5px; font-weight: 400; font-variant: normal; letter-spacing: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb { padding: 16px; min-height: 0; }
.pb.flush { padding: 0; }
.pb.tight { padding: 12px 12px 8px; }
.note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); max-width: 62ch; }

/* ---------- States ---------- */
.notice { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #2a1c21; border-bottom: 1px solid #6b3540; color: #f3b8c3; }
.notice[hidden] { display: none; }
.notice .btn { margin-left: auto; }
.empty { padding: 28px 16px; color: var(--muted); font-size: 13px; }
.empty b { color: var(--ink); font-weight: 600; }
.empty .btn { margin-top: 12px; }
.skel { display: grid; gap: 10px; }
.skel i { display: block; height: 12px; border-radius: 2px; background: var(--raised); animation: pulse 1.4s ease-in-out infinite; }
.skel i:nth-child(2n) { width: 70%; } .skel i:nth-child(3n) { width: 85%; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Session ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 18px; }
.kpis div { display: flex; flex-direction: column; }
.kpis em { font: 600 22px/1.15 var(--mono); font-style: normal; font-variant-numeric: tabular-nums; }
.kpis em small { font-size: 13px; color: var(--muted); }
.kpis span { font-size: 12px; color: var(--muted); }
.bars { display: grid; grid-template-columns: minmax(84px, 128px) 1fr 1fr 48px; row-gap: 4px; align-items: center; }
.bars > * { min-width: 0; }
.bar-row { display: contents; }
.bar-row .n { padding: 3px 8px 3px 0; color: var(--ink-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; text-align: left; }
.bars .l, .bars .r { height: 20px; display: flex; align-items: center; }
.bars .l { justify-content: flex-end; border-right: 1px solid #4a4f57; }
.bars .l i, .bars .r i { display: block; height: 12px; min-width: 2px; }
.bars .l i { background: var(--dn); border-radius: 2px 0 0 2px; }
.bars .r i { background: var(--up); border-radius: 0 2px 2px 0; }
.bars .v { text-align: right; font: 13px var(--mono); }
.bars .flat { height: 1px; width: 100%; }
.axis { display: grid; grid-template-columns: minmax(84px, 128px) 1fr 1fr 48px; margin-top: 6px; font: 11.5px var(--mono); color: var(--dim); }
.axis span { display: flex; justify-content: space-between; }
.idle-line { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--seam); font-size: 12.5px; color: var(--muted); }
.idle-line b { color: var(--idle); font-weight: 600; }
.idle-line button { border: 0; background: none; padding: 0; color: var(--ink-2); cursor: pointer; }

/* Shared selection: hovering or picking a player lights them up in every panel. */
tr.is-hot td.name a, .tbl tr.is-idle.is-hot td.name a { color: var(--sel); }
.bars.has-hot .bar-row:not(.is-hot) i { opacity: .35; }
.bar-row.is-hot .n { color: var(--sel); }
tr.is-sel td { background: var(--row-hot); }

/* ---------- Charts ---------- */
.chart-wrap { padding: 8px 12px 10px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; overflow: visible; }
.chart text { font: 11.5px var(--mono); fill: var(--dim); }
.chart .grid-line { stroke: #26292e; }
.chart .band { fill: #ffffff; opacity: .045; }
.chart .band.alt { opacity: .075; }
.chart .band-edge { stroke: #34383e; stroke-width: 1; }
.chart .band-label { font: 600 10.5px var(--sans); letter-spacing: .06em; text-transform: uppercase; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.chart .prev { stroke: #4a4f57; stroke-dasharray: 3 3; }
.chart .prev-label { font-size: 11px; fill: var(--muted); }
.race-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: 12.5px; }
.race-legend li { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); cursor: pointer; }
.race-legend li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-legend li span:last-child { font-family: var(--mono); }
.race-legend li.is-hot span:first-child { color: var(--sel); }
.chart .line { fill: none; stroke: #5a5f68; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; transition: stroke .15s, opacity .15s; }
.chart .hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.chart .end { fill: #c4c7cc; font: 12px var(--sans); }
.chart .end tspan { font-family: var(--mono); }
.chart.has-hot .line:not(.is-hot) { opacity: .45; }
.chart .line.is-hot { stroke: var(--sel); stroke-width: 2.25; opacity: 1; }
.chart .end.is-hot { fill: var(--sel); }
.chart .dot { fill: var(--sel); }
.chart .cursor { stroke: #3a3e45; stroke-dasharray: 2 3; }
/* Race: leaders join crowded names to their lines; a dotted end means no matches since, so MMR held. */
.chart .leader { fill: none; stroke: #3a3e45; stroke-width: 1; }
.chart .leader.is-hot { stroke: var(--sel); }
.chart.has-hot .leader:not(.is-hot), .chart.has-hot .end:not(.is-hot) { opacity: .45; }
.chart .line.carry { stroke-dasharray: 1.5 4; }
.race-legend.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Projection fan: neutral ink, since colour here would read as a gain or a loss. */
.chart .fan80 { fill: var(--ink); opacity: .06; }
.chart .fan50 { fill: var(--ink); opacity: .09; }
.chart .proj-line { fill: none; stroke: var(--ink-2); stroke-width: 1.75; stroke-dasharray: 5 4; stroke-linecap: round; }
.chart .proj-end { fill: var(--ink); }
.chart .today { stroke: #4a4f57; stroke-dasharray: 3 3; }
.chart.proj .line { stroke-width: 2; }
.chart .end-sub { font: 11.5px var(--sans); }
.chart .bar-up { fill: var(--up); } .chart .bar-dn { fill: var(--dn); } .chart .bar-n { fill: #4f6ea8; }
.chart-foot { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.tooltip { position: fixed; z-index: 40; pointer-events: none; min-width: 170px; background: #0d0e10; border: 1px solid var(--seam); border-radius: var(--r); padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.tooltip b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--ink); }
.tooltip div { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.tooltip div span:last-child { font-family: var(--mono); color: var(--ink); }
.tooltip div.is-hot span { color: var(--sel); }

/* ---------- Heatmap ---------- */
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.heat th { font: 11px var(--mono); color: var(--dim); font-weight: 400; text-align: center; height: 18px; }
.heat th.wk { color: var(--muted); }
.heat td { height: 24px; border-radius: 2px; background: var(--heat-0); }
.heat col.cp { width: 128px; } .heat col.ct { width: 44px; }
.heat td.p { background: none; padding-right: 6px; color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.heat td.t { background: none; width: 42px; text-align: right; font: 12px var(--mono); color: var(--muted); }
.heat td.h1 { background: var(--heat-1); } .heat td.h2 { background: var(--heat-2); } .heat td.h3 { background: var(--heat-3); } .heat td.h4 { background: var(--heat-4); }
.heat tr.is-hot td.p { color: var(--sel); }
.heat tr.is-hot td:not(.p):not(.t) { box-shadow: inset 0 0 0 1px var(--sel); }
.legend { display: inline-flex; align-items: center; gap: 3px; font: 11px var(--mono); font-variant: normal; letter-spacing: 0; color: var(--dim); }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--muted); text-align: right; border-bottom: 1px solid var(--seam); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; text-align: left; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tbl th button:hover, .tbl th[aria-sort] button { color: var(--ink); }
.tbl th[aria-sort="ascending"] button::after { content: ""; border: 4px solid transparent; border-bottom-color: currentColor; margin-top: -4px; }
.tbl th[aria-sort="descending"] button::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.tbl td { height: 36px; padding: 0 12px; border-bottom: 1px solid var(--row); text-align: right; white-space: nowrap; }
.tbl td.num { font-size: 13px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #1e2024; }
.tbl tr.is-idle td { color: var(--dim); }
.tbl tr.is-idle td.name a { color: var(--muted); }
.tbl td.name { max-width: 180px; }
.tbl td.name a { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); text-decoration: none; }
.tbl td.name a:hover .ellipsis { text-decoration: underline; }
.tbl.static tbody tr { cursor: default; }
.tbl.static tbody tr:hover td { background: none; }
.rank { display: inline-flex; align-items: center; gap: 6px; }
.rank img { width: 18px; height: 18px; object-fit: contain; }
.is-idle .rank img, .is-idle .av img { filter: grayscale(1); opacity: .6; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.st i { width: 6px; height: 6px; border-radius: 50%; background: var(--up); }
.st.idle i { background: var(--idle); }
.st.idle { color: var(--idle); }

/* ---------- Avatars ---------- */
/* Steam pictures only. Everyone else gets an empty slot in lists so names line up, and nothing in headers. */
.av { flex: none; display: inline-block; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; background: var(--raised); box-shadow: inset 0 0 0 1px var(--seam); }
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 48px; height: 48px; box-shadow: 0 0 0 1px var(--seam); }
.av.av-empty { background: var(--row); }

/* ---------- Players ---------- */
.field { width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
textarea.field { height: auto; padding: 10px; resize: vertical; font-size: 12.5px; line-height: 1.5; }
.field::placeholder { color: #7d828b; }
.field:focus { border-color: var(--sel); outline: none; }
.plist { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; }
.plist a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 8px 16px; color: var(--ink-2); text-decoration: none; }
.plist .av { grid-row: span 2; }
.plist a:hover { background: #1e2024; }
.plist a[aria-current="true"] { background: var(--row-hot); color: var(--ink); }
.plist a[aria-current="true"] .nm { color: var(--sel); }
.plist .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .mm { font: 13px var(--mono); text-align: right; }
.plist .meta { grid-column: 2 / -1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .meta .idle { color: var(--idle); }
.plist .none { padding: 12px 16px; color: var(--muted); font-size: 13px; }
.archived { margin-top: auto; border-top: 1px solid var(--seam); padding: 10px 16px 14px; }
.archived summary { cursor: pointer; font-size: 13px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--muted); }
.archived ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.archived li { display: grid; gap: 6px; }
.archived .row { display: flex; gap: 8px; flex-wrap: wrap; }
.archived .who { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archived .who small { display: block; font-size: 12px; color: var(--muted); }

.detail { min-height: 0; }
.dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px; border-bottom: 1px solid var(--seam); }
.dhead h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dhead h2 a { color: inherit; text-decoration: none; }
.dhead h2 a:hover { color: var(--sel); text-decoration: underline; }
.dhead-main { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.dhead-text { min-width: 0; }
.dhead p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.dhead .dlinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 12.5px; }
.dhead .nick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; }
.dhead .nick label { color: var(--muted); }
.dhead .nick .field { width: 200px; height: 26px; }
.dhead .danger-zone { padding-left: 24px; margin-left: 8px; border-left: 1px solid var(--seam); }
.dsec { padding: 14px 16px 16px; border-bottom: 1px solid var(--seam); }
.dsec h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--ink-2); }
.dsec h3 small { margin-left: 8px; font: 12px var(--mono); font-variant: normal; letter-spacing: 0; color: var(--muted); }
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.multiples h4 { margin: 0 0 4px; font: 12px var(--mono); color: var(--muted); font-weight: 400; display: flex; justify-content: space-between; }
.multiples h4 b { color: var(--ink); font-weight: 400; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
.mix { display: grid; gap: 8px; }
.mix div { display: grid; grid-template-columns: 40px 1fr 56px; align-items: center; gap: 10px; font-size: 12.5px; }
.mix span:first-child { font-family: var(--mono); color: var(--muted); }
.mix .track { height: 8px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.mix .track i { display: block; height: 100%; background: var(--sel); transform-origin: left center; }
/* Player-switch motion scales bars from their baseline. */
.chart .bar-n { transform-box: fill-box; transform-origin: 50% 100%; }
.mix span:last-child { font-family: var(--mono); text-align: right; }

/* ---------- Projection ---------- */
.proj-head { flex-wrap: wrap; }
.proj-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; }
.proj-controls .lbl { margin-bottom: 6px; }
.pace { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 26px; }
.pace input[type=range] { width: 168px; margin: 0; accent-color: var(--sel); cursor: pointer; }
.pace input[type=range]:disabled { cursor: not-allowed; opacity: .5; }
.pace output { font: 12.5px var(--mono); color: var(--ink-2); min-width: 21ch; }
.link.small { font-size: 12.5px; }
.proj-body { transition: opacity .2s ease-out; }
.proj-body.is-loading { opacity: .55; }
.proj-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpis em.rng { font-size: 18px; line-height: 1.4; white-space: nowrap; }
.kpis em.rank-kpi { font: 600 16px/1.6 var(--sans); }
.headline { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); }
.sub-h { margin-top: 4px !important; }
.ladder .tier { font-weight: 600; }
.ladder tr.is-reached td { color: var(--muted); }
.ladder tr.is-reached .tier { opacity: .7; }
.method { margin: 0; max-width: 90ch; }
.switch-pl { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; }
.avatar-row { margin: 4px 0 16px; }
.avatar-row .note { margin-bottom: 8px; }

/* ---------- Reports ---------- */
.quick { display: flex; gap: 6px; margin-bottom: 10px; }
.checks { border: 0; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; max-height: 52vh; overflow-y: auto; }
.checks label { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); cursor: pointer; }
.checks label:hover { background: #1e2024; }
.checks input { width: 15px; height: 15px; accent-color: var(--sel); margin: 0; }
.checks .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks small { font: 12px var(--mono); color: var(--muted); }
.checks small.idle { color: var(--idle); }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status { font-size: 12.5px; color: var(--muted); }
.status.err { color: var(--dn); }
.status.ok { color: var(--up); }

/* ---------- Import dialog ---------- */
.dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--seam); border-radius: var(--r); background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.dialog.narrow { width: min(420px, calc(100vw - 32px)); }
.login-fields { padding: 14px 16px 4px; }
.login-fields .note { margin: 8px 0 0; }
.dialog::backdrop { background: rgba(8, 9, 11, .72); }
.dialog-body { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 16px 12px; border-bottom: 1px solid var(--seam); }
.dialog-head h2 { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.dialog-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.btn.icon { padding: 0 7px; }
.dialog-hint { margin: 12px 16px 0; }
.imp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 12px 16px 16px; overflow-y: auto; }
.imp-slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.imp-slot h3 { margin: 0; font-size: 13px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--ink-2); }
.imp-slot h3 small { margin-left: 6px; font-size: 12.5px; font-weight: 400; font-variant: normal; letter-spacing: 0; color: var(--muted); }
.imp-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12.5px; }
.imp-link[hidden] { display: none; }
.drop.small { min-height: 76px; margin: 0; padding: 12px; font-size: 13px; }
.drop .link { font-size: inherit; }
.dialog.dragging .drop { border-color: #4a5a7a; }
.imp-slot textarea { min-height: 96px; }
.slot-note { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.slot-note.ok { color: var(--up); }
.slot-note.err { color: var(--dn); }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--seam); }
.dialog-foot .status { margin-right: auto; }
.chart .hit-col { fill: transparent; }
.season-form { display: grid; gap: 6px; max-width: 320px; }
.season-form .lbl { margin: 8px 0 0; }
.season-form .note { margin: 6px 0 4px; }
.season-form input[type=date] { color-scheme: dark; }

/* ---------- Drop zones ---------- */
.drop { display: grid; place-items: center; text-align: center; gap: 4px; min-height: 150px; margin-bottom: 16px; padding: 20px; border: 1px dashed #3a3f47; border-radius: var(--r); background: var(--bg); transition: border-color .15s, background .15s; }
.drop p { margin: 0; }
.drop.over { border-color: var(--sel); background: var(--sel-tint); }
.stack { display: grid; gap: 6px; margin-bottom: 14px; }
.stack .actions { margin-top: 8px; }
.lbl { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.actions + .results { margin-top: 14px; }
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--seam); }
.results:empty { display: none; }
.results li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--row); font-size: 13px; }
.results b { font: 11.5px var(--mono); letter-spacing: .04em; }
.results .imported b { color: var(--up); } .results .duplicate b { color: var(--idle); } .results .error b { color: var(--dn); }
.results span { overflow-wrap: anywhere; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-family: var(--mono); }

/* ---------- Team filter (top bar) ---------- */
.team-filter select { height: 28px; max-width: 180px; padding: 0 26px 0 10px; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5' fill='none' stroke='%239a9fa8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center / 14px; color: var(--ink-2); font: 12px var(--mono); appearance: none; cursor: pointer; text-overflow: ellipsis; }
.team-filter select:hover { color: var(--ink); }
.team-filter.is-on select { border-color: var(--sel); background-color: var(--sel-tint); color: var(--sel); }

/* ---------- Teams ---------- */
.new-team { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 1px solid var(--seam); }
.new-team .field { flex: 1 1 140px; height: 28px; }
.new-team .status { flex-basis: 100%; }
.rename { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rename .field { width: min(320px, 100%); height: 32px; font-size: 16px; font-weight: 600; }
.member-editor { background: var(--bg); }
.checks.wide { max-height: none; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; margin: 0; }
.dsec .kpis { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); margin-bottom: 0; }
.dsec.flush-x { padding-left: 0; padding-right: 0; }
.dsec.flush-x h3 { padding: 0 16px; }
.share { display: inline-block; width: 72px; height: 6px; margin-right: 8px; vertical-align: middle; border-radius: 2px; background: var(--raised); overflow: hidden; }
.share i { display: block; height: 100%; background: var(--sel); }
.share-v { font-size: 12.5px; color: var(--muted); }
.teams-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.lbl-inline { margin-right: 4px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; height: 26px; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
.chip a { padding: 0 8px; color: var(--ink-2); text-decoration: none; }
.chip a:hover { color: var(--sel); }
.chip button { display: grid; place-items: center; width: 24px; height: 100%; border: 0; border-left: 1px solid var(--seam); background: none; color: var(--muted); cursor: pointer; }
.chip button:hover { color: var(--dn); }
.chip-add { width: auto; height: 26px; padding: 0 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- Reports ---------- */
.rep-kind { margin-bottom: 14px; }
.rep-kind button { padding: 5px 12px; }
.rep-target { margin-bottom: 14px; }
.rep-target .quick { align-items: center; }
.rep-target .quick small { margin-left: auto; font: 12px var(--mono); }
.rep-note { margin-top: 14px; }
.preview { display: flex; flex-direction: column; }
.report-img { display: block; width: 100%; max-width: 1200px; height: auto; margin: 0 auto; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
.skel.tall { max-width: 1200px; width: 100%; margin: 0 auto; }
.skel.tall i { height: 120px; }
#preview-actions small { font: 12px var(--mono); }

/* ---------- Share dialog ---------- */
.dialog.share-modal { width: min(860px, calc(100vw - 32px)); }
.share-stage { padding: 16px; overflow-y: auto; }
/* Held at the image's own 1200×630 shape while it renders, so the dialog doesn't jump. */
.share-stage .share-img, .share-stage .share-wait { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
.share-stage .share-wait { display: grid; place-items: center; color: var(--muted); font-size: 13px; animation: pulse 1.4s ease-in-out infinite; }
.share-stage .empty { padding: 28px 0; }
.dialog.share-modal .dialog-foot .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- Versus ---------- */
/* Two team inks (from the report series palette) mark the sides; state colours keep their meanings. */
.vs-setup { display: flex; flex-direction: column; gap: 14px; }
.vs-basis .seg button { padding: 4px 12px; }
.vs-side { border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
.vs-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--seam); }
.vs-team { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.vs-dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--team, var(--dim)); }
.vs-dot.none { background: none; box-shadow: inset 0 0 0 1.5px var(--heat-2); }
.vs-strength { font-size: 12.5px; color: var(--muted); }
.vs-strength .num { color: var(--ink); font-weight: 600; margin-left: 4px; }
.vs-slots { list-style: none; margin: 0; padding: 6px 0; }
.vs-slot { display: grid; grid-template-columns: 22px minmax(0, 1fr) 84px; align-items: center; column-gap: 10px; padding: 4px 12px; }
.vs-slot .field { height: 30px; padding: 0 6px; background: var(--panel); text-overflow: ellipsis; }
.vs-rate { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.vs-rate img { width: 20px; height: 20px; }
.vs-rate .num { font-size: 13px; font-weight: 600; }
.vs-from { grid-column: 2 / -1; font-size: 12px; color: var(--muted); padding-top: 2px; }
.vs-fill { display: block; width: calc(100% - 24px); margin: 2px 12px 12px; height: 28px; font-size: 12.5px; color: var(--ink-2); }
.vs-mid { display: flex; justify-content: center; gap: 8px; margin: -4px 0; }
.vs-odds { min-height: 40px; }
.vs-odds-bar { display: flex; height: 6px; border-radius: 2px; overflow: hidden; background: var(--raised); }
.vs-odds-bar i { display: block; background: #7dcfff; transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.vs-odds-bar i + i { flex: 1; background: #ff9e64; margin-left: 2px; }
.vs-odds-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.vs-odds-row b { color: var(--ink); font-size: 15px; }
.vs-odds-row small { color: var(--muted); font-size: 12px; text-align: center; }
.vs-go { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vs-go .btn.primary { height: 34px; padding: 0 16px; }
.vs-setup .note { margin: 0; }

.vs-board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--seam); }
.vs-score-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-width: 0; }
.vs-score-side.right { grid-template-columns: auto minmax(0, 1fr); text-align: right; }
.vs-side-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vs-score-side.right .vs-side-id { align-items: flex-end; }
.vs-side-id .vs-team { font-size: 15px; }
.vs-roster { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.vs-score-side.right .vs-roster { flex-direction: row-reverse; }
.vs-avs { display: inline-flex; flex: none; }
.vs-avs .av + .av { margin-left: -6px; }
.vs-avs .av { box-shadow: 0 0 0 2px var(--panel); }
.vs-roster-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Score tiles: a tint of the side's ink, its ink along the top, the figure in mono. */
.vs-goals { display: grid; place-items: center; min-width: 76px; height: 64px; padding: 0 12px; border-radius: var(--r); background: color-mix(in srgb, var(--team) 10%, var(--bg)); box-shadow: inset 0 2px 0 var(--team), inset 0 0 0 1px color-mix(in srgb, var(--team) 22%, var(--seam)); font-size: 40px; line-height: 1; color: var(--ink); transition: background .3s; }
.vs-score-side.leads .vs-goals { background: color-mix(in srgb, var(--team) 20%, var(--bg)); }
.vs-score-side.flash .vs-goals { animation: vs-goal 1.2s cubic-bezier(.16, 1, .3, 1); }
@keyframes vs-goal { 0% { color: var(--team); transform: scale(1.18); } 60% { color: var(--team); } 100% { color: var(--ink); transform: scale(1); } }
.vs-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 112px; padding: 0 14px; border: 1px solid var(--seam); border-radius: var(--r); background: var(--bg); }
.vs-clock .num { font-size: 26px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.vs-clock small { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--muted); }
.vs-clock[data-phase="live"] small::before, .vs-clock[data-phase="ot"] small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: pulse 1.4s ease-in-out infinite; }
.vs-clock[data-phase="ot"] .num, .vs-clock[data-phase="final"] .num { color: var(--ink-2); }
#vs-chat[aria-pressed="true"], #vs-trail[aria-pressed="true"] { border-color: var(--sel); color: var(--sel); background: var(--sel-tint); }
.vs-ctls { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.vs-pitch { position: relative; background: var(--panel); overflow: hidden; }
.vs-pitch canvas { display: block; width: 100%; transform-origin: 50% 60%; }
/* Goal: the pitch tips toward the net that was scored in. Demo: a short jolt. */
.vs-pitch canvas.tilt-goal { animation: vs-tilt .75s cubic-bezier(.16, 1, .3, 1); }
.vs-pitch canvas.tilt-demo { animation: vs-jolt .38s ease-out; }
@keyframes vs-tilt {
  0% { transform: none; }
  22% { transform: perspective(1100px) rotateY(calc(var(--dir) * -5deg)) rotate(calc(var(--dir) * .9deg)) scale(1.012); }
  100% { transform: none; }
}
@keyframes vs-jolt {
  0%, 100% { transform: none; }
  20% { transform: translateX(calc(var(--dir) * 4px)) rotate(calc(var(--dir) * .5deg)); }
  45% { transform: translateX(calc(var(--dir) * -3px)) rotate(calc(var(--dir) * -.35deg)); }
  70% { transform: translateX(calc(var(--dir) * 1px)) rotate(calc(var(--dir) * .12deg)); }
}

/* Chat log: a card in the pitch's bottom-left corner, like an in-game chat; under the pitch on phones. */
.vs-chatlog { position: absolute; left: 12px; bottom: 12px; width: min(340px, 42%); max-height: 46%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; padding: 6px 0; border: 1px solid var(--seam); border-radius: var(--r); background: rgba(13, 14, 16, .86); overflow: hidden; pointer-events: none; }
.vs-chatlog:empty { display: none; }
.vs-chatline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin: 0; padding: 1px 10px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); animation: vs-in .3s cubic-bezier(.16, 1, .3, 1); }
.vs-chatline:not(:nth-last-child(-n+4)) { opacity: .55; }
.vs-chatline b { font-weight: 600; }
.vs-chatline b::after { content: ":"; color: var(--muted); }
.vs-chat-t { font-size: 11px; color: var(--dim); }
.vs-chat-text { color: var(--ink); }
.vs-chat-fx { font-size: 11px; color: var(--muted); }
.vs-chat-fx.tilt { color: var(--dn); }
/* Boost in the box score: a 40px meter and its value. */
.vs-box td.boost { white-space: nowrap; }
.vs-boost { display: inline-block; width: 40px; height: 4px; margin-right: 8px; vertical-align: middle; border-radius: 2px; background: var(--raised); overflow: hidden; }
.vs-boost i { display: block; height: 100%; width: 33%; background: var(--ink-2); transition: width .2s linear; }
.vs-box td.boost b { display: inline-block; min-width: 3ch; font-size: 13px; font-weight: 400; text-align: right; }
.vs-box td.boost.low .vs-boost i { background: var(--dn); }
.vs-box td.boost.low b { color: var(--dn); }

/* Event cards, broadcast-overlay style but in the graphite world: each side's plays stack on its side. */
.vs-cards { position: absolute; top: 12px; display: flex; flex-direction: column; gap: 6px; width: min(244px, 34%); pointer-events: none; }
.vs-cards[data-side="0"] { left: 12px; }
.vs-cards[data-side="1"] { right: 12px; align-items: flex-end; }
.vs-cards[data-side="mid"] { left: 50%; transform: translateX(-50%); align-items: center; width: min(260px, 40%); }
.vs-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 0 9px; width: 100%; padding: 6px 10px 6px 6px; border: 1px solid var(--seam); border-radius: var(--r); background: rgba(13, 14, 16, .9); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); animation: vs-card-in .32s cubic-bezier(.16, 1, .3, 1); transition: opacity .26s, transform .26s; }
.vs-cards[data-side="1"] .vs-card { --from: 14px; }
.vs-cards[data-side="0"] .vs-card { --from: -14px; }
.vs-card.out { opacity: 0; transform: translateY(-4px); }
.vs-card-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 2px; background: color-mix(in srgb, var(--team, #9a9fa8) 16%, transparent); color: var(--team, var(--ink-2)); }
.vs-card-ico .ico { width: 16px; height: 16px; }
.vs-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.vs-card-text b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.vs-card-text b .num { margin-left: 4px; color: var(--team, var(--ink)); }
.vs-card-text span { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-card-t { align-self: start; padding-top: 1px; font-size: 11px; color: var(--muted); }
.vs-card.goal { border-color: color-mix(in srgb, var(--team) 55%, var(--seam)); }
.vs-card.goal .vs-card-ico { background: var(--team); color: var(--bg); }
@keyframes vs-card-in { from { opacity: 0; transform: translateX(var(--from, 0)) translateY(var(--from-y, 0)); } }
.vs-cards[data-side="mid"] .vs-card { --from-y: -8px; }
.vs-track { height: 2px; background: var(--raised); }
.vs-track i { display: block; height: 100%; background: var(--ink-2); transform-origin: left; transform: scaleX(0); }
.vs-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--seam); }
.vs-controls #vs-skip { margin-left: auto; }
.vs-controls .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.vs-result { border-bottom: 1px solid var(--seam); }
.vs-result-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 16px; }
.vs-result-head h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.vs-result-head h3 .vs-dot { width: 11px; height: 11px; }
.vs-result-head h3 .num { font-size: 20px; }
.vs-result-head p { grid-column: 1; margin: 0; font-size: 13px; color: var(--ink-2); }
.vs-result-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 8px; }
.vs-boxwrap { border-bottom: 1px solid var(--seam); }
.vs-box td.name { display: flex; align-items: center; gap: 8px; height: 36px; }
.vs-box td.name span:not(.vs-mvp) { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.vs-box td.bump { animation: vs-bump .7s cubic-bezier(.16, 1, .3, 1); }
@keyframes vs-bump { 0% { color: var(--team); } 100% { color: inherit; } }
/* Mood: a small chip with an icon; up moods in gain green, down moods in loss rose, steady in ink. */
.vs-mood { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 6px; border-radius: 2px; background: var(--raised); font-size: 12px; color: var(--ink-2); white-space: nowrap; animation: vs-in .35s cubic-bezier(.16, 1, .3, 1); }
.vs-mood .ico { width: 13px; height: 13px; }
.vs-mood.up .ico { color: var(--up); }
.vs-mood.dn .ico { color: var(--dn); }
.vs-tipped { text-decoration: underline dotted var(--heat-2); text-underline-offset: 4px; }
.vs-strength, .vs-rate[tabindex] { cursor: help; border-radius: 2px; }
.tooltip.vs-tip { max-width: 300px; }
.tooltip.vs-tip div { align-items: baseline; padding: 2px 0; }
.tooltip.vs-tip div small { display: block; font-size: 11.5px; color: var(--muted); }
.tooltip.vs-tip div.sep, .tooltip.vs-tip div.total { border-top: 1px solid var(--seam); margin-top: 4px; padding-top: 5px; }
.tooltip.vs-tip div.total span { color: var(--ink); font-weight: 600; }
.tooltip.vs-tip p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.vs-box tr.is-mvp td.name { font-weight: 600; }
.vs-mvp { font: 600 11px var(--mono); color: var(--ink); border: 1px solid var(--heat-2); border-radius: 2px; padding: 1px 5px; }
.vs-sub-h { margin: 0; height: 36px; display: flex; align-items: center; padding: 0 16px; font-size: 12px; font-weight: 600; font-variant: all-small-caps; letter-spacing: .08em; color: var(--muted); }
.vs-feed-empty { margin: 0; padding: 0 16px 16px; font-size: 12.5px; color: var(--muted); max-width: 62ch; }
.vs-feed { list-style: none; margin: 0; padding: 0 0 12px; max-height: 340px; overflow-y: auto; }
.vs-ev { display: grid; grid-template-columns: 52px 9px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: 30px; padding: 3px 16px; border-top: 1px solid var(--row); font-size: 13px; color: var(--ink-2); animation: vs-in .35s cubic-bezier(.16, 1, .3, 1); }
.vs-ev-t { font-size: 12px; color: var(--muted); }
.vs-ev.goal { color: var(--ink); font-weight: 600; background: var(--raised); }
.vs-ev.big { color: var(--ink); }
.vs-ev.odd .vs-ev-text { font-style: italic; }
.vs-ev-score { font-size: 13px; }
@keyframes vs-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Toast ---------- */
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 45; max-width: min(420px, calc(100vw - 32px)); background: #0d0e10; border: 1px solid var(--seam); border-radius: var(--r); padding: 10px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.toast.err { border-color: #6b3540; color: #f3b8c3; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  /* The last-import stamp repeats the status line; it gives way so the bar's controls never overflow. */
  .stamp { display: none; }
}
@media (max-width: 1100px) {
  .overview, .reports, .settings, .versus { grid-template-columns: minmax(0, 1fr); }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .bar { height: auto; flex-wrap: wrap; gap: 0 16px; padding: 0 12px; }
  .brand { height: 44px; }
  .bar-end { margin-left: auto; }
  .stamp { display: none; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--seam); }
  .tabs a { height: 42px; flex: 1; justify-content: center; padding: 0 8px; }
  .bar-end .btn span { display: none; }
  .bar-end .btn { padding: 0 9px; }
  .players { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .statusline .keys { display: none; }
  .players aside .plist { max-height: 40vh; }
  .dhead { flex-direction: column; }
  .dhead .danger-zone { padding: 12px 0 0; margin: 0; border-left: 0; border-top: 1px solid var(--seam); width: 100%; }
  .heat col.cp { width: 96px; }
  .race-legend.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj-controls { width: 100%; }
  .heat .old { display: none; }
}
@media (max-width: 720px) {
  .imp-grid { grid-template-columns: minmax(0, 1fr); }
  .team-filter select { max-width: 130px; }
  #preview-actions small { display: none; }
}
@media (max-width: 520px) {
  .dialog.share-modal .dialog-foot { flex-wrap: wrap; }
  .dialog.share-modal .dialog-foot .status { flex-basis: 100%; }
  .bar-end { width: 100%; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 0 0 8px; }
  /* Refresh moves up beside the brand so the period and playlist switches share one row. */
  .bar-end #refresh { position: absolute; top: 4px; right: 12px; }
  .bar-end .seg button { padding: 4px 7px; }
  .pb { padding: 14px 12px; }
  .tbl .opt { display: none; }
  .kpis { gap: 8px 10px; }
  .kpis em { font-size: 18px; }
  .kpis span { font-size: 11.5px; line-height: 1.3; }
  .pace input[type=range] { width: 100%; }
  .proj-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pace output { min-width: 0; }
  .vs-board { gap: 6px; padding: 10px 12px; }
  .vs-goals { min-width: 48px; height: 48px; font-size: 28px; padding: 0 8px; }
  .vs-roster-names { display: none; }
  .vs-clock { min-width: 72px; padding: 0 6px; }
  .vs-clock .num { font-size: 20px; }
  .vs-controls { padding: 10px 12px; }
  .vs-controls #vs-skip { margin-left: 0; }
  .vs-result-head { grid-template-columns: minmax(0, 1fr); }
  .vs-result-actions { grid-column: 1; grid-row: auto; padding-top: 8px; }
  .vs-ev { grid-template-columns: 44px 9px minmax(0, 1fr) auto; padding: 3px 12px; }
  .vs-chatlog { position: static; width: auto; max-height: none; margin: 0; border-width: 1px 0 0; border-radius: 0; background: var(--bg); }
  .vs-cards { top: 8px; width: 46%; }
  .vs-cards[data-side="0"] { left: 8px; }
  .vs-cards[data-side="1"] { right: 8px; }
  .vs-cards[data-side="mid"] { top: auto; bottom: 8px; width: 70%; }
  .vs-card { grid-template-columns: 22px minmax(0, 1fr); padding: 4px 8px 4px 4px; }
  .vs-card-ico { width: 22px; height: 22px; }
  .vs-card-t { display: none; }
}
@media (pointer: coarse) {
  .tabs a, .btn, .seg button, .field { min-height: 44px; }
  .checks label { min-height: 44px; }
  .bars .l, .bars .r { height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
