/* ============================================================
   FIFA EDGE — Dashboard styles
   Trading-desk aesthetic: dark, neutral-cool, monospace numerics
   ============================================================ */

:root {
  /* Neutrals — cool dark */
  --bg-0: oklch(0.15 0.008 260);        /* page background */
  --bg-1: oklch(0.18 0.008 260);        /* sidebar / topbar */
  --bg-2: oklch(0.21 0.008 260);        /* cards */
  --bg-3: oklch(0.25 0.008 260);        /* card elevated / hover */
  --bg-4: oklch(0.30 0.010 260);        /* inputs */

  --line-1: oklch(0.28 0.010 260);      /* subtle border */
  --line-2: oklch(0.35 0.012 260);      /* stronger border */

  --text-0: oklch(0.97 0.005 260);      /* headings */
  --text-1: oklch(0.82 0.008 260);      /* body */
  --text-2: oklch(0.62 0.010 260);      /* muted */
  --text-3: oklch(0.48 0.010 260);      /* subtle */

  /* Accent — switchable via data-accent */
  --accent:      oklch(0.78 0.16 155);
  --accent-dim:  oklch(0.50 0.10 155);
  --accent-bg:   oklch(0.78 0.16 155 / 0.10);
  --accent-bd:   oklch(0.78 0.16 155 / 0.35);

  /* Semantic */
  --win:   oklch(0.78 0.16 155);
  --loss:  oklch(0.66 0.19 25);
  --warn:  oklch(0.78 0.14 75);
  --info:  oklch(0.72 0.13 230);
  --neu:   oklch(0.62 0.010 260);

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  /* Fonts */
  --f-ui: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Density — overridden by data-density */
  --pad-card: 16px;
  --pad-row: 12px;
  --gap-grid: 14px;
}

[data-accent="amber"]  { --accent: oklch(0.80 0.14 75); --accent-dim: oklch(0.52 0.10 75); --accent-bg: oklch(0.80 0.14 75 / 0.10); --accent-bd: oklch(0.80 0.14 75 / 0.35); }
[data-accent="cyan"]   { --accent: oklch(0.80 0.12 210); --accent-dim: oklch(0.52 0.09 210); --accent-bg: oklch(0.80 0.12 210 / 0.10); --accent-bd: oklch(0.80 0.12 210 / 0.35); }
[data-accent="violet"] { --accent: oklch(0.72 0.17 300); --accent-dim: oklch(0.48 0.12 300); --accent-bg: oklch(0.72 0.17 300 / 0.10); --accent-bd: oklch(0.72 0.17 300 / 0.35); }

[data-density="compact"]     { --pad-card: 12px; --pad-row: 8px; --gap-grid: 10px; }
[data-density="comfortable"] { --pad-card: 16px; --pad-row: 12px; --gap-grid: 14px; }
[data-density="spacious"]    { --pad-card: 22px; --pad-row: 16px; --gap-grid: 18px; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-ui);
  font-feature-settings: 'ss01', 'cv11';
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.mono { font-family: var(--f-mono); font-feature-settings: 'tnum'; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- Layout shell ---------- */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line-1);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg-0);
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.03em;
}
.brand-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text-0);
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-section {
  padding: 14px 12px 8px;
}
.nav-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 10px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-bg);
  color: var(--text-0);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item .ico { width: 16px; height: 16px; color: currentColor; opacity: 0.9; flex: none; }
.nav-item .count {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
}
.nav-item.active .count { color: var(--accent); background: transparent; border: 1px solid var(--accent-bd); }
.nav-item .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--loss);
  margin-left: auto;
  box-shadow: 0 0 0 0 var(--loss);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 oklch(0.66 0.19 25 / 0.5); }
  70%  { box-shadow: 0 0 0 6px oklch(0.66 0.19 25 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.66 0.19 25 / 0); }
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line-1);
}
.bot-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  font-size: 11px;
}
.bot-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--win);
  align-self: center;
  box-shadow: 0 0 8px var(--win);
}
.bot-status .k { color: var(--text-3); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.bot-status .v { color: var(--text-0); font-family: var(--f-mono); font-size: 11px; }

/* ---------- Top bar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-1);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--f-mono);
}
.crumbs .sep { color: var(--text-3); opacity: 0.5; }
.crumbs .cur { color: var(--text-0); }

.search {
  position: relative;
  max-width: 420px;
  width: 100%;
  justify-self: center;
}
.search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  color: var(--text-1);
  padding: 8px 12px 8px 34px;
  font-family: var(--f-ui);
  font-size: 12.5px;
  outline: none;
  transition: border-color .12s;
}
.search input:focus { border-color: var(--accent-bd); }
.search input::placeholder { color: var(--text-3); }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: 10px; color: var(--text-3);
  background: var(--bg-3); padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--line-1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  background: var(--bg-2);
  font-family: var(--f-mono);
  font-size: 11px;
}
.ticker .lbl { color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.ticker .v { color: var(--text-0); }
.ticker .v.pos { color: var(--win); }
.ticker .v.neg { color: var(--loss); }
.ticker .sep { width: 1px; height: 14px; background: var(--line-1); }

.iconbtn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
}
.iconbtn:hover { background: var(--bg-2); color: var(--text-0); border-color: var(--line-2); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-1);
  border-radius: 18px;
  background: var(--bg-2);
}
.user-chip .av {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: grid; place-items: center;
  color: var(--bg-0); font-family: var(--f-mono); font-weight: 600; font-size: 10px;
}
.user-chip .nm { font-size: 12px; color: var(--text-0); }
.user-chip .rl { font-size: 10px; color: var(--text-3); font-family: var(--f-mono); }

/* ---------- Content ---------- */
.content {
  padding: 20px 24px 60px;
  max-width: 1600px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 20px;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-0);
  margin: 0;
}
.page-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.page-actions { display: flex; gap: 8px; }

.btn {
  padding: 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .12s;
}
.btn:hover { background: var(--bg-3); color: var(--text-0); }
.btn.primary {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }

/* ---------- KPIs ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-grid);
  margin-bottom: 20px;
}
.kpi {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  padding: var(--pad-card);
  position: relative;
  overflow: hidden;
}
.kpi .lbl {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.kpi .lbl .pip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.kpi .val {
  font-family: var(--f-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi .val .unit { font-size: 13px; color: var(--text-3); margin-left: 2px; }
.kpi .delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--f-mono);
  font-size: 11px;
  margin-top: 8px;
  padding: 2px 6px;
  border-radius: 3px;
}
.kpi .delta.pos { color: var(--win); background: oklch(0.78 0.16 155 / 0.08); }
.kpi .delta.neg { color: var(--loss); background: oklch(0.66 0.19 25 / 0.08); }
.kpi .spark {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 72px;
  height: 28px;
  opacity: 0.9;
}

/* ---------- Card ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-1);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-0);
  letter-spacing: -0.005em;
}
.card-title .bar {
  width: 3px; height: 14px; background: var(--accent); border-radius: 2px;
}
.card-title .badge {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  padding: 2px 6px;
  background: var(--bg-2);
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 400;
}
.card-tools { display: flex; gap: 6px; }
.tool-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--line-1);
  border-radius: 3px;
  color: var(--text-2);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.tool-btn:hover, .tool-btn.active { color: var(--accent); border-color: var(--accent-bd); background: var(--accent-bg); }
.card-body { padding: var(--pad-card); }
.card-body.flush { padding: 0; }

/* ---------- Match row ---------- */
.match {
  display: grid;
  grid-template-columns: 74px 1fr 120px 110px 90px;
  align-items: center;
  gap: 14px;
  padding: var(--pad-row) 16px;
  border-bottom: 1px solid var(--line-1);
  transition: background .1s;
}
.match:last-child { border-bottom: none; }
.match:hover { background: var(--bg-2); }

.match .time {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
}
.match .time .t { color: var(--text-1); font-size: 13px; }

.match .tmr .t {
  color: var(--loss);
  display: inline-flex; align-items: center; gap: 4px;
}
.match .tmr .t::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--loss); animation: pulse 1.4s infinite;
}

.match .teams { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.match .row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.match .row .nm { color: var(--text-0); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .row .nm .tm { color: var(--text-3); margin-left: 6px; font-weight: 400; font-size: 11px; }
.match .row .sc {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--text-0);
  min-width: 18px;
  text-align: right;
}
.match .row .sc.w { color: var(--win); font-weight: 600; }

.match .league {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.odd {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 3px;
  padding: 6px 4px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-1);
  cursor: pointer;
  transition: all .1s;
}
.odd .k { color: var(--text-3); font-size: 9px; letter-spacing: 0.1em; display: block; }
.odd .v { color: var(--text-0); font-size: 12px; font-weight: 500; }
.odd:hover { border-color: var(--line-2); background: var(--bg-3); }
.odd.highlight {
  background: var(--accent-bg);
  border-color: var(--accent-bd);
}
.odd.highlight .v { color: var(--accent); }

.ev-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  justify-self: end;
}
.ev-pill.pos { background: oklch(0.78 0.16 155 / 0.12); color: var(--win); border: 1px solid oklch(0.78 0.16 155 / 0.30); }
.ev-pill.mid { background: oklch(0.78 0.14 75 / 0.10); color: var(--warn); border: 1px solid oklch(0.78 0.14 75 / 0.28); }
.ev-pill.flat { background: var(--bg-2); color: var(--text-3); border: 1px solid var(--line-1); }

/* ---------- Chip / tag / etc ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 11px;
  font-family: var(--f-mono);
  cursor: pointer;
  white-space: nowrap;
  transition: all .1s;
}
.chip:hover { color: var(--text-0); border-color: var(--line-2); }
.chip.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-bd); }
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Two-col grid ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--gap-grid);
}

/* ---------- Table ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-2);
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-1);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
.table th.num, .table td.num { text-align: right; font-family: var(--f-mono); }
.table th:hover { color: var(--text-1); }
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-1);
  color: var(--text-1);
}
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr:last-child td { border-bottom: none; }

.rank {
  font-family: var(--f-mono);
  color: var(--text-3);
  font-size: 11px;
}
.rank.top { color: var(--accent); font-weight: 600; }

.elo { font-family: var(--f-mono); color: var(--text-0); font-weight: 500; }
.elo .d { font-size: 10px; color: var(--win); margin-left: 4px; }
.elo .d.neg { color: var(--loss); }

.form-dots {
  display: inline-flex; gap: 3px;
}
.form-dots span {
  width: 14px; height: 14px;
  border-radius: 3px;
  font-family: var(--f-mono); font-size: 9px; font-weight: 600;
  color: var(--bg-0);
  display: grid; place-items: center;
}
.form-dots .w { background: var(--win); }
.form-dots .d { background: var(--text-3); color: var(--text-0); }
.form-dots .l { background: var(--loss); }

/* ---------- Signal queue ---------- */
.sig {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-1);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  transition: background .1s;
}
.sig:hover { background: var(--bg-2); }
.sig:last-child { border-bottom: none; }
.sig-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 10px; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase;
  grid-column: 1 / -1;
}
.sig-head .live {
  color: var(--loss);
  display: inline-flex; align-items: center; gap: 4px;
}
.sig-head .live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--loss); animation: pulse 1.4s infinite;
}
.sig-match {
  font-size: 13px;
  color: var(--text-0);
  font-weight: 500;
}
.sig-match .vs { color: var(--text-3); margin: 0 6px; }
.sig-meta {
  display: flex; gap: 14px; margin-top: 4px;
  font-family: var(--f-mono); font-size: 11px; color: var(--text-2);
}
.sig-meta .k { color: var(--text-3); margin-right: 4px; text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; }

.sig-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sig-tip {
  font-family: var(--f-mono); font-size: 12px; color: var(--text-0);
  padding: 4px 8px;
  border: 1px dashed var(--accent-bd);
  border-radius: 3px;
  background: var(--accent-bg);
}
.sig-tip .k { color: var(--accent); margin-right: 6px; font-weight: 600; }

.countdown {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.countdown .n { color: var(--text-0); font-size: 12px; }

/* ---------- EV meter (circular) ---------- */
.ev-meter {
  width: 44px; height: 44px;
  position: relative;
}
.ev-meter svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ev-meter .bg { fill: none; stroke: var(--line-1); stroke-width: 4; }
.ev-meter .fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ev-meter .label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--text-0);
}

/* ---------- Heatmap / sparkline ---------- */
.heat {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
}
.heat .cell {
  aspect-ratio: 1;
  background: var(--bg-3);
  border-radius: 2px;
}
.heat .cell.h1 { background: oklch(0.78 0.16 155 / 0.15); }
.heat .cell.h2 { background: oklch(0.78 0.16 155 / 0.35); }
.heat .cell.h3 { background: oklch(0.78 0.16 155 / 0.60); }
.heat .cell.h4 { background: oklch(0.78 0.16 155 / 0.90); }

/* ---------- Live event ---------- */
.live-event {
  display: grid;
  grid-template-columns: 56px 1fr 120px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-1);
  gap: 14px;
}
.live-event:last-child { border-bottom: none; }
.live-time {
  font-family: var(--f-mono);
  color: var(--loss);
  font-weight: 600;
  font-size: 13px;
  display: flex; flex-direction: column; gap: 2px;
}
.live-time .bar { width: 100%; height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.live-time .bar > i { display: block; height: 100%; background: var(--loss); border-radius: 2px; }
.live-teams {
  display: flex; flex-direction: column; gap: 6px;
}
.live-teams .row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; font-size: 13px;
}
.live-teams .row .nm { color: var(--text-0); font-weight: 500; }
.live-teams .row .sc { font-family: var(--f-mono); font-size: 16px; color: var(--text-0); font-weight: 600; }
.live-odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.live-odds .o {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  padding: 4px 2px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  border-radius: 2px;
  color: var(--text-1);
}

/* ---------- Tweaks panel ---------- */
.tweaks-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 14px;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.tweaks-panel h4 {
  margin: 0 0 12px;
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex; justify-content: space-between; align-items: center;
}
.tweak { margin-bottom: 10px; }
.tweak .lbl { font-size: 11px; color: var(--text-2); margin-bottom: 6px; display: block; }
.swatches { display: flex; gap: 6px; }
.sw {
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
  color: var(--bg-0); font-size: 10px; font-weight: 700;
}
.sw.active { outline: 2px solid var(--text-0); outline-offset: 2px; }
.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 4px;
  padding: 2px;
}
.seg button {
  background: transparent; border: none; padding: 5px 8px;
  color: var(--text-3); font-family: var(--f-ui); font-size: 11px; cursor: pointer;
  border-radius: 3px;
}
.seg button.active { background: var(--bg-3); color: var(--text-0); }

/* ---------- Misc ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-grid); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-grid); }
.stack { display: flex; flex-direction: column; gap: var(--gap-grid); }

.divider { height: 1px; background: var(--line-1); margin: 6px 0; }

.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid oklch(0.78 0.14 75 / 0.35);
  background: oklch(0.78 0.14 75 / 0.08);
  margin-bottom: 20px;
  align-items: center;
}
.alert .i {
  width: 28px; height: 28px; border-radius: 4px;
  background: oklch(0.78 0.14 75 / 0.18);
  color: var(--warn);
  display: grid; place-items: center;
}
.alert .t { color: var(--text-0); font-weight: 500; font-size: 12.5px; }
.alert .d { color: var(--text-2); font-size: 11.5px; margin-top: 2px; }

.select {
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  color: var(--text-1);
  padding: 6px 28px 6px 10px;
  font-family: var(--f-ui);
  font-size: 12px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' stroke='%23787878' stroke-width='1.2' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

/* ---------- H2H Hero ---------- */
.h2h-hero {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  padding: 28px 24px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.h2h-side {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.h2h-av {
  width: 72px; height: 72px; border-radius: 10px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 22px; font-weight: 700; color: var(--text-0);
}
.h2h-side.a .h2h-av { box-shadow: 0 0 0 2px var(--accent-bd), 0 0 20px var(--accent-bg); }
.h2h-side.b .h2h-av { box-shadow: 0 0 0 2px oklch(0.72 0.13 230 / 0.35), 0 0 20px oklch(0.72 0.13 230 / 0.12); }
.h2h-name { font-size: 18px; font-weight: 700; color: var(--text-0); letter-spacing: -0.01em; }
.h2h-team { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }

.h2h-core { text-align: center; }
.h2h-title {
  font-size: 10px; letter-spacing: 0.18em; color: var(--text-3); text-transform: uppercase; margin-bottom: 10px;
}
.h2h-rings {
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.ring { position: relative; width: 96px; height: 96px; }
.ring.small { width: 78px; height: 78px; }
.ring svg { width: 100%; height: 100%; }
.ring .ring-v {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 28px; font-weight: 700; color: var(--text-0);
}
.ring.small .ring-v { font-size: 22px; }
.ring .ring-k {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 9px; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}

/* ---------- Stats filter block ---------- */
.stats-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex; justify-content: space-between; align-items: center;
}
.field label .v { color: var(--accent); font-size: 11px; text-transform: none; letter-spacing: 0; }
.field input[type="range"] {
  -webkit-appearance: none;
  background: var(--bg-2);
  height: 6px;
  border-radius: 3px;
  border: 1px solid var(--line-1);
  outline: none;
  padding: 0;
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--bg-0);
  box-shadow: 0 0 0 1px var(--accent-bd);
}
.field input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg-0);
}

.seg4 {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.seg4 button {
  background: transparent; border: none; padding: 7px 8px;
  color: var(--text-3); font-family: var(--f-ui); font-size: 11.5px;
  cursor: pointer; border-radius: 3px; font-weight: 500;
  white-space: nowrap;
}
.seg4 button:hover { color: var(--text-1); }
.seg4 button.active { background: var(--accent); color: var(--bg-0); font-weight: 600; }

.search-inline {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  color: var(--text-3);
}
.search-inline input {
  background: transparent; border: none; outline: none;
  color: var(--text-1); font-family: var(--f-ui); font-size: 12px;
  width: 100%;
}

/* Stats table specific */
.scrollx { overflow-x: auto; }
.stats-table { min-width: 1500px; }
.stats-table th, .stats-table td { padding: 9px 12px; white-space: nowrap; }
.stats-table .sticky-col {
  position: sticky; left: 0;
  background: var(--bg-1);
  z-index: 1;
  border-right: 1px solid var(--line-1);
}
.stats-table tbody tr:hover .sticky-col { background: var(--bg-2); }
.stats-table thead th:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--bg-2);
  border-right: 1px solid var(--line-1);
}

.avatar-sq {
  width: 26px; height: 26px; border-radius: 4px;
  background: var(--bg-3);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 10px; color: var(--text-0); font-weight: 600;
  border: 1px solid var(--line-1);
}

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--line-1);
  background: var(--bg-1);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Filters row ---------- */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-1);
  background: var(--bg-1);
  flex-wrap: wrap;
}
.filters .lbl {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 4px;
}
.filters .sep { width: 1px; height: 18px; background: var(--line-1); margin: 0 4px; }
