/* =====================================================================
   SportAI UI-kit 18.11 — дизайн-система v11 на структуре версии 18.11.
   Подключается последним, после type-hierarchy.css. Разметку и тексты 18.11 не меняет.
   Живой справочник: ui-kit-1811.html.

   Что взято из v11: цвета (графит, светлые поверхности), шрифты Geist / Geist Mono,
   срезанные углы (--cut-s 6 · --cut 10 · --cut-l 16 · --cut-xl 28), кнопки Primary / Secondary, Action-ссылки, чипы.
   Что осталось от 18.11: структура страниц, тексты и шкала заголовков (H1 64/40 · H2 40/28 · H3 24/20 · H4 16 · body 15).
   Тёмные панели — только у графиков: так линии контрастные и чёткие.
   ===================================================================== */
@font-face { font-family: "Geist"; src: url("../fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* v11 */
  --ds-bg: #f3f4f5; --ds-s0: #ffffff; --ds-s1: #f8f9fa; --ds-s2: #eceef0; --ds-s3: #e2e5e8; --ds-s4: #d3d8dc;
  --ds-line: rgba(17,20,23,.12); --ds-line-2: rgba(17,20,23,.2); --ds-line-3: rgba(17,20,23,.34);
  --ds-ink: #111417; --ds-ink-2: #3b4248; --ds-ink-3: #5c656d; --ds-ink-4: #9aa3ab;
  --ds-action: #14171b; --ds-action-hover: #2b3137; --ds-action-ink: #ffffff;
  --ds-pos: #11704d; --ds-pos-soft: #e3f3ec; --ds-warn: #8a6410; --ds-warn-soft: #f6efdc; --ds-neg: #b23b3b; --ds-neg-soft: #f8e6e6;
  --ds-dark: #13161a; --ds-dark-2: #21262c; --ds-dark-line: rgba(238,241,243,.12); --ds-dark-ink: #eef1f3; --ds-dark-ink-2: #b4bcc3;
  --ds-dark-pos: #7fdcb4; --ds-dark-neg: #e3a0a0;
  --ds-data-1: #7fdcb4; --ds-data-2: #8fb3d9; --ds-data-3: #eef1f3;
  --ds-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ds-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --cut-s: 6px; --cut: 10px; --cut-l: 16px; --cut-xl: 28px;

  /* переменные 18.11 → значения v11 */
  --paper: var(--ds-bg); --white: var(--ds-s0); --ink: var(--ds-ink); --muted: var(--ds-ink-3);
  --line: #d5d9dd; --sage: var(--ds-s1); --sage-line: #d5d9dd;
  --green: var(--ds-pos); --green-soft: var(--ds-pos-soft); --red: var(--ds-neg); --orange: var(--ds-ink); --rust: var(--ds-action);
  font-family: var(--ds-sans);
}
@media (max-width: 760px) { :root { --cut-l: 12px; --cut-xl: 18px; } }

html, body, button, input, select, textarea { font-family: var(--ds-sans) !important; }
body { background: var(--ds-bg) !important; color: var(--ds-ink); }

/* ---------- срезанный угол: верхний левый и нижний правый ---------- */
.cut, .game-spotlight, .ranking-desk, .earning-guide, .factor, .forecast, .editorial-pick, .match-money, .directory-kpis > div,
.partner-option, .analysis-lead, .analysis-link, .model-about, .league-strip, .forecast-release, .stat-surface,
.btn, .home-action, .directory-action, .forecast-subscribe, .league-tabs button, .status, .stage-options > *,
.portal-fixture span[class]:not(.portal-match):not(.portal-league-label):not(.portal-time),
.comparison-chart, .model-comparison select, .model-comparison button, .directory-filters select, .directory-filters button {
  --c: var(--cut);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}
.game-spotlight, .ranking-desk, .earning-guide, .factor, .forecast, .editorial-pick, .match-money, .directory-kpis > div,
.partner-option, .analysis-lead, .analysis-link, .model-about, .stat-surface, .forecast-release { --c: var(--cut-l); }
.comparison-chart { --c: var(--cut); }
.league-tabs button, .status, .portal-fixture span[class]:not(.portal-match):not(.portal-league-label):not(.portal-time) { --c: var(--cut-s); }

/* ---------- поверхности ---------- */
.game-spotlight, .ranking-desk, .earning-guide, .factor, .forecast, .partner-option, .analysis-lead, .analysis-link,
.model-about, .league-strip, .directory-kpis > div, .stat-surface {
  background: var(--ds-s0) !important; border: 1px solid var(--ds-line-2) !important; border-top-width: 1px !important;
}
.spotlight-pick { background: var(--ds-s1) !important; border-left: 1px solid var(--ds-line) !important; }
.spotlight-return { background: var(--ds-pos-soft) !important; border: 0 !important; color: var(--ds-pos) !important; }
.spotlight-return strong, .spotlight-return span { color: var(--ds-pos) !important; }
.editorial-pick { background: var(--ds-s0) !important; border: 1px solid var(--ds-line-2) !important; }
.match-money { background: var(--ds-s1) !important; border: 0 !important; }
.forecast-release { background: var(--ds-s2) !important; border: 0 !important; }
.partner-api { background: var(--ds-s1) !important; }
.model-comparison { background: var(--ds-s0) !important; border: 1px solid var(--ds-line-2) !important; border-top: 1px solid var(--ds-line-2) !important;
  --c: var(--cut-xl); clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); }
.comparison-bank { background: var(--ds-s1) !important; border: 0 !important; }
.directory-table thead { background: var(--ds-s1) !important; }
.directory-kpis > div:has(dd.positive) { background: var(--ds-s0) !important; border-color: var(--ds-line-2) !important; }
.portal-home .games-desk { border-top: 2px solid var(--ds-ink) !important; }

/* ---------- цвет текста: без ржавого, акцент — графит; результат — зелёный/красный ---------- */
.eyebrow, .rank-period, .line-link, .spotlight-link, .forecast-byline a, .spotlight-pick p a, .earning-example-head p a,
.rank-footer, .comparison-heading a, .comparison-footer a, .next-release, .directory-table td a, .partner-who, .match-first-outcome .publication strong {
  color: var(--ds-ink) !important;
}
.eyebrow, .rank-period { color: var(--ds-ink-3) !important; }
.positive, .comparison-positive { color: var(--ds-pos) !important; }
.negative, .comparison-negative { color: var(--ds-neg) !important; }
.logo span { color: var(--ds-ink) !important; }
.portal-header a:hover, a:hover { color: var(--ds-ink-2); }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--ds-ink) !important; outline-offset: 3px; }

/* ---------- цифры — Geist Mono ---------- */
.portal-time, .update-meta time,
.portal-rank td:not(:first-child), .directory-table td.number, .comparison-statistics td:not(:first-child), .forecast-calculator dd {
  font-family: var(--ds-mono) !important; font-variant-numeric: tabular-nums; letter-spacing: -.02em !important;
}

/* ---------- кнопки ---------- */
.btn, .home-action, .directory-action, .forecast-subscribe {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px !important; border: 1px solid transparent !important;
  font: 600 15px/1.2 var(--ds-sans) !important; letter-spacing: 0 !important; white-space: nowrap; text-decoration: none !important; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn-primary, .home-action, .directory-action, .forecast-subscribe { background: var(--ds-action) !important; color: var(--ds-action-ink) !important; }
.btn-primary:hover, .home-action:hover, .directory-action:hover, .forecast-subscribe:hover { background: var(--ds-action-hover) !important; color: #fff !important; }
.btn-secondary, .directory-favorite { background: var(--ds-s0) !important; color: var(--ds-ink) !important; border-color: var(--ds-line-3) !important; }
.btn-secondary:hover, .directory-favorite:hover { background: var(--ds-s2) !important; color: var(--ds-ink) !important; }
.btn-link, .line-link, .spotlight-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ds-ink) !important;
  font: 600 15px/1.3 var(--ds-sans) !important; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.btn-link:hover, .line-link:hover, .spotlight-link:hover { text-decoration-thickness: 2px; }

/* CTA внизу блока: одна главная кнопка + вторичное действие + пояснение */
.block-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.cta-note { display: block; color: var(--ds-ink-3); font-size: 12px !important; line-height: 1.3 !important; }
.block-cta .cta-note { flex-basis: 100%; }
.rank-footer.block-cta { color: inherit !important; font-size: 15px; }
p.cta-note { margin-top: 8px; }
.page-cta { margin: 20px 0 4px; }
.earning-guide .block-cta { margin-top: 18px; }
@media (max-width: 760px) { .block-cta .btn { width: 100%; } }

/* ---------- переключатели, поля, чипы ---------- */
.league-tabs button { background: var(--ds-s2) !important; color: var(--ds-ink-2) !important; border: 0 !important; min-height: 36px; padding: 0 12px !important; font-weight: 600 !important; }
.league-tabs button[aria-pressed="true"] { background: var(--ds-action) !important; color: #fff !important; }
.model-comparison select, .model-comparison button, .directory-filters select, .directory-filters button, .partner-model-choice select {
  background: var(--ds-s0) !important; border: 1px solid var(--ds-line-3) !important; color: var(--ds-ink) !important; border-radius: 0 !important;
}
.comparison-metrics button[aria-pressed="true"], [data-comparison-stake][aria-pressed="true"] { background: var(--ds-action) !important; color: #fff !important; border-color: var(--ds-action) !important; }
.comparison-models label { background: var(--ds-s0) !important; border-color: var(--ds-line-3) !important; }
.status, .portal-fixture span[class]:not(.portal-match):not(.portal-league-label):not(.portal-time) { border: 0 !important; font-weight: 600 !important; }
.portal-fixture .won, .settled-badge.won { background: var(--ds-pos-soft) !important; color: var(--ds-pos) !important; }
.portal-fixture .lost, .settled-badge.lost { background: var(--ds-neg-soft) !important; color: var(--ds-neg) !important; }
.portal-fixture .waiting { background: var(--ds-warn-soft) !important; color: var(--ds-warn) !important; }
.portal-fixture .open { background: var(--ds-s2) !important; color: var(--ds-ink) !important; }
.edition p:first-child span { background: var(--ds-s2) !important; color: var(--ds-ink-3) !important; }

/* =====================================================================
   Графики — тёмная панель, контрастные линии, анимация прорисовки (league-khl-preview-chart.js)
   ===================================================================== */
.comparison-chart {
  display: block; box-sizing: border-box; padding: 0; background: var(--ds-dark) !important;
  --chart-label: #b4bcc3; --chart-grid: rgba(238,241,243,.10); --chart-zero: rgba(238,241,243,.42);
  --chart-s1: #7fdcb4; --chart-s2: #8fb3d9; --chart-s3: #eef1f3; --chart-line: 2.6;
  --chart-font: 500 12px "Geist Mono", ui-monospace, monospace;
}
.model-comparison .comparison-chart { height: 280px !important; }
.model-comparison[data-model-comparison="league"] .comparison-chart { height: 220px !important; }
.comparison-chart-heading { margin-bottom: 10px !important; }
/* легенда в цветах тёмного графика */
.comparison-models label:nth-child(1) .comparison-dot, .comparison-statistics tbody tr:nth-child(1) .comparison-dot { background: #2f9e74 !important; }
.comparison-models label:nth-child(2) .comparison-dot, .comparison-statistics tbody tr:nth-child(2) .comparison-dot { background: #5b86b8 !important; }
.comparison-models label:nth-child(3) .comparison-dot, .comparison-statistics tbody tr:nth-child(3) .comparison-dot { background: var(--ds-ink) !important; }
.comparison-dot { height: 4px !important; width: 16px !important; }
/* столбики статистики на странице матча — тоже тёмная панель */
.stat-surface:has(.shot-bars), figure:has(> .shot-bars) { background: var(--ds-dark) !important; color: var(--ds-dark-ink) !important; border: 0 !important; }
.shot-bars i { background: #5d6770 !important; animation: bar-grow .8s cubic-bezier(.16,1,.3,1) both; transform-origin: bottom; }
.shot-bars li:nth-last-child(-n+3) i { background: var(--ds-data-1) !important; }
.shot-bars li { color: var(--ds-dark-ink-2) !important; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .shot-bars i { animation: none; } }

/* крупные цифры — Geist с табличными цифрами (моно оставляем для таблиц и времени) */
.metric b, .spotlight-return strong, .match-money-heading b, .directory-kpis dd, .spotlight-pick strong { font-family: var(--ds-sans) !important; font-variant-numeric: tabular-nums; }
/* одна главная кнопка в блоке: Telegram и «Журнал модели» — вторичные */
.forecast-subscribe, .directory-links .directory-action:not(.directory-favorite) { background: var(--ds-s0) !important; color: var(--ds-ink) !important; border-color: var(--ds-line-3) !important; }
.forecast-subscribe:hover, .directory-links .directory-action:not(.directory-favorite):hover { background: var(--ds-s2) !important; color: var(--ds-ink) !important; }
