:root, [data-theme="dark"] {
  --bg: #0b0f19;
  --bg-soft: #131a2b;
  --surface: #182036;
  --surface-2: #1e2742;
  --border: #26304d;
  --border-strong: #3a4670;
  --text: #e6ebf5;
  --text-2: #9aa4be;
  --text-3: #6b7593;
  --primary: #22d3ee;
  --primary-soft: rgba(34,211,238,.12);
  --accent: #8b5cf6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --betano: #ff6b00;
  --betano-text: #ffb47a;
  --superbet: #e30613;
  --superbet-text: #ff9da8;
  --shadow: 0 4px 16px rgba(0,0,0,.35);
  --shadow-glow: 0 0 40px rgba(34,211,238,.25);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --border: #dde3ee;
  --border-strong: #b9c3d4;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #6b7280;
  --primary: #0891b2;
  --primary-soft: rgba(8,145,178,.10);
  --accent: #7c3aed;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --betano: #ea580c;
  --betano-text: #9a3412;
  --superbet: #dc2626;
  --superbet-text: #991b1b;
  --shadow: 0 2px 12px rgba(15,23,42,.08);
  --shadow-glow: 0 0 30px rgba(8,145,178,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- NAV ---------- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: rgba(19,26,43,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
nav.hidden { display: none; }
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--text);
  text-decoration: none; letter-spacing: -.02em;
}
.logo-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px rgba(34,211,238,.5);
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  color: var(--text-2); text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 500; font-size: .9rem;
  transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-right { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.btn-group { display: inline-flex; gap: 4px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); }
.btn-group .btn { border: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text); font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary { background: var(--primary); color: #0b0f19; border-color: var(--primary); }
.btn-primary:hover { background: #22d3eedd; border-color: var(--primary); box-shadow: 0 0 20px rgba(34,211,238,.4); }
.btn-success { background: var(--success); color: #052e16; border-color: var(--success); }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: #1a1207; border-color: var(--warning); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- FORMS ---------- */
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .9rem;
  background: var(--bg-soft); color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
label { font-weight: 500; font-size: .85rem; color: var(--text-2); display: block; margin-bottom: 6px; }
.form-group { margin-bottom: 14px; }

/* ---------- LAYOUT ---------- */
#app { padding: 24px; max-width: 1400px; margin: 0 auto; }
.loading { text-align: center; padding: 80px; color: var(--text-2); }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  background: var(--primary-soft); color: var(--primary);
}
.badge.betano   { background: rgba(255,107,0,.15);  color: var(--betano); }
.badge.superbet { background: rgba(227,6,19,.15);   color: #ff6676; }
.badge.success  { background: rgba(34,197,94,.15); color: var(--success); }
.badge.warning  { background: rgba(245,158,11,.15); color: var(--warning); }
.badge.danger   { background: rgba(239,68,68,.15); color: var(--danger); }

/* ---------- LANDING ---------- */
.landing {
  min-height: 100vh;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(34,211,238,.15), transparent 60%),
              radial-gradient(900px 500px at 100% 110%, rgba(139,92,246,.15), transparent 60%),
              var(--bg);
}
.landing-hero {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px;
  max-width: 1240px; margin: 0 auto; padding: 100px 24px 80px;
  align-items: center;
}
.landing-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1.08; letter-spacing: -.03em; font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, #8b5cf6 60%, var(--primary) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.landing-hero p { font-size: 1.1rem; color: var(--text-2); max-width: 520px; margin-bottom: 32px; }
.hero-badges { display: flex; gap: 8px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: #fff; color: #1a1a1a;
  border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: all .2s;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(34,211,238,.35); }
.btn-google svg { width: 20px; height: 20px; }

.landing-visual {
  position: relative; height: 460px;
}
.float-card {
  position: absolute;
  background: rgba(24,32,54,.85); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
  min-width: 220px;
}
.float-card:nth-child(1) { top: 20px;  left: 30px;  animation-delay: 0s; }
.float-card:nth-child(2) { top: 180px; right: 0px;  animation-delay: 1.5s; }
.float-card:nth-child(3) { bottom: 30px; left: 60px; animation-delay: 3s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}

.float-card .match-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
}
.float-card .match-teams { font-weight: 600; font-size: .9rem; }
.float-card .match-time { font-size: .75rem; color: var(--text-3); font-family: 'JetBrains Mono', monospace; }
.odd-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: .85rem; font-weight: 600;
}
.odd-pill.betano   { background: rgba(255,107,0,.2);  color: var(--betano); }
.odd-pill.superbet { background: rgba(227,6,19,.2);   color: #ff6676; }
.odd-pill.best     { box-shadow: 0 0 0 2px var(--success); }

/* animated network lines in background */
.bg-grid {
  position: absolute; inset: 0; opacity: .25;
  background-image:
    linear-gradient(rgba(34,211,238,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.15) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(800px 500px at 50% 40%, #000, transparent 85%);
  animation: gridshift 20s linear infinite;
}
@keyframes gridshift { from { background-position: 0 0; } to { background-position: 42px 42px; } }

.pulse-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 rgba(34,211,238,.5);
  animation: pulse 2.4s ease-out infinite;
}
.pulse-dot:nth-child(1) { top: 22%; left: 12%;  animation-delay: .2s; }
.pulse-dot:nth-child(2) { top: 78%; left: 88%;  animation-delay: 1.1s; background: var(--accent); }
.pulse-dot:nth-child(3) { top: 55%; left: 48%;  animation-delay: .7s; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,238,.5); }
  100% { box-shadow: 0 0 0 28px rgba(34,211,238,0); }
}

.landing-features {
  max-width: 1240px; margin: 0 auto; padding: 40px 24px 80px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  position: relative; z-index: 2;
}
.feat-card {
  background: rgba(24,32,54,.6); backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feat-card .icon { font-size: 1.8rem; margin-bottom: 10px; }
.feat-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feat-card p  { color: var(--text-2); font-size: .9rem; }

/* ---------- DASHBOARD ---------- */
.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.dash-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.dash-header .sub { color: var(--text-2); font-size: .9rem; margin-top: 4px; }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.board-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: relative;
  transition: all .15s;
}
.board-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.board-card .book-tabs {
  display: flex; gap: 6px; margin-bottom: 12px; font-size: .8rem;
}
.book-tab {
  padding: 3px 10px; border-radius: 6px; font-weight: 600;
  background: var(--bg-soft); color: var(--text-3);
  cursor: pointer; border: 1px solid transparent;
}
.book-tab.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

.add-board {
  border: 2px dashed var(--border-strong);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
  color: var(--text-2); font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.add-board:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- COMPARISON TABLE ---------- */
.comparison-grid {
  display: grid; gap: 10px; margin-top: 16px;
}
.cmp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.cmp-card.has-arb { border-color: var(--success); box-shadow: 0 0 0 1px var(--success); }
.cmp-head {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
}
.cmp-match { font-weight: 700; font-size: 1rem; }
.cmp-meta  { font-size: .8rem; color: var(--text-3); display: flex; gap: 10px; }
.cmp-arb   { color: var(--success); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

.cmp-markets {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px;
  font-size: .85rem;
}
.cmp-row {
  display: grid; grid-template-columns: 1fr 80px 80px 56px; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  align-items: center;
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .sel { color: var(--text-2); }
.cmp-row .odd { font-family: 'JetBrains Mono', monospace; text-align: center; padding: 3px 6px; border-radius: 6px; }
.cmp-row .odd.betano   { background: rgba(255,107,0,.12); }
.cmp-row .odd.superbet { background: rgba(227,6,19,.15); }
.cmp-row .odd.best     { font-weight: 700; }
.cmp-row .diff { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--text-3); }
.cmp-row .diff.hot { color: var(--success); font-weight: 700; }

/* ---------- TABLE ---------- */
table.table {
  width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 12px;
}
table.table th, table.table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table.table th { font-weight: 600; color: var(--text-2); background: var(--bg-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
table.table tbody tr:hover { background: var(--bg-soft); }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 24px;
  width: 440px; max-width: 92vw;
}
.modal h2 { font-size: 1.1rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---------- TOAST ---------- */
#toast-root { position: fixed; top: 80px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); padding: 12px 16px; border-radius: var(--radius-sm);
  min-width: 260px; max-width: 400px; box-shadow: var(--shadow);
  animation: toast-in .2s ease-out;
}
.toast.error   { border-color: var(--danger);  color: #fca5a5; }
.toast.success { border-color: var(--success); color: #86efac; }
.toast.warn    { border-color: var(--warning); color: #fcd34d; }
@keyframes toast-in { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- LEAGUE-GROUPED COMPARISON (new) ---------- */
.league-section {
  margin-bottom: 28px;
}
.league-section > h2 {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.1rem; font-weight: 700;
  padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.league-country {
  font-size: .75rem; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 8px; background: var(--bg-soft); border-radius: 999px;
}
.league-name { color: var(--primary); }
.league-count {
  margin-left: auto; font-size: .8rem; color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

.match-list { display: flex; flex-direction: column; gap: 6px; }
.match-list.flat { gap: 8px; }

.match-league {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 4px;
}
.match-league .league-country {
  font-size: .68rem; padding: 1px 8px;
  background: var(--bg-soft); border-radius: 999px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
}
.match-league .league-name-inline {
  font-size: .78rem; color: var(--primary); font-weight: 600;
}

.match-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  transition: border-color .15s;
}
.match-card.has-arb {
  border-color: var(--success);
  box-shadow: inset 3px 0 0 var(--success);
}
.match-card.has-value {
  border-color: var(--warning);
  box-shadow: inset 3px 0 0 var(--warning);
}

.match-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.match-teams { font-weight: 700; font-size: .95rem; }
.match-teams .vs { color: var(--text-3); font-weight: 400; margin: 0 6px; }
.match-meta { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--text-3); flex-wrap: wrap; }

.badge-arb {
  background: rgba(34,197,94,.2); color: var(--success);
  padding: 3px 10px; border-radius: 999px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; font-size: .78rem;
}
.badge-value {
  background: rgba(245,158,11,.15); color: var(--warning);
  padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: .78rem;
}
.badge-djaghah {
  padding: 3px 10px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .78rem;
  box-shadow: 0 0 12px rgba(34,211,238,.35);
  cursor: pointer;
  transition: all .15s;
}
.badge-djaghah:hover { transform: scale(1.05); box-shadow: 0 0 18px rgba(139,92,246,.5); }
.djaghah-modal { width: 640px; max-width: 94vw; max-height: 88vh; overflow-y: auto; }
.djaghah-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.djaghah-breakdown { background: var(--bg-soft); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.dj-bar { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; padding: 4px 0; font-size: .82rem; }
.dj-bar-label { font-family: 'JetBrains Mono', monospace; color: var(--text-2); }
.dj-bar-track { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.dj-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.dj-bar-meta { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--text-3); text-align: right; }
.djaghah-section { padding: 10px 0; border-top: 1px solid var(--border); }
.djaghah-section h3 { font-size: .95rem; margin-bottom: 6px; }
.dj-list { margin-left: 20px; font-size: .84rem; color: var(--text); line-height: 1.5; }
.dj-list li { margin: 4px 0; }
.dj-list.dj-missing li { color: var(--text-2); font-size: .8rem; }

/* one-line 1X2 summary */
.oneline-1x2 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 8px 0;
}
.ol-sel {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--bg-soft); border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.ol-sel.empty { opacity: .5; }
.ol-lbl { font-weight: 700; color: var(--text-2); font-size: .85rem; width: 20px; }
.ol-val {
  flex: 1; text-align: center; padding: 3px 0;
  background: var(--surface-2); border-radius: 6px; font-size: .88rem;
}
.ol-val.betano   { background: rgba(255,107,0,.12);  color: var(--betano); }
.ol-val.superbet { background: rgba(227,6,19,.15);   color: #ff6676; }
.ol-val.best { font-weight: 700; box-shadow: 0 0 0 1px var(--success); }

/* full markets details */
.match-history { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.match-history > summary {
  cursor: pointer; color: var(--text-2); font-size: .82rem;
  padding: 4px 0; list-style: none; user-select: none;
}
.match-history > summary::before { content: '▸ '; color: var(--text-3); }
.match-history[open] > summary::before { content: '▾ '; }
.history-legend {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  padding: 8px 4px; font-size: .8rem;
}
.leg-item { display: inline-flex; align-items: center; gap: 6px; }
.leg-swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.history-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.history-outcome {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
}
.history-outcome-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 4px;
}

.match-details { margin-top: 8px; }
.match-details > summary {
  cursor: pointer; color: var(--text-2); font-size: .8rem;
  padding: 4px 0; list-style: none;
}
.match-details > summary::before {
  content: '▸ '; color: var(--text-3);
}
.match-details[open] > summary::before { content: '▾ '; }
.match-details .cmp-markets {
  display: flex; flex-direction: column; gap: 0;
  background: var(--bg-soft); border-radius: 8px; padding: 6px 12px;
}
.match-details .cmp-row {
  display: grid;
  grid-template-columns: 2fr repeat(var(--cols, 2), 60px) 60px;
  gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: .82rem; align-items: center;
}
.match-details .cmp-row.header {
  color: var(--text-3); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border-strong);
}
.match-details .cmp-row:last-child { border-bottom: 0; }
.match-details .cmp-row.is-value { background: rgba(245,158,11,.07); margin: 0 -6px; padding: 6px; border-radius: 4px; }
.match-details .sel { color: var(--text); }
.match-details .odd, .match-details .odd-head {
  font-family: 'JetBrains Mono', monospace; text-align: center;
  padding: 3px 4px; border-radius: 4px; font-size: .82rem;
}
.match-details .odd.betano { background: rgba(255,107,0,.1); }
.match-details .odd.superbet { background: rgba(227,6,19,.12); }
.match-details .odd.best { font-weight: 700; outline: 1px solid var(--success); }
.match-details .diff, .match-details .diff-head {
  font-family: 'JetBrains Mono', monospace; text-align: right; font-size: .75rem; color: var(--text-3);
}
.match-details .diff.hot { color: var(--warning); font-weight: 700; }

/* ---------- MARKET TABS + FILTER BAR ---------- */
.market-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px;
}
.tab-chip {
  padding: 8px 16px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all .15s;
}
.tab-chip:hover { background: var(--bg-soft); color: var(--text); }
.tab-chip.active { background: var(--primary); color: #0b0f19; }

.filter-bar {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.filter-group label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0; }
.filter-group select { padding: 6px 10px; font-size: .85rem; min-width: 220px; }
.chip-group { display: flex; gap: 4px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-2);
  border-radius: 6px; font-size: .82rem; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ---------- OUTCOME GRID (per market) ---------- */
.market-block { padding: 8px 0; }
.market-line { font-size: .78rem; color: var(--text-3); margin-bottom: 6px; }
.outcome-grid {
  display: grid; gap: 10px;
}
.outcome {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px;
}
.outcome.empty { opacity: .45; }
.outcome.plausible { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-soft); }
.out-lbl {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: .9rem; margin-bottom: 6px;
}
.out-lbl .pf {
  font-family: 'JetBrains Mono', monospace; font-size: .72rem;
  font-weight: 500; color: var(--text-3);
}
.out-val { font-family: 'JetBrains Mono', monospace; font-size: .95rem; color: var(--text-3); text-align: center; padding: 4px 0; }
.out-books { display: flex; flex-direction: column; gap: 3px; }
.book-cell {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 6px; align-items: center;
  padding: 4px 8px; border-radius: 5px;
  background: var(--surface);
  font-family: 'JetBrains Mono', monospace; font-size: .82rem;
}
.book-cell.empty { opacity: .4; }
.book-cell.betano   { background: rgba(255,107,0,.10); }
.book-cell.superbet { background: rgba(227,6,19,.10); }
[data-theme="light"] .book-cell.betano   { background: rgba(255,107,0,.08); }
[data-theme="light"] .book-cell.superbet { background: rgba(227,6,19,.07); }
.book-cell.best { outline: 1px solid var(--success); font-weight: 700; }
.book-cell .book-name { font-size: .72rem; color: var(--text); text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.book-cell.betano   .book-name { color: var(--betano-text); }
.book-cell.superbet .book-name { color: var(--superbet-text); }
.book-cell .book-odd { font-weight: 700; text-align: center; }
.book-cell .book-edge {
  font-size: .72rem; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-soft); color: var(--text-3);
}
.book-cell .book-edge.edge-ok   { background: rgba(34,197,94,.1);  color: var(--success); }
.book-cell .book-edge.edge-warm { background: rgba(245,158,11,.15); color: var(--warning); font-weight: 700; }
.book-cell .book-edge.edge-hot  { background: rgba(239,68,68,.2);  color: var(--danger);  font-weight: 700; }

/* ---------- ACTION MODAL ---------- */
.action-modal { width: 560px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column; }
.action-status { padding: 10px 0; font-size: .95rem; }
.action-steps { overflow-y: auto; flex: 1; padding: 8px 0; background: var(--bg-soft); border-radius: 6px; padding: 10px; margin: 6px 0; }
.action-step {
  display: grid; grid-template-columns: 24px 1fr 2fr; gap: 10px;
  padding: 6px 8px; border-radius: 4px; font-size: .85rem;
  align-items: baseline;
}
.action-step.ok   { color: var(--success); background: rgba(34,197,94,.06); }
.action-step.fail { color: var(--danger);  background: rgba(239,68,68,.08); }
.action-step .astep-ic  { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.action-step .astep-lbl { color: var(--text); font-weight: 600; }
.action-step .astep-msg { color: var(--text-2); font-size: .78rem; font-family: 'JetBrains Mono', monospace; white-space: pre-wrap; word-break: break-word; }

/* ---------- ADMIN STATS — per-league summary + per-cell buttons ---------- */
.btn-mini {
  display: inline-block; padding: 1px 6px; margin-left: 4px;
  font-size: .7rem; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-soft); color: var(--text-2); cursor: pointer;
}
.btn-mini:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.summary-row > td { padding: 0 !important; background: var(--bg-soft); }
.summary-panel { padding: 14px 16px; }
.summary-header { font-size: .95rem; margin-bottom: 10px; color: var(--text-2); }
.summary-seasons th, .summary-seasons td { text-align: center; padding: 6px 8px; font-size: .82rem; }
.summary-seasons td:first-child, .summary-seasons th:first-child { text-align: left; }
.fc-full    { color: var(--success); font-weight: 700; }
.fc-partial { color: var(--warning); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: .78rem; }
.fc-empty   { color: var(--text-3); }

/* ---------- BET-MATCH DETAIL ---------- */
.insights { border-left: 3px solid var(--primary); }
.insights .dj-list li { font-size: .9rem; padding: 4px 0; }
.team-side .team-side-stats { font-size: .88rem; line-height: 1.5; }
.mdetail-market { margin-bottom: 16px; }
.mdetail-market-head {
  font-weight: 700; padding: 6px 10px;
  background: var(--bg-soft); border-radius: 6px 6px 0 0;
  border: 1px solid var(--border); border-bottom: 0;
}
.mdetail-odds { margin: 0; border-radius: 0 0 6px 6px; overflow: hidden; border: 1px solid var(--border); border-top: 0; }
.mdetail-odds th, .mdetail-odds td { padding: 5px 8px; }

/* ---------- STATS EXPLORER ---------- */
.standings-table th, .standings-table td { padding: 6px 8px; text-align: center; }
.standings-table td:nth-child(2) { text-align: left; }
.standings-table .hm-split { color: var(--text-2); font-family: 'JetBrains Mono', monospace; font-size: .78rem; }
.form-chip {
  display: inline-block; width: 20px; height: 20px; line-height: 20px;
  text-align: center; border-radius: 4px; font-weight: 700; font-size: .72rem;
  margin-right: 2px; color: #fff;
}
.form-chip.success { background: var(--success); }
.form-chip.warning { background: var(--warning); color: #1a1207; }
.form-chip.danger  { background: var(--danger); }
.league-avg-summary {
  padding: 8px 12px; background: var(--bg-soft); border-radius: 6px;
  font-size: .82rem; color: var(--text-2); margin-bottom: 10px;
}

.team-top { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 900px) { .team-top { grid-template-columns: 1fr; } }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
}
.stat-card {
  background: var(--bg-soft); border-radius: 8px; padding: 10px 12px;
}
.stat-label { font-size: .72rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.stat-value { font-size: 1.3rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.stat-sub { font-size: .72rem; color: var(--text-3); margin-top: 2px; }

.style-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.style-tag {
  padding: 4px 12px; background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; font-size: .8rem; font-weight: 600;
  cursor: help;
}
.style-reasons { margin-left: 18px; font-size: .82rem; color: var(--text-2); }
.style-reasons li { margin: 4px 0; }

.h2h-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 10px 0;
}
.h2h-summary > div { text-align: center; }
.h2h-num { font-size: 2rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; display: block; }
.h2h-lbl { font-size: .78rem; color: var(--text-3); }

.match-score-big {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center;
  padding: 24px 0; text-align: center; font-weight: 700; font-size: 1.2rem;
}
.match-score-big .mscore { font-family: 'JetBrains Mono', monospace; font-size: 2.6rem; color: var(--primary); }
.match-score-big > div:first-child { text-align: right; }
.match-score-big > div:last-child { text-align: left; }

.match-stats-table { width: 100%; border-collapse: collapse; }
.match-stats-table td { padding: 6px 12px; font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.match-stats-table tr { border-bottom: 1px solid var(--border); }

/* ---------- STATS / SOURCES MATRIX ---------- */
.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.source-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
}
.source-card.inactive { opacity: .5; }
.source-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.source-meta { font-size: .78rem; color: var(--text-2); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.source-covers { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.cov-chip {
  padding: 2px 8px; background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; font-size: .7rem; font-weight: 600;
}
.source-stats { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--text-2); }
.source-notes {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: .75rem; color: var(--text-3); line-height: 1.35;
}
.refs-matrix th, .refs-matrix td { text-align: center; }
.refs-matrix td:nth-child(3) { text-align: left; }
.field-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.field-count {
  padding: 3px 10px; border-radius: 999px; font-size: .75rem;
  font-family: 'JetBrains Mono', monospace; font-weight: 600;
}
.field-count.full    { background: rgba(34,197,94,.15);  color: var(--success); }
.field-count.partial { background: rgba(245,158,11,.15); color: var(--warning); }
.field-count.empty   { background: rgba(239,68,68,.12);  color: var(--danger); }

/* ---------- LINKED LEAGUES LIST (mappings page) ---------- */
.linked-list { display: flex; flex-direction: column; gap: 6px; }
.linked-row {
  display: grid;
  grid-template-columns: 90px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 6px 10px; background: var(--bg-soft);
  border-radius: 6px;
}
.linked-name { font-weight: 600; font-size: .88rem; }
.linked-country { font-size: .78rem; color: var(--text-2); font-family: 'JetBrains Mono', monospace; }
.linked-country.mismatch { color: var(--warning); font-weight: 700; }
.linked-unlink { color: var(--text-3); font-size: .85rem; text-decoration: none; }
.linked-unlink:hover { color: var(--danger); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 60px; gap: 40px; }
  .landing-visual { height: 300px; }
  .landing-features { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .cmp-markets { grid-template-columns: 1fr; }
}
