/* FREEBET SCANNER // RAZOR — тестовый дизайн (без внешних CDN) */

:root {
  --bg: #020406;
  --panel: #080c10;
  --lime: #a3e635;
  --orange: #f97316;
  --amber: #fbbf24;
  --text: #f8fafc;
  --muted: #94a3b8;
  --dim: #64748b;
  --line: rgba(255, 255, 255, 0.07);
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --accent: var(--lime);
  --accent-rgb: 163, 230, 53;
  --accent-soft: #bef264;
  --accent-deep: #34d399;
  --secondary: var(--orange);
  --secondary-rgb: 249, 115, 22;
  --secondary-soft: #fdba74;
}

body[data-mode="cash"] {
  --accent: #38bdf8;
  --accent-rgb: 56, 189, 248;
  --accent-soft: #bae6fd;
  --accent-deep: #0284c7;
  --secondary: #818cf8;
  --secondary-rgb: 129, 140, 248;
  --secondary-soft: #c7d2fe;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(circle at 10% 15%, rgba(var(--accent-rgb), 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(var(--secondary-rgb), 0.10) 0%, transparent 48%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  overflow-x: hidden;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

.lime { color: var(--accent); }
.orange { color: var(--secondary); }
.mode-accent { color: var(--accent); }
.amber { color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* Геометрия лезвий */
.blade-tile { clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.blade-btn { clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.blade-chip { clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.blade-modal { clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }

.blade-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.4) 0%, rgba(255, 255, 255, 0.06) 40%, transparent 100%);
}

/* Шапка */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid var(--line);
  padding: 10px 24px;
}

.topbar-inner {
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  transform: rotate(45deg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.brand h1, .brand-name {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }

.status-line {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.chip, .chip-btn {
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chip:hover, .chip-btn:hover { color: #fff; }

.chip.active {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  box-shadow: none;
}

.chip-btn.accent {
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-soft);
}

.chip-btn.accent:hover { background: var(--accent); color: #000; }

.counter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  padding: 6px 12px;
  background: rgba(var(--accent-rgb), 0.08);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

/* Основная сцена */
.scene {
  position: relative;
  z-index: 10;
  max-width: 1520px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

/* Два режима одного рабочего пульта. */
.scanner-panel {
  margin-bottom: 20px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-top-color: rgba(var(--accent-rgb), 0.42);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.mode-tab {
  position: relative;
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.mode-tab + .mode-tab { border-left: 1px solid var(--line); }
.mode-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.mode-tab.active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.13), rgba(var(--accent-rgb), 0.055));
  box-shadow: inset 0 2px var(--accent);
}
.mode-tab.active::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}

.mode-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font: 900 16px var(--font-mono);
  transform: skew(-8deg);
}

.mode-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mode-copy strong { font-size: 12px; font-style: italic; letter-spacing: 0.035em; white-space: nowrap; }
.mode-copy small { color: var(--muted); font: 10px var(--font-mono); white-space: normal; }

.console {
  display: grid;
  grid-template-columns: 5fr 7fr;
  grid-template-rows: auto auto 120px auto;
  align-items: stretch;
  column-gap: 40px;
  padding: 0;
}

.wing { display: contents; }
.wing.right { position: relative; }
.mode-switch { grid-column: 1; grid-row: 1; }
.wing:not(.right) > .wing-heading { grid-column: 1; grid-row: 2; }
.wing:not(.right) > .freebet-row { grid-column: 1; grid-row: 3; }
.wing:not(.right) > .slider-block { grid-column: 1; grid-row: 4; }
.wing.right > .wing-heading { grid-column: 2; grid-row: 2; }
.wing.right > .bk-grid { grid-column: 2; grid-row: 3; }
.wing.right > .slider-block { grid-column: 2; grid-row: 4; }

.wing-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 12px;
  min-height: 34px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.wing-kicker { grid-column: 1 / -1; color: var(--dim); font: 10px var(--font-mono); letter-spacing: 0.12em; }
.wing-heading strong { color: var(--accent); font-size: 13px; font-style: italic; letter-spacing: 0.04em; }
.wing-heading > span:last-child { color: var(--muted); font: 11px var(--font-mono); text-align: right; }

/* выравнивание левого и правого блоков: подписи и ползунки на одном уровне */
.slider-block { min-height: 54px; }
.slider-row { align-items: center; }

.freebet-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 120px;
}

.primary-pair { display: flex; align-items: center; justify-content: center; }

.big-word {
  font-size: clamp(40px, 5.6vw, 72px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
}

.mode-accent { color: var(--accent); }

.fb-tile {
  position: relative;
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.045);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.fb-tile:hover { background: rgba(var(--accent-rgb), 0.11); border-color: var(--accent); transform: translateY(-2px); }
.fb-tile[aria-expanded="true"] { background: rgba(var(--accent-rgb), 0.13); border-color: var(--accent); }

.fb-tile-logo { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; }
.fb-tile-logo .bk-logo {
  width: 100%;
  height: 100%;
  background: none;
}

.fb-tile-logo .bk-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fb-tile-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.fb-tile-chevron {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #071008;
  font: 900 23px/1 var(--font-display);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  transition: transform 180ms ease;
}

.fb-tile[aria-expanded="true"] .fb-tile-chevron { transform: rotate(180deg); }

.bk-grid {
  display: grid;
  grid-template-columns: repeat(8, 64px);
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
}

/* Верхние селекторы обоих плеч имеют одинаковую высоту. */
.wing.right > .bk-grid {
  height: 120px;
  align-content: center;
  align-items: center;
}

.bk-tile {
  min-width: 0;
  width: 100%;
  height: 62px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2px;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.bk-tile:hover { transform: translateY(-3px); }

/* неактивная (выключенная) плитка — приглушена */
.bk-tile:not(.active) { opacity: 0.15; filter: grayscale(0.6); }

.bk-tile.active {
  opacity: 1;
}

.bk-tile-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bk-logo {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Betby не имеет локального растрового файла: знак остаётся встроенным,
   поэтому фильтр и карточки не зависят от внешнего CDN или broken image. */
.bk-logo-betby {
  color: #f5efff;
}

.bk-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #f8f3ff;
  background: linear-gradient(135deg, #9c6cff, #5630b5);
  border: 1px solid rgba(219, 199, 255, 0.75);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(112, 70, 205, 0.38);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.bk-tile .bk-logo-mark {
  font-size: 16px;
}

.odd-logo .bk-logo-mark {
  border-radius: 4px;
  font-size: 8px;
}

/* логотип в плитке БК — на всю доступную ширину, без рамки/фона */
.bk-tile .bk-logo {
  width: 54px;
  height: 42px;
  flex: 0 1 42px;
  min-height: 0;
  background: none;
}

.bk-tile .bk-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.bk-tile .bk-logo-fallback {
  background: none;
  font-size: 22px;
}

.fb-book-menu {
  position: absolute;
  z-index: 45;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  width: 100%;
  padding: 12px;
  background: rgba(10, 12, 10, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  grid-template-columns: repeat(8, 56px);
}

.fb-book-menu[hidden], .market-menu[hidden] { display: none; }
.fb-book-menu .bk-tile { height: 56px; }
.fb-book-menu .bk-tile .bk-logo { width: 46px; height: 36px; flex-basis: 36px; }
.fb-book-menu .bk-tile.inactive { opacity: 0.65; }
.fb-book-menu .bk-tile.active { background: rgba(var(--accent-rgb), 0.12); }

.bk-logo img { width: 100%; height: 100%; object-fit: contain; }

.bk-logo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 13px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.bk-logo.noimg img { display: none; }
.bk-logo.noimg .bk-logo-fallback { display: flex; }

.odd-logo .bk-logo { width: 26px; height: 26px; }

.slider-caption {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 6px;
}

.slider-caption .lime, .slider-caption .orange { font-weight: 700; }

.slider-row { display: flex; align-items: center; gap: 12px; }

.val-chip {
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  min-width: 56px;
  text-align: center;
}

.range-holder { position: relative; flex: 1; height: 24px; }

.range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.range-fill {
  position: absolute;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.range-fill.fb { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.range-fill.hg { background: linear-gradient(90deg, var(--accent), var(--secondary)); }

.range-holder input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.range-holder input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 22px;
  background: var(--accent);
  border: 2px solid #000;
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.75);
  cursor: grab;
  transition: transform 0.15s ease;
}

.range-holder input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); background: #fff; }

.range-holder input[type="range"].hedge-thumb::-webkit-slider-thumb {
  background: var(--secondary);
  box-shadow: 0 0 18px rgba(var(--secondary-rgb), 0.75);
}

.range-holder input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 20px;
  background: var(--accent);
  border: 2px solid #000;
  border-radius: 0;
  cursor: grab;
}

.range-holder input[type="range"].hedge-thumb::-moz-range-thumb { background: var(--secondary); }

/* Фильтр-бар */
.filter-bar {
  position: sticky;
  top: var(--topbar-h, 48px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 10px 24px;
  margin: 0 -24px 12px;
  background: rgba(2, 4, 6, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.muted-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 6px;
}

.blade-select {
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  background: rgba(255, 255, 255, 0.05);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
}

.blade-select select {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
}

.blade-select select option { background: var(--panel); color: #fff; font-style: normal; }

.search-input {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  min-width: 220px;
  outline: none;
}

.search-input::placeholder { color: var(--dim); }
.search-input:focus { background: rgba(var(--accent-rgb), 0.06); }

.status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 8px 2px;
}

/* Таблица матчей */
.matches { display: flex; flex-direction: column; }
.matches { scroll-margin-top: calc(var(--topbar-h, 48px) + var(--filter-h, 60px) + 44px); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.pagination[hidden] { display: none; }
.pagination .chip, .pagination .chip-btn { min-width: 42px; text-align: center; }
.pagination button:disabled { opacity: 0.35; cursor: default; }
.page-gap { min-width: 20px; text-align: center; color: var(--dim); font-family: var(--font-mono); }

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 12px;
  margin: 0 -12px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  animation: row-in 260ms ease-out both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
}

.match-row:hover { transform: translateX(6px); background: rgba(255, 255, 255, 0.025); }
.match-row:active { transform: translateX(6px) scale(0.995); }

.match-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 280px;
}

.sport-chip {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.2s ease;
}

.match-row:hover .sport-chip { background: rgba(var(--accent-rgb), 0.2); }

.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.t-time { color: #fff; font-weight: 700; }
.t-left { color: var(--accent); font-weight: 700; font-size: 11px; }
.t-market { color: var(--dim); font-size: 11px; text-transform: uppercase; }

.match-teams {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.match-row:hover .match-teams { color: var(--accent); }
.match-teams .sep { color: var(--dim); font-style: normal; font-weight: 400; margin: 0 4px; }

.match-league {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.match-odds { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }

.vs-mark {
  font-family: var(--font-mono);
  font-weight: 900;
  font-style: italic;
  font-size: 14px;
  color: var(--dim);
  letter-spacing: 0.1em;
  user-select: none;
}

.odd-btn {
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.odd-btn:hover { filter: brightness(1.3); }

.odd-btn.fb {
  background: rgba(16, 185, 129, 0.15);
  border-left: 2px solid var(--accent);
}

.odd-btn.hedge { background: rgba(255, 255, 255, 0.05); }

.o-role {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.odd-btn.fb .o-role { color: var(--accent-soft); }
.odd-btn.hedge .o-role { color: var(--muted); }

.o-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 900;
}

.odd-btn.fb .o-val { color: var(--accent); }
.odd-btn.hedge .o-val { color: #fff; }

.copy-btn {
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-btn:hover { background: rgba(var(--accent-rgb), 0.2); color: var(--accent); }

.yield {
  font-family: var(--font-mono);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 34px);
  color: var(--accent);
  padding-left: 10px;
  min-width: 120px;
  text-align: right;
  text-shadow: 0 0 15px rgba(var(--accent-rgb), 0.3);
}

.yield.neg { color: var(--secondary); text-shadow: none; }

.yield-label {
  display: block;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-shadow: none;
  margin-bottom: 2px;
}

.empty-state {
  padding: 64px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--dim);
}

.empty-state small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: none;
}

/* Липкая шапка таблицы: легенда колонок */
.table-head {
  position: sticky;
  top: calc(var(--topbar-h, 48px) + var(--filter-h, 60px));
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 -24px;
  padding: 8px 24px;
  background: rgba(2, 4, 6, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}

.th-event { flex: 1; min-width: 280px; }
.th-legs { margin-left: auto; }
.th-yield { min-width: 120px; text-align: right; color: var(--muted); }
.table-head[hidden] { display: none; }

/* Скелетон загрузки */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 12px;
  margin: 0 -12px;
}

.sk {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.1s linear infinite;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

@keyframes sk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.sk-chip { width: 42px; height: 42px; flex: 0 0 42px; }
.sk-lines { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 12px; }
.sk-line.w40 { width: 40%; }
.sk-line.w70 { width: 70%; }
.sk-odd { width: 96px; height: 38px; flex: 0 0 96px; }
.sk-yield { width: 110px; height: 30px; margin-left: auto; }

/* Превью денежного режима */
.cash-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  opacity: 0.5;
  filter: saturate(0.5);
}

.cash-preview .odd-btn { cursor: default; }
.cash-preview .yield { min-width: 0; font-size: 26px; }

.mode-placeholder {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  text-align: center;
  animation: mode-in 180ms ease-out;
}

.mode-placeholder-icon { color: var(--accent); font: 900 clamp(32px, 6vw, 58px) var(--font-mono); letter-spacing: -0.08em; }
.mode-placeholder h2 { margin: 20px 0 10px; color: var(--text); font-size: clamp(23px, 4vw, 34px); font-style: italic; }
.mode-placeholder p { max-width: 520px; margin: 0 0 12px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.mode-placeholder small { color: var(--dim); font: 11px/1.6 var(--font-mono); }

@keyframes mode-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Модалки */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal-box {
  background: var(--panel);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.lime-frame { border-left: 4px solid var(--accent); border-right: 4px solid var(--accent); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-head.bordered { border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 16px; }

.modal-title {
  font-weight: 900;
  font-style: italic;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calc-title {
  margin: 4px 0 0;
  font-weight: 900;
  font-style: italic;
  font-size: 17px;
  text-transform: uppercase;
}

.calc-body { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }

.calc-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.sum-input-wrap { display: flex; align-items: baseline; gap: 4px; }

#calcSum {
  width: 96px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}

.calc-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.calc-leg { padding: 16px; font-family: var(--font-mono); }

.calc-leg.fb {
  background: rgba(16, 185, 129, 0.15);
  border-left: 2px solid var(--accent);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.calc-leg.hedge {
  background: rgba(255, 255, 255, 0.05);
  border-right: 2px solid var(--secondary);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

.calc-leg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-weight: 700;
}

.calc-leg-row span:first-child { font-family: var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-leg-row .lime { font-size: 17px; font-weight: 900; }
.calc-leg-row span:last-child:not(.lime) { font-size: 17px; font-weight: 900; }

.calc-result {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.calc-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calc-line.calc-stakes { justify-content: flex-start; line-height: 1.6; color: var(--muted); }
.calc-line.total { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 10px; font-weight: 700; }
.calc-line .big { font-size: 20px; font-weight: 900; }

.close-calc {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.close-calc:hover { filter: brightness(1.1); }

/* Тост */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 200;
  background: rgba(8, 12, 16, 0.95);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 22px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Футер */
.foot {
  position: relative;
  z-index: 10;
  border-top: 1px solid var(--line);
  padding: 20px 24px;
}

.foot p {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
}

/* Пояснения и индексируемые страницы */
.seo-guide {
  max-width: 880px;
  margin: 40px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.seo-guide h2 { color: var(--text); font-size: 23px; line-height: 1.3; margin: 0 0 14px; }
.seo-guide p { margin: 0 0 14px; }
.seo-guide a, .content a, .foot-nav a { color: var(--accent); text-underline-offset: 3px; }
.foot-inner { max-width: 1520px; margin: 0 auto; display: flex; align-items: flex-start; gap: 24px; justify-content: space-between; }
.foot-inner p { margin: 0; max-width: 980px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; white-space: nowrap; }
.brand-link { color: var(--text); text-decoration: none; }
.content { position: relative; z-index: 1; width: min(880px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 72px; }
.content-kicker { color: var(--accent); font: 700 12px var(--font-mono); margin: 0 0 16px; }
.content h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.1; margin: 0 0 20px; letter-spacing: 0; }
.content-lead { color: var(--muted); font-size: 18px; line-height: 1.65; margin: 0 0 40px; }
.content section { border-top: 1px solid var(--line); padding: 26px 0 6px; }
.content h2 { font-size: 23px; line-height: 1.3; margin: 0 0 14px; }
.content p, .content li { color: var(--muted); font-size: 16px; line-height: 1.75; }
.content p { margin: 0 0 16px; }
.content li { margin-bottom: 10px; }
.content strong { color: var(--text); }
.content pre { overflow-x: auto; padding: 18px; background: var(--panel); border-left: 2px solid var(--accent); font: 13px/1.8 var(--font-mono); }
.content code { color: var(--text); }

.market-picker { position: relative; }
.market-toggle {
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border: 0;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: 700 11px var(--font-mono);
  cursor: pointer;
}
.market-toggle[aria-expanded="true"] { color: var(--accent); }
.market-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 7px);
  left: 0;
  min-width: 190px;
  padding: 8px 14px;
  background: rgba(10, 12, 10, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
}
.market-menu label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  color: var(--text);
  font: 12px var(--font-mono);
  cursor: pointer;
}
.market-menu input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

:where(button, a, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.wing:has(.fb-tile:focus-visible),
.wing:has(.fb-tile[aria-expanded="true"]) { z-index: 46; }
.freebet-row:has(.fb-tile:focus-visible),
.freebet-row:has(.fb-tile[aria-expanded="true"]) { z-index: 46; }
.market-picker:has(.market-toggle:focus-visible) { z-index: 46; }

/* Скроллбар */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.5); }

/* Адаптив */
@media (max-width: 1100px) {
  .console { grid-template-columns: 1fr; grid-template-rows: none; gap: 20px; }
  .wing,
  .wing:not(.right),
  .wing.right { position: relative; display: flex; flex-direction: column; grid-row: auto; gap: 16px; min-width: 0; }
  .mode-switch,
  .wing > .wing-heading,
  .wing > .freebet-row,
  .wing > .bk-grid,
  .wing > .slider-block { grid-column: auto; grid-row: auto; }
}

@media (max-width: 640px) {
  .scene { padding: 12px 16px 32px; }
  .scanner-panel { margin-bottom: 12px; }
  .console { padding: 0; }
  .console { gap: 12px; }
  .mode-tab { min-height: 44px; gap: 8px; padding: 6px 8px; }
  .mode-icon { width: 27px; height: 27px; flex-basis: 27px; font-size: 13px; }
  .mode-copy strong { font-size: 11px; white-space: normal; line-height: 1.15; }
  .mode-copy small { font-size: 9px; line-height: 1.35; }
  .mode-tab.active::after { left: 12%; right: 12%; }
  .wing,
  .wing:not(.right),
  .wing.right { gap: 10px; }
  .wing-heading {
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 2px 10px;
    min-height: 0;
    padding-bottom: 6px;
  }
  .wing-kicker { display: none; }
  .wing-heading strong { font-size: 12px; }
  .wing-heading > span:last-child { text-align: right; font-size: 10px; }
  .bk-grid {
    grid-template-columns: repeat(8, 58px);
    justify-content: start;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
  }
  .bk-tile { scroll-snap-align: start; }
  .fb-book-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .topbar { padding: 10px 16px; }
  .topbar-right { gap: 6px; }
  .status-line { font-size: 9px; }
  .topbar-right .chip-btn { padding: 8px 10px; font-size: 10px; min-height: 34px; }
  .freebet-row { gap: 8px; }
  .big-word { font-size: 27px; }
  .fb-tile { width: 84px; height: 84px; padding: 6px 8px 10px; }
  .fb-tile-name { font-size: 9px; letter-spacing: 0.14em; }
  .fb-tile-chevron { width: 22px; height: 22px; font-size: 18px; right: 6px; bottom: 5px; }
  .freebet-row,
  .wing.right > .bk-grid { height: 84px; }
  .bk-grid { grid-template-columns: repeat(8, 52px); gap: 6px; }
  .bk-tile { height: 56px; }
  .bk-tile .bk-logo { width: 42px; height: 34px; flex-basis: 34px; }
  .bk-tile-name { font-size: 8px; }
  .slider-block { min-height: 0; }
  .slider-caption { font-size: 9px; letter-spacing: 0.1em; margin-bottom: 3px; }
  .slider-row { gap: 8px; }
  .val-chip { font-size: 11px; padding: 3px 9px; min-width: 48px; }
  .range-holder { height: 18px; }
  .status { font-size: 10px; padding: 4px 2px; }
  .search-input { min-width: 0; flex: 1; }
  .filter-bar { margin: 0 -16px 8px; padding: 6px 16px; gap: 8px; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-left { gap: 8px; }
  .filter-left, .filter-right { flex-wrap: nowrap; flex: 0 0 auto; }
  .filter-right { gap: 4px; }
  .muted-label { display: none; }
  .blade-select { min-height: 38px; padding: 0 14px; }
  .blade-select select { font-size: 11px; }
  .market-toggle { min-height: 38px; padding: 0 14px; font-size: 10px; }
  .chip { min-height: 34px; padding: 6px 10px; font-size: 10px; }
  .search-input { padding: 9px 14px; }
  .table-head { margin: 0 -16px; padding: 5px 16px; }
  .th-event { min-width: 0; }
  .th-yield { min-width: auto; }
  .th-legs { display: none; }
  .match-row { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 10px; margin: 0 -10px; }
  .match-main { min-width: 0; }
  .match-teams { font-size: 19px; }
  .match-odds { margin-left: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr auto 44px; gap: 8px; align-items: center; }
  .match-odds .odd-btn { justify-content: space-between; min-height: 44px; padding: 8px 10px; }
  .match-odds .vs-mark { display: none; }
  .match-odds .copy-btn { width: 44px; height: 44px; }
  .match-odds .copy-btn { grid-column: 4; grid-row: 1; }
  .yield { grid-column: 3; grid-row: 1; min-width: 0; padding-left: 0; text-align: right; font-size: 24px; }
  .skeleton-row { padding: 14px 10px; margin: 0 -10px; }
  .sk-odd { display: none; }
  .calc-legs { grid-template-columns: 1fr; }
  .content { width: calc(100% - 32px); padding: 36px 0 48px; }
  .content-lead { font-size: 16px; }
  .foot-inner { flex-direction: column; gap: 14px; }
  .foot-nav { white-space: normal; }
  .seo-guide { margin-top: 32px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.result-info { margin: 0 2px 12px; color: var(--muted); font: 11px/1.6 var(--font-mono); overflow-wrap: anywhere; }
.t-quote { color: var(--muted); font-size: 10px; }
