/* ============================================================
   Слой интерфейса v25 — поверх style.css.
   Цвета берутся из переменных темы (theme.css), поэтому все личные
   палитры и фоны игроков продолжают работать.

   Шрифты: Sofia Sans Extra Condensed — заголовки, как плашки в трансляции;
   Sofia Sans Condensed — цифры счёта и очков; Golos Text — весь текст.
   Сетка отступов кратна 4px.
   ============================================================ */
:root {
  --font-display: "Sofia Sans Extra Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-board: "Sofia Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --on-accent: #201500;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --tabbar-h: 3.75rem;
  --ink-well: color-mix(in srgb, var(--pitch-deep) 62%, #000);
  --hair: color-mix(in srgb, var(--line) 55%, transparent);
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }

body { font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { width: min(1080px, 100% - 2rem); padding-bottom: 3rem; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--board); outline-offset: 2px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.foot { font-size: .8rem; border-top-color: var(--hair); }

/* ---------------- заголовки ---------------- */
.display {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.4rem, 7vw, 3.5rem); line-height: .95; letter-spacing: .01em;
  margin: 0 0 .5rem; text-shadow: none;
}
.round-head { margin: 1rem 0 1rem; }
.round-note { font-size: .875rem; max-width: 68ch; line-height: 1.45; }
.round-note b { color: inherit; font-weight: 600; }
.side-title, .sec-title {
  font-family: var(--font-display); font-weight: 700; text-transform: none;
  font-size: 1.5rem; line-height: 1.1; letter-spacing: .01em; margin: 0 0 .75rem;
}
.strong, .digit, .colon, .pl-score, .mypred, .pts, .round-chip {
  font-family: var(--font-board); font-variant-numeric: tabular-nums;
}
.strong { font-size: 1.05rem; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.login-title { font-family: var(--font-display); font-weight: 800; font-size: 2rem; text-transform: uppercase; }
.brand-badge, .login-crest { font-family: var(--font-display); font-weight: 800; color: var(--on-accent); }

/* ---------------- шапка ---------------- */
.hdr {
  display: flex; align-items: center; gap: 1.25rem;
  width: min(1080px, 100% - 2rem); margin: 0 auto; padding: .75rem 0;
}
.hdr .brand { flex: 0 0 auto; }
.topnav { display: flex; gap: .25rem; margin-left: auto; }
.topnav a {
  color: var(--chalk-dim); text-decoration: none; font-weight: 600; font-size: .9rem;
  padding: .5rem .75rem; border-radius: var(--radius-sm);
  transition: color .15s, background-color .15s;
}
.topnav a:hover { color: var(--chalk); background: var(--pitch-up); }
.topnav a[aria-current] { color: var(--chalk); box-shadow: inset 0 -2px 0 var(--board); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

.usermenu { position: relative; flex: 0 0 auto; }
.usermenu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .375rem;
  font-weight: 600; font-size: .9rem; color: var(--chalk);
  padding: .5rem .625rem .5rem .75rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--pitch);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu[open] summary svg { transform: rotate(180deg); }
.um-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-list {
  position: absolute; right: 0; top: calc(100% + .375rem); z-index: 70; min-width: 15rem;
  background: var(--pitch-up); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .375rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  animation: pop .14s var(--ease);
}
.um-list a {
  display: block; padding: .625rem .75rem; border-radius: 8px;
  text-decoration: none; font-size: .9rem; font-weight: 500;
}
.um-list a:hover { background: var(--pitch); }
.um-list .um-exit { color: var(--loss); border-top: 1px solid var(--hair); border-radius: 0 0 8px 8px; margin-top: .25rem; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------------- нижняя навигация (телефон) ---------------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .hdr { width: 100%; padding: .625rem .75rem; }
  .hdr .topnav { display: none; }
  .hdr .usermenu { margin-left: auto; }
  .wrap { width: 100%; padding: 0 .75rem 2rem; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--pitch) 92%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .125rem;
    color: var(--chalk-dim); text-decoration: none; font-size: .6875rem; font-weight: 600;
    position: relative; -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--chalk); }
  .tabbar a[aria-current] svg { stroke: var(--board); }
  .tabbar a[aria-current]::before {
    content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px;
    background: var(--board); border-radius: 0 0 2px 2px;
  }
  .tabbar a:active { background: var(--pitch-up); }
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  body.has-tabbar .netbar, body.has-tabbar .updbar {
    bottom: calc(var(--tabbar-h) + .625rem + env(safe-area-inset-bottom));
  }
  .foot { margin-top: 1rem; }
}

/* полоса загрузки следующей страницы */
.navprog {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 90;
  background: linear-gradient(90deg, transparent, var(--board), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: navprog 1s linear infinite;
}
@keyframes navprog { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---------------- кнопки, поля, таблицы ---------------- */
.btn { border-radius: var(--radius-sm); font-size: .9rem; padding: .625rem 1rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--board) 86%, #fff); }
.btn.ghost { color: var(--chalk); }
.flash { border-radius: var(--radius-sm); }
.mini-table, .big-table, .matrix { font-size: .9rem; }
.mini-table th, .big-table th, .matrix th { text-transform: none; letter-spacing: 0; font-size: .78rem; padding: .625rem .75rem; }
.mini-table td, .big-table td, .matrix td { padding: .625rem .75rem; border-bottom-color: var(--hair); }
tr.me td { background: color-mix(in srgb, var(--board) 9%, transparent); }
tr.me td:first-child { box-shadow: inset 2px 0 0 var(--board); }
.plink { text-decoration: none; font-weight: 600; }
.plink:hover { text-decoration: underline; text-underline-offset: 3px; }
.round-chip { font-size: 1rem; font-weight: 700; border-radius: var(--radius-sm); min-width: 2.75rem; padding: .5rem; transition: color .15s, border-color .15s, background-color .15s; }
.round-chip.sel { color: var(--on-accent); }
.vt.sel { color: var(--on-accent); }
.tag { text-transform: none; letter-spacing: 0; font-size: .75rem; font-weight: 600; padding: .125rem .5rem; }
.tag.open.soon { background: color-mix(in srgb, var(--board) 16%, transparent); color: var(--board); border-color: color-mix(in srgb, var(--board) 45%, transparent); }
.pts { font-size: .95rem; line-height: 1.2; padding: 0 .375rem; border-radius: 6px; }
.pts.soft { opacity: .8; outline: 1px dashed currentColor; outline-offset: 1px; }

/* ============================================================
   ЭКРАН ТУРА
   ============================================================ */
.round-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; }
@media (max-width: 900px) { .round-grid { grid-template-columns: 1fr; } .round-grid .sidebar { order: 0; position: static; } }
.sidebar { top: 5.5rem; }

/* --- полоса прогресса: один сегмент на матч --- */
.prog {
  position: sticky; top: 0; z-index: 30; margin: 0 -.75rem 1rem; padding: .625rem .75rem .75rem;
  background: color-mix(in srgb, var(--pitch-deep) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.prog-line { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.prog-count { font-size: .9rem; font-weight: 600; }
.prog-count b { font-family: var(--font-board); font-size: 1.35rem; font-weight: 700; line-height: 1; }
.prog-note { font-size: .8125rem; color: var(--chalk-dim); text-align: right; }
.prog-note.soon { color: var(--board); font-weight: 600; }
.prog-segs { display: flex; gap: 4px; }
.seg {
  flex: 1; height: 8px; border-radius: 4px; position: relative;
  border: 1.5px solid var(--line); background: transparent;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.seg::after { content: ""; position: absolute; inset: -10px -2px; }   /* зона нажатия */
.seg.bet { background: var(--win); border-color: var(--win); }
.seg.missed { border-style: dashed; border-color: var(--loss); }
.seg.live { box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 45%, transparent); }

/* --- лист матчей --- */
.sheet { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.day {
  font-family: var(--font-body); font-size: .8125rem; font-weight: 600; color: var(--chalk-dim);
  margin: .75rem 0 .125rem; padding-left: .125rem;
}
.day:first-child { margin-top: 0; }
.day::first-letter { text-transform: uppercase; }

.fx {
  background: var(--pitch); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .625rem .875rem .75rem; scroll-margin-top: 5.5rem;
  transition: border-color .2s;
}
.fx.is-live { border-color: color-mix(in srgb, var(--live) 60%, var(--line)); }
.fx.is-done { background: color-mix(in srgb, var(--pitch) 70%, transparent); }
.fx-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.fx-top .tag { margin-left: 0; }
.fx-time { font-family: var(--font-board); font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; line-height: 1; }

.fx-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .75rem; }
.fx-team { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.fx-team.home { justify-content: flex-end; text-align: right; }
.fx-name { font-weight: 600; font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; }
.fx-logo { width: 36px; height: 36px; object-fit: contain; flex: 0 0 auto; }
.fx-logo.ph {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--pitch-deep); border: 1px solid var(--line);
  font-size: .7rem; font-weight: 700; color: var(--chalk-dim);
}
.fx-center { display: flex; justify-content: center; }
.fx-center .board { padding: .25rem .625rem; border-radius: var(--radius-sm); }
.fx-center .digit { font-size: 1.75rem; line-height: 1.15; min-width: .9em; }
.fx-center .colon { font-size: 1.4rem; }

/* --- поля счёта: две клетки табло --- */
.fx .predict-form { display: flex; align-items: center; gap: .375rem; flex-wrap: nowrap; }
.fx .predict-form input[type=number] {
  width: 2.875rem; height: 2.875rem; padding: 0; text-align: center;
  font-family: var(--font-board); font-weight: 700; font-size: 1.75rem; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--board); caret-color: var(--board);
  background: var(--ink-well); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  -moz-appearance: textfield; appearance: textfield;
  transition: border-color .15s, box-shadow .15s;
}
.fx .predict-form input[type=number]::-webkit-outer-spin-button,
.fx .predict-form input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fx .predict-form input[type=number]:focus {
  outline: none; border-color: var(--board);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--board) 28%, transparent);
}
.fx .predict-form[data-saved]:not([data-dirty]) input[type=number]:not(:focus) {
  border-color: color-mix(in srgb, var(--win) 60%, var(--line));
}
.fx .pf-colon { font-family: var(--font-board); font-weight: 700; font-size: 1.4rem; color: var(--chalk-dim); }

.fx-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .5rem; min-height: 1.75rem; }
.fx .pf-state { font-size: .8125rem; font-weight: 500; color: var(--chalk-dim); min-width: 0; text-align: left; flex: 1; display: block; }
.fx .pf-state.ok { color: var(--win); font-weight: 600; }
.fx .pf-state.ok::before { content: "✓ "; }
.fx .pf-state.wait { color: var(--board); }
.fx .pf-state.err { color: var(--loss); font-weight: 600; }
.fx-mine { font-size: .8125rem; color: var(--chalk-dim); display: inline-flex; align-items: center; gap: .375rem; flex: 1; }
.fx-mine b { font-family: var(--font-board); font-size: 1.125rem; font-weight: 700; color: var(--chalk); font-variant-numeric: tabular-nums; }
.fx-more {
  font: inherit; font-size: .8125rem; font-weight: 500; color: var(--chalk-dim);
  background: none; border: 0; padding: .375rem .25rem .375rem .5rem; margin: -.375rem -.25rem -.375rem 0;
  display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; border-radius: 8px;
  white-space: nowrap; min-height: 2.25rem;
}
.fx-more:hover { color: var(--chalk); }
.fx-more svg { transition: transform .18s var(--ease); }
.fx-more[aria-expanded=true] svg { transform: rotate(180deg); }

.fx-preds { list-style: none; margin: .625rem 0 0; padding: .625rem 0 0; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: .375rem; }
.fx-preds li {
  display: inline-flex; align-items: center; gap: .375rem; font-size: .8125rem;
  padding: .1875rem .5rem; border-radius: 999px; background: var(--pitch-deep); border: 1px solid var(--hair);
}
.fx-preds li.me { border-color: var(--board-deep); }
.fx-preds b { font-family: var(--font-board); font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fp-name { color: var(--chalk-dim); }

.fx-detail { margin-top: .625rem; padding-top: .625rem; border-top: 1px solid var(--hair); animation: reveal .18s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.fx-detail .preview { margin: 0 0 .625rem; font-size: .875rem; color: var(--chalk-dim); max-width: 70ch; }
.fx-detail .fname { min-width: 8.5rem; }
.who { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem; }
.who li { font-size: .8125rem; padding: .1875rem .5rem; border-radius: 999px; border: 1px solid var(--hair); color: var(--chalk-dim); }
.who li::before { content: "○ "; }
.who li.yes { color: var(--chalk); border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.who li.yes::before { content: "✓ "; color: var(--win); }
.who li.me { font-weight: 600; }
.fx .hidden-note { margin: .5rem 0 0; }
.fx .queued-note { margin-top: .5rem; }

.fx.just-saved { animation: bet-saved .9s ease-out; }
.fx.goal .board { animation: goal 1.6s var(--ease); }
@keyframes goal {
  0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--board) 70%, transparent); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 transparent; transform: none; }
}

/* широкий экран: матч в одну строку */
@media (min-width: 700px) {
  .prog { margin: 0 0 1rem; padding: .75rem 0; }
  .fx {
    display: grid; grid-template-columns: 6.75rem minmax(0, 1fr) 11.5rem;
    align-items: center; column-gap: 1rem; padding: .75rem 1rem;
  }
  .fx-top { flex-direction: column; align-items: flex-start; gap: .25rem; margin: 0; }
  .fx-foot { margin: 0; justify-content: flex-end; flex-wrap: wrap; row-gap: 0; }
  .fx .pf-state, .fx-mine { flex: 0 1 auto; text-align: right; justify-content: flex-end; }
  .fx-preds, .fx-detail, .fx .queued-note { grid-column: 1 / -1; }
}
/* телефон: эмблема над названием, счёт по центру */
@media (max-width: 699px) {
  .fx-main { gap: .5rem; align-items: start; }
  .fx-team, .fx-team.home { flex-direction: column; align-items: center; text-align: center; gap: .25rem; }
  .fx-team.home { flex-direction: column-reverse; }
  .fx-name { font-size: .8125rem; }
  .fx-center { padding-top: .125rem; }
  .fx .predict-form input[type=number] { width: 3rem; height: 3rem; }
}

/* ============================================================
   ГЛАВНАЯ
   ============================================================ */
.hero {
  margin: 1rem 0 2rem; padding: 1.25rem 1.25rem 1.5rem; border-radius: 20px;
  background: var(--ink-well); border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .45);
}
.hero-lead { margin: 0; font-size: .9rem; color: var(--chalk-dim); }
.hero-clock {
  font-family: var(--font-display); font-weight: 800; color: var(--board);
  font-size: clamp(4rem, 19vw, 8.5rem); line-height: .9; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; margin: .25rem 0 .5rem; display: block;
}
.hero-clock.calm { color: var(--chalk); font-size: clamp(2.6rem, 10vw, 4.5rem); text-transform: uppercase; line-height: .95; }
.hero-match { margin: 0; font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hero-match img { width: 26px; height: 26px; object-fit: contain; }
.hero-match .when { font-weight: 400; color: var(--chalk-dim); font-size: .9rem; }
.hero-actions { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.hero-actions .btn { font-size: 1rem; padding: .75rem 1.25rem; }
.hero-rest { font-size: .875rem; color: var(--chalk-dim); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 2.5rem; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.standing { margin: 0 0 1rem; font-size: 1rem; max-width: 46ch; }
.standing b { font-family: var(--font-board); font-size: 1.35rem; font-weight: 700; }

.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .625rem; }
.lb a { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: .125rem .625rem; align-items: baseline; text-decoration: none; }
.lb .lb-place { color: var(--chalk-dim); font-family: var(--font-board); font-weight: 700; font-size: 1rem; }
.lb .lb-name { font-weight: 600; }
.lb .lb-pts { font-family: var(--font-board); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.lb .lb-bar { grid-column: 2 / -1; height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.lb .lb-bar i { display: block; height: 100%; border-radius: 3px; background: var(--chalk-dim); }
.lb li.me .lb-bar i { background: var(--board); }
.lb li.me .lb-name::after { content: " (вы)"; font-weight: 400; color: var(--chalk-dim); }
.lb a:hover .lb-name { text-decoration: underline; text-underline-offset: 3px; }

.res { list-style: none; margin: 0; padding: 0; }
.res li { border-bottom: 1px solid var(--hair); }
.res li:last-child { border-bottom: 0; }
.res a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem; align-items: center; padding: .625rem 0; text-decoration: none; }
.res .res-teams { font-weight: 500; font-size: .9rem; min-width: 0; }
.res .res-score { font-family: var(--font-board); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.res .res-mine { min-width: 4.5rem; text-align: right; font-size: .8125rem; color: var(--chalk-dim); display: inline-flex; gap: .375rem; justify-content: flex-end; align-items: center; }
.res .res-mine b { font-family: var(--font-board); font-size: 1rem; color: var(--chalk); }
.res .livedot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: .375rem; animation: pulse 1.6s infinite; }
.hint {
  margin: 2rem 0 0; padding: .875rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius);
  font-size: .9rem; display: flex; gap: .75rem 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.hint p { margin: 0; max-width: 60ch; }

/* ============================================================
   СТАТИСТИКА ИГРОКА
   ============================================================ */
.pl-sub { margin: 0; color: var(--chalk-dim); font-size: .95rem; }
.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; padding: 1.25rem 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
@media (max-width: 640px) { .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fig b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.fig span { font-size: .8125rem; color: var(--chalk-dim); }
.block { margin: 0 0 2.5rem; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.chart .axis { fill: var(--chalk-dim); font: 500 11px var(--font-body); }
.chart .bar-me { fill: var(--board); }
.chart .bar-vs { fill: var(--chalk-dim); }
.chart .avg { stroke: var(--chalk); stroke-width: 2; stroke-linecap: round; }
.chart g.col:hover .bar-me, .chart g.col:hover .bar-vs { opacity: .75; }
.chart .hit { fill: transparent; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8125rem; color: var(--chalk-dim); margin-top: .5rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .375rem; }
.legend .k-me { background: var(--board); }
.legend .k-vs { background: var(--chalk-dim); }
.legend .k-avg { height: 2px; border-radius: 1px; background: var(--chalk); vertical-align: 4px; }

.dist { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin-bottom: .625rem; }
.dist i { display: block; min-width: 2px; }
.dist .d3, .dl .d3 i { background: var(--win); }
.dist .d2, .dl .d2 i { background: var(--draw); }
.dist .d1, .dl .d1 i { background: var(--chalk-dim); }
.dist .d0, .dl .d0 i { background: var(--hair); }
.dl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: .375rem 1.5rem; font-size: .875rem; }
.dl i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .375rem; }
.dl b { font-family: var(--font-board); font-size: 1.1rem; }

.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--hair); font-size: .9rem; }
.kv-list li:last-child { border-bottom: 0; }
.kv-list b { font-family: var(--font-board); font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-list .sub { color: var(--chalk-dim); font-size: .8125rem; font-weight: 400; font-family: var(--font-body); margin-left: .375rem; }
.kv-list .club { display: inline-flex; align-items: center; gap: .5rem; }
.kv-list .club img { width: 20px; height: 20px; object-fit: contain; }

.pair { display: grid; grid-template-columns: 5rem minmax(0, 1fr) 3rem; gap: .375rem .75rem; align-items: center; font-size: .875rem; }
.pair .track { height: 8px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.pair .track i { display: block; height: 100%; border-radius: 4px; background: var(--board); }
.pair .track.real i { background: var(--chalk-dim); }
.pair .val { font-family: var(--font-board); font-weight: 700; font-size: 1rem; text-align: right; }
.pair .lbl { color: var(--chalk-dim); }
.pair .grp { grid-column: 1 / -1; font-weight: 600; margin-top: .5rem; }
.pair .grp:first-child { margin-top: 0; }

.duel-score { font-family: var(--font-display); font-weight: 800; font-size: 3.25rem; line-height: 1; font-variant-numeric: tabular-nums; margin: 0 0 .25rem; }
.duel-score span { color: var(--chalk-dim); }

/* ---------------- привязка Telegram на «Состоянии» ---------------- */
.tgbox { margin: 0 0 1.5rem; padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--pitch); }
.tgbox h2 { margin: 0 0 .375rem; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.tgbox p { margin: 0 0 .75rem; font-size: .9rem; max-width: 62ch; color: var(--chalk-dim); }
.tgbox .ok { color: var(--win); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------------- правки после просмотра ---------------- */
select, input[type=text], input[type=password] { max-width: 100%; }
.tag { white-space: nowrap; }
.prog-note { white-space: nowrap; }
@media (min-width: 700px) { .fx { grid-template-columns: 7.5rem minmax(0, 1fr) 11.5rem; } }
.hero-list { list-style: none; margin: 0; padding: 0; }
.hero-list a { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; padding: .5rem 0; text-decoration: none; font-size: .9rem; border-bottom: 1px solid var(--hair); }
.hero-list li:last-child a { border-bottom: 0; }
.hero-list time, .hero-list .more { color: var(--chalk-dim); font-size: .8125rem; }
.hero-list .more { padding-top: .5rem; }
.hero-list a:hover span { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) {
  .hero.with-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 2.5rem; align-items: end; }
}
@media (max-width: 899px) { .hero-list { margin-top: 1.25rem; padding-top: .5rem; border-top: 1px solid var(--hair); } }
.cols > div > .block:last-child { margin-bottom: 2.5rem; }
.admin-grid > * { min-width: 0; }
.stack-form select { width: 100%; }

/* ============================================================
   v43: закреплённые колонки в широких таблицах.
   При прокрутке вправо место и имя (клуб) остаются на месте,
   цифры уезжают под них.
   ============================================================ */
.table-scroll { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.table-scroll .big-table, .table-scroll .matrix { overflow: visible; border-collapse: separate; border-spacing: 0; }

.big-table th:first-child, .big-table td:first-child {
  position: sticky; left: 0; z-index: 2;
  width: 2.25rem; min-width: 2.25rem; max-width: 2.25rem;
  padding-left: .625rem; padding-right: .125rem;
}
.big-table th:nth-child(2), .big-table td:nth-child(2) { position: sticky; left: 2.25rem; z-index: 2; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 2; }

/* закреплённым ячейкам нужен непрозрачный фон, иначе цифры просвечивают */
.big-table td:first-child, .big-table td:nth-child(2), .matrix td:first-child { background: var(--pitch); }
.big-table th:first-child, .big-table th:nth-child(2), .matrix th:first-child { background: var(--pitch-up); }
.big-table tr.me td:first-child, .big-table tr.me td:nth-child(2), .matrix tr.me td:first-child {
  background: linear-gradient(color-mix(in srgb, var(--board) 9%, transparent), color-mix(in srgb, var(--board) 9%, transparent)), var(--pitch);
}
.big-table tr.leader td:first-child, .big-table tr.leader td:nth-child(2) {
  background: linear-gradient(rgba(55, 194, 110, .08), rgba(55, 194, 110, .08)), var(--pitch);
}
.big-table tr.me td:first-child, .matrix tr.me td:first-child { box-shadow: inset 2px 0 0 var(--board); }

/* тонкая граница справа от закреплённой части — видно, где начинается прокрутка */
.big-table th:nth-child(2), .big-table td:nth-child(2),
.matrix th:first-child, .matrix td:first-child { border-right: 1px solid var(--line); }

/* скругление углов: у таблицы больше нет overflow:hidden, поэтому обрезает обёртка */
.table-scroll { border: 1px solid var(--line); border-radius: var(--radius); background: var(--pitch); }
.table-scroll .big-table, .table-scroll .matrix { border: 0; border-radius: 0; }

@media (max-width: 760px) {
  /* имя не должно съедать пол-экрана: длинные названия клубов переносятся */
  .big-table td:nth-child(2), .big-table th:nth-child(2) { max-width: 9.5rem; white-space: normal; padding-right: .5rem; }
  .big-table .clubwrap { gap: .375rem; }
  .matrix td:first-child, .matrix th:first-child { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
