/* AI Gamblers. Layout: purple-to-pink party bar with the robot mascot, match picker, then a single
   column of cards (projection, best bets, markets, AI brief, form, comparison + history, tips). */
:root {
  color-scheme: light;
  --page: #f6f3ff;
  --surface: #ffffff;
  --surface-2: #eee9fb;
  --text: #1a1330;
  --text-2: #4d4668;
  --muted: #857ea0;
  --grid: #e3def3;
  --axis: #c6bfdc;
  --border: rgba(70, 40, 140, 0.13);
  --team-a: #2a78d6;
  --team-b: #eb6834;
  --good: #047a3a;
  --good-bg: rgba(16, 185, 95, 0.12);
  --warn: #8a5a00;
  --critical: #d03b3b;
  --accent: #7c3aed;
  --accent-2: #db2777;
  --gold: #f5b301;
  --pitch: #5b21b6;
  --pitch-2: #be185d;
  --on-pitch: #ffffff;
  --ai-1: #7c3aed;
  --ai-2: #db2777;
  --over: #7c3aed;
  --under: #c6bfdc;
  --shadow: 0 1px 2px rgba(60, 30, 120, 0.06), 0 8px 24px rgba(60, 30, 120, 0.07);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0a1f; --surface: #191233; --surface-2: #241a45;
    --text: #f6f3ff; --text-2: #c9c2e6; --muted: #8e87ad;
    --grid: #2c2350; --axis: #3d3366; --border: rgba(200, 180, 255, 0.13);
    --team-a: #4b95ec; --team-b: #f07a45;
    --good: #2fd27a; --good-bg: rgba(47, 210, 122, 0.15); --warn: #fab219; --critical: #f07373;
    --accent: #a78bfa; --accent-2: #f472b6; --gold: #fbbf24;
    --pitch: #3b1584; --pitch-2: #8f1550; --ai-1: #a78bfa; --ai-2: #f472b6; --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --over: #a78bfa; --under: #463c70;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0a1f; --surface: #191233; --surface-2: #241a45;
  --text: #f6f3ff; --text-2: #c9c2e6; --muted: #8e87ad;
  --grid: #2c2350; --axis: #3d3366; --border: rgba(200, 180, 255, 0.13);
  --team-a: #4b95ec; --team-b: #f07a45;
  --good: #2fd27a; --good-bg: rgba(47, 210, 122, 0.15); --warn: #fab219; --critical: #f07373;
  --accent: #a78bfa; --accent-2: #f472b6; --gold: #fbbf24;
  --pitch: #3b1584; --pitch-2: #8f1550; --ai-1: #a78bfa; --ai-2: #f472b6; --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --over: #a78bfa; --under: #463c70;
}

* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  background: var(--page);
  background-image: radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 40%),
    radial-gradient(circle at 95% 20%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 35%);
  background-attachment: fixed;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
a { color: var(--accent); }

/* --- Top bar --- */
.topbar { background: linear-gradient(120deg, var(--pitch), var(--pitch-2)); color: var(--on-pitch); border-bottom: 3px solid var(--gold); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; background: linear-gradient(160deg, #34d399, #16a34a); border-radius: 14px; flex: none; padding: 2px; box-shadow: 0 2px 0 #1e1338; transform: rotate(-6deg); transition: transform 0.2s; }
.brand:hover .brand-mark { transform: rotate(6deg) scale(1.06); }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; line-height: 1.15; }
.brand-name span { color: var(--gold); }
.brand-sub { font-size: 12px; opacity: 0.8; }

/* --- Buttons & controls --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform 0.1s, box-shadow 0.15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(120deg, #7c3aed, #db2777); color: #fff; border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: linear-gradient(120deg, #7c3aed, #db2777); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-2) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.on-pitch { color: var(--on-pitch); border-color: rgba(255, 255, 255, 0.3); }
.btn.on-pitch:hover { background: rgba(255, 255, 255, 0.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); padding: 3px; border-radius: 8px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.seg button.is-active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.field { display: grid; gap: 6px; }
.field-label, .team-field label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }

/* --- Hero & picker --- */
.hero { padding-block: 28px 18px; max-width: 700px; }
.hero h1 { font-size: clamp(26px, 4.4vw, 36px); line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 8px; text-wrap: balance; font-weight: 850; background: linear-gradient(110deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--text-2); }
.demo-pill { display: inline-flex; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head h2::before { content: ""; display: inline-block; width: 6px; height: 1em; margin-right: 8px; vertical-align: -0.12em; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.card-intro { margin: 0 0 14px; color: var(--text-2); font-size: 14px; max-width: 75ch; }

.picker { display: grid; gap: 16px; margin-bottom: 20px; }
.matchups { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.matchup-btn { display: grid; gap: 2px; text-align: left; border: 1px solid var(--border); background: var(--page); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.matchup-btn:hover { background: var(--surface-2); }
.matchup-btn.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface); }
.matchup-btn b { font-size: 14px; }
.matchup-btn span { font-size: 12px; color: var(--muted); }

.picker-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 12px; align-items: end; }
.vs { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding-bottom: 11px; }
.team-field { position: relative; }
.team-field label { margin-bottom: 6px; }
.team-field input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); }
.suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.suggestions button { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 7px; cursor: pointer; }
.suggestions button:hover { background: var(--surface-2); }
.suggestions img { width: 20px; height: 20px; object-fit: contain; }
.suggestions .country { color: var(--muted); font-size: 13px; margin-left: auto; }
.suggestions .status { padding: 8px; color: var(--muted); font-size: 14px; }

.league-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--page); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.is-active { background: linear-gradient(120deg, #7c3aed, #db2777); color: #fff; border-color: transparent; font-weight: 600; }
.fixture-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.fixture-list > p { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 8px; }
.fixture { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--border); background: var(--page); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.fixture { transition: transform 0.12s, border-color 0.12s; }
.fixture:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-1px); }
.fixture.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 6px 18px color-mix(in srgb, var(--accent) 18%, transparent); }
.fixture:disabled { opacity: 0.6; cursor: wait; }
.fx-when { display: grid; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fx-when b { color: var(--text); font-size: 13px; }
.fx-teams { display: grid; gap: 2px; font-weight: 600; font-size: 14px; min-width: 0; }
.fx-teams span { display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-teams img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.fx-go { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.fx-odds { display: grid; justify-items: end; gap: 2px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); font: inherit; color: inherit; }
.loading { display: grid; gap: 6px; }
.loading p { margin: 0; }
.loading-row { display: flex; align-items: center; gap: 10px; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; min-width: 0; }
dialog select { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); width: 100%; font: inherit; color: inherit; }

.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--text-2); }
.notice strong { color: var(--text); }
.notice.warn { box-shadow: inset 3px 0 0 var(--warn); }

/* --- Results --- */
.results { display: grid; gap: 20px; padding-bottom: 32px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col > * { min-width: 0; }
.table-wrap { overflow-x: auto; position: relative; }
.subtle { color: var(--muted); font-size: 13px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.swatch.a { background: var(--team-a); }
.swatch.b { background: var(--team-b); }
.team-tag { display: inline-flex; align-items: center; gap: 6px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-radius: 5px; padding: 1px 6px; vertical-align: 2px; }

.match { display: grid; gap: 14px; }
.match .sub-h { margin: 4px 0 -4px; }
.last-games { display: grid; gap: 8px; }
.last-games-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 600; }
.last-games-head .subtle { font-weight: 400; }
.match-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.matchup { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.matchup .vs-word { color: var(--muted); font-weight: 500; font-size: 16px; }
.record { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.tile .label { font-size: 12px; color: var(--text-2); }
.tile .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.form-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.form-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.form-chip .res, .res-mini { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.res-mini { width: 20px; height: 20px; font-size: 10px; }
.res.W, .res-mini.W { background: var(--good); color: var(--surface); }
.res.L, .res-mini.L { background: var(--critical); color: var(--surface); }

/* Projection */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.goal-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.goal-facts span { display: grid; font-size: 12px; color: var(--text-2); }
.goal-facts small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.goal-facts b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.form-block .goal-facts { margin-bottom: 10px; }
.proj { background: var(--surface-2); border-radius: 12px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.proj h3 { margin: 0; font-size: 15px; }
.proj-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.proj-total .big { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.split { display: flex; gap: 2px; height: 10px; }
.split span { display: block; height: 100%; }
.split-a { background: var(--team-a); border-radius: 5px 0 0 5px; }
.split-b { background: var(--team-b); border-radius: 0 5px 5px 0; }
.split-labels { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.split-labels b { font-variant-numeric: tabular-nums; }
.proj-note { margin: 0; font-size: 13px; color: var(--text-2); }
.ou-table { font-size: 13px; background: var(--surface); border-radius: 8px; }
.ou-table th, .ou-table td { padding: 5px 10px; }
.ou-table .lead { font-weight: 700; }
.ou-table .subtle { font-size: 11px; font-weight: 400; margin-left: 4px; }
.conf { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface); white-space: nowrap; }
.conf-High { color: var(--good); }
.conf-Medium { color: var(--warn); }
.conf-Low { color: var(--critical); }

/* Best bets */
.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.picks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pick { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: linear-gradient(135deg, var(--gold), #f97316); color: #1a1330; }
.pick-body { display: grid; gap: 6px; min-width: 0; }
.pick-name { font-weight: 700; }
.pick-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pick-stats span { display: grid; }
.pick-stats small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pick-stats b { font-variant-numeric: tabular-nums; }
.pick-why { font-size: 13px; color: var(--text-2); }
.pos { color: var(--good); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
tr.group th { background: var(--surface-2); color: var(--text); font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.table-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.market-table td:first-child { font-weight: 600; white-space: nowrap; }
.market-table label { cursor: pointer; }
.odds-input { width: 78px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); text-align: right; font-variant-numeric: tabular-nums; }
.edge { white-space: nowrap; }
.edge-num { font-weight: 700; }
.edge-label { display: block; font-size: 11px; font-weight: 600; }
.edge.value { color: var(--good); background: var(--good-bg); }
.edge.thin { color: var(--warn); }
.edge.none { color: var(--muted); }
.muted { color: var(--muted); }
.stake { font-weight: 600; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-block { min-width: 0; }
.form-block h3 { font-size: 15px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-table td { white-space: nowrap; }
.compare-table th[scope="row"] { font-weight: 500; color: var(--text); font-size: 14px; border-bottom: 1px solid var(--border); }
.compare-table thead th .team-tag { justify-content: flex-end; }
.compare-table .lead { font-weight: 700; }

/* Chart */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .line-key { width: 16px; border-top: 2px dashed var(--text-2); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar-a { fill: var(--team-a); }
.chart .bar-b { fill: var(--team-b); }
.chart .total-label { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .ref-line { stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.chart .ref-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .hit { fill: transparent; }
.chart .bar-group.is-dim { opacity: 0.35; }

/* Every outcome */
.swatch.under { background: var(--under); }
.swatch.over { background: var(--over); }
.chart .bar-under { fill: var(--under); }
.chart .bar-over { fill: var(--over); }
.chart .is-top { stroke: var(--text); stroke-width: 1.5; }
.outcomes-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.splits h3, .sub-h { font-size: 15px; margin: 0 0 8px; }
.sub-h { margin-top: 18px; }
.split-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.split-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.split-list li span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lines-table tbody tr { cursor: pointer; }
.lines-table tbody tr:hover td, .lines-table tbody tr.is-selected td { background: var(--surface-2); }
.lines-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--text); }

/* Players & absences */
.squad { min-width: 0; display: grid; gap: 10px; align-content: start; }
.squad h3 { font-size: 16px; margin: 0; }
.squad h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); margin: 6px 0 0; }
.squad > p { margin: 0; }
.missing { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.missing li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.status-pill { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); }
.status-pill.out { color: var(--critical); }
.status-pill.doubt { color: var(--warn); }
.status-dot { color: var(--critical); font-size: 10px; vertical-align: 1px; }
.highlights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hl { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; min-width: 0; }
.hl small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hl b { font-size: 14px; overflow-wrap: anywhere; }
.hl span { font-size: 13px; color: var(--text-2); }
.hl .hl-flag { font-size: 12px; font-weight: 700; color: var(--warn); }
.hl.is-out .hl-flag { color: var(--critical); }
.hl.is-out { box-shadow: inset 0 0 0 1px var(--critical); }
.player-table td { white-space: nowrap; }

/* AI */
.ai { display: grid; gap: 12px; }
.ai .card-head, .ai .card-intro { margin-bottom: 0; }
.ai-title { display: flex; align-items: center; gap: 10px; }
.ai-badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--ai-1), var(--ai-2)); color: var(--surface); font-size: 16px; }
.ai textarea { width: 100%; min-height: 72px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); }
.ai-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ai-output { border-top: 1px solid var(--border); padding-top: 14px; max-width: 78ch; }
.ai-output h2, .ai-output h3 { font-size: 16px; margin: 18px 0 6px; }
.ai-output > :first-child { margin-top: 0; }
.ai-output p, .ai-output ul, .ai-output ol { margin: 0 0 10px; }
.ai-output li { margin-bottom: 4px; }
.ai-output code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.ai-output hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.thinking { color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }

/* Tips */
.tip-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 80ch; color: var(--text-2); }
.tip-list b { color: var(--text); }

.error-text { color: var(--critical); font-size: 14px; margin: 0; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 200px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-width: 180px; }
.tooltip .tt-title { font-weight: 600; margin-bottom: 2px; }
.tooltip .tt-sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tooltip .tt-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

.footer { font-size: 12px; color: var(--muted); padding-block: 16px 32px; border-top: 1px solid var(--border); }

/* Settings dialog */
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog form { padding: 22px; display: grid; gap: 10px; }
dialog h2 { margin: 0 0 4px; font-size: 20px; }
dialog label { font-size: 13px; font-weight: 600; color: var(--text-2); }
dialog label small { font-weight: 400; color: var(--muted); }
dialog input { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); width: 100%; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
/* Bet slips */
.visually-hidden { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.btn.small { padding: 5px 10px; font-size: 13px; justify-self: start; }
.btn.danger { color: var(--critical); }
.add-leg { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); font-weight: 700; font-size: 16px; cursor: pointer; line-height: 1; }
.add-leg:hover { background: var(--surface-2); }
.add-leg.in-slip { background: var(--accent); color: #fff; border-color: transparent; }
.slip-fab {
  position: fixed; z-index: 40; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0;
  background: linear-gradient(120deg, #7c3aed, #db2777); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent-2) 40%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}
.slip-fab:hover { transform: translateY(-2px); }
.slip-panel { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 20px; overflow-y: auto; }
.slip-panel > .seg { margin-bottom: 14px; }
.slip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.slip-head h2 { margin: 0; font-size: 20px; }
.slip-body { display: grid; gap: 12px; }
.slip-body > p { margin: 0; }
.icon-x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; cursor: pointer; color: var(--text-2); flex: none; }
.icon-x:hover { background: var(--surface-2); }
.legs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.leg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.leg-body { display: grid; flex: 1; min-width: 0; }
.leg-body b { font-size: 14px; }
.leg-body .subtle { font-size: 12px; }
.leg-odds { display: grid; gap: 2px; font-size: 11px; }
.leg-odds input { width: 70px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); text-align: right; font-variant-numeric: tabular-nums; }
.leg-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.res-mini.pending { background: var(--surface); }
.slip-totals { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); }
.slip-totals span, .slip-totals label { display: grid; }
.slip-totals small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.slip-totals b { font-size: 18px; font-variant-numeric: tabular-nums; }
.slip-totals input { width: 90px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); }
.slip-name { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); }
.warn-text { color: var(--warn); }
.saved-slip { display: grid; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
.saved-slip.won { box-shadow: inset 3px 0 0 var(--good); }
.saved-slip.lost { box-shadow: inset 3px 0 0 var(--critical); }
.saved-slip header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; }
.status-chip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.status-chip.won { color: var(--good); }
.status-chip.lost { color: var(--critical); }
.status-chip.pending { color: var(--text-2); }
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.copy-fallback { width: 100%; min-height: 120px; font-size: 12px; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.shared-slip { display: grid; gap: 12px; }
.shared-slip h3 { margin: 0; }
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(16px + env(safe-area-inset-top, 0px)); display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); display: grid; gap: 6px; animation: toast-in 0.25s ease-out; }
.toast p { margin: 0; font-size: 15px; }
.toast.praise { border-color: var(--good); box-shadow: inset 4px 0 0 var(--good), 0 10px 30px rgba(0, 0, 0, 0.2); }
.toast.stop, .toast.caution { border-color: var(--warn); box-shadow: inset 4px 0 0 var(--warn), 0 10px 30px rgba(0, 0, 0, 0.2); }
.toast-actions { display: flex; gap: 14px; justify-content: flex-end; font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.page { padding-bottom: 72px; }

/* Friends League */
.league-post { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.league-post h3 { margin: 0; font-size: 16px; }
.league-post p { margin: 0; }
.league-post-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.league-post-row input { width: 110px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); }
.league-body { gap: 14px; }
.post { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.post.won { box-shadow: inset 4px 0 0 var(--good); }
.post.lost { box-shadow: inset 4px 0 0 var(--critical); }
.post header { display: flex; align-items: center; gap: 10px; }
.post header > div { flex: 1; min-width: 0; }
.post-caption-user { font-size: 13px; color: var(--text-2); font-style: italic; }
.post-caption { margin: 0; font-weight: 600; font-size: 15px; }
.post-meta { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.post-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.react { border: 1px solid var(--border); background: var(--page); border-radius: 999px; padding: 3px 9px; font-size: 15px; cursor: pointer; }
.react span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.react.is-mine { border-color: var(--accent); background: var(--surface-2); }
.react:disabled { cursor: default; opacity: 0.7; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); display: inline-block; }
.avatar.initials { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }
.recover { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.recover summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.league-body h3 { margin: 0; font-size: 17px; }
.league-body > p { margin: 0; }
.league-table .player-cell { display: inline-flex; align-items: center; gap: 8px; }
.league-table .avatar { width: 26px; height: 26px; }
.league-table tr.is-me td { background: var(--surface-2); }
.badges { font-size: 14px; white-space: nowrap; }

/* Privacy policy and terms pages */
.legal { max-width: 760px; padding-block: 32px 48px; line-height: 1.6; }
.legal h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.02em; margin: 0 0 4px; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; color: var(--text-2); }
.legal li { margin-bottom: 6px; }
.legal b { color: var(--text); }
.legal a, .footer a, .gate-legal a { color: var(--accent); }
.legal mark { background: rgba(250, 178, 25, 0.35); color: var(--text); padding: 0 3px; border-radius: 3px; }
.legal-home { text-decoration: none; color: inherit; }

/* Entry screen: age check and responsible-betting advice */
.gate { padding-block: 40px; }
.gate-card { max-width: 620px; margin: 0 auto; display: grid; gap: 14px; padding: 28px; }
.gate-card h1 { font-size: clamp(24px, 4vw, 30px); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
.gate-card h2 { font-size: 18px; margin: 10px 0 0; }
.gate-card p { margin: 0; color: var(--text-2); }
.gate-brand { display: flex; align-items: center; gap: 10px; }
.gate-brand { font-size: 20px; }
.gate-brand b span { color: var(--accent-2); }
.gate-form { display: grid; gap: 12px; padding: 16px; border-radius: 12px; background: var(--surface-2); }
.gate-form > label:first-child { font-size: 13px; font-weight: 600; color: var(--text-2); }
.gate-form input[type="date"] { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); max-width: 220px; }
.gate-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.gate-form .check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.gate-form .btn { justify-self: start; }
.advice-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.advice-list b { color: var(--text); }
.gate-card a, .advice-dialog a { color: var(--accent); }
.advice-dialog { padding: 24px; max-width: 560px; }
.advice-dialog h2 { margin: 0 0 12px; }
.advice-dialog p { margin: 12px 0 0; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.hero-meta .demo-pill { margin-bottom: 0; }
.footer .link { font-size: inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@media (max-width: 900px) {
  .two-col, .form-grid, .outcomes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .card { padding: 14px; }
  .proj-grid { grid-template-columns: 1fr; }
  .picker-row { grid-template-columns: 1fr; }
  .vs { padding: 0; text-align: center; }
  .record { gap: 8px; }
  .tile { padding: 10px; }
  th, td { padding: 7px 6px; }
  .brand-sub { display: none; }
}
@media (max-width: 520px) {
  .topbar-inner { gap: 8px; }
  .topbar-inner .btn-label { display: none; }
  .topbar-inner button { padding-inline: 11px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .skeleton { animation: none; }
}
