/* ==========================================================================
   hockey365 — «Ice & Ink»
   Печатный спортивный альманах: светлая «бумажная» тема (по умолчанию),
   отдельная тёмная через prefers-color-scheme. Serif-заголовки,
   табличные цифры, hairline-разлиновка, персональные цвета лиг.
   ========================================================================== */

/* ---------- Токены: светлая тема ---------- */
:root {
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #f0ebde;
  --ink: #15181d;
  --ink-2: #454c58;
  --muted: #7b8492;
  --line: #ddd6c6;
  --line-2: #ebe6da;
  --accent: #0e5f9e;
  --accent-soft: rgba(14, 95, 158, .08);
  --gold: #8f6413;
  --green: #1c7a4a;
  --green-soft: rgba(28, 122, 74, .10);
  --red: #b0462e;

  --shadow-sm: 0 1px 1px rgba(21, 24, 29, .05);
  --shadow: 0 1px 2px rgba(21, 24, 29, .06), 0 10px 24px -18px rgba(21, 24, 29, .45);
  --hover: rgba(21, 24, 29, .035);
  --zebra: rgba(21, 24, 29, .022);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --radius: 6px;
  --maxw: 1240px;
}

/* ---------- Тёмная тема ----------
   Держится в двух местах синхронно: системная (prefers-color-scheme) и
   принудительная (html[data-theme="dark"]). Значения identical by design. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1319;
    --surface: #151c25;
    --surface-2: #1b2430;
    --ink: #e8eef6;
    --ink-2: #bcc7d5;
    --muted: #8895a6;
    --line: #2a3542;
    --line-2: #202b38;
    --accent: #5fa8e8;
    --accent-soft: rgba(95, 168, 232, .12);
    --gold: #e2b45f;
    --green: #4cc98a;
    --green-soft: rgba(76, 201, 138, .14);
    --red: #f08a72;
    --shadow-sm: 0 1px 1px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 28px -18px rgba(0, 0, 0, .8);
    --hover: rgba(255, 255, 255, .05);
    --zebra: rgba(255, 255, 255, .028);
  }
}
:root[data-theme="dark"] {
  --paper: #0e1319;
  --surface: #151c25;
  --surface-2: #1b2430;
  --ink: #e8eef6;
  --ink-2: #bcc7d5;
  --muted: #8895a6;
  --line: #2a3542;
  --line-2: #202b38;
  --accent: #5fa8e8;
  --accent-soft: rgba(95, 168, 232, .12);
  --gold: #e2b45f;
  --green: #4cc98a;
  --green-soft: rgba(76, 201, 138, .14);
  --red: #f08a72;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 28px -18px rgba(0, 0, 0, .8);
  --hover: rgba(255, 255, 255, .05);
  --zebra: rgba(255, 255, 255, .028);
}
/* Принудительная светлая тема перекрывает системную тёмную. */
:root[data-theme="light"] {
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #f0ebde;
  --ink: #15181d;
  --ink-2: #454c58;
  --muted: #7b8492;
  --line: #ddd6c6;
  --line-2: #ebe6da;
  --accent: #0e5f9e;
  --accent-soft: rgba(14, 95, 158, .08);
  --gold: #8f6413;
  --green: #1c7a4a;
  --green-soft: rgba(28, 122, 74, .10);
  --red: #b0462e;
  --shadow-sm: 0 1px 1px rgba(21, 24, 29, .05);
  --shadow: 0 1px 2px rgba(21, 24, 29, .06), 0 10px 24px -18px rgba(21, 24, 29, .45);
  --hover: rgba(21, 24, 29, .035);
  --zebra: rgba(21, 24, 29, .022);
}

/* ---------- Акцентные цвета лиг ----------
   --league для светлой темы, --league-dark для тёмной; --accent выбирается
   в зависимости от активного режима. */
body[data-league="khl"]  { --league: #1a6bb5; --league-dark: #5fa8e8; }
body[data-league="nhl"]  { --league: #a02233; --league-dark: #e8798a; }
body[data-league="mhl"]  { --league: #2c7a56; --league-dark: #5cc796; }
body[data-league="vhl"]  { --league: #8a5a1e; --league-dark: #d9a45f; }
body[data-league="ahl"]  { --league: #5748a8; --league-dark: #9c8ce8; }
body[data-league="ru"]   { --league: #93272f; --league-dark: #ef8f9c; }
body[data-league="ussr"] { --league: #7a3b8f; --league-dark: #c08fd8; }

body[data-league] {
  --accent: var(--league);
  --accent-soft: rgba(0, 0, 0, .06); /* фолбэк, если color-mix не поддерживается */
  --accent-soft: color-mix(in srgb, var(--league) 10%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-league] {
    --accent: var(--league-dark);
    --accent-soft: color-mix(in srgb, var(--league-dark) 13%, transparent);
  }
}
:root[data-theme="dark"] body[data-league] {
  --accent: var(--league-dark);
  --accent-soft: color-mix(in srgb, var(--league-dark) 13%, transparent);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font-body);
  text-rendering: optimizeLegibility;
}
/* Тонкая «фактура» страницы */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 88% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(700px 380px at 4% 108%, var(--green-soft), transparent 60%);
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; margin: 0 0 10px; line-height: 1.22; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
b, strong { font-weight: 700; }
code { font-family: var(--font-num); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; }

.skip-link {
  position: absolute; left: 16px; top: -56px; z-index: 60;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 0 0 var(--radius) var(--radius);
  transition: top .16s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }
main:focus { outline: none; }
.muted { color: var(--muted); font-weight: 400; }

/* ==========================================================================
   Шапка
   ========================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.masthead-top { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 21px; line-height: 1; }
.brand-word em { font-style: italic; color: var(--accent); }
.brand-tag { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .01em; }
.brand-season { color: var(--ink-2); font-weight: 600; }

.league-tabs { border-top: 1px solid var(--line-2); background: var(--surface); }
.section-tabs { border-top: 1px solid var(--line-2); background: var(--paper); }
.tabs-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs-row::-webkit-scrollbar { display: none; }

.league-tab {
  flex: 0 0 auto; padding: 11px 15px; color: var(--ink-2);
  font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.league-tab:hover { color: var(--ink); text-decoration: none; }
.league-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.section-tab {
  flex: 0 0 auto; padding: 9px 15px; color: var(--muted);
  font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.section-tab:hover { color: var(--ink); text-decoration: none; }
.section-tab.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ==========================================================================
   Герой и панели
   ========================================================================== */
main > .hero:first-child { margin-top: 4px; }
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.kicker {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
  margin: 0 0 8px;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 22px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
.meta-item { display: flex; flex-direction: column; gap: 1px; }
.meta-item dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.meta-item dd { margin: 0; font-family: var(--font-num); font-size: 12.5px; color: var(--muted); }
.league-block .panel-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 6px; }
.hero .accent { color: var(--accent); font-style: italic; }
.hero p { color: var(--ink-2); max-width: 62ch; margin-bottom: 16px; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 4px;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); filter: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  /* Контейнер: ширина панели задаётся сеткой, а не минимальной шириной таблицы,
     поэтому широкие таблицы скроллятся внутри, а не разрывают вёрстку. */
  container-type: inline-size;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 24px; }
.panel-title { font-size: 19px; margin-bottom: 12px; }
.panel-links { display: flex; gap: 16px; font-size: 13.5px; }
.section-label {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 20px 0 8px;
}
.page-title { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 8px; }
.page-note { color: var(--ink-2); font-size: 14px; max-width: 96ch; margin: 0 0 18px; }
.page-note a { text-decoration: underline; text-underline-offset: 2px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ==========================================================================
   Значки команд
   ========================================================================== */
.badge { flex: 0 0 auto; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.badge-initials { font-family: var(--font-body); font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 0 1px var(--line); }
.team-cell, .team-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.team-name { font-family: var(--font-body); }
.static-row { display: inline-flex; align-items: center; gap: 8px; }
.mug { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }

/* ==========================================================================
   Мини-списки лидеров
   ========================================================================== */
.mini-leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 10px 0 4px; }
.mini-leaders h4 {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px;
}
.mini-table { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.mini-table li { border-bottom: 1px dashed var(--line-2); }
.mini-table li:last-child { border-bottom: 0; }
.mini-table li a, .mini-table .plain {
  display: flex; align-items: center; gap: 10px; padding: 7px 6px;
  color: var(--ink); counter-increment: rank; border-radius: 4px;
}
.mini-table li a:hover { background: var(--hover); text-decoration: none; }
.mini-table li a::before {
  content: counter(rank); flex: 0 0 18px; text-align: right;
  font-family: var(--font-num); font-size: 11.5px; color: var(--muted);
}
/* flex:1 только для подписи — иначе растягивается и значок-монограмма */
.mini-table li a > span:not(.badge), .mini-table .plain > span:first-child {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-table li a b, .mini-table .plain b { font-family: var(--font-num); color: var(--gold); }
.mini-table .plain { width: 100%; }
.player-ref { color: var(--accent); }

/* ==========================================================================
   Матчи (scorebug)
   ========================================================================== */
.date-group { margin-bottom: 18px; }
.date-title {
  font-family: var(--font-body); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.games { display: flex; flex-direction: column; gap: 7px; }
.game {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; color: var(--ink);
}
a.game:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-sm); }
.game-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game-side:last-child { justify-content: flex-end; }
.game-side .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.game-score { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 19px; font-weight: 700; white-space: nowrap; }
.score { color: var(--ink); font-variant-numeric: tabular-nums; }
.game-time { font-family: var(--font-num); font-size: 13.5px; font-weight: 600; color: var(--accent); }
.ot-badge {
  font-family: var(--font-body); font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: var(--gold); background: transparent; border: 1px solid currentColor;
  padding: 1px 6px; border-radius: 999px;
}
/* Победитель в scorebug — жирный, проигравший приглушён */
.game.home-won .game-side:last-child .team-name { font-weight: 700; }
.game.away-won .game-side:first-child .team-name { font-weight: 700; }
.game.home-won .game-side:first-child .team-name { color: var(--muted); }
.game.away-won .game-side:last-child .team-name { color: var(--muted); }

.empty-note {
  color: var(--ink-2); background: var(--surface-2);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 14px 16px; font-size: 14px;
}

/* ==========================================================================
   Таблицы (леджер)
   ========================================================================== */
.conf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-scroll::-webkit-scrollbar { height: 9px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
table.standings, table.roster { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.standings th, .roster th {
  text-align: right; color: var(--muted);
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 10px 9px; border-bottom: 1.5px solid var(--line); white-space: nowrap;
  background: var(--surface-2);
}
.standings th:first-child, .roster th:first-child { border-top-left-radius: 0; }
.standings th.team-col, .roster th.team-col, .standings td.team-col, .roster td.team-col { text-align: left; }
.standings td, .roster td {
  padding: 9px; text-align: right; border-bottom: 1px solid var(--line-2);
  white-space: nowrap; font-family: var(--font-num); font-variant-numeric: tabular-nums;
}
.standings tbody tr:nth-child(even) td, .roster tbody tr:nth-child(even) td { background: var(--zebra); }
.standings tbody tr:hover td, .roster tbody tr:hover td { background: var(--hover); }
.standings tbody tr:last-child td, .roster tbody tr:last-child td { border-bottom: 0; }
.standings td.pos, .roster td.pos { width: 38px; color: var(--muted); }
.standings tr.playoff td.pos { box-shadow: inset 3px 0 0 var(--green); }
.standings tr.playoff td { background: var(--green-soft); }
.standings tr.playoff:nth-child(even) td { background: var(--green-soft); }
.standings td.team-col a, .roster td.team-col a { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.standings td.team-col a:hover, .roster td.team-col a:hover { text-decoration: none; }
.standings td.team-col a:hover .team-name, .roster td.team-col a:hover .team-name { text-decoration: underline; text-underline-offset: 2px; }
.standings td.team-col .sub, .roster td.team-col .sub { display: block; color: var(--muted); font-size: 11px; margin-left: 7px; font-family: var(--font-body); }
.standings .pts, .roster .pts { color: var(--gold); }
.standings td.pts b, .roster td.pts b { font-size: 14px; }
.pos-num { color: var(--green); }
.neg-num { color: var(--red); }
.l10 { font-variant-numeric: tabular-nums; }
.player-col { display: flex; align-items: center; gap: 9px; }

/* ==========================================================================
   Карточки команд
   ========================================================================== */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.team-card {
  display: flex; flex-direction: column; gap: 3px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .14s ease, border-color .14s ease;
}
.team-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.team-card-badge { margin-bottom: 6px; }
.team-card-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.team-card-meta { color: var(--ink-2); font-size: 12.5px; }

/* ==========================================================================
   Профиль команды / игрока
   ========================================================================== */
.team-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  /* Оттенок считается от --accent: на странице клуба он переопределён
     цветами команды (inline-стиль в team.php). */
  background: var(--surface);
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 55%);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 18px;
}
.team-hero h1 { margin: 0; font-size: clamp(26px, 3.2vw, 34px); }
.team-hero-sub { color: var(--ink-2); margin: 4px 0 0; font-size: 14px; }
.team-hero-sub a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.info-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm);
}
.info-card b { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.info-card span { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }

.team-games { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.roster-panel { margin-bottom: 14px; }

.player-mug { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.player-hero h1 { margin-bottom: 2px; }

/* ==========================================================================
   Архивные сезоны
   ========================================================================== */
.seasons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.season-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .14s ease, border-color .14s ease;
}
.season-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.season-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.season-champ { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.season-sub { color: var(--muted); font-size: 13px; }
.season-open { color: var(--muted); font-size: 12px; margin-top: 6px; letter-spacing: .04em; text-transform: uppercase; }
.season-card:hover .season-open { color: var(--accent); }

.champ-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  background: linear-gradient(100deg, rgba(143, 100, 19, .14) 0%, var(--surface) 55%);
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.champ-cup { font-size: 27px; line-height: 1; }
.champ-label { color: var(--gold); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.champ-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.champ-sub { color: var(--ink-2); font-size: 13.5px; }

.note-banner {
  background: var(--accent-soft); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; color: var(--ink); font-size: 14px;
}
.title-note { font-family: var(--font-body); font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.source-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.season-leaders .mini-table li span:first-child { flex: 1; }

/* ---------- Сетка плей-офф ---------- */
.po-series { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 7px 14px; margin-bottom: 16px; }
.po-series-item {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 8px 12px; font-size: 13.5px;
}
.po-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.po-team:first-child { text-align: right; }
.po-team.is-winner { color: var(--ink); font-weight: 700; }
.po-score { color: var(--muted); white-space: nowrap; font-family: var(--font-num); }
.po-score b { font-weight: 400; }
.po-score b.is-winner { color: var(--gold); font-weight: 700; }

.ranking-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rank-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 8px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--ink);
}
.rank-chip b { font-family: var(--font-num); color: var(--gold); min-width: 20px; text-align: center; }

.source-warnings { margin: 6px 0 16px; color: var(--ink-2); font-size: 13.5px; }
.source-warnings summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.source-warnings ul { margin: 8px 0 0 20px; }
.source-warnings li { margin-bottom: 3px; }

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 24px; }
.footer-note { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 70ch; }
.footer-note b { font-family: var(--font-display); color: var(--ink-2); letter-spacing: -.01em; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* ==========================================================================
   Компактизация таблиц по ширине контейнера (панели — контейнеры)
   ========================================================================== */
@container (max-width: 680px) {
  .standings th, .standings td, .roster th, .roster td { padding: 7px 5px; font-size: 12.5px; }
  .standings td.team-col .sub, .roster td.team-col .sub { display: none; }
}
@container (max-width: 470px) {
  .standings th, .standings td, .roster th, .roster td { padding: 6px 4px; font-size: 12px; }
  /* Extra-колонки овертаймов уступают место, когда совсем тесно */
  .standings .ot-col { display: none; }
}

/* ==========================================================================
   Переключатель темы
   ========================================================================== */
.theme-toggle {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2); font: 600 12px/1 var(--font-body);
  letter-spacing: .04em; padding: 7px 13px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .tt-icon { font-size: 13px; line-height: 1; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 1040px) {
  .conf-grid, .home-grid, .team-games { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .tabs-row { padding: 0 16px; }
  .masthead-top { gap: 8px; padding-top: 12px; padding-bottom: 8px; }
  .brand { font-size: 23px; }
  .brand-tag { font-size: 12px; width: 100%; }
  .mini-leaders { grid-template-columns: 1fr; }
  .panel, .hero { padding: 16px; }
  .game { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 9px 11px; }
  .game-score { font-size: 17px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .standings th, .roster th, .standings td, .roster td { padding: 7px 6px; }
}

/* ==========================================================================
   Доступность и печать
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .masthead, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .panel, .table-scroll, .game, .team-card, .season-card { border-color: #999; box-shadow: none; break-inside: avoid; }
  main.wrap { padding: 0; }
}

/* Чемпионаты мира: блок шайб под матчем */
.wm-game {
  flex-wrap: wrap;
}
.wm-goals {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border-top: 1px dashed rgba(128, 128, 128, .35);
  display: grid;
  gap: 3px;
}
.wm-goal {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.5;
}
.wm-goal-time {
  color: var(--muted, #888);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}
.wm-goal-score {
  min-width: 40px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wm-goal-team {
  margin-left: auto;
  text-align: right;
}
