/* Дота-помощник — мини-приложение.
   Стиль True-black flat (tasteskill, seed 802305462): ground #000, card #111, nested #2a2a2a, no borders or
   shadows on cards; colour only on data. Лицо продукта: стороны Доты — лайм Radiant = хорошо для тебя,
   красный Dire = плохо; больше цвет нигде не появляется. Сигнатура: доска пика, как в самой игре. */

:root {
  --ground: #000000;
  --surface: #111111;
  --raised: #2a2a2a;
  --hover: #1a1a1a;
  --border: #1a1a1a;
  --rule: #1c1c1c;
  --control: #444444;
  --text: #ffffff;
  --nav: #bbbbbb;
  --muted: #b4b4b4;
  --faint: #949494;
  --accent: #c6f24e;     /* Radiant: выгодно, твоя сторона, главный ряд данных */
  --positive: #c6f24e;
  --negative: #e5484d;   /* Dire: невыгодно, враги */
  --warning: #e5a93b;
  --pill-positive-bg: #222a10; --pill-positive-ink: #c6f24e;
  --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
  --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b;
  --pill-neutral-bg: #222222; --pill-neutral-ink: #ffffff;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-title: 20px; --fs-section: 16px; --fs-kpi: 24px; --fs-lead: 32px; --fs-body: 14px; --fs-small: 13px;

  --radius-card: 20px; --radius-inner: 12px; --radius-media: 6px; --radius-control: 999px;
  --gap: 14px; --pad: 22px; --card-pad: 18px;
  --control-height: 36px;
  --sidebar-width: 220px;
  --topbar: 64px;
  --tabbar: 64px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms; --t-ui: 200ms;
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); }
body { font: 400 var(--fs-body)/20px var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- shell ----------
   Desktop (≥ 900px): ruled T-frame — 220px sidebar + 64px top bar on one ground, divided by 1px rules.
   Grid sum at 1440: 220 + 1 + 29 + 1161 + 29 = 1440; the content column is 1161px. */
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: var(--topbar) 1fr; min-height: 100svh; }
.sidebar { grid-row: 1 / 3; position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 0 12px 16px; border-right: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; height: var(--topbar); padding: 0 8px; font-weight: 600; font-size: 15px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { display: grid; gap: 0; margin-top: 8px; }
.nav-group { margin: 22px 8px 6px; color: var(--faint); font-size: var(--fs-small); }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px; color: var(--nav); border-radius: 10px; transition: color var(--t-ui) ease, background-color var(--t-ui) ease; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--text); }
.nav .sub { margin-left: auto; color: var(--faint); font-size: var(--fs-small); }
.side-foot { margin-top: auto; padding: 0 8px; color: var(--faint); font-size: var(--fs-small); line-height: 18px; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 0 29px; border-bottom: 1px solid var(--rule); min-width: 0; }
.topbar .back { display: none; }
.topbar .brand-mini { display: none; }
.topbar .crumb { color: var(--muted); }
.topbar .crumb b { color: var(--text); font-weight: 500; }
.topbar .spacer { flex: 1; }
.access { display: flex; align-items: center; gap: 10px; height: 100%; padding-left: 16px; border-left: 1px solid var(--rule); color: var(--muted); white-space: nowrap; }
.access b { color: var(--text); font-weight: 500; }

.canvas { min-width: 0; padding: 28px 29px 48px; }
.screen { max-width: 1161px; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.title-row h1 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.01em; }
.title-row .sub { margin-top: 4px; color: var(--muted); max-width: 64ch; }

.tabbar { display: none; }

/* ---------- panels and grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.panel { background: var(--surface); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 24px; }
.panel h2 { font-size: var(--fs-section); line-height: 22px; font-weight: 600; }
.panel .meta { color: var(--faint); font-size: var(--fs-small); }
.well { background: var(--raised); border-radius: var(--radius-inner); padding: 14px; }
.stack { display: grid; gap: var(--gap); }

/* ---------- the draft board (signature) ---------- */
.board { display: grid; gap: 14px; }
.side-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 12px; }
.side-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.side-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.side-label .dot.dire { background: var(--negative); }
.side-label .dot.radiant { background: var(--accent); }
.side-label .count { color: var(--faint); font-size: var(--fs-small); margin-left: auto; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slot { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-media); overflow: hidden; background: var(--raised); transition: transform var(--t-press) var(--ease-out); }
.slot:active { transform: scale(0.97); }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot.free { background: transparent; border: 1px dashed #3a3a3a; display: grid; place-items: center; color: var(--faint); }
.slot.free svg { width: 18px; height: 18px; }
.slot.free:hover { border-color: var(--control); color: var(--text); }
.slot.off { visibility: hidden; }
.slot .x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.72); display: grid; place-items: center; }
.slot .x svg { width: 12px; height: 12px; }
.slot.me { grid-column: span 2; }
.board-foot { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: var(--fs-small); }
.board-foot .spacer { flex: 1; }
.favboard { max-width: 760px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 16px; border-radius: var(--radius-control); background: var(--raised); color: var(--text); font-weight: 500; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-ui) ease, opacity var(--t-ui) ease; }
.btn:hover { background: #333333; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--text); color: #000000; }
.btn.primary:hover { background: #e6e6e6; }
.btn.ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.btn.ghost:hover { color: var(--text); background: var(--hover); }
.btn.wide { width: 100%; height: 44px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background-color var(--t-ui) ease, color var(--t-ui) ease; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.link { color: var(--text); font-weight: 500; text-underline-offset: 3px; }
.link:hover { text-decoration: underline; }

/* segmented: the selected option inverts (the style's one emphasis), never the accent */
.segmented { position: relative; display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--radius-control); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { height: 32px; padding: 0 14px; border-radius: var(--radius-control); color: var(--nav); white-space: nowrap; transition: background-color var(--t-ui) ease, color var(--t-ui) ease; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.panel .segmented { background: var(--ground); }

.input { width: 100%; height: 44px; padding: 0 16px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--ground); outline: none; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--text); }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; flex: none; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* ---------- rows ---------- */
.rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; }
.rows > .row + .row { border-top: 1px solid var(--rule); }
.row.tap { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 12px; transition: background-color var(--t-ui) ease; }
.row.tap:hover { background: var(--hover); }
.row .portrait { width: 72px; aspect-ratio: 16 / 9; border-radius: var(--radius-media); object-fit: cover; flex: none; background: var(--raised); }
.row .item-icon { width: 46px; height: 34px; border-radius: 4px; object-fit: cover; flex: none; background: var(--raised); }
.row .body { min-width: 0; flex: 1; }
.row .name { display: block; font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .line2 { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .figure { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.row .figure b { display: block; font-size: 16px; line-height: 20px; font-weight: 600; }
.row .figure span { display: block; margin-top: 3px; color: var(--faint); font-size: var(--fs-small); }
.row .rank { width: 22px; flex: none; color: var(--faint); font-variant-numeric: tabular-nums; }
.row .chev { color: var(--faint); flex: none; width: 16px; height: 16px; }
/* кандидаты в пике: враги мини-портретами вместо строки текста */
.vchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.vchip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px 0 0; border-radius: 6px; background: var(--raised); overflow: hidden; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.vchip img, .vchip i { width: 34px; height: 22px; object-fit: cover; flex: none; }
.vchip i { display: grid; place-items: center; font-style: normal; color: var(--faint); font-size: 10px; }
.vchip b { font-weight: 500; }
.vchip .neg-ink { color: #ff8589; }
.vchip.ring { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.pill.small { height: 20px; padding: 0 8px; font-size: 12px; vertical-align: 2px; margin-left: 6px; }
.row.cand { align-items: flex-start; }
.row.cand .rank { padding-top: 10px; }
.row.cand .figure { padding-top: 2px; }
.legend { margin-top: 12px; color: var(--faint); font-size: var(--fs-small); line-height: 18px; }
.panel-foot { padding-top: 12px; display: flex; justify-content: flex-end; }
.segmented.fill { display: flex; }
.segmented.fill button { flex: 1; padding: 0 10px; }

/* пик: доска и «твои герои» слева, кандидаты справа; на телефоне кандидаты сразу под доской */
.row.stage { min-height: 52px; align-items: flex-start; }
.stage-title { width: 96px; flex: none; padding-top: 7px; color: var(--muted); }
.stage-items { display: flex; flex-wrap: wrap; gap: 6px; }
.offer .price { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.offer .price .value { font-size: 44px; line-height: 48px; font-weight: 600; letter-spacing: -0.02em; }
.offer .price .value span { font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.offer .price .vs { margin-top: 4px; }
.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.feats div { padding: 12px 14px; background: var(--ground); border-radius: var(--radius-inner); min-width: 0; }
.feats b { display: block; font-weight: 500; }
.feats span { display: block; margin-top: 2px; color: var(--faint); font-size: var(--fs-small); line-height: 18px; }
.split { grid-template-rows: auto 1fr; }
.split > .lead { grid-column: 1 / span 5; grid-row: 1; }
.split > .main { grid-column: 6 / span 7; grid-row: 1 / span 2; }
.split > .aside { grid-column: 1 / span 5; grid-row: 2; }
.split.solo > .main { grid-row: 1; }

.pos-ink { color: var(--positive); }
.neg-ink { color: var(--negative); }
.vs { color: var(--muted); }
.vs .p { color: var(--positive); }
.vs .n { color: var(--negative); }
.tag { color: var(--faint); }

/* the advantage bar: the row's share of the best candidate */
.adv-track { display: block; height: 4px; margin-top: 8px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.adv-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.adv-fill.neg { background: var(--negative); }

/* ---------- KPIs: one divided strip ---------- */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--raised); border-radius: var(--radius-inner); }
.kpi { padding: 12px 14px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid #333333; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { margin-top: 4px; font-size: var(--fs-kpi); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 400; margin-left: 2px; }

/* ---------- player header ---------- */
.object { display: flex; align-items: center; gap: 14px; }
.object .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--raised); flex: none; }
.object .name { font-size: 18px; line-height: 24px; font-weight: 600; }
.object .meta-line { color: var(--muted); }
.object .actions { margin-left: auto; display: flex; gap: 4px; }
.finding { margin-top: 14px; color: var(--text); }

/* hero chips row */
.chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.chip { min-width: 0; }
.chip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-media); background: var(--raised); }
.chip .cap { margin-top: 6px; display: flex; justify-content: space-between; gap: 6px; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip .cap b { color: var(--text); font-weight: 500; }

/* ---------- game ---------- */
.rating { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: end; }
.rating .value { font-size: var(--fs-lead); line-height: 38px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rating .title { color: var(--muted); }
.meter { grid-column: 1 / -1; margin-top: 10px; }
.meter .track { height: 8px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 600ms var(--ease-out); }
.meter .ends { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.stat-line { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); }
.stat-line b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.round-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.round-head h2 { font-size: 18px; line-height: 24px; }
.enemy-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.enemy-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-media) var(--radius-media) 0 0; border-bottom: 3px solid var(--negative); }
.enemy-strip figure { margin: 0; min-width: 0; }
.enemy-strip figcaption { margin-top: 4px; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.question { margin: 18px 0 12px; font-size: 16px; font-weight: 600; }
.enemy-solo { display: flex; align-items: center; gap: 14px; }
.enemy-solo img { width: 160px; flex: none; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-media); border-bottom: 3px solid var(--negative); }
.enemy-solo b { display: block; font-size: 18px; line-height: 24px; font-weight: 600; }
.enemy-solo span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); }
.options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.option { position: relative; text-align: left; background: var(--raised); border-radius: 14px; padding: 8px; transition: transform var(--t-press) var(--ease-out), background-color var(--t-ui) ease, opacity var(--t-ui) ease; }
.option:hover { background: #333333; }
.option:active { transform: scale(0.97); }
.option img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.option .nm { display: block; margin-top: 8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.option .res { display: block; margin-top: 2px; min-height: 18px; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.option.done { pointer-events: none; }
.option.best { outline: 2px solid var(--accent); outline-offset: -2px; }
.option.picked:not(.best) { outline: 2px solid var(--negative); outline-offset: -2px; }
.option.dim { opacity: 0.55; }
.verdict { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.verdict .delta { font-size: var(--fs-kpi); font-weight: 600; font-variant-numeric: tabular-nums; }
.verdict p { color: var(--muted); }
.explain { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--muted); }
.explain > span { display: block; font-size: var(--fs-small); color: var(--faint); }
.explain > span.gap { margin-top: 14px; }
.explain .why { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text); line-height: 1.45; }
.explain .why li::marker { color: var(--faint); }
.explain .tips { display: grid; gap: 10px; margin-top: 10px; }
.explain .tip { display: flex; gap: 10px; align-items: flex-start; }
.explain .tip img { width: 48px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; margin-top: 2px; }
.explain .tip p { margin: 0; color: var(--text); line-height: 1.45; }
.explain .tip b { font-weight: 600; }
.beta-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; color: var(--muted); font-size: var(--fs-small); line-height: 1.45; }
.beta-note .pill { flex: none; }
.beta-note p { margin: 0; padding-top: 2px; }
.verdict .btn { margin-left: auto; }
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.ladder span { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-inner); background: var(--ground); color: var(--faint); font-size: var(--fs-small); line-height: 16px; min-width: 0; }
.ladder span i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--faint); }
.ladder .past { color: var(--muted); }
.ladder .here { background: var(--raised); color: var(--text); outline: 1.5px solid var(--accent); outline-offset: -1.5px; }

/* ---------- match ---------- */
.team h3 { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-size: 14px; font-weight: 600; }
.team h3 .win { color: var(--faint); font-weight: 400; }
.player { display: grid; grid-template-columns: 64px minmax(0, 1fr) 62px; gap: 4px 12px; align-items: center; padding: 10px 0; }
.player + .player { border-top: 1px solid var(--rule); }
.player.me { margin: 0 -10px; padding: 10px; background: var(--raised); border-radius: 12px; border-top-color: transparent; }
.player.me .inv i { background: #3d3d3d; }
.player .portrait { width: 64px; aspect-ratio: 16 / 9; border-radius: var(--radius-media); object-fit: cover; }
.player .who { min-width: 0; }
.player .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .who span { display: block; color: var(--faint); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .kda { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.player .kda span { display: block; color: var(--warning); font-size: var(--fs-small); font-weight: 400; }
.player .inv { grid-column: 2 / 4; display: grid; grid-template-columns: repeat(6, 34px) 26px; gap: 4px; align-items: center; }
.player .inv img, .player .inv i { width: 34px; height: 25px; border-radius: 3px; object-fit: cover; background: var(--raised); display: block; }
.player .inv .neutral { width: 26px; height: 26px; border-radius: 50%; }
.timings { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.timings figure { margin: 0; text-align: center; }
.timings img { width: 100%; aspect-ratio: 88 / 64; border-radius: 4px; object-fit: cover; }
.timings figcaption { margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-small); }

/* weekly bars (progress) */
.weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; height: 150px; }
.week { display: grid; grid-template-rows: 1fr auto; height: 100%; min-width: 0; }
.week .bar-area { position: relative; display: flex; align-items: flex-end; }
.week .bar { width: 100%; background: #3a3a3a; border-radius: 4px 4px 0 0; }
.week.now .bar { background: var(--accent); }
.week .v { position: absolute; left: 0; right: 0; text-align: center; font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.week .d { margin-top: 6px; text-align: center; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.weeks-axis { position: relative; }
.weeks-axis .half { position: absolute; left: 0; right: 0; border-top: 1px dashed #2b2b2b; }

/* ---------- picker sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity var(--t-ui) ease; z-index: 20; }
.scrim.open { opacity: 1; }
.sheet { position: fixed; z-index: 21; left: 50%; bottom: 0; width: min(760px, 100%); height: min(88svh, 820px); transform: translate(-50%, 100%); background: var(--surface); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transition: transform 260ms var(--ease-out); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); } /* taste-skill-ignore: the sheet floats over the screen */
.sheet.open { transform: translate(-50%, 0); }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px 20px; }
.sheet header h2 { flex: 1; font-size: 17px; font-weight: 600; }
.sheet .tools { display: grid; gap: 10px; padding: 0 16px 12px; }
.sheet .grid-heroes { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 8px; align-content: start; }
.pick { text-align: left; min-width: 0; transition: transform var(--t-press) var(--ease-out), opacity var(--t-ui) ease; }
.pick:active { transform: scale(0.95); }
.pick img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-media); background: var(--raised); }
.pick span { display: block; margin-top: 4px; font-size: var(--fs-small); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick[disabled] { opacity: 0.25; pointer-events: none; }
.pick.chosen { opacity: 1; }
.pick.chosen img { outline: 2px solid var(--accent); outline-offset: -2px; }
.pick.chosen span { color: var(--text); }
.sheet .nothing { grid-column: 1 / -1; padding: 24px 0; color: var(--muted); }

/* ---------- states ---------- */
.skeleton { display: block; background: #1d1d1d; border-radius: 6px; }
.empty { display: grid; place-items: center; min-height: 64px; padding: 16px; border: 1px dashed #333333; border-radius: var(--radius-inner); color: var(--muted); text-align: center; }
.empty.start { gap: 12px; padding: 20px 16px; }
.empty.start p { max-width: 36ch; }
.error { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--pill-negative-bg); color: var(--pill-negative-ink); border-radius: var(--radius-inner); }
.error .link { color: var(--text); }
.notice { padding: 12px 14px; background: var(--pill-warning-bg); color: var(--pill-warning-ink); border-radius: var(--radius-inner); }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; padding: 10px 16px; background: var(--raised); border-radius: 999px; transition: opacity var(--t-ui) ease, transform var(--t-ui) var(--ease-out); pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.guide { width: 100%; border-radius: var(--radius-inner); }

/* ---------- desktop: wide screens get two columns ---------- */
@media (min-width: 900px) {
  .sheet .grid-heroes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- tablet and phone: the sidebar folds into a bottom bar ---------- */
@media (max-width: 899px) {
  :root { --pad: 16px; --card-pad: 16px; --radius-card: 18px; }
  .app { display: block; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { position: sticky; top: 0; z-index: 10; height: 52px; padding: 0 16px; background: var(--ground); gap: 10px; }
  .topbar .brand-mini:not([hidden]) { display: flex; align-items: center; gap: 8px; font-weight: 600; }
  .topbar .brand-mini svg { width: 22px; height: 22px; }
  .topbar .crumb { display: none; }
  .topbar .back:not([hidden]) { display: inline-grid; margin-left: -8px; }
  .topbar .back:not([hidden]) + .brand-mini { display: none; }
  .access { border-left: 0; padding-left: 0; font-size: 13px; }
  .canvas { padding: 16px 16px 32px; }
  .title-row { margin-bottom: 14px; }
  .title-row h1 { font-size: 22px; line-height: 28px; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--ground); border-top: 1px solid var(--rule); }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 4px; color: var(--nav); font-size: 11px; line-height: 14px; transition: color var(--t-ui) ease; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .side-row { grid-template-columns: 1fr; gap: 8px; }
  .side-label .count { margin-left: 0; }
  .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheet { height: 92svh; border-radius: 20px 20px 0 0; }
  .sheet .grid-heroes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row .portrait { width: 64px; }
  .split > .lead, .split > .main, .split > .aside, .split.solo > .main { grid-column: 1 / -1; grid-row: auto; }
  .split.game > .main { order: -1; }
}
@media (max-width: 599px) {
  .segmented .long { display: none; }
  .row.stage { flex-direction: column; gap: 8px; }
  .round-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .wide-only { display: none; }
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented.ranks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 18px; overflow: visible; }
  .segmented.ranks button { padding: 0 4px; }
  .kpi-value small { display: block; margin-left: 0; font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stage-title { width: auto; padding-top: 0; }
  /* кандидат на телефоне: портрет, имя и итог в строку, враги под ними во всю ширину */
  .row.cand { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 8px; align-items: center; }
  .row.cand .rank { display: none; }
  .row.cand .body { display: contents; }
  .row.cand .name { grid-column: 2; grid-row: 1; }
  .row.cand .figure { grid-column: 3; grid-row: 1; padding-top: 0; }
  .row.cand .vchips { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
}
@media (max-width: 420px) {
  .slots { gap: 6px; }
  .weeks { gap: 5px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 20px; line-height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
.verdict p .sub { display: block; color: var(--faint); font-size: var(--fs-small); }
