/* Shatterfall admin: a dark, quiet tool in the game's colors (deep violet, cyan accent). System fonts only.
   Chart colors are the c-* classes below (validated for color-vision deficiency on the panel color); charts.js only
   assigns the classes. */
:root {
  --bg: #0b0a12;
  --panel: #12101c;
  --panel-2: #1a1727;
  --line: #242033;
  --line-2: #342f48;
  --text: #ecebf5;
  --text-2: #b9b6cc;
  --muted: #858199;
  --cyan: #3ef0ff;
  --violet: #b86bff;
  --gold: #ffd24d;
  --green: #5bff8a;
  --red: #ff5a78;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--ui);
  padding-inline: 24px;
  padding-block: 8px 48px;
  min-width: 0;
}
.top, .tabs, .banner, main { max-width: 1480px; margin-inline: auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 18px; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; }
h1 span { color: var(--muted); font-weight: 500; margin-left: 6px; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: var(--text-2); }
.logo { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); margin-right: 12px; background: linear-gradient(135deg, var(--cyan), var(--violet)); }

.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.who { margin-left: auto; color: var(--muted); font: 12px var(--mono); overflow-wrap: anywhere; }

.login-page { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(100%, 380px); display: grid; gap: 14px; justify-items: start; }
.login h1 { font-size: 26px; }
.login .btn { display: inline-block; text-decoration: none; padding: 10px 18px; border-radius: 8px; font-weight: 700; }
.btn.primary { background: var(--cyan); color: #04121a; }
.btn.primary:hover { filter: brightness(1.1); }
.hint.small { font-size: 12px; }
.badge { font: 700 10.5px var(--ui); letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid; }
.badge.live { color: var(--red); border-color: var(--red); }
.badge.test { color: var(--gold); border-color: var(--gold); }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted);
  padding: 10px 14px; font: 600 14px var(--ui); cursor: pointer; white-space: nowrap;
}
.tabs button:hover:not(:disabled) { color: var(--text); border-color: transparent; }
.tabs button[aria-current="true"] { color: var(--text); border-bottom-color: var(--cyan); }

.banner { background: #3a1020; border: 1px solid var(--red); color: #ffd2db; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

button, select, input, textarea { font: inherit; color: inherit; }
button {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 12px; cursor: pointer; color: var(--text);
}
button:hover:not(:disabled) { border-color: var(--violet); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--cyan); color: #04121a; border-color: var(--cyan); font-weight: 700; }
button.danger { color: var(--red); border-color: #5a2236; }
button.danger.armed { background: var(--red); color: #1a0509; border-color: var(--red); font-weight: 700; }
button.small { padding: 3px 9px; font-size: 12px; }
button.link { background: none; border: 0; color: var(--cyan); padding: 8px 2px 0; font-size: 13px; }
button.link:hover { text-decoration: underline; }
select, input[type="number"], input[type="search"] {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; min-width: 0;
}
input[type="number"] { width: 90px; font-variant-numeric: tabular-nums; }
:is(button, select, input, textarea):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar.tight { margin-bottom: 8px; }
.bar label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.bar label.check { gap: 6px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.hint { color: var(--muted); font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; margin-bottom: 16px; }

/* ---------------------------------------------------------------- dashboard layout */

.jump {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto;
  padding-block: 10px; margin-bottom: 4px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.jump button { background: none; border-color: var(--line-2); border-radius: 999px; padding: 4px 13px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.jump button:hover:not(:disabled) { color: var(--text); }

.dsec { margin-top: 26px; scroll-margin-top: 60px; }
.dsec-title {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
  font: 600 11.5px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.dsec-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.grid12 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card.full { grid-column: 1 / -1; }
@media (max-width: 1050px) { .grid12 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.card-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-tools { flex: none; }
.card-body { margin-top: 14px; transition: opacity .2s; }
.card.stale .card-body { opacity: .4; }
.card .err { color: var(--red); font-size: 13px; overflow-wrap: anywhere; }
.none, .loading { color: var(--muted); margin: 0; }
.foot { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.seg button { background: none; border: 0; border-radius: 6px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* ---------------------------------------------------------------- chart colors */

.c-1 { --c: #3987e5; } .c-2 { --c: #d95926; } .c-3 { --c: #199e70; } .c-4 { --c: #c98500; } .c-5 { --c: #d55181; }
.c-q { --c: #6e6a85; } .c-x { --c: #39354d; }
.c-o1 { --c: #1c5cab; } .c-o2 { --c: #2a78d6; } .c-o3 { --c: #5598e7; } .c-o4 { --c: #9ec5f4; }
.c-d1 { --c: #e66767; } .c-d2 { --c: #9c4446; } .c-d3 { --c: #256abf; } .c-d4 { --c: #6da7ec; }

/* ---------------------------------------------------------------- KPI tiles */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kpi { background: var(--panel); padding: 14px 16px; display: grid; gap: 2px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 650; line-height: 1.15; color: var(--text); }
.kpi-hint { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- bar lists and stacked bars */

.blist-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.blist-tools .search { width: min(100%, 220px); }
.tools-label { font-size: 12px; color: var(--muted); margin-left: auto; }
.blist-rows { display: grid; }
.card.full .blist-rows { display: block; columns: 2 420px; column-gap: 40px; }
.brow { display: grid; grid-template-columns: minmax(110px, 36%) minmax(0, 1fr); align-items: center; gap: 14px; padding: 5px 6px; border-radius: 6px; break-inside: avoid; }
.brow:hover { background: rgba(255, 255, 255, .035); }
.brow-label { display: flex; flex-direction: column; min-width: 0; }
.brow-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow-meta { font-size: 12px; color: var(--muted); }
.brow-track { --fill: .84; position: relative; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.brow-bar { flex: none; height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--c); }
.brow-val { font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.brow-ref { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-2); opacity: .55; }
.brow.faded .brow-bar { opacity: .35; }
.brow.faded .brow-name, .brow.faded .brow-val { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.legend-key.line { width: 14px; height: 2px; border-radius: 1px; }

.stackbar .segs { flex: none; display: flex; gap: 2px; height: 16px; border-radius: 0 4px 4px 0; overflow: hidden; }
.stackbar.diverging, .stackbar.share { --fill: 1; }
.stackbar.diverging .segs { width: 100%; display: grid; grid-template-columns: 1fr 1px 1fr; gap: 3px; border-radius: 0; overflow: visible; }
.arm { display: flex; gap: 2px; height: 16px; overflow: hidden; }
.arm.left { justify-content: flex-end; border-radius: 4px 0 0 4px; }
.arm.right { border-radius: 0 4px 4px 0; }
.mid { height: 24px; align-self: center; background: var(--text-2); opacity: .55; }
.seg-part { position: relative; display: flex; align-items: center; justify-content: center; min-width: 2px; height: 100%; background: var(--c); }
.arm .seg-part { flex: none; }
.seg-part[hidden] { display: none; }
.seg-part:hover { filter: brightness(1.18); }
.seg-text { font: 600 10.5px var(--ui); color: #fff; white-space: nowrap; pointer-events: none; }
.seg-text.off { visibility: hidden; }
.c-4 .seg-text, .c-o3 .seg-text, .c-o4 .seg-text, .c-d4 .seg-text { color: #0b0a12; }

/* ---------------------------------------------------------------- line chart */

.linebox { width: 100%; }
.linebox svg { display: block; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .axis { stroke: var(--line-2); stroke-width: 1; }
.linechart .tick { fill: var(--muted); font: 11px var(--ui); font-variant-numeric: tabular-nums; }
.linechart .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.linechart .dot { fill: var(--c); stroke: var(--panel); stroke-width: 2; }
.linechart .cross { stroke: var(--line-2); stroke-width: 1; }
.linechart .hit { fill: transparent; }

/* ---------------------------------------------------------------- tooltip */

.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 130px; max-width: 320px;
  background: #1d1a2b; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45); font-size: 12px;
}
.tip-title { color: var(--muted); margin-bottom: 4px; overflow-wrap: anywhere; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row b { font-size: 13px; font-weight: 650; color: var(--text); }
.tip-row span { color: var(--text-2); }
.tip-key { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.tip-key.line { height: 2px; border-radius: 1px; }

/* ---------------------------------------------------------------- tables */

.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
caption { text-align: left; padding: 8px 0; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.text { min-width: 220px; max-width: 560px; overflow-wrap: anywhere; }
td.mono { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
tr:hover td { background: rgba(255, 255, 255, .03); }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pct { display: inline-block; width: 90px; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.pct i { display: block; height: 100%; background: #3987e5; }
.status-free { color: var(--green); }
.status-used { color: var(--muted); }
.actions { display: inline-flex; gap: 6px; white-space: nowrap; }

/* ---------------------------------------------------------------- runs tab */

.panel.flush { padding: 0; overflow: hidden; }
.filters input[type="search"] { width: min(100%, 230px); }
table.stale { opacity: .45; transition: opacity .2s; }
table.runs th, table.runs td { padding: 9px 12px; white-space: nowrap; }
table.runs td.muted { color: var(--muted); }
.run-row { cursor: pointer; }
.run-row:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.run-row[aria-expanded="true"] td { background: var(--panel-2); border-bottom-color: transparent; }
.run-detail-row td { background: var(--panel-2); padding: 4px 16px 16px; white-space: normal; }
.run-detail-row:hover td { background: var(--panel-2); }
.run-detail { display: grid; gap: 10px; }
.rd-group { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: start; }
.rd-label { font-size: 12px; color: var(--muted); padding-top: 2px; }
a.btn.small { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); }
a.btn.small:hover { border-color: var(--violet); }
a.btn.small.primary { background: var(--cyan); color: #04121a; border-color: var(--cyan); font-weight: 700; }

/* ---------------------------------------------------------------- feedback tab */

.stack { display: grid; gap: 10px; margin-bottom: 14px; }
.fb { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.fb .head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; margin-bottom: 6px; }
.fb .rate { font-size: 18px; }
.fb .stage { font-weight: 700; color: var(--cyan); }
.fb .when { color: var(--muted); font-size: 12px; margin-left: auto; }
.fb p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 12px var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.chip.warn { color: var(--gold); border-color: var(--gold); }

textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; padding: 8px; font: 13px/1.5 var(--mono); resize: vertical; margin-bottom: 8px; }

@media (max-width: 640px) {
  body { padding-inline: 16px; }
  .who { margin-left: 0; width: 100%; }
  .brow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .card { padding: 14px; }
  .card-head { flex-wrap: wrap; }
}
.usage { margin: 0 0 12px; }
.usage b { color: var(--gold); font-weight: 600; }

/* ================================================================ admin rework (2026-10-07): side menu, pages, players */
body.shell { padding: 0; }
body.shell .top {
  position: sticky; top: 0; z-index: 20; max-width: none; margin: 0; gap: 14px; padding: 10px 20px;
  background: rgba(11, 10, 18, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; font-size: 17px; font-weight: 700; letter-spacing: .02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.search { flex: 1; max-width: 520px; margin-left: 8px; }
.search input { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; }
.search input:focus { border-color: var(--cyan); }
body.shell .who { margin-left: auto; }
.menu-btn { display: none; padding: 4px 10px; font-size: 18px; line-height: 1; }
body.shell .banner { max-width: none; margin: 10px 20px 0; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { position: sticky; top: 56px; align-self: start; display: grid; gap: 1px; padding: 14px 10px 30px; max-height: calc(100vh - 56px); overflow-y: auto; border-right: 1px solid var(--line); }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-weight: 550; }
.side a:hover { background: var(--panel); color: var(--text); }
.side a[aria-current="true"] { background: rgba(62, 240, 255, .1); color: #fff; box-shadow: inset 2px 0 0 var(--cyan); }
.side-group { margin: 14px 12px 4px; font: 700 10.5px var(--ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nb { min-width: 20px; padding: 1px 6px; border-radius: 999px; font: 700 11px var(--ui); text-align: center; color: #04121a; background: var(--cyan); }
.nb.warn { background: var(--gold); } .nb.bad { background: var(--red); color: #fff; }
.nb[hidden] { display: none; }
.view { min-width: 0; padding: 18px 24px 60px; }
.view.loading-view { opacity: .5; transition: opacity .2s .1s; }
.page { max-width: 1480px; display: grid; gap: 16px; }
body[data-env="live"] .top { box-shadow: inset 0 -2px 0 rgba(255, 90, 120, .35); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 24px; font-weight: 750; letter-spacing: .01em; }
.page-sub { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.back { color: var(--text-2); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--cyan); }
a { color: var(--cyan); }
.muted { color: var(--muted); }
.block { display: block; }
.mono { font-family: var(--mono); font-size: 12px; }
.empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line-2); border-radius: 10px; margin: 0; }
.ok-line { color: var(--green); margin: 0; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.field.block { display: grid; gap: 6px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
input[type="text"], input[type="date"], input[type="search"] { background: var(--panel); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 9px; min-width: 0; color: var(--text); }
input.narrow { width: 80px; }
.bar input[type="search"] { width: min(100%, 320px); }
.bar { margin-bottom: 0; }
a.btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); }
a.btn:hover { border-color: var(--violet); }
button.danger.solid { background: var(--red); color: #1a0509; border-color: var(--red); font-weight: 700; }

/* boxes, columns, tiles */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.box-title { margin: 0 0 10px; font-size: 13px; font-weight: 650; letter-spacing: .04em; color: var(--text-2); }
.box h4 { margin: 14px 0 6px; font-size: 13px; color: var(--text-2); }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols > div { display: grid; gap: 16px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tile { display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-hint { font-size: 12px; color: var(--muted); }
.tile.live .tile-value { color: var(--green); }
.trend { font-size: 12px; color: var(--muted); }
.trend.up { color: var(--green); } .trend.down { color: var(--red); }
.tile.invert .trend.up { color: var(--red); } .tile.invert .trend.down { color: var(--green); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font: 700 11px var(--ui); letter-spacing: .03em; border: 1px solid; white-space: nowrap; }
.pill.ok { color: var(--green); border-color: rgba(91, 255, 138, .5); }
.pill.warn { color: var(--gold); border-color: rgba(255, 210, 77, .5); }
.pill.bad { color: var(--red); border-color: rgba(255, 90, 120, .6); background: rgba(255, 90, 120, .08); }
.pill.info { color: var(--cyan); border-color: rgba(62, 240, 255, .5); }
.pill.gold { color: #1a1200; background: var(--gold); border-color: var(--gold); }
.pill.mute { color: var(--muted); border-color: var(--line-2); }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 12px; color: var(--muted); font-weight: 600; }
.subtabs button:hover:not(:disabled) { color: var(--text); border-color: transparent; }
.subtabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--cyan); }
.subtabs em { margin-left: 6px; padding: 0 6px; border-radius: 999px; font: 700 11px var(--ui); font-style: normal; color: var(--text-2); background: var(--panel-2); }
tr.click { cursor: pointer; }
tr.click:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
tr.dim td { opacity: .5; }
.rank-medal { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 800 11px var(--ui); color: var(--mc); box-shadow: 0 0 0 2px var(--mc); }
.rank-medal.m1 { --mc: #ffd24d; } .rank-medal.m2 { --mc: #d8deef; } .rank-medal.m3 { --mc: #e0995f; }
.plink { color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 1px dotted var(--line-2); }
.plink:hover { color: var(--cyan); border-color: var(--cyan); }
.plink.banned { color: var(--red); text-decoration: line-through; }
.plink.hidden-p { color: var(--gold); }
.pcell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sup { color: var(--gold); }

/* Today */
.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.attn li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.attn .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); }
.attn li.warn .dot { background: var(--gold); }
.attn li.bad .dot { background: var(--red); box-shadow: 0 0 8px var(--red); }
.attn li span { flex: 1; }
.attn .go { font-size: 13px; }
.season-now { display: grid; gap: 6px; }
.season-now b { font-size: 16px; }
.weeks { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.weeks i { height: 8px; border-radius: 2px; background: var(--line-2); }
.weeks i.past { background: rgba(232, 195, 122, .5); }
.weeks i.now { background: #e8c37a; box-shadow: 0 0 8px #e8c37a; }
.spark-rows { display: grid; gap: 10px; }
.spark-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; }
.spark-label { display: grid; font-size: 12px; color: var(--muted); }
.spark-label b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
svg.spark { width: 100%; height: 48px; display: block; }
svg.spark .area { fill: var(--c); opacity: .14; }
svg.spark .line { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; }
svg.spark .end { fill: var(--c); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mini-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 1px; }
.mini-list li > :nth-child(2) { overflow-wrap: anywhere; }
.mini-list li small { grid-column: 2; }
.budgets { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.budgets li { display: grid; grid-template-columns: 90px minmax(0, 1fr) 110px; align-items: center; gap: 10px; font-size: 13px; }
.budgets small { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: #3987e5; }
.budgets li.warn .meter i { background: var(--gold); }
.budgets li.bad .meter i { background: var(--red); }
.notice-live { margin: 0; padding: 9px 14px; border-radius: 8px; border: 1px solid rgba(62, 240, 255, .35); background: rgba(62, 240, 255, .06); }

/* player page */
.player-head { display: grid; gap: 12px; padding: 16px 18px; border-radius: 12px; background: linear-gradient(120deg, rgba(62, 240, 255, .07), transparent 60%), var(--panel); border: 1px solid var(--line); }
.ph-main h1 { font-size: 26px; font-weight: 750; }
.ph-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ph-meta { margin: 8px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-mini, .notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fb-mini li, .notes li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fb-mini li { grid-template-columns: minmax(0, 1fr) auto; }
.fb-mini p, .notes p { grid-column: 1 / -1; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes li { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.notes li p { grid-column: 1; }
.notes li small { grid-column: 1; }
.notes li button { grid-column: 2; grid-row: 1 / 3; }
.note { color: var(--gold); font-size: 13px; }
details summary { cursor: pointer; color: var(--text-2); margin-top: 10px; }

/* feedback inbox */
.fb { display: grid; gap: 6px; }
.fb.s0 { border-left: 3px solid var(--cyan); }
.fb.s2 { opacity: .7; }
.fb .head { margin-bottom: 0; }
.fb-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.fb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fb-actions { display: inline-flex; gap: 6px; margin-left: auto; }

/* season */
.season-title { display: flex; align-items: center; gap: 12px; }
.season-title h2 { margin: 0; font-size: 18px; color: var(--text); }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.week { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; }
.week.past { border-color: rgba(232, 195, 122, .35); }
.week.now { border-color: #e8c37a; box-shadow: 0 0 12px rgba(232, 195, 122, .3); }
.week small { font-size: 11.5px; }

/* switches: the announcement preview, as the game shows it */
.notice-preview { --nc: #3ef0ff; display: flex; align-items: center; gap: 10px; max-width: 620px; padding: 9px 12px 9px 14px; border-radius: 12px 3px 12px 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--nc) 16%, #080614), #080614); border: 1px solid color-mix(in srgb, var(--nc) 55%, transparent); }
.notice-preview.warn { --nc: #ffd24d; }
.notice-preview.event { --nc: #ff4dd8; }
.notice-preview span { flex: 1; overflow-wrap: anywhere; }
.notice-preview b { color: var(--muted); }

/* dialogs and toasts */
.dlg-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 10, .72); }
.dlg { width: min(100%, 460px); display: grid; gap: 14px; padding: 18px 20px; border-radius: 12px; background: #17142a; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.dlg.wide { width: min(100%, 640px); }
.dlg h2 { margin: 0; font-size: 18px; color: var(--text); }
.dlg-body { display: grid; gap: 10px; }
.dlg-body p { margin: 0; color: var(--text-2); }
.dlg-field { display: grid; gap: 5px; }
.dlg-field > span { font-size: 13px; color: var(--text-2); }
.dlg-field input, .dlg-field select, .dlg-field textarea { width: 100%; font-family: var(--ui); margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 8px; background: #1d1a2b; border: 1px solid var(--line-2); border-left: 3px solid var(--green); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transition: opacity .5s, transform .5s; }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .menu-btn { display: inline-block; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 52px; left: 0; bottom: 0; z-index: 30; width: 240px; max-height: none; background: var(--bg); transform: translateX(-105%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0, 0, 0, .5); }
  body.menu-open .side { transform: none; }
  .view { padding: 14px 16px 50px; }
  body.shell .top { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  body.shell .who { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spark-row { grid-template-columns: 100px minmax(0, 1fr); }
  .budgets li { grid-template-columns: 70px minmax(0, 1fr) 90px; }
  .fb-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .side, .toast, .view.loading-view { transition: none; } }
/* (The old layout centred main at 1480px: in the grid that shrank every page to its content.) */
main.view { max-width: none; margin: 0; }
.page { width: 100%; }
