/* stats.cgmbet.com — same palette as www.cgmbet.com */
:root {
  --bg: #f8fafc; --card: #ffffff; --card2: #f1f5f9; --line: #e2e8f0;
  --text: #1e293b; --text2: #64748b; --muted: #94a3b8;
  --blue: #3b82f6; --blue2: #2563eb; --purple: #8b5cf6; --green: #10b981; --red: #ef4444; --orange: #f59e0b;
  --home: #f97316; --away: #3b82f6;           /* orange = home team of the next fixture, blue = away (as in CGMBet26) */
  --homebg: rgba(249,115,22,.13); --awaybg: rgba(59,130,246,.13);
  --hero: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --grad: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 14px rgba(15,23,42,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --card: #111a2e; --card2: #17223a; --line: #23304a;
    --text: #e2e8f0; --text2: #94a3b8; --muted: #64748b;
    --homebg: rgba(249,115,22,.2); --awaybg: rgba(59,130,246,.22);
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.5; font-size: 15px; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.muted { color: var(--text2); }
.num { font-variant-numeric: tabular-nums; }

/* ── top bar ── */
.top { background: var(--hero); color: #fff; position: sticky; top: 0; z-index: 50; }
.top-in { max-width: 1400px; margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 18px; }
.brand img { border-radius: 8px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: brightness(1.5); }
.updated { color: #94a3b8; font-size: 13px; margin-left: auto; }
.cta-btn { background: var(--grad); color: #fff; text-decoration: none; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.cta-btn:hover { filter: brightness(1.1); }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 22px; padding: 4px 6px; }

/* ── layout ── */
.layout { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; display: flex; gap: 20px; padding: 20px 16px; }
.side { width: 260px; flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); align-self: flex-start; position: sticky; top: 78px; max-height: calc(100vh - 98px);
  display: flex; flex-direction: column; overflow: hidden; }
.side-head { padding: 12px; border-bottom: 1px solid var(--line); }
.side-head input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.side-list { overflow-y: auto; padding: 6px 0 12px; }
.side-group { padding: 10px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  padding: 6px 14px; font-size: 14px; color: var(--text); }
.side-item:hover { background: var(--card2); }
.side-item.on { background: var(--awaybg); color: var(--blue); font-weight: 600; }
.side-item .c { color: var(--muted); font-size: 12px; margin-left: auto; }
.star { color: var(--orange); }
.main { flex: 1; min-width: 0; }
.scrim { display: none; }
.loading { padding: 60px; text-align: center; color: var(--text2); }

/* ── league header + tabs ── */
.lg-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lg-head h1 { font-size: 24px; line-height: 1.2; }
.lg-head .sub { color: var(--text2); font-size: 14px; }
.fav { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text2); }
.fav.on { color: var(--orange); border-color: var(--orange); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--text2);
  border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.tab .new { font-size: 10px; background: var(--grad); color: #fff; border-radius: 6px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }

/* ── cards ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 17px; margin-bottom: 4px; }
.card h3 { font-size: 15px; margin-bottom: 8px; }
.card .intro { color: var(--text2); font-size: 14px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* segmented control */
.seg { display: inline-flex; background: var(--card2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text2); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button.lock { color: var(--muted); }
.btn { background: var(--blue); color: #fff; border: 0; border-radius: 8px; padding: 7px 16px; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--blue2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--card2); color: var(--text); }
select.sel { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); max-width: 100%; }

/* ── tables ── */
.tw { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.t th { text-align: right; font-size: 12px; font-weight: 600; color: var(--text2); padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { text-align: right; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t th.l, .t td.l { text-align: left; }
.t th.c, .t td.c { text-align: center; }
.t th[data-sort] { cursor: pointer; }
.t th[data-sort]:hover { color: var(--text); }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--card2); }
.t tr.mh td { background: var(--homebg); }
.t tr.ma td { background: var(--awaybg); }
.t td.team { font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.t td.pts { font-weight: 700; }
.t .pos { color: var(--text2); width: 28px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.h { background: var(--home); } .dot.a { background: var(--away); }
.zone-top td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.zone-bot td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* form pills */
.fp { display: inline-flex; gap: 3px; }
.fp i { display: inline-block; width: 18px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 700; font-style: normal;
  color: #fff; text-align: center; line-height: 18px; }
.fp .W { background: var(--green); } .fp .D { background: #94a3b8; } .fp .L { background: var(--red); }
.res { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 4px; color: #fff; font-weight: 700; font-size: 12px; text-align: center; }
.res.W { background: var(--green); } .res.D { background: #94a3b8; } .res.L { background: var(--red); }

/* probability bar */
.pbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; font-size: 11px; font-weight: 700; color: #fff; min-width: 150px; }
.pbar span { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pbar .p1 { background: var(--home); } .pbar .px { background: #94a3b8; } .pbar .p2 { background: var(--away); }
.pct { font-weight: 700; }
.heat { border-radius: 4px; padding: 2px 6px; display: inline-block; min-width: 46px; }
.delta-up { color: var(--green); font-weight: 700; font-size: 12px; }
.delta-dn { color: var(--red); font-weight: 700; font-size: 12px; }
.mx td { padding: 3px 2px; font-size: 11px; text-align: center; min-width: 24px; }
.mx th { padding: 3px 2px; font-size: 11px; text-align: center; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card2); border-radius: 10px; padding: 10px 12px; }
.tile .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 12px; color: var(--text2); }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tiles.wide .v { font-size: 18px; }
.bars .b { display: grid; grid-template-columns: 44px 1fr 48px; align-items: center; gap: 8px; font-size: 13px; margin: 3px 0; font-variant-numeric: tabular-nums; }
.bars .b > div { background: var(--card2); border-radius: 4px; height: 14px; overflow: hidden; }
.bars .b > div > span { display: block; height: 100%; background: var(--grad); border-radius: 4px; }

/* next fixture */
.nextfx { display: flex; flex-direction: column; gap: 8px; }
.nextfx .teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 16px; }
.nextfx .teams span:last-child { text-align: right; }
.nextfx .when { color: var(--text2); font-size: 13px; text-align: center; }

/* CTA blocks */
.promo { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(59,130,246,.10), rgba(139,92,246,.12));
  border: 1px solid rgba(99,102,241,.25); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.promo .ico { font-size: 20px; }
.promo a { margin-left: auto; white-space: nowrap; font-weight: 700; text-decoration: none; background: var(--grad); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.locked { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--text2); font-size: 13px; margin-top: 12px; }
.locked b { color: var(--text); }
.locked a { font-weight: 700; }
.lockbtn { background: var(--card2); border: 1px dashed var(--muted); color: var(--text2); border-radius: 8px; padding: 5px 10px; font-size: 13px; }
.lockbtn::before { content: "🔒 "; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text2); font-size: 11px; font-family: inherit; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.chip.on { color: #fff; border-color: transparent; }

/* what-if */
.wi { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 8px; align-items: center; font-size: 14px; }
.wi .h { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi .a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi .sc { display: flex; gap: 4px; }
.wi input { width: 38px; text-align: center; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.wi input.set { border-color: var(--blue); background: var(--awaybg); font-weight: 700; }
.banner { background: var(--awaybg); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }

/* time machine */
.tm-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tm-ctl input[type=range] { flex: 1; min-width: 160px; accent-color: var(--blue); }
.tm-date { font-weight: 700; min-width: 110px; }
.tm-games { font-size: 13px; color: var(--text2); min-height: 20px; margin-bottom: 6px; }
.t tr.just td { background: rgba(16,185,129,.10); }
.mv-up { color: var(--green); font-size: 12px; font-weight: 700; }
.mv-dn { color: var(--red); font-size: 12px; font-weight: 700; }

/* twin */
.story { font-size: 15px; line-height: 1.65; }
.story b { color: var(--blue); }
.twin-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }

.toast { visibility: hidden; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: #0f172a; color: #fff;
  padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3); transition: transform .25s; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { visibility: visible; transform: translateX(-50%) translateY(0); }
.toast a { color: #93c5fd; font-weight: 700; }

/* ── footer ── */
.foot { background: var(--hero); color: #cbd5e1; font-size: 13px; margin-top: 20px; }
.foot-in { max-width: 1400px; margin: 0 auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; }
.foot a { color: #93c5fd; }
.foot .muted { color: #64748b; }

/* ── responsive ── */
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .burger { display: block; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; max-height: none; height: 100vh; border-radius: 0; z-index: 60;
    transform: translateX(-105%); transition: transform .2s; width: 290px; }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .layout { padding: 14px 12px; }
  .updated { display: none; }
  .cta-btn { margin-left: auto; padding: 7px 12px; font-size: 13px; }
  .lg-head h1 { font-size: 20px; }
  .tw { margin: 0 -12px; padding: 0 12px; }
  .card { padding: 14px 12px; }
  .hide-m, .dl { display: none; }
  .brand { font-size: 16px; white-space: nowrap; }
  .heat { min-width: 0; padding: 2px 4px; }
  .promo { flex-wrap: wrap; }
  .promo a { margin-left: 0; }
}

/* cookie consent */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto; z-index: 90; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 14px 16px; font-size: 14px;
  display: flex; flex-direction: column; gap: 10px; }
.consent[hidden] { display: none; }
