/* slamwatch
   Язык: телевизионное табло. Типографика несёт страницу, цвет покрытия
   работает полем. Данные разделяются воздухом, а не линейкой под каждой строкой.

   Тема тёмная по умолчанию. Светлая включается системной настройкой либо
   переключателем: он ставит data-theme на <html> и переживает перезагрузку. */

:root {
  color-scheme: dark;

  --bg:        #0B0C0E;
  --bg-lift:   #131519;
  --ink:       #F2F4F3;
  --ink-2:     #A8B0AE;
  --ink-3:     #7C8583;
  --rule:      #23272B;
  --rule-2:    #343A3E;

  --clay:      #E4703F;
  --grass:     #57B45F;
  --hard:      #3E9BE0;
  --accent:    var(--hard);
  --on-accent: #08090A;

  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --text:    "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --gut: clamp(18px, 3.4vw, 52px);
  --maxw: 1400px;
}

/* Светлая палитра описана дважды: для системной настройки и для явного
   выбора в переключателе. Значения обязаны совпадать. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #FBFBFA; --bg-lift: #F1F2F0; --ink: #0E1012; --ink-2: #4B5457;
    --ink-3: #656D70; --rule: #E0E3E1; --rule-2: #C7CCC9;
    --clay: #C2521F; --grass: #2F7A38; --hard: #1466A8; --on-accent: #FFFFFF;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FBFBFA; --bg-lift: #F1F2F0; --ink: #0E1012; --ink-2: #4B5457;
  --ink-3: #656D70; --rule: #E0E3E1; --rule-2: #C7CCC9;
  --clay: #C2521F; --grass: #2F7A38; --hard: #1466A8; --on-accent: #FFFFFF;
}

.s-clay  { --accent: var(--clay); }
.s-grass { --accent: var(--grass); }
.s-hard  { --accent: var(--hard); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* =============================================================== шапка */

.top { border-bottom: 1px solid var(--rule); }
.top .bar {
  max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut);
  height: 58px; display: flex; align-items: center; gap: 22px;
}
.mark { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.045em; }
.top nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.top nav a { font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }

.theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; cursor: pointer;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--rule-2);
}
.theme:hover { color: var(--ink); border-color: var(--ink); }
.theme svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .moon,
:root:not([data-theme="dark"]) .theme .moon { display: block; }
:root[data-theme="light"] .theme .sun,
:root:not([data-theme="dark"]) .theme .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .moon { display: none; }
  :root:not([data-theme="light"]) .theme .sun { display: block; }
}

/* =========================================================== хлебные крошки */

.crumbs { padding-top: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule-2); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

/* =============================================================== герой */

.hero { padding-block: clamp(24px, 3.4vw, 44px) clamp(24px, 3.4vw, 44px); }
.hero .status {
  display: inline-flex; align-items: center;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(38px, 6.4vw, 92px);
  line-height: 0.9; letter-spacing: -0.045em; margin: 0; text-wrap: balance;
}
.hero .sub { margin: 16px 0 0; max-width: 52ch; font-size: 17px; color: var(--ink-2); }
.hero .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.hero.compact { padding-block: clamp(18px, 2.4vw, 30px) clamp(18px, 2.4vw, 28px); }
.hero.compact h1 { font-size: clamp(30px, 4vw, 52px); line-height: 0.95; }
.hero.compact .sub { margin-top: 12px; font-size: 16px; }

.band { height: 8px; background: var(--accent); }

/* ============================================================== кнопки */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 20px; font-size: 15px; font-weight: 600;
  background: var(--ink); color: var(--bg);
  transition: opacity .12s ease;
}
.btn:hover { color: var(--bg); opacity: .85; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); }
.btn.ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); opacity: 1; }

/* ============================================================== секции */

section { padding-block: clamp(30px, 3.6vw, 52px); }
section + section { border-top: 1px solid var(--rule); }

h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(23px, 2.4vw, 32px);
  line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 18px; text-wrap: balance;
}
h3 { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; margin: 0 0 8px; }

.prose { max-width: 68ch; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ================================================ компактная строка фактов */

.strip { display: flex; flex-wrap: wrap; gap: 0; border-block: 1px solid var(--rule); }
.strip > div { padding: 12px 22px 12px 0; margin-right: 22px; border-right: 1px solid var(--rule); }
.strip > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.strip .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.strip .v { font-size: 16px; font-weight: 600; margin-top: 3px; }
.strip .v.num { font-weight: 500; }

/* =============================================================== списки */

.list { display: grid; gap: 1px; }
.list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  align-items: baseline; padding: 13px 16px; background: var(--bg-lift);
}
.list a:hover { background: var(--accent); color: var(--on-accent); }
.list a:hover .meta { color: var(--on-accent); }
.list .name { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.list .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ============================================================== рейтинг */

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3);
  padding: 0 14px 10px 0; border-bottom: 1px solid var(--rule-2);
}
.tbl td { padding: 11px 14px 11px 0; vertical-align: baseline; }
.tbl tbody tr + tr td { border-top: 1px solid var(--rule); }
.tbl .pos { font-family: var(--mono); font-size: 16px; font-weight: 500; width: 50px; }
.tbl .who { font-weight: 600; font-size: 16px; }
.tbl tbody tr:first-child .pos, .tbl tbody tr:first-child .who { color: var(--accent); }
.tbl .pts { font-family: var(--mono); font-size: 15px; text-align: right; white-space: nowrap; }
.tbl .thin { color: var(--ink-3); font-family: var(--mono); font-size: 13px; }
.tbl .mv { font-family: var(--mono); font-size: 13px; width: 60px; }
.tbl .up { color: var(--grass); }
.tbl .dn { color: var(--clay); }
.tbl td.right, .tbl th.right { text-align: right; }

/* ================================================================ сетка */

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.legend span, .legend b {
  font-family: var(--mono); font-size: 12px; font-weight: 400;
  padding: 6px 11px; color: var(--ink-3); background: var(--bg-lift);
}
.legend b { color: var(--on-accent); background: var(--accent); font-weight: 500; }

.bracket { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: clamp(12px, 1.4vw, 24px); overflow-x: auto; }
.bracket .col > h3 {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px;
}
.bracket .stack { display: flex; flex-direction: column; }

/* Высота матча фиксирована: по ней генератор считает отступы раундов.
   Менять только вместе с константой H в tools/build.js. */
.tie {
  height: 76px; display: flex; flex-direction: column; justify-content: center;
  background: var(--bg-lift); padding: 0 13px;
}
.tie.decider { box-shadow: inset 3px 0 0 var(--accent); }
.tie .side { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 3px 0; }
.tie .sd { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.tie .nm { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tie .sc { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.tie .sc sup { font-size: 9px; }
.tie .won .nm { font-weight: 600; }
.tie .lost .nm, .tie .lost .sc { color: var(--ink-3); }
.tie .empty { color: var(--ink-3); }

/* ======================================================= где смотреть */

.where { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; }
.where > div { background: var(--bg-lift); padding: 16px 18px; }
.where .place { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.where .who { font-weight: 600; font-size: 17px; }
.where .todo { color: var(--ink-3); font-weight: 400; }

.offer {
  margin-top: 26px; background: var(--accent); color: var(--on-accent);
  padding: clamp(20px, 2.6vw, 32px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: center;
}
.offer h3 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.08; margin: 0 0 8px; }
.offer p { margin: 0; max-width: 58ch; font-size: 15.5px; opacity: .9; }
.offer .btn { background: var(--on-accent); color: var(--accent); }
.offer .btn:hover { color: var(--accent); }
.fineprint { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.fineprint a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* ================================================================ вопросы */

.qa { display: grid; gap: 1px; max-width: 900px; }
.qa > div { background: var(--bg-lift); padding: 18px 20px; }
.qa h3 { margin: 0 0 6px; font-size: 17px; }
.qa p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; max-width: 68ch; }

/* ================================================================ подвал */

footer.site { border-top: 1px solid var(--rule); padding-block: 34px 44px; margin-top: 8px; }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px 20px; }
footer.site h4 { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
footer.site ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
footer.site li a { font-size: 14.5px; color: var(--ink-2); }
footer.site li a:hover { color: var(--ink); }
footer.site .base { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }

/* =============================================================== мобилка */

@media (max-width: 1080px) {
  .bracket { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .bracket .stack { gap: 1px !important; padding-top: 0 !important; }
  .offer { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .top .bar { height: 52px; gap: 12px; }
  .top nav { gap: 14px; }
  .top nav a { font-size: 13px; }
  .tbl .thin, .tbl th.thin { display: none; }
  .strip > div { padding-right: 16px; margin-right: 16px; }
  .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
