:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface-1: #fcfcfb;
  --surface-2: #efefeb;
  --border: #dddcd5;
  --grid: #e6e5df;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7a7974;
  --home: #2a78d6;
  --away: #eb6834;
  --home-soft: rgba(42,120,214,.14);
  --away-soft: rgba(235,104,52,.14);
  --pitch: #eef3ec;
  --pitch-line: #b9c7b5;
  --good: #1a7f37;
  --warn: #b26b00;
  --bad: #c62828;
  --accent: #2a78d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface-1: #1a1a19;
    --surface-2: #232321;
    --border: #33332f;
    --grid: #2a2a27;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --home: #3987e5;
    --away: #d95926;
    --home-soft: rgba(57,135,229,.18);
    --away-soft: rgba(217,89,38,.18);
    --pitch: #18221a;
    --pitch-line: #3a4d3c;
    --good: #4caf6a;
    --warn: #e0a030;
    --bad: #ef5350;
    --accent: #3987e5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface-1: #1a1a19;
  --surface-2: #232321;
  --border: #33332f;
  --grid: #2a2a27;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #8f8e86;
  --home: #3987e5;
  --away: #d95926;
  --home-soft: rgba(57,135,229,.18);
  --away-soft: rgba(217,89,38,.18);
  --pitch: #18221a;
  --pitch-line: #3a4d3c;
  --good: #4caf6a;
  --warn: #e0a030;
  --bad: #ef5350;
  --accent: #3987e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text-primary);
  font: 14px/1.5 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 16px; align-items: center;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--surface-1) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(90deg, var(--home) 50%, var(--away) 50%); }
.search { flex: 1; display: flex; gap: 8px; max-width: 760px; }
.search input {
  flex: 1; min-width: 0; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); font: inherit;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px;
  padding: 10px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
button.ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); padding: 8px 12px; }

main { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* cards */
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; min-width: 0;
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card .sub { margin: 0 0 14px; color: var(--text-muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }

/* home */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--text-secondary); margin: 0 auto; max-width: 620px; }
.daybar { display: flex; gap: 8px; align-items: center; margin: 24px 0 12px; flex-wrap: wrap; }
.daybar .ghost.active { border-color: var(--accent); color: var(--text-primary); }
.league-block { margin-bottom: 18px; }
.league-block h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.fx {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-1);
  cursor: pointer; text-align: left; color: var(--text-primary); font-weight: 500;
}
.fx:hover { border-color: var(--accent); }
.fx .t { display: flex; gap: 8px; align-items: center; min-width: 0; }
.fx .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx img { width: 18px; height: 18px; object-fit: contain; }
.fx .st { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-muted); font-weight: 400; }
.live { color: var(--bad); font-weight: 700; }

/* match header */
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 24px; margin-bottom: 16px;
}
.sb-team { display: flex; align-items: center; gap: 14px; }
.sb-team.away { flex-direction: row-reverse; text-align: right; }
.sb-team img { width: 64px; height: 64px; object-fit: contain; }
.sb-team .nm { font-size: 20px; font-weight: 700; }
.sb-team .meta { color: var(--text-muted); font-size: 12.5px; }
.sb-score { text-align: center; }
.sb-score .big { font-size: 46px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.sb-score .xg { color: var(--text-secondary); margin-top: 6px; font-size: 13px; }
.sb-score .stat { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-secondary); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.sw-home { background: var(--home); } .sw-away { background: var(--away); }
.goal-list { display: flex; justify-content: space-between; gap: 24px; font-size: 12.5px; color: var(--text-secondary); margin-top: 10px; }
.goal-list > div:last-child { text-align: right; }
@media (max-width: 700px) {
  .scoreboard { grid-template-columns: 1fr; text-align: center; }
  .sb-team, .sb-team.away { flex-direction: column; text-align: center; }
}

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--text-secondary); padding: 10px 12px; font-weight: 600;
}
.tabs button.on { color: var(--text-primary); border-bottom-color: var(--accent); }

/* insights */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.insight { border-left: 3px solid var(--border); padding: 10px 14px; background: var(--surface-2); border-radius: 0 10px 10px 0; }
.insight.home { border-left-color: var(--home); }
.insight.away { border-left-color: var(--away); }
.insight b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.insight span { color: var(--text-secondary); font-size: 12.5px; }
.insight .tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 700; }

/* stat comparison rows */
.cmp { display: grid; gap: 10px; }
.cmp-row { display: grid; grid-template-columns: 70px 1fr 70px; gap: 10px; align-items: center; }
.cmp-row .v { font-weight: 600; }
.cmp-row .v.r { text-align: right; }
.cmp-row .lab { text-align: center; font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.cmp-row .lab small { color: var(--text-muted); }
.bars { display: flex; gap: 2px; height: 8px; }
.bars div { height: 100%; }
.bars .h { background: var(--home); border-radius: 4px 0 0 4px; }
.bars .a { background: var(--away); border-radius: 0 4px 4px 0; }
.better { color: var(--text-primary); }
.worse { color: var(--text-muted); font-weight: 500 !important; }

/* kpi tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.kpi .k { font-size: 11.5px; color: var(--text-muted); }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi .d { font-size: 11.5px; color: var(--text-secondary); }

/* charts */
svg { display: block; max-width: 100%; }
svg text { fill: var(--text-secondary); font-family: Inter, sans-serif; }
.axis line, .axis path { stroke: var(--grid); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; font-size: 11.5px; position: sticky; top: 0; background: var(--surface-1); cursor: pointer; user-select: none; }
th:first-child, td:first-child { text-align: left; }
td.l, th.l { text-align: left; }
tr:hover td { background: var(--surface-2); }
.bar-cell { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); vertical-align: middle; margin-left: 6px; opacity: .8; }

/* feed */
.feed { max-height: 640px; overflow-y: auto; }
.feed-row { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--grid); font-size: 13px; }
.feed-row .m { color: var(--text-muted); font-weight: 600; }
.feed-row.key { background: var(--surface-2); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filters button { padding: 5px 10px; font-size: 12px; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 300px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.tip b { display: block; }
.tip .mut { color: var(--text-muted); }

.center-msg { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-pill { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.form-W { background: var(--good); } .form-D { background: var(--text-muted); } .form-L { background: var(--bad); }
.hl td { background: var(--surface-2); font-weight: 600; }
@media (max-width: 600px) { main { padding: 16px; } .topbar { padding: 10px 16px; flex-wrap: wrap; } .search { order: 3; flex-basis: 100%; } }

/* ---- nav ---- */
.mainnav { display: flex; gap: 4px; }
.mainnav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; color: var(--text-secondary); }
.mainnav a:hover { background: var(--surface-2); }
.mainnav a.on { background: var(--surface-2); color: var(--text-primary); }
.mainnav a[href="#/live"]::before { content: "●"; color: var(--bad); margin-right: 6px; font-size: 10px; vertical-align: 1px; }
.sb-team .nm a, .live-score a, .pc-teams a, .fx a { text-decoration: none; }
.sb-team .nm a:hover, .live-score a:hover, .pc-teams a:hover { text-decoration: underline; }
.mut { color: var(--text-muted); }
.chip.big { font-size: 13px; padding: 6px 12px; text-decoration: none; }
.chip.big:hover { outline: 1px solid var(--accent); }

/* ---- page heads ---- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h2 { margin: 0; }
.pagehead .sub { margin: 4px 0 0; color: var(--text-muted); max-width: 720px; }
.pagehead-tools { display: flex; gap: 10px; align-items: center; }
.toggle { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
select { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); }
.section-h { margin: 24px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

/* ---- probability bar ---- */
.probbar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; font-size: 12px; font-weight: 700; color: #fff; }
.probbar.small { height: 20px; font-size: 11px; }
.probbar > div { display: grid; place-items: center; min-width: 0; white-space: nowrap; }
.pb-h { background: var(--home); } .pb-a { background: var(--away); }
.pb-d { background: var(--text-muted); }

/* ---- live ---- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.live-card { cursor: pointer; display: grid; gap: 12px; transition: border-color .2s; }
.live-card:hover { border-color: var(--accent); }
.live-card.flash { animation: flash 2.4s ease-out 2; border-color: var(--good); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.live-top { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.live-top .mut { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.live-score .lt { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.live-score .lt.r { justify-content: flex-end; text-align: right; }
.live-score img { width: 28px; height: 28px; object-fit: contain; }
.live-score .ls { font-size: 26px; font-weight: 700; }
.live-ev { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.live-ev .r { text-align: right; }
.live-stats { display: grid; gap: 6px; }
.mini-cmp { display: grid; grid-template-columns: 36px 1fr 36px; gap: 8px; align-items: center; font-size: 12px; }
.mini-cmp small { display: block; text-align: center; color: var(--text-muted); font-size: 10.5px; }
.mini-cmp .r { text-align: right; }
.mini-cmp .bars { height: 6px; }
.live-prob small { display: block; margin-bottom: 4px; font-size: 11px; }

/* ---- predictions ---- */
.pred-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pred-card { cursor: pointer; display: grid; gap: 10px; padding: 14px 16px; }
.pred-card:hover { border-color: var(--accent); }
.pc-teams { display: grid; gap: 6px; font-weight: 600; }
.pc-teams .t { display: flex; gap: 8px; align-items: center; }
.pc-teams img, .nologo { width: 20px; height: 20px; object-fit: contain; display: inline-block; }
.pc-pred { display: grid; gap: 8px; }
.pc-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); align-items: center; }
.edge { color: var(--good); font-weight: 600; }
.form-pill.sm { width: 18px; height: 18px; font-size: 10px; border-radius: 4px; }
a.form-pill { text-decoration: none; }
.sm-wrap { font-size: 11px; }
.sm-ylab { color: var(--text-muted); margin-bottom: 6px; }
.sm-grid { display: grid; grid-template-columns: 22px repeat(6, minmax(0, 1fr)); gap: 2px; }
.sm-h { display: grid; place-items: center; color: var(--text-muted); font-weight: 600; }
.sm-cell { aspect-ratio: 1.6; display: grid; place-items: center; border-radius: 4px; font-weight: 600; color: var(--text-primary); font-size: 11px; }

/* ---- team page ---- */
.team-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.team-head img { width: 72px; height: 72px; object-fit: contain; }
.iv { display: grid; gap: 8px; }
.iv-row { display: grid; grid-template-columns: 28px 1fr 70px 1fr 28px; gap: 8px; align-items: center; font-size: 12px; }
.iv-row .r { text-align: right; }
.iv-lab { text-align: center; color: var(--text-muted); }
.iv-l, .iv-r { height: 12px; display: flex; }
.iv-l { justify-content: flex-end; }
.iv-l div { border-radius: 4px 0 0 4px; height: 100%; } .iv-r div { border-radius: 0 4px 4px 0; height: 100%; }
@media (max-width: 700px) { .mainnav { order: 2; } .live-grid, .pred-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- accounts ---- */
.brand-name b { font-weight: 800; color: var(--accent); }
.userbox { display: flex; align-items: center; gap: 8px; margin-left: auto; white-space: nowrap; }
.userbox .chip { font-size: 12.5px; padding: 5px 10px; }
.ghost-link { text-decoration: none; font-weight: 600; color: var(--text-secondary); padding: 8px 10px; border-radius: 8px; }
.ghost-link:hover { background: var(--surface-2); color: var(--text-primary); }
.chip.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.chip.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; }
button.sm { padding: 4px 10px; font-size: 12px; }
button.linkbtn { background: none; border: none; color: var(--text-primary); padding: 0; font-weight: 500; }
button.linkbtn:hover { color: var(--accent); }
td.wrap { white-space: normal; min-width: 180px; }
.filters input, .filters select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); }
.filters button.active { border-color: var(--accent); color: var(--text-primary); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .2s; background: var(--text-primary); color: var(--surface-1); padding: 8px 16px; border-radius: 99px; font-weight: 600; z-index: 60; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 420px; padding: 0; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-brand h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.auth-brand p { margin: 2px 0 0; color: var(--text-muted); }
.brand-dot.big { width: 40px; height: 40px; flex: none; }
.auth-card { padding: 22px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.auth-tabs button { background: none; border: none; color: var(--text-secondary); padding: 8px; border-radius: 8px; }
.auth-tabs button.on { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.auth-card form { display: grid; gap: 14px; }
.auth-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.auth-card input { font: inherit; font-weight: 400; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); }
.auth-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.auth-card input.num { letter-spacing: .06em; text-transform: uppercase; }
.auth-card button[type=submit] { padding: 12px; margin-top: 4px; }
.auth-card button:disabled { opacity: .6; cursor: wait; }
.auth-hint { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.auth-msg { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.auth-msg.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
@media (max-width: 900px) { .brand-name { display: none; } }
@media (max-width: 600px) { .userbox #who { display: none; } }

[hidden] { display: none !important; }

/* ---- live chat ---- */
.chat-root { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.chat-fab { display: flex; align-items: center; gap: 8px; border-radius: 99px; padding: 12px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.25); position: relative; }
.chat-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-size: 12px; display: grid; place-items: center; }
.chat-panel { width: 360px; height: min(560px, calc(100vh - 110px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.3); position: relative; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.chat-empty { margin: auto; text-align: center; }
.chat-msg { position: relative; padding: 4px 8px; border-radius: 10px; margin-top: 8px; }
.chat-msg.grouped { margin-top: 0; }
.chat-msg:hover { background: var(--surface-2); }
.chat-msg.mine { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chat-msg.mention { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.chat-meta { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.chat-meta .chip { font-size: 10px; padding: 1px 6px; }
.chat-text { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-tools { position: absolute; right: 6px; top: 4px; display: none; gap: 4px; }
.chat-msg:hover .chat-tools { display: flex; }
.chat-tools button { background: var(--surface-1); border: 1px solid var(--border); padding: 2px 6px; font-size: 12px; border-radius: 6px; }
.chat-newpill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; padding: 5px 12px; font-size: 12px; border-radius: 99px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); }
.chat-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-form button { padding: 8px 14px; }
.chat-err { margin: 0 12px 4px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chat-rules { font-size: 11px; padding: 0 12px 10px; }
@media (max-width: 600px) {
  .chat-root { right: 12px; bottom: 12px; left: auto; }
  .chat-panel { position: fixed; inset: auto 0 0 0; width: 100%; height: 75vh; border-radius: 16px 16px 0 0; }
}
.mini-h { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.wordlist { display: flex; flex-wrap: wrap; gap: 6px; }
.wordchip { display: inline-flex; gap: 6px; align-items: center; }
.wordchip .linkbtn { font-size: 11px; color: var(--text-muted); }

/* terms */
.auth-card label.auth-check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; line-height: 1.4; }
.auth-card label.auth-check input { width: 17px; height: 17px; margin: 1px 0 0; padding: 0; flex: none; accent-color: var(--accent); }
.auth-check a { color: var(--accent); }
.site-foot a, .terms-back a, .terms-card a, .log-entry a { color: var(--link-soft); text-decoration-color: color-mix(in srgb, var(--link-soft) 45%, transparent); text-underline-offset: 3px; }
.site-foot a:hover, .terms-back a:hover, .terms-card a:hover, .log-entry a:hover { color: var(--text-primary); }
:root { --link-soft: #3a3a37; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --link-soft: #d4d4cf; } }
:root[data-theme="dark"] { --link-soft: #d4d4cf; }
/* changelog */
.log-entry { padding: 20px 24px; margin-bottom: 14px; line-height: 1.6; color: var(--text-secondary); }
.log-entry header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.log-entry time { font-weight: 600; color: var(--text-primary); }
.log-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.log-entry ul { margin: 0; padding-left: 20px; }
.log-entry li { margin: 4px 0; }
.log-entry b { color: var(--text-primary); }
@media (max-width: 600px) { .log-entry { padding: 16px; } }
.site-foot { text-align: center; font-size: 12.5px; color: var(--text-muted); padding: 18px 16px 24px; margin: 0; }
.terms-page { min-height: 100vh; padding: 32px 16px; }
.terms-wrap { max-width: 760px; margin: 0 auto; padding: 0; }
.terms-card { padding: 24px 26px; line-height: 1.6; color: var(--text-secondary); }
.terms-card h2 { font-size: 16px; color: var(--text-primary); margin: 24px 0 6px; letter-spacing: -.01em; }
.terms-card > p:first-child { margin-top: 0; }
.terms-card ul { padding-left: 20px; margin: 6px 0; }
.terms-card li { margin: 4px 0; }
.terms-card b { color: var(--text-primary); }
.terms-back { margin: 16px 0 0; }
@media (max-width: 600px) { .terms-card { padding: 18px 16px; } }

/* weather & odds */
.imp { display: inline-block; vertical-align: middle; margin-left: 8px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); }
.imp.imp-1 { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.imp.imp-2 { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.imp.imp-3 { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.wx-ic { margin-right: 6px; }
.wx-hours { margin-top: 12px; }
.wx-effects { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.wx-effects li { display: grid; gap: 3px; padding: 10px 12px 10px 14px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--border); line-height: 1.5; color: var(--text-secondary); }
.wx-effects li b { color: var(--text-primary); }
.wx-effects li.imp-1 { border-left-color: var(--good); }
.wx-effects li.imp-2 { border-left-color: var(--warn); }
.wx-effects li.imp-3 { border-left-color: var(--bad); }
.wx-guide { margin-top: 14px; color: var(--text-secondary); line-height: 1.55; }
.wx-guide summary { cursor: pointer; font-weight: 600; color: var(--text-primary); }
.wx-guide ul { padding-left: 20px; margin: 8px 0; }
.wx-guide b { color: var(--text-primary); }
.odds-head { margin: 0 0 12px; line-height: 1.5; color: var(--text-secondary); }
.odds-head b { color: var(--text-primary); }
.odds-tbl td .p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.odds-tbl .mut { color: var(--text-muted); font-size: 12px; }
.mv { font-weight: 600; margin-left: 4px; }
.mv.up { color: var(--good); }
.mv.down { color: var(--bad); }
.wx-cond { font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }

/* site banner + toasts */
.site-banner { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 9px 16px; font-size: 13.5px; font-weight: 500; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); text-align: center; }
.site-banner.lv-good { background: color-mix(in srgb, var(--good) 16%, var(--surface-1)); }
.site-banner.lv-warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface-1)); }
.site-banner.lv-bad { background: color-mix(in srgb, var(--bad) 18%, var(--surface-1)); }
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast2 { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-left: 4px solid var(--text-muted); box-shadow: 0 8px 28px rgba(0,0,0,.28); font-size: 13.5px; line-height: 1.45; animation: toastIn .25s ease-out; }
.toast2.click { cursor: pointer; }
.toast2 .t-tx b { display: block; margin-bottom: 2px; }
.toast2 .t-tx div { color: var(--text-secondary); }
.toast2.lv-good { border-left-color: var(--good); } .toast2.lv-warn { border-left-color: var(--warn); } .toast2.lv-bad { border-left-color: var(--bad); }
.t-x { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 2px; font-size: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* match buttons, bell, share modal */
.sb-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.sb-actions button.on { border-color: var(--good); color: var(--good); }
.bell { background: none; border: none; cursor: pointer; padding: 0 4px; font-size: 14px; opacity: .7; }
.bell.on, .bell:hover { opacity: 1; }
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.share-prev img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--border); }
/* track record */
.cal-bar { position: relative; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.cal-bar span { position: absolute; left: 0; height: 7px; }
.cal-bar .cal-p { top: 0; background: var(--text-muted); }
.cal-bar .cal-f { bottom: 0; background: var(--home); }
.rec-tbl td.pick { font-weight: 700; color: var(--text-primary); }
.rec-tbl td.won { background: color-mix(in srgb, var(--good) 14%, transparent); }
.hit { color: var(--good); font-weight: 700; } .miss { color: var(--bad); font-weight: 700; }
/* player page */
.player-head { display: flex; gap: 18px; align-items: center; }
.ph-img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.ph-init { display: grid; place-items: center; font-size: 28px; font-weight: 700; color: var(--text-secondary); }
.ph-team { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--text-secondary); }
.ph-team img { width: 22px; height: 22px; object-fit: contain; }
/* admin: site control + usage */
.ctl-card { margin-bottom: 0; }
.ctl-status { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ctl-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); }
.ctl-status.up .dot { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); }
.ctl-status.down .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.go { background: var(--good); border-color: var(--good); color: #fff; }
.nt-list { padding-left: 18px; margin: 8px 0 0; font-size: 13px; }
.nt-list li { margin: 4px 0; }
.u-bar { position: relative; height: 18px; background: var(--surface-2); border-radius: 4px; }
.u-bar span { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--home) 55%, transparent); border-radius: 4px; }
.u-bar b { position: relative; padding-left: 6px; font-size: 12px; line-height: 18px; }
.u-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 90px; align-items: end; }
.u-hours div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.u-hours span { display: block; background: color-mix(in srgb, var(--home) 60%, transparent); border-radius: 3px 3px 0 0; min-height: 2px; }
.u-hours small { font-size: 10px; color: var(--text-muted); height: 14px; }
@media (max-width: 600px) { .player-head { flex-direction: column; text-align: center; } .ph-team { justify-content: center; } .pill-row { justify-content: center; } }

/* player photos */
.pl-cell { display: inline-flex; align-items: center; gap: 8px; }
.face { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.face::before { content: attr(data-i); font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; opacity: 0; transition: opacity .2s; }
.face img.ok { opacity: 1; }
.ph-wrap { display: grid; justify-items: center; gap: 4px; flex: none; }
.ph-img { width: 112px; height: 112px; object-position: 50% 15%; border: 2px solid var(--border); }
.ph-credit { font-size: 10.5px; color: var(--text-muted); text-decoration: none; }
.ph-credit:hover { text-decoration: underline; }

/* ================= motion ================= */
/* bars slide to new values */
.probbar > div { overflow: hidden; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bars { justify-content: center; }
.bars > div { transition: width .7s cubic-bezier(.2,.8,.2,1); }
.u-bar span { transition: width .7s cubic-bezier(.2,.8,.2,1); }
.u-hours span { transition: height .7s cubic-bezier(.2,.8,.2,1); }
/* goal flash: score block flashes and the numbers slide in */
.goal-pop { animation: goalFlash 1.6s ease-out; }
@keyframes goalFlash {
  0% { background: var(--away); color: #fff; transform: scale(1.12); box-shadow: 0 0 0 0 color-mix(in srgb, var(--away) 70%, transparent); }
  25% { transform: scale(1); }
  60% { background: color-mix(in srgb, var(--away) 35%, transparent); box-shadow: 0 0 0 18px transparent; }
  100% { background: transparent; }
}
.goal-pop { border-radius: 8px; }
.ls.goal-pop, .sb-score .big.goal-pop { padding: 0 8px; }
/* live dot + minute */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 5px; vertical-align: 1px; animation: livePulse 1.6s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
.tick { font-variant-numeric: tabular-nums; }
/* red cards */
.redcard { display: inline-block; width: 10px; height: 14px; background: var(--bad); border-radius: 2px; margin: 0 4px; vertical-align: -2px; }
.redcard.red-drop { animation: redDrop .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes redDrop { 0% { transform: translateY(-22px) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* page + tab changes */
.page-in { animation: pageIn .22s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* charts that play once: hidden until they scroll into view, then play */
svg.prep .anim-path, svg.prep .anim-pop, svg.prep .anim-shot, svg.prep .anim-ripple, svg.prep .anim-mom { opacity: 0; }
svg.play .anim-path { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: drawLine 1.4s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
svg.play .anim-pop { transform-box: fill-box; transform-origin: center; animation: popIn .4s cubic-bezier(.3,1.6,.5,1) both; animation-delay: var(--d, 0s); }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
svg.play .anim-shot { transform-box: fill-box; transform-origin: center; animation: popIn .35s cubic-bezier(.3,1.6,.5,1) both; animation-delay: var(--d, 0s); }
svg.play .anim-ripple { transform-box: fill-box; transform-origin: center; animation: ripple 1s ease-out both; animation-delay: var(--d, 0s); }
@keyframes ripple { 0% { transform: scale(.4); opacity: 0; } 30% { opacity: 1; } 60% { transform: scale(2.2); opacity: .2; } 100% { transform: scale(1); opacity: 1; } }
svg.play .anim-mom { transform-box: fill-box; animation: momGrow .35s ease-out both; animation-delay: var(--d, 0s); }
svg.play .anim-mom.mom-home { transform-origin: bottom; }
svg.play .anim-mom.mom-away { transform-origin: top; }
@keyframes momGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* loading shimmer instead of spinners */
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--border)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel-wrap { display: grid; gap: 16px; }
.skel-title { height: 34px; width: min(420px, 70%); }
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.skel-card { height: 170px; border-radius: 14px; }
.skel-bar { height: 20px; margin: 4px 0 10px; }
.skel-line { height: 12px; width: 70%; }
.skel-msg { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; }
.spinner { width: 160px; height: 10px; border: none; border-radius: 6px; margin: 0 auto 14px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 45%, var(--border)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
/* alerts: bounce in, goals shake once */
.toast2 { animation: toastBounce .5s cubic-bezier(.3,1.5,.5,1); }
@keyframes toastBounce { 0% { opacity: 0; transform: translateY(24px) scale(.96); } 100% { opacity: 1; transform: none; } }
.toast2.shake { animation: toastBounce .5s cubic-bezier(.3,1.5,.5,1), shake .5s ease-in-out .5s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(1deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
/* admin: live "online now" */
#online-n.bump { display: inline-block; animation: bump .5s ease-out; }
@keyframes bump { 0% { transform: scale(1.35); color: var(--good); } 100% { transform: none; } }
.lt-right { display: inline-flex; align-items: center; gap: 4px; }

/* CometStats brand */
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 30px; height: 30px; flex: none; display: block; }
.brand-logo.big { width: 56px; height: 56px; }
.brand-name { font-weight: 500; letter-spacing: -.01em; }
.brand-name b { font-weight: 800; color: var(--away); }
.wordmark { font-weight: 500 !important; }
.wordmark b { font-weight: 800; }

/* home banner: floodlit stadium + ball on the right, fading into the dark on the left */
html, body { overflow-x: clip; }
.hero-banner { position: relative; margin: -24px calc(50% - 50vw) 28px; min-height: 260px; display: flex; align-items: center;
  --hero-h: 260px; height: var(--hero-h); background-color: #0b0d10;
  background-image: linear-gradient(90deg, #0b0d10 0%, #0b0d10 100%), url(/hero.jpg);
  background-repeat: no-repeat; background-position: left top, right center; background-size: max(1px, calc(100% - var(--hero-h) * 3.114 + 2px)) 100%, auto 100%; border-bottom: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.hero-banner::before { content: ""; position: absolute; left: -120px; top: -160px; width: 420px; height: 320px; background: radial-gradient(closest-side, rgba(57,135,229,.28), transparent); pointer-events: none; }
.hero-inner { position: relative; width: 100%; max-width: 1280px; margin: 0 auto; padding: 44px 24px 40px; box-sizing: border-box; }
.hero-bar { display: block; width: 46px; height: 4px; border-radius: 2px; background: var(--away); margin-bottom: 14px; }
.hero-banner h1 { margin: 0 0 14px; font-size: clamp(40px, 6vw, 64px); line-height: 1; font-weight: 800; letter-spacing: -.025em; color: #fff; }
.hero-banner h1 span { color: var(--away); }
.hero-banner p { margin: 0; max-width: 620px; font-size: 15.5px; line-height: 1.6; color: #c9ccd2; }
@media (max-width: 900px) {
  .hero-banner { height: auto; min-height: 0; background-image: linear-gradient(0deg, rgba(11,13,16,.92), rgba(11,13,16,.65)), url(/hero.jpg); background-size: cover, cover; background-position: center, 70% center; }
  .hero-inner { padding: 32px 16px 28px; }
}

/* =====================================================================
   CometStats v2 layout: navy dark theme, blue accent, left sidebar
   ===================================================================== */
:root { --accent: #1f63e0; --side-bg: #ffffff; --gold: #b07d00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0a0e17; --surface-1: #111827; --surface-2: #172036; --border: #243049; --grid: #1c2740; --text-secondary: #b8c0d0; --text-muted: #8a95ab; --accent: #2f7bff; --side-bg: #0c111c; --gold: #f5b301; }
}
:root[data-theme="dark"] { --bg: #0a0e17; --surface-1: #111827; --surface-2: #172036; --border: #243049; --grid: #1c2740; --text-secondary: #b8c0d0; --text-muted: #8a95ab; --accent: #2f7bff; --side-bg: #0c111c; --gold: #f5b301; }
.brand-name b { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-col > main { width: 100%; }
.sidebar { width: 228px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; background: var(--side-bg); border-right: 1px solid var(--border); z-index: 30; }
.side-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: 20px; padding-bottom: 4px; }
.side-brand img { width: 52px; height: 52px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--text-secondary); text-decoration: none; font-weight: 500; min-height: 44px; }
.side-nav a::before { content: none !important; }
.side-nav a svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.side-nav a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.side-count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-nav a.on .side-count { background: #fff; color: var(--accent); }
.side-promo { margin-top: auto; text-align: center; padding: 16px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); background: color-mix(in srgb, var(--accent) 9%, var(--surface-1)); display: grid; gap: 6px; justify-items: center; }
.side-promo svg { width: 24px; height: 24px; fill: var(--gold); stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; }
.side-promo b { font-size: 15px; }
.side-promo p { margin: 0 0 6px; font-size: 12.5px; color: var(--text-secondary); }
.side-promo-btn { display: inline-flex; gap: 6px; align-items: center; background: var(--accent); color: #fff; padding: 9px 16px; border-radius: 9px; text-decoration: none; font-weight: 600; font-size: 13px; min-height: 40px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; font-size: 12px; color: var(--text-muted); padding: 0 6px; }
.side-foot b { color: var(--text-primary); font-size: 13px; }
.side-foot a { color: var(--text-muted); }
.side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 25; }

/* top bar */
.topbar { gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.menu-btn { display: none; place-items: center; width: 44px; height: 44px; padding: 0; background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.menu-btn svg, .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; }
.search { position: relative; margin: 0 auto; max-width: 620px; align-items: center; }
.search .search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { padding: 11px 14px 11px 42px; border-radius: 999px; background: var(--surface-1); }
.search button { border-radius: 999px; padding: 10px 18px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.live-pill b { color: var(--text-primary); }
.live-pill:not(.on) .live-dot { background: var(--text-muted); animation: none; }
.live-pill.on .live-dot { background: #22c55e; }
.userbox { margin-left: 0; }

/* home banner (inside the content column now) */
.hero-banner { margin: 0 0 24px; border-radius: 16px; border: 1px solid var(--border); --hero-h: 220px; }
.hero-banner::after { content: ""; position: absolute; right: -30px; top: -10px; bottom: -10px; width: 210px; pointer-events: none;
  background: repeating-linear-gradient(118deg, transparent 0 26px, rgba(47,123,255,.55) 26px 38px, transparent 38px 64px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.hero-banner::before { background: radial-gradient(closest-side, rgba(47,123,255,.35), transparent); }
.hero-inner { padding: 30px 34px; max-width: none; }
.hero-banner h1 { display: flex; flex-direction: column; font-style: italic; font-weight: 900; font-size: clamp(38px, 5vw, 58px); line-height: .98; letter-spacing: -.02em; margin-bottom: 14px; }
.hero-banner h1 .h-a { color: #fff; }
.hero-banner h1 .h-b { color: #2f7bff; }
.hero-banner p { max-width: 520px; font-size: 15px; }

/* home grid */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.home-side { display: grid; gap: 16px; }
.block { margin-bottom: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h2 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 10px; }
.block-head h2 .ic { color: var(--accent); }
.block-head a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.red-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
.green-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; }
.lr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 12px; }
.lr-card { display: grid; gap: 9px; padding: 12px 14px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--border); text-decoration: none; transition: border-color .15s, transform .15s; }
.lr-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lr-card.is-live { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--bad); }
.badge { justify-self: start; display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-secondary); }
.badge.live { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.badge .live-dot { width: 6px; height: 6px; margin-right: 4px; }
.lr-team { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; align-items: center; font-weight: 600; }
.lr-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-team img, .logo-ph { width: 22px; height: 22px; object-fit: contain; }
.logo-ph { display: inline-block; border-radius: 50%; background: var(--surface-2); }
.lr-league { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 8px; }
.lr-league img { width: 16px; height: 16px; object-fit: contain; }
.lr-league span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-skel { height: 128px; border-radius: 12px; }
.daybar { margin: 0 0 14px; }
.day-pill { background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.day-pill:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.day-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fx-group { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.fx-league { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-weight: 700; font-size: 13.5px; background: var(--surface-2); }
.fx-league a { text-decoration: none; }
.fx-league a:hover { color: var(--accent); }
.fx-league img { width: 20px; height: 20px; object-fit: contain; }
.fx-group.fav .fx-league { color: var(--gold); }
.fx-group.fav .fx-league .ic { fill: var(--gold); stroke: var(--gold); }
.fx-row { display: grid; grid-template-columns: minmax(0, 1fr) 26px 96px 26px minmax(0, 1fr) 18px; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); text-decoration: none; min-height: 52px; }
.fx-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.fx-row img { width: 26px; height: 26px; object-fit: contain; }
.fx-h, .fx-a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fx-h { justify-content: flex-end; }
.fx-h .ic, .fx-a .ic { width: 14px; height: 14px; fill: var(--gold); stroke: var(--gold); }
.fx-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.fx-time, .fx-score { font-weight: 700; font-size: 15px; }
.fx-score.live { color: var(--bad); }
.fx-min { font-size: 10.5px; color: var(--text-muted); }
.fx-row > .ic { width: 16px; height: 16px; color: var(--text-muted); }
.side-card h3 { display: flex; align-items: center; gap: 8px; }
.side-card h3 .ic { color: var(--accent); }
.qs-list { margin: 0; display: grid; gap: 10px; }
.qs-list div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qs-list dt { color: var(--text-secondary); }
.qs-list dd { margin: 0; font-weight: 700; color: var(--accent); display: flex; align-items: center; }
.fav-list, .find-list, .fav-edit { list-style: none; margin: 0; padding: 0; }
.fav-list li, .find-list li, .fav-edit li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.fav-list li:first-child, .find-list li:first-child, .fav-edit li:first-child { border-top: none; }
.fav-list a, .find-list a, .fav-edit a, .tm { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; min-width: 0; }
.fav-list img, .find-list img, .fav-edit img, .tm img { width: 24px; height: 24px; object-fit: contain; flex: none; }
.find-list small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.side-link { display: inline-block; margin-top: 10px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }

/* leagues */
.league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.league-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--border); text-decoration: none; font-weight: 600; min-height: 64px; transition: border-color .15s, transform .15s; }
.league-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.league-card img { width: 36px; height: 36px; object-fit: contain; }
.league-card .ic { margin-left: auto; color: var(--text-muted); width: 16px; height: 16px; }
.lg-title { display: flex; gap: 14px; align-items: center; }
.lg-title img { width: 56px; height: 56px; object-fit: contain; }
.lg-title .sub a { color: var(--accent); }
.lg-table td .tm { font-weight: 600; }
.lg-table td.rk { width: 34px; }
.lg-table tr.fav td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lg-key { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-muted); margin: -4px 0 16px; }
.lg-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* search page */
.find-form { display: flex; gap: 8px; max-width: 640px; margin-bottom: 18px; }
.find-form input { flex: 1; min-width: 0; padding: 13px 16px; font: inherit; font-size: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); }
.find-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.find-sec { margin-bottom: 14px; }
.find-match { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; }
.fav-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fav-btn .ic { width: 14px; height: 14px; }
.fav-btn.on { color: var(--gold); border-color: var(--gold); }
.fav-btn.on .ic { fill: var(--gold); }

/* settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.set-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--border); cursor: pointer; }
.set-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.set-row small { display: block; color: var(--text-muted); font-size: 12.5px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 10px 16px; font-weight: 600; color: var(--text-secondary); }
.seg-opt input:checked + span { background: var(--accent); color: #fff; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.pw-form { display: grid; gap: 12px; max-width: 380px; }
.pw-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.pw-form input, .card .filters input { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); }

/* tablets + phones: sidebar slides in from the left */
@media (max-width: 1150px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 10px 0 30px rgba(0,0,0,.35); }
  body.menu-open .sidebar { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .live-pill { margin-left: auto; }
  .userbox .chip { display: none; }
  .hero-inner { padding: 24px 20px; }
  .fx-row { grid-template-columns: minmax(0, 1fr) 22px 70px 22px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .fx-row > .ic { display: none; }
  .fx-row img { width: 22px; height: 22px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

/* sidebar must keep its own order/name on small screens (older top-bar rules) */
.side-brand .brand-name { display: inline !important; }
.side-nav { order: 0 !important; }
/* compact two-line fixture rows (narrow columns) */
.fx-row.fxc { grid-template-columns: 64px minmax(0, 1fr) 16px; gap: 10px; padding: 9px 12px; }
.fx-row.fxc > .ic { display: block; }
.fxc-teams { display: grid; gap: 4px; min-width: 0; }
.fxc-team { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.fxc-team img, .fxc-team .logo-ph { width: 20px; height: 20px; object-fit: contain; }
.fxc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; display: flex; gap: 5px; align-items: center; }
.fxc-name .ic { width: 13px; height: 13px; fill: var(--gold); stroke: var(--gold); }
.fx-row.fxc .fx-time, .fx-row.fxc .fx-score { font-size: 13px; }

/* dark-only site: these are the default colours on every page */
:root, :root[data-theme="light"] { color-scheme: dark; --bg: #0a0e17; --surface-1: #111827; --surface-2: #172036; --border: #243049; --grid: #1c2740;
  --text-primary: #ffffff; --text-secondary: #b8c0d0; --text-muted: #8a95ab; --home: #3987e5; --away: #d95926;
  --home-soft: rgba(57,135,229,.18); --away-soft: rgba(217,89,38,.18); --pitch: #18221a; --pitch-line: #3a4d3c;
  --good: #4caf6a; --warn: #e0a030; --bad: #ef5350; --accent: #2f7bff; --side-bg: #0c111c; --gold: #f5b301; --link-soft: #d4d4cf; }

/* banner photo fills the whole banner; a soft fade keeps the text readable */
.hero-banner { height: auto; min-height: 230px; background-color: #0b0d10;
  background-image: linear-gradient(90deg, rgba(11,13,16,.96) 0%, rgba(11,13,16,.82) 28%, rgba(11,13,16,.35) 55%, rgba(11,13,16,0) 75%), url(/hero.jpg);
  background-size: 100% 100%, cover; background-position: center, right bottom; background-repeat: no-repeat; min-height: clamp(230px, 19vw, 320px); }
@media (max-width: 900px) {
  .hero-banner { background-image: linear-gradient(0deg, rgba(11,13,16,.9), rgba(11,13,16,.55)), url(/hero.jpg); background-position: center, 72% bottom; }
}

.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.contact-mail a { font-size: 16px; font-weight: 600; word-break: break-all; }
.contact-copy { margin-left: auto; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-primary); cursor: pointer; }
.contact-copy:hover { background: var(--surface-3, var(--border)); }
