/* Цвета, шрифт и радиус — из design/tokens.json (node tools/tokens.mjs). Блоки между метками руками не править. */
:root {
  /* tokens:light */
  --accent: #5b4be6;
  --accent-strong: #4a3bd1;
  --accent-soft: rgba(91, 75, 230, 0.14);
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef0f5;
  --line: #e1e4ea;
  --text: #14161b;
  --muted: #555c6b;
  --faint: #666b7f;
  --pos: #0b8a4d;
  --pos-soft: rgba(11, 138, 77, 0.14);
  --neg: #c93636;
  --warn: #b45309;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  /* /tokens */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  /* tokens:dark */
  --accent: #8f82ff;
  --accent-strong: #a094ff;
  --accent-soft: rgba(143, 130, 255, 0.18);
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #272b34;
  --line: #2c3040;
  --text: #eef0f6;
  --muted: #a4a8bb;
  --faint: #8e92a8;
  --pos: #45d08f;
  --pos-soft: rgba(69, 208, 143, 0.16);
  --neg: #ff7676;
  --warn: #f0b429;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  /* /tokens */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; padding-bottom: calc(64px + var(--safe-bottom)); }
button { font: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.top-right { display: flex; align-items: center; gap: 8px; }
.invite { border: 0; border-radius: 999px; padding: 4px 10px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.logo { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); position: relative; }
.logo::after { content: ""; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; box-shadow: 4px 4px 0 -1px #fff; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.view { padding: 0 16px 16px; max-width: 720px; margin: 0 auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; touch-action: pan-x; }
/* Горизонтальные жесты в ленте — переключение вкладок приложения, а не прокрутка или «назад» браузера. */
#view { touch-action: pan-y pinch-zoom; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Фильтр «Все / Лайв / Скоро», сортировка и поиск над списком матчей */
.controls { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; }
.seg { display: inline-flex; flex: 1; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.seg button { flex: 1; padding: 7px 0; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--accent); color: #fff; }
.controls select { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
.search { width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.btn.more { display: block; width: 100%; margin: 2px 0 10px; }
.badges { display: inline-flex; gap: 4px; vertical-align: middle; }
.badges .badge { font-size: 11px; }
.badge.hot { background: var(--surface-2); color: var(--warn); }
.badge.warn { background: var(--surface-2); background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.soft { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.card.accent { border-color: var(--accent); }
.kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.match { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; color: inherit; box-shadow: var(--shadow); }
.match:active { transform: scale(.995); }
.match .when { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.match .teams { font-weight: 650; font-size: 15.5px; }
.match .odds { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; margin-top: 8px; }
.odd { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.odd b { font-size: 15px; }
.odd.fav { background: var(--accent-soft); }
.odd small { color: var(--muted); font-size: 11px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn:active { background: var(--accent-strong); }
.btn[disabled] { opacity: .55; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.prob { display: grid; grid-template-columns: minmax(70px, 1fr) 50px 1fr 52px; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.prob .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prob.pick { cursor: pointer; border-radius: 10px; padding: 6px 6px; margin: 0 -6px; }
.prob.pick:active { background: var(--surface-2); }
.prob.pick.on { background: var(--accent-soft); }
.prob.pick.on .name::before { content: '✓ '; color: var(--accent); font-weight: 700; }
.leg { display: grid; grid-template-columns: 1fr auto 28px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.leg:last-of-type { border-bottom: 0; }
.leg .t { min-width: 0; display: flex; flex-direction: column; }
.leg .t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg .t span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg .o { font-weight: 700; }
.leg .x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
table.kv { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
table.kv td { padding: 4px 0; }
table.kv td:last-child { text-align: right; font-weight: 700; }
table.kv td.neg { color: var(--neg, #c0392b); }
.prob .odd-v { color: var(--muted); text-align: right; }
.prob .pct { text-align: right; font-weight: 700; }
.track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.track u { position: absolute; top: -2px; width: 2px; height: 10px; background: var(--text); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 7px 4px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.best { color: var(--pos); font-weight: 700; }
.gain { margin-top: 8px; font-size: 13px; }
.gain b { color: var(--pos); }
.partner { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.partner .row { margin: 6px 0; }
.list { margin: 0; padding-left: 18px; }
.list li { margin: 4px 0; }
.fact { font-size: 13px; margin: 6px 0; }
details.profile { margin: 8px 0; padding: 6px 0; border-top: 1px solid var(--line); }
details.profile summary { cursor: pointer; font-size: 14px; list-style: none; }
details.profile summary::after { content: ' ▾'; color: var(--muted); }
details.profile[open] summary::after { content: ' ▴'; }
.fact b { color: var(--accent); margin-right: 4px; }
details summary { cursor: pointer; font-weight: 600; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); z-index: 6; }
/* На широком экране (веб-версия на компьютере) вкладки стоят под колонкой, а не растянуты на всю ширину окна. */
@media (min-width: 720px) { .tabs { padding-left: calc(50% - 280px); padding-right: calc(50% - 280px); } }
.tabs button { flex: 1; min-height: 56px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.tabs button.on { color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(76px + var(--safe-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; z-index: 9; box-shadow: var(--shadow); }
.field { margin: 10px 0; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.skeleton { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin-bottom: 10px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.back { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px 0; margin-bottom: 4px; }
.foot { padding: 16px 0 8px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.big { font-size: 28px; font-weight: 750; }
.match .when .live-dot { color: var(--neg, #e5484d); font-weight: 600; }
