/* ═══════════════════════════════════════════════════════════════
   Flash Arbitrage — премиум тёмная тема. Дизайн-токены → компоненты.
   Всё self-contained: без внешних шрифтов/CDN.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg:        #070c16;
  --bg-2:      #0a1120;
  --surface:   #111c30;
  --surface-2: #16233b;
  --line:      #1e3050;
  --line-soft: #182742;
  --text:      #e6edf7;
  --text-dim:  #a2b3ca;
  --text-mute: #7e91ac;
  --brand:     #38bdf8;
  --emerald:   #34d399;
  --emerald-d: #10b981;
  --amber:     #fbbf24;
  --violet:    #8b5cf6;
  --red:       #f87171;
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 40px rgba(0,0,0,.45);
  --ease:      cubic-bezier(.22,.61,.36,1);
  --mono:      ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 78% -8%, rgba(56,189,248,.10), transparent 60%),
    radial-gradient(900px 520px at 8% 0%,  rgba(52,211,153,.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
.accent { color: var(--emerald); }
::selection { background: rgba(52,211,153,.30); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-2); background-clip: padding-box; }

/* ── Хедер ── */
.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 15px 28px;
  background: rgba(10,17,32,.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }
.brand-mark {
  font-size: 26px; line-height: 1;
  filter: drop-shadow(0 0 8px rgba(52,211,153,.6));
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--mono); font-weight: 800; font-size: 24px;
  letter-spacing: .04em; color: var(--text); line-height: 1.05;
}
.brand-name .accent {
  background: linear-gradient(90deg, var(--emerald), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-tag { font-size: 10.5px; color: var(--text-mute); letter-spacing: .01em; margin-top: 1px; }

.header-grow { flex: 1; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-mute); box-shadow: 0 0 0 0 transparent;
}
.live-dot.on   { background: var(--emerald); animation: pulse 2s var(--ease) infinite; }
.live-dot.off  { background: var(--red); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
/* ── Панель статистики ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 16px 28px;
}
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 74px;
}
.stat-accent { border-color: rgba(52,211,153,.35); box-shadow: inset 0 0 24px rgba(16,185,129,.08); }
.stat-val {
  font-family: var(--mono); font-weight: 800; font-size: 24px; line-height: 1.05;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.stat-accent .stat-val { color: var(--emerald); }
.stat-label { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; letter-spacing: .02em; }

/* ── Тулбар ── */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 22px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10,17,32,.5);
}
.filter-group {
  position: relative; display: flex;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px;
}
.filter-btn {
  position: relative; z-index: 2;
  padding: 5px 16px; border: none; background: transparent;
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  cursor: pointer; border-radius: 999px; transition: color .2s var(--ease);
}
.filter-btn.active { color: #05140d; font-weight: 700; }
.filter-slider {
  position: absolute; z-index: 1; top: 3px; bottom: 3px; left: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--emerald-d));
  transition: left .28s var(--ease), width .28s var(--ease);
}

/* Переключатель вида спорта */
.sport-group {
  display: flex; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px;
}
.sport-btn {
  padding: 5px 14px; border: none; background: transparent;
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  cursor: pointer; border-radius: 999px; transition: all .18s var(--ease);
}
.sport-btn:hover { color: var(--text); }
.sport-btn.active {
  background: rgba(56,189,248,.16); color: var(--brand); font-weight: 700;
}
/* Переключатель источника цены Polymarket: аск (исполнимо) / средняя (Gamma) */
.price-mode { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; }
.price-mode-btn { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  border: none; background: transparent; color: var(--text-dim); cursor: pointer; transition: .15s; }
.price-mode-btn:hover { color: var(--text); }
.price-mode-btn.on { background: rgba(52,211,153,.16); color: var(--emerald); }

/* Фильтр по коридору профита (двусторонний ползунок) */
.profit-group {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px;
}
.profit-label {
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.profit-label b { color: var(--emerald); font-weight: 700; min-width: 88px; display: inline-block; }
/* Коридор сужен относительно полного диапазона — подсветка, чтобы фильтр не забывался */
.profit-group.active { border-color: rgba(52,211,153,.45); }

/* Два наложенных range: треки прозрачны и не ловят клики, кликабельны только
   бегунки (pointer-events на thumb). Общий трек и заливка рисуются div'ами. */
.dual-range { position: relative; width: 150px; height: 16px; }
.dual-range::before {
  content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 4px;
  border-radius: 999px; background: var(--line);
}
.dual-fill {
  position: absolute; top: 6px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald), var(--emerald-d));
}
.dual-range input[type=range] {
  -webkit-appearance: none; appearance: none;
  position: absolute; top: 0; left: 0; width: 100%; height: 16px; margin: 0;
  background: transparent; outline: none; pointer-events: none;
}
.dual-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 14px; height: 14px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-d));
  border: 2px solid #05140d; box-shadow: 0 0 6px rgba(52,211,153,.5);
}
.dual-range input[type=range]::-moz-range-thumb {
  pointer-events: auto;
  width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  background: var(--emerald); border: 2px solid #05140d;
}
.dual-range input[type=range]::-moz-range-track { background: transparent; }

.hidden-info {
  font-size: 11px; color: var(--text-dim); cursor: pointer;
  white-space: nowrap; transition: color .15s;
  border-bottom: 1px dashed var(--text-mute);
}
.hidden-info:hover { color: var(--brand); }
.hidden-info.hidden { display: none; }

.data-age { font-size: 11px; color: var(--text-mute); margin-left: auto; font-variant-numeric: tabular-nums; }
.data-age.fresh { color: var(--emerald); }
.data-age.stale { color: var(--amber); }
.data-age.dead  { color: var(--red); }

.conn-status { font-size: 11px; }
.conn-status.connected    { color: var(--emerald); }
.conn-status.connecting   { color: var(--amber); }
.conn-status.disconnected { color: var(--red); }

/* ── Как работает ── */
/* ── Промо-баннер (вход в блог-воронку) ── */
.promo-banner {
  display: flex; align-items: center; gap: 14px;
  margin: 4px 28px 14px; padding: 14px 20px;
  text-decoration: none; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(52,211,153,.13), rgba(56,189,248,.07));
  border: 1px solid rgba(52,211,153,.32);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.promo-banner:hover { transform: translateY(-1px); border-color: var(--emerald); }
.promo-ico { flex-shrink: 0; display: flex; }
.promo-ico svg {
  width: 52px; height: 52px;
  filter: drop-shadow(0 0 10px rgba(52,211,153,.55)) drop-shadow(0 0 4px rgba(56,189,248,.4));
  animation: cubeFloat 3.5s var(--ease) infinite;
}
@keyframes cubeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.promo-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 4px; }
.promo-text b { font-size: 26px; color: var(--text); line-height: 1.15; }
.promo-text span { font-size: 16px; color: var(--text-dim); line-height: 1.3; }
.promo-arrow { color: var(--emerald); font-size: 24px; flex-shrink: 0; }

/* ── Сетка карточек ── */
.list {
  flex: 1;
  padding: 18px 22px 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px; align-content: start;
}

/* Пустое состояние + радар */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--text-mute);
}
.radar { position: relative; width: 70px; height: 70px; margin: 0 auto 20px; }
.radar span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--emerald); opacity: 0;
  animation: radar 2.4s var(--ease) infinite;
}
.radar span:nth-child(2) { animation-delay: .8s; }
.radar span:nth-child(3) { animation-delay: 1.6s; }
@keyframes radar { 0% { transform: scale(.3); opacity: .7; } 100% { transform: scale(1); opacity: 0; } }
.empty-title { font-size: 15px; color: var(--text-dim); font-weight: 600; }
.empty-hint  { font-size: 12px; margin-top: 8px; color: var(--text-mute); }

/* ── Закреплённые (отслеживаемые) ── */
.pinned-wrap { padding: 8px 22px 0; }
.pinned-wrap.hidden { display: none; }
.pinned-title { font-size: 12px; color: var(--emerald); font-weight: 700; letter-spacing: .03em; margin: 4px 0 8px; }
.pinned { padding: 0 !important; }

.card.pinned { border-color: rgba(52,211,153,.6); box-shadow: 0 0 0 1px rgba(52,211,153,.25), inset 0 0 22px rgba(16,185,129,.06); }
.card.stale { opacity: .6; }
.badge-pin   { background: rgba(52,211,153,.16); color: var(--emerald); }
.badge-stale { background: rgba(148,163,184,.18); color: #94a3b8; }

/* ── Карточка ── */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid rgba(251,191,36,.45);         /* единая золотистая обводка на всех */
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 0 22px rgba(251,191,36,.05);
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
  box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(251,191,36,.35);
}

.card-head {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: rgba(0,0,0,.22);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}
.card-badge {
  font-family: var(--mono); font-weight: 700; font-size: 10px;
  color: var(--brand); letter-spacing: .04em;
  padding: 1px 6px; border-radius: 5px; background: rgba(56,189,248,.12);
}
.badge-map  { background: #7c3aed; color: #fef08a; }
.badge-live { background: rgba(248,113,113,.16); color: var(--red); }
.badge-live::before { content:"● "; }
.badge-pre  { background: rgba(56,189,248,.14); color: #7dd3fc; }
.tournament {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 10px; color: var(--text-dim);
  background: rgba(30,48,80,.55); padding: 2px 7px; border-radius: 5px;
}
.card-dismiss, .card-pin {
  background: none; border: none; color: var(--text-mute);
  font-size: 13px; line-height: 1; cursor: pointer; padding: 2px 3px; flex-shrink: 0;
  transition: color .15s, transform .15s, opacity .15s;
}
.card-dismiss:hover { color: var(--red); }
.card-pin { opacity: .55; }
.card-pin:hover { opacity: 1; transform: scale(1.15); }

/* Имя команды Fonbet — кликом копируется для поиска в БК */
.side-team.copyable { cursor: pointer; }
.side-team.copyable:hover { color: var(--brand); text-decoration: underline dotted; }
.side-team.copied { color: var(--emerald) !important; }
.sim-badge { font-size: 10px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.sim-ok  { color: var(--emerald); }
.sim-mid { color: var(--amber); }
.sim-low { color: var(--red); }

.card-teams {
  padding: 9px 13px 4px; font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Полоска совпадения */
.sim-track { height: 3px; margin: 2px 13px 8px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.sim-fill  { height: 100%; border-radius: 3px; transition: width .4s var(--ease); }

.card-sides { display: flex; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.side { flex: 1; padding: 8px 13px 9px; min-width: 0; }
.side-left { border-right: 1px solid var(--line-soft); }
.side-link { cursor: pointer; transition: background .15s; }
.side-link:hover { background: rgba(139,92,246,.12); }
.side-bk { font-size: 10px; font-weight: 700; margin-bottom: 3px; letter-spacing: .02em; }
.side-left  .side-bk { color: var(--violet); }
.side-right .side-bk { color: var(--brand); }
.side-team { color: var(--text-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-coeff { font-family: var(--mono); font-size: 19px; font-weight: 800; color: var(--text); margin-top: 3px; font-variant-numeric: tabular-nums; }
.side-info { font-size: 10px; color: var(--text-mute); margin-top: 1px; }

.card-roi { padding: 9px 13px; display: flex; align-items: baseline; gap: 10px; }
.roi-val {
  font-family: var(--mono); font-size: 22px; font-weight: 800;
  color: var(--emerald); font-variant-numeric: tabular-nums;
}
.profit-neg .roi-val { color: var(--amber); }
.margin-val { font-size: 10px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.poly-link-hint { margin-left: auto; font-size: 11px; color: var(--violet); cursor: pointer; transition: color .15s; }
.poly-link-hint:hover { color: #c4b5fd; }

/* ── Футер ── */
.footer {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px;
  padding: 26px 22px; margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  background: rgba(7,12,22,.6);
}
.foot-title { font-family: var(--mono); font-weight: 800; font-size: 13px; letter-spacing: .05em; margin-bottom: 9px; }
.foot-col p { font-size: 11.5px; color: var(--text-mute); line-height: 1.6; }
.foot-fine { font-size: 10.5px; }
.foot-cta {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(56,189,248,.14), rgba(52,211,153,.10));
  border: 1px solid rgba(56,189,248,.28); color: var(--text);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.foot-cta:hover { transform: translateY(-2px); border-color: rgba(56,189,248,.6); }
.foot-cta + .foot-cta { margin-top: 10px; }
.foot-cta-ico { font-size: 20px; }
.foot-cta-sub { font-size: 10.5px; color: var(--text-dim); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.foot-nav a {
  font-size: 11.5px; color: var(--text-dim); text-decoration: none;
  transition: color .15s;
}
.foot-nav a:hover { color: var(--brand); }

/* ── Адаптив ── */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .how-arrow { display: none; }
  .footer { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  .header { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr 1fr; padding: 12px; }
  .list { padding: 12px; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* Название конторы на карточке — ссылка в каталог БК */
a.side-bk-link { color: inherit; text-decoration: none; cursor: pointer; transition: color .15s; }
a.side-bk-link:hover { color: var(--emerald); }
