:root {
  color-scheme: var(--scheme);
  --bg: #0c1117;
  --panel: rgba(var(--shade), .76);
  --panel-solid: #121a24;
  --panel-raised: #18222e;
  --line: rgba(var(--tint), .08);
  --line-strong: rgba(var(--tint), .15);
  --ink: #e9eef3;
  --muted: #9aa8b6;
  --faint: #6b7a89;
  --accent: #3fae7d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(63, 174, 125, .15);
  --green: #3fae7d;
  --amber: #e0a03c;
  --red: #e05a5a;
  --live: #ef4f4f;
  --unknown: #7d8a99;
  --blue: #5aa9e6;
  /* Dark theme channels and text tones; the light theme block below overrides them. */
  --scheme: dark;
  --tint: 255, 255, 255;
  --shade: 12, 17, 23;
  --field: 13, 21, 18;
  --ink-soft: #c3d0c9;
  --ink-strong: #ffffff;
  --accent-text: #8fe0b8;
  --bad-text: #ff9a9e;
  --warn-text: #ffd28a;
  --info-text: #9ccbf0;
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", ui-sans-serif, sans-serif;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Live stadium backdrop */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
/* Two photo layers crossfade when the scene changes (every 20 minutes); each drifts slowly while it is up. */
.backdrop-photo {
  position: absolute; inset: -6%;
  background: url('https://images.unsplash.com/photo-1489944440615-453fc2b6a9a9?auto=format&fit=crop&w=2000&q=70') center 40% / cover no-repeat;
  opacity: 0; transition: opacity 3s ease;
  animation: drift 40s ease-in-out infinite alternate;
}
.backdrop-photo.visible { opacity: 1; }
#backdrop-b { animation-name: drift-alt; animation-duration: 46s; }
/* Floodlight sweep and a faint pulse across the pitch, so the backdrop feels live. */
.backdrop-light {
  position: absolute; inset: -20%;
  background:
    radial-gradient(ellipse 40% 30% at 30% 20%, rgba(var(--tint), .10), transparent 70%),
    radial-gradient(ellipse 35% 25% at 75% 15%, rgba(190, 230, 255, .08), transparent 70%);
  mix-blend-mode: screen;
  animation: floodlight 18s ease-in-out infinite alternate, shimmer 6s ease-in-out infinite;
}
@keyframes drift-alt { from { transform: scale(1.06) translate3d(1%, 0, 0); } to { transform: scale(1) translate3d(-1%, -1%, 0); } }
@keyframes floodlight { from { transform: translate3d(-8%, 0, 0) rotate(-2deg); } to { transform: translate3d(8%, 3%, 0) rotate(2deg); } }
@keyframes shimmer { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.backdrop-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(var(--shade), .58) 0%, rgba(var(--shade), .68) 30%, rgba(var(--shade), .84) 65%, rgba(var(--shade), .94) 100%);
}
body.detail-mode .backdrop-shade { background: linear-gradient(180deg, rgba(var(--shade), .45) 0%, rgba(var(--shade), .75) 40%, rgba(var(--shade), .9) 100%); }
@keyframes drift { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.08) translate3d(-1.5%, 1%, 0); } }
@media (prefers-reduced-motion: reduce) { .backdrop-photo, .backdrop-light { animation: none; } .backdrop-photo { transition: none; } .pulse { animation: none !important; } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(var(--shade), .7); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.brand-name b { color: var(--accent); }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.topnav button:hover { color: var(--ink); background: rgba(var(--tint), .06); }
.topnav .nav-active { color: var(--accent-ink); background: var(--accent); }
.topnav .nav-active:hover { color: var(--accent-ink); background: var(--accent); }
.count-badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(var(--tint), .14); font-size: 12px; text-align: center; }
.nav-active .count-badge { background: rgba(var(--tint), .22); }
.live-pill { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(240, 69, 75, .7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(240, 69, 75, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 69, 75, 0); } }

.page { max-width: 1240px; margin: auto; padding: 0 20px 40px; }

/* Hero */
.hero { min-height: 330px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 64px 0 34px; }
.kicker { display: inline-block; padding: 5px 10px; border-radius: 6px; background: rgba(var(--shade), .72); border: 1px solid rgba(63, 174, 125, .45); color: var(--accent-text); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 14px 0 12px; font-family: var(--display); font-size: clamp(44px, 7vw, 82px); line-height: .92; font-weight: 800; text-transform: uppercase; letter-spacing: -.005em; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { max-width: 620px; margin: 0; color: var(--ink-soft); line-height: 1.6; }
.hero-stats { display: flex; gap: 10px; }
.hero-stats div { min-width: 104px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(var(--shade), .55); backdrop-filter: blur(8px); }
.hero-stats strong { display: block; font-family: var(--display); font-size: 38px; line-height: 1; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

/* Board */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h2 { margin: 0; font-family: var(--display); font-size: 32px; font-weight: 800; text-transform: uppercase; }
.board-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search input, .date-pick input { height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); padding: 0 12px; outline: none; }
.search input { width: 230px; }
.search input:focus, .date-pick input:focus { border-color: var(--accent); }
.date-pick input { color-scheme: var(--scheme); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; min-width: 74px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; }
.day strong { display: block; font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: .03em; }
.day span { font-size: 12px; color: var(--muted); }
.day:hover { border-color: var(--line-strong); }
.day.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.active span { color: rgba(255, 255, 255, .85); }

.league-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--league, var(--accent)); }
.chip small { color: var(--muted); font-weight: 500; }
.chip:hover { border-color: var(--line-strong); }
.chip.active { border-color: var(--league, var(--accent)); background: color-mix(in srgb, var(--league, var(--accent)) 18%, var(--panel-solid)); color: var(--ink-strong); }

.message { color: var(--muted); margin: 6px 0 12px; }
.message:empty { display: none; }
.match-list { display: grid; gap: 14px; }

/* League group */
.league-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; backdrop-filter: blur(6px); }
.league-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-left: 4px solid var(--league); background: linear-gradient(90deg, color-mix(in srgb, var(--league) 22%, transparent), transparent 70%); }
.cc { padding: 2px 6px; border-radius: 5px; background: rgba(var(--tint), .1); font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--ink-soft); }
.league-head h3 { margin: 0; font-family: var(--display); font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.league-head .league-count { margin-left: auto; color: var(--muted); font-size: 12px; }

.match-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 150px minmax(0, 1fr) 76px; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); position: relative; }
.match-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--league); opacity: .55; }
.match-row:hover { background: rgba(var(--tint), .035); }
.row-open { all: unset; position: absolute; inset: 0; cursor: pointer; }
.row-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.when { font-family: var(--display); font-size: 18px; font-weight: 700; text-align: center; }
.when small { display: block; font-family: Inter, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.when.ft small { color: var(--accent); }
.when.pending small { color: var(--amber); }
.side { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.side.home { justify-content: flex-end; text-align: right; }
.side span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.fav span.name::after { content: "★"; margin-left: 6px; color: var(--accent); font-size: 11px; vertical-align: 2px; }
.side.home.fav span.name::after { content: none; }
.side.home.fav span.name::before { content: "★"; margin-right: 6px; color: var(--accent); font-size: 11px; vertical-align: 2px; }
.crest { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--crest); border: 2px solid rgba(var(--tint), .22); font-family: var(--display); font-size: 13px; font-weight: 800; letter-spacing: .02em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.crest.logo { background: none; border: 0; border-radius: 0; overflow: hidden; }
/* Tall or wide logos (API-Football's are not all square) are fitted inside the box, never stretched past it. */
.crest.logo img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
.team-cell { display: inline-flex; align-items: center; gap: 8px; }
.team-cell .crest { width: 20px; height: 20px; font-size: 8px; border-width: 1px; }
.centre { display: grid; gap: 5px; justify-items: center; }
.score { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: .04em; }
.odds { display: flex; gap: 4px; }
.odds span { min-width: 44px; padding: 3px 6px; border-radius: 6px; background: rgba(var(--tint), .06); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.odds span.low { background: var(--accent-soft); color: var(--accent); }
.odds-empty { font-size: 12px; color: var(--faint); }
.prob { display: flex; width: 132px; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(var(--tint), .08); }
.prob i:nth-child(1) { background: var(--accent); }
.prob i:nth-child(2) { background: #8796a0; }
.prob i:nth-child(3) { background: var(--blue); }
.row-actions { position: relative; z-index: 1; display: flex; justify-content: flex-end; gap: 6px; }
.save { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: none; color: var(--muted); font-size: 15px; }
.save:hover { color: var(--accent); border-color: var(--accent); }
.save.saved { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.go { color: var(--faint); font-size: 18px; align-self: center; }
.empty { padding: 40px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--panel); color: var(--muted); text-align: center; }

/* Detail */
.back { margin: 22px 0 14px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); font-weight: 600; }
.back:hover { border-color: var(--accent); color: var(--accent); }
.loading { padding: 70px 20px; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid rgba(var(--tint), .12); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(245, 165, 36, .35); border-radius: 12px; background: rgba(245, 165, 36, .1); color: var(--warn-text); font-size: 14px; }

.match-hero { position: relative; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; padding: 22px 24px 20px; background:
  linear-gradient(180deg, rgba(var(--shade), .25), rgba(var(--shade), .88)),
  url('https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?auto=format&fit=crop&w=1600&q=60') center 70% / cover; }
.match-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--league); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 13px; }
.league-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px; background: color-mix(in srgb, var(--league) 30%, rgba(0, 0, 0, .4)); border: 1px solid color-mix(in srgb, var(--league) 60%, transparent); font-weight: 700; color: #fff; }
.hero-meta .sep { color: var(--faint); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin: 26px 0 18px; }
.team-block { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.team-block .crest { width: 74px; height: 74px; font-size: 26px; border-width: 3px; }
.team-block .crest.logo { width: 92px; height: 92px; }
.team-block h2 { margin: 0; font-family: var(--display); font-size: clamp(24px, 3.4vw, 38px); font-weight: 800; text-transform: uppercase; line-height: 1; }
.team-block .pos { color: var(--muted); font-size: 13px; }
.mini-form { display: flex; gap: 3px; }
.kick { text-align: center; }
.kick .big { font-family: var(--display); font-size: clamp(38px, 6vw, 62px); font-weight: 800; line-height: 1; }
.kick small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.market-strip { display: grid; gap: 8px; }
.market-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 700; }
.market-bar div { display: flex; align-items: center; justify-content: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.market-bar .h { background: var(--accent); color: var(--accent-ink); }
.market-bar .d { background: #5d6b73; }
.market-bar .a { background: var(--blue); color: #08263a; }
.market-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.stack { display: grid; gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 18px; backdrop-filter: blur(6px); }
.card h3 { margin: 0 0 12px; font-family: var(--display); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { margin-left: auto; font-family: Inter, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.source-line { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--faint); font-size: 11px; line-height: 1.6; }
.source-line a { color: var(--muted); }

/* Risk */
.risk-top { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; margin-bottom: 16px; }
.gauge { position: relative; width: 150px; height: 150px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { stroke: rgba(var(--tint), .08); }
.gauge .value { stroke: var(--level); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.gauge-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-label strong { font-family: var(--display); font-size: 48px; font-weight: 800; line-height: 1; }
.gauge-label span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.level-low { --level: var(--green); }
.level-elevated { --level: var(--amber); }
.level-high { --level: var(--red); }
.risk-verdict { font-family: var(--display); font-size: 30px; font-weight: 800; text-transform: uppercase; color: var(--level); line-height: 1; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: rgba(var(--tint), .06); font-size: 12px; font-weight: 600; }
.count i { width: 8px; height: 8px; border-radius: 50%; }
.legend-full i { background: var(--red); }
.legend-partial i { background: var(--amber); }
.legend-unknown i { background: repeating-linear-gradient(45deg, var(--unknown) 0 2px, transparent 2px 4px); border: 1px solid var(--unknown); }
.legend-none i { background: var(--green); }

.factors { display: grid; gap: 6px; }
.factor { border-radius: 10px; background: rgba(var(--tint), .03); }
.factor > summary { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px 9px 0; cursor: pointer; list-style: none; }
.factor > summary::-webkit-details-marker { display: none; }
.factor > summary:hover { background: rgba(var(--tint), .03); border-radius: 10px; }
.factor .bar { align-self: stretch; border-radius: 0 4px 4px 0; background: var(--state); }
.factor .f-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.factor .f-name { font-weight: 700; }
.weight { padding: 1px 6px; border-radius: 5px; background: rgba(var(--tint), .08); font-size: 11px; font-weight: 700; color: var(--muted); }
.factor > p { margin: 0; padding: 0 12px 10px 16px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.stats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.stat { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; background: rgba(var(--tint), .06); border: 1px solid transparent; font-size: 12.5px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat small { color: var(--muted); font-size: 11px; }
.stat b { font-weight: 700; }
.stat .crest { width: 16px; height: 16px; font-size: 7px; border-width: 1px; }
.stat.muted { color: var(--faint); }
.stat.tone-warn { background: color-mix(in srgb, var(--amber) 14%, transparent); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.stat.tone-warn b { color: var(--warn-text); }
.stat.tone-bad { background: color-mix(in srgb, var(--red) 14%, transparent); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.stat.tone-bad b { color: var(--bad-text); }
.stat.tone-good { background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 32%, transparent); }
.stat.tone-good b { color: var(--accent-text); }
.state { align-self: start; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: color-mix(in srgb, var(--state) 18%, transparent); color: var(--state); border: 1px solid color-mix(in srgb, var(--state) 45%, transparent); white-space: nowrap; }
.s-none { --state: var(--green); }
.s-partial { --state: var(--amber); }
.s-full { --state: var(--red); }
.s-unknown { --state: var(--unknown); }
.s-unknown .bar { background: repeating-linear-gradient(180deg, var(--unknown) 0 4px, transparent 4px 8px); }

/* Form, table, lists */
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.form-row:last-of-type { border-bottom: 0; }
.form-row strong { display: flex; align-items: center; gap: 8px; min-width: 0; }
.form-row strong .crest { width: 24px; height: 24px; font-size: 10px; }
.chips { display: flex; gap: 4px; }
.res { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; font-size: 11px; font-weight: 800; color: #fff; }
.res.W { background: #2f9e6b; }
.res.D { background: #64748b; }
.res.L { background: #c94848; }
.form-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }

table.league { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.league th { padding: 6px 4px; color: var(--faint); font-size: 11px; font-weight: 700; text-align: right; text-transform: uppercase; letter-spacing: .06em; }
table.league th:nth-child(2), table.league td:nth-child(2) { text-align: left; }
table.league td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
table.league td:first-child { width: 30px; text-align: center; font-weight: 700; color: var(--muted); border-left: 3px solid transparent; }
table.league tr.zone-top td:first-child { border-left-color: var(--accent); }
table.league tr.zone-upper td:first-child { border-left-color: var(--blue); }
table.league tr.zone-bottom td:first-child { border-left-color: var(--red); }
table.league tr.focus td { background: color-mix(in srgb, var(--league) 18%, transparent); font-weight: 700; color: var(--ink-strong); }
table.league td.pts { font-weight: 800; color: var(--ink-strong); }
.table-wrap { max-height: 430px; overflow: auto; }
.zone-key { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--muted); }
.zone-key i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }

.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; background: rgba(var(--tint), .03); font-size: 13px; }
.list li .muted { color: var(--muted); }
.list li b { font-family: var(--display); font-size: 16px; }
/* Head to head: who wins these meetings, at a glance (home green, draw grey, away blue, as on the chances bar). */
.h2h-summary { display: grid; gap: 8px; margin: 4px 0 12px; }
.h2h-counts { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.h2h-counts b { font-family: var(--display); font-size: 22px; margin-right: 3px; }
.h2h-counts .h2h-home b { color: var(--green); } .h2h-counts .h2h-draw b { color: var(--muted); } .h2h-counts .h2h-away b { color: var(--blue); }
.h2h-counts .h2h-draw { text-align: center; } .h2h-counts .h2h-away { text-align: right; }
.h2h-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(var(--tint), .06); }
.h2h-bar i { display: block; height: 100%; }
.h2h-bar .h2h-home { background: var(--green); } .h2h-bar .h2h-draw { background: var(--unknown); } .h2h-bar .h2h-away { background: var(--blue); }
.h2h-summary .note { margin: 0; }
.h2h-list li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 10px; row-gap: 2px; }
.h2h-list .h2h-chip { grid-row: 1 / span 2; min-width: 88px; padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.h2h-chip.home { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.h2h-chip.away { background: color-mix(in srgb, var(--blue) 22%, transparent); color: var(--blue); }
.h2h-chip.draw { background: rgba(var(--tint), .08); color: var(--muted); }
.h2h-list .h2h-score { color: var(--muted); }
.h2h-list .h2h-winner { color: var(--ink); font-family: inherit; font-size: inherit; font-weight: 800; }
.h2h-list .h2h-when { font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.price { padding: 10px; border-radius: 10px; background: rgba(var(--tint), .05); text-align: center; }
.price small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.price strong { font-family: var(--display); font-size: 26px; }
.price em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.player { display: flex; align-items: baseline; gap: 8px; }
.player .pill { padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; background: rgba(240, 69, 75, .18); color: var(--bad-text); }
.player .pill.d { background: rgba(245, 165, 36, .18); color: var(--warn-text); }
.player .key { color: var(--accent); font-size: 10px; font-weight: 800; }
.wx { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.wx strong { font-family: var(--display); font-size: 40px; line-height: 1; }
.columns3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.history-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.history-row summary { cursor: pointer; font-weight: 600; }
.refresh-btn { margin-top: 16px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }

/* AI analyst */
.card.analyst { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(160deg, var(--accent-soft), transparent 45%), var(--panel); }
.analyst-headline { font-family: var(--display); font-size: 24px; font-weight: 800; text-transform: uppercase; line-height: 1.1; margin-bottom: 6px; }
.analyst-preview { margin: 0 0 10px; color: var(--ink-soft); line-height: 1.55; font-size: 14.5px; }
.bullets { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-soft); }
.bullets li::marker { color: var(--accent); }
.analyst-watch { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.analyst-watch strong, .data-check .note strong { color: var(--ink); }
.data-check { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.data-check > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-family: var(--display); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.data-check .factors { margin-top: 6px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; }
.analyst-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; }
.card h4 { margin: 14px 0 8px; font-family: var(--display); font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); display: flex; align-items: center; }

/* Analyst chat head: a floating bubble that expands into a panel */
.chat-dock { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; }
.chat-dock > * { pointer-events: auto; }
.chat-bubble { position: relative; width: 58px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 0 0 4px rgba(63, 174, 125, .18); transition: transform .18s ease, box-shadow .18s ease; }
.chat-bubble:hover { transform: translateY(-2px) scale(1.04); }
.chat-bubble:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.chat-bubble svg { width: 26px; height: 26px; grid-area: 1 / 1; transition: opacity .15s ease, transform .2s ease; }
.chat-bubble .icon-close { opacity: 0; transform: rotate(-90deg); }
.chat-dock.open .chat-bubble .icon-open { opacity: 0; transform: rotate(90deg); }
.chat-dock.open .chat-bubble .icon-close { opacity: 1; transform: none; }
.chat-unread { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--live); border: 2px solid var(--bg); }

.chat-panel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-solid); box-shadow: 0 24px 60px rgba(0, 0, 0, .55); overflow: hidden; transform-origin: bottom right; animation: chat-in .18s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chat-panel, .chat-bubble, .chat-bubble svg { animation: none; transition: none; } }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.chat-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.chat-avatar svg { width: 19px; height: 19px; }
.chat-title { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.chat-title strong { font-family: var(--display); font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.chat-title span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.chat-icon-btn:hover { color: var(--ink); background: rgba(var(--tint), .07); }
.chat-icon-btn svg { width: 18px; height: 18px; }

.chat-log { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 14px 14px 4px; overscroll-behavior: contain; }
.chat-log[hidden] { display: none !important; }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: rgba(var(--tint), .05); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink-soft); }
.msg p { margin: 0 0 6px; }
.msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 6px; padding-left: 18px; }
.msg li::marker { color: var(--accent); }
.msg strong { color: var(--ink-strong); }
.chat-log .banner { margin: 4px 0; }
.typing { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.typing em { margin-right: 6px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-of-type(2) { animation-delay: .2s; }
.typing i:nth-of-type(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.chat-starters:not(:empty) { flex: 1 1 auto; align-content: flex-end; padding-bottom: 10px; }
.chat-hello { width: 100%; margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 6px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line-strong); border-radius: 21px; background: rgba(var(--tint), .04); padding: 0 16px; outline: none; }
.chat-form input:focus { border-color: var(--accent); }
.chat-send { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.chat-send svg { width: 20px; height: 20px; }
.chat-form button:disabled, .chat-form input:disabled { opacity: .55; cursor: default; }
.chat-note { margin: 0; padding: 0 14px 10px; color: var(--faint); font-size: 11px; text-align: center; }

@media (max-width: 720px) {
  .chat-dock { right: 16px; bottom: 16px; }
  .chat-dock.open { inset: 0; padding: 0; justify-content: flex-end; }
  .chat-dock.open .chat-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .chat-dock.open .chat-bubble { position: absolute; right: 16px; bottom: 76px; display: none; }
}

/* Data lean */
.lean-strong { --lean: var(--green); }
.lean-moderate { --lean: var(--blue); }
.lean-weak { --lean: #8796a0; }
.lean-conflicting { --lean: var(--amber); }
.lean-insufficient, .lean-none { --lean: var(--unknown); }
.card.lean { border-color: color-mix(in srgb, var(--lean) 40%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--lean) 12%, transparent), transparent 50%), var(--panel); }
.lean-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lean-verdict { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--lean); background: color-mix(in srgb, var(--lean) 16%, transparent); border: 1px solid color-mix(in srgb, var(--lean) 45%, transparent); }
.lean-pick { display: grid; text-align: right; font-family: var(--display); font-size: 20px; font-weight: 800; text-transform: uppercase; line-height: 1.1; }
.lean-pick small { font-family: Inter, sans-serif; font-size: 12px; font-weight: 500; text-transform: none; color: var(--muted); }
.lean-pick.lean-gap { color: var(--muted); font-size: 16px; }
.lean-what { margin: -4px 0 10px; }
.signals { display: grid; gap: 6px; margin-bottom: 8px; }
.signal { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; background: rgba(var(--tint), .04); font-size: 13px; }
.signal i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-weight: 800; font-size: 12px; color: var(--sig); background: color-mix(in srgb, var(--sig) 18%, transparent); }
.signal b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.sig-agree { --sig: var(--green); }
.sig-neutral { --sig: #8796a0; }
.sig-against { --sig: var(--red); }
.sig-missing { --sig: var(--unknown); }
.cautions { display: grid; gap: 4px; margin-bottom: 8px; }
.caution { padding: 6px 10px; border-radius: 9px; font-size: 12.5px; color: var(--warn-text); background: color-mix(in srgb, var(--amber) 12%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
#record-content table.league tr.focus td { background: var(--accent-soft); }
.lean-history { margin: 4px 0 6px; padding: 8px 10px; border-radius: 9px; background: rgba(var(--tint), .04); font-size: 13px; color: var(--ink-soft); }
.lean-history b { color: var(--ink); }

/* Learning run */
.card.learning .record-stats { margin-top: 12px; }
.verdict-line { margin: 12px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.lean-row .lean-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--lean); }
table.league td.up { color: var(--green); font-weight: 700; }
table.league td.down { color: var(--bad-text); }
.cal-key { display: flex; gap: 14px; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.cal-key i { display: inline-block; width: 12px; height: 6px; margin-right: 5px; border-radius: 2px; vertical-align: 1px; }
.cal-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 82px 52px; gap: 8px; align-items: center; padding: 4px 0; font-size: 12px; }
.cal-row span, .cal-row small { color: var(--muted); }
.cal-row small { text-align: right; }
.cal-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cal-bars { display: grid; gap: 2px; }
.cal-bars i { display: block; height: 5px; border-radius: 3px; }
.cal-pred { background: var(--accent); }
.cal-act { background: var(--ink-soft); }
.section-title { margin: 28px 0 12px; font-family: var(--display); font-size: 24px; font-weight: 800; text-transform: uppercase; }
.section-title span { margin-left: 8px; font-family: Inter, sans-serif; font-size: 12px; font-weight: 500; text-transform: none; color: var(--muted); }

/* PitchIQ model */
.model-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 44px 36px; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.model-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-row strong { font-family: var(--display); font-size: 18px; text-align: right; }
.model-row em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }
.model-row em.up { color: var(--accent); }
.model-row em.down { color: var(--bad-text); }
.model-bars { display: grid; gap: 3px; }
.mbar { height: 6px; border-radius: 3px; }
.mbar.model, .model-key i.model { background: var(--accent); }
.mbar.market, .model-key i.market { background: #7c8a99; }
.model-key { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 4px; font-size: 11px; color: var(--muted); }
.model-key i { display: inline-block; width: 10px; height: 6px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }

/* Track record */
.record-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.record-stats strong { display: block; font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.record-stats span { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .record-stats { grid-template-columns: 1fr; } }

/* Live and finished matches */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; flex: 0 0 auto; }
.live-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 6px; background: rgba(239, 79, 79, .16); color: var(--bad-text); font-family: Inter, sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.when.live { display: grid; justify-items: center; gap: 4px; }
.when.live small { color: var(--bad-text); font-size: 12px; }
.when.ended { color: var(--muted); }
.when.ended small { color: var(--faint); }
.when.off { color: var(--amber); font-size: 15px; }
.match-row.is-live { background: linear-gradient(90deg, rgba(239, 79, 79, .07), transparent 60%); }
.score.live { color: var(--bad-text); }
.score.final { color: var(--ink); }
.side.won .name { font-weight: 800; color: var(--ink-strong); }
.side.lost .name { color: var(--muted); font-weight: 500; }
.kick.live .big { color: var(--bad-text); }
.kick .live-tag { margin-bottom: 6px; }
.live-chip { border-color: rgba(239, 79, 79, .4); }
.live-chip.active { background: rgba(239, 79, 79, .18); border-color: var(--live); }

/* League logos */
.league-logo { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.league-head .league-logo { width: 28px; height: 28px; }
.league-tag .league-logo { width: 20px; height: 20px; }
.league-title { display: grid; line-height: 1.1; }
.league-title span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.league-count { display: inline-flex; align-items: center; gap: 8px; }

.footer { max-width: 1240px; margin: auto; padding: 22px 20px 34px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }

@media (max-width: 980px) {
  .grid, .columns3 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; min-height: 0; padding-top: 44px; }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 10px; padding: 0 16px; }
  .live-pill { display: none; }
  .topnav { margin-left: auto; }
  .page { padding: 0 16px 32px; }
  .hero-stats div { min-width: 0; flex: 1; }
  .search input { width: 100%; }
  .board-tools { width: 100%; }
  .search { flex: 1; }
  .match-row { grid-template-columns: 52px minmax(0, 1fr) 40px; grid-template-areas: "when home actions" "when away actions" "when centre actions"; row-gap: 6px; }
  .match-row .when { grid-area: when; }
  .match-row .side.home { grid-area: home; justify-content: flex-end; text-align: left; flex-direction: row-reverse; }
  .match-row .side.away { grid-area: away; }
  .match-row .centre { grid-area: centre; justify-items: start; }
  .match-row .row-actions { grid-area: actions; flex-direction: column; align-items: flex-end; }
  .match-row .go { display: none; }
  .side.home.fav span.name::before { content: none; }
  .side.home.fav span.name::after { content: "★"; margin-left: 6px; color: var(--accent); font-size: 11px; vertical-align: 2px; }
  .crest { width: 26px; height: 26px; font-size: 11px; }
  .prob { width: 100%; max-width: 180px; }
  .versus { gap: 8px; }
  .team-block .crest { width: 54px; height: 54px; font-size: 19px; }
  .team-block .crest.logo { width: 64px; height: 64px; }
  .risk-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .counts { justify-content: center; }
  .match-hero { padding: 18px 16px; }
}
.hero-stats .stat-live strong { color: var(--bad-text); }

/* Market finder */
.card.markets { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 10%, transparent), transparent 50%), var(--panel); }
.mf-basis { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-soft); }
.mf-pick { padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: rgba(var(--tint), .04); border: 1px solid var(--line); }
.mf-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mf-top strong { font-family: var(--display); font-size: 19px; font-weight: 800; text-transform: uppercase; }
.mf-prob { font-family: var(--display); font-size: 24px; font-weight: 800; color: var(--blue); }
.mf-pick .stats { margin-top: 4px; }
.mf-why { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12.5px; }
.mf-why li { padding-left: 18px; position: relative; color: var(--ink-soft); }
.mf-why li::before { position: absolute; left: 0; font-weight: 800; }
.mf-why li.for::before { content: "✓"; color: var(--green); }
.mf-why li.against::before { content: "✗"; color: var(--red); }
.mf-alt { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mf-all { margin-top: 10px; }
.mf-all > summary { cursor: pointer; font-family: var(--display); font-size: 15px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.mf-grid { display: grid; gap: 12px; margin-top: 8px; }
.mf-grid table.league td, .mf-grid table.league th { text-align: center; }
.factor .f-plain { margin: 3px 0 0; padding: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }
.bottom-line { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.confidence { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.points { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 6px; }
.points li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 9px; background: rgba(var(--tint), .04); border-left: 3px solid var(--accent); font-size: 13.5px; }
.points li span { color: var(--ink-soft); font-size: 13px; }
.bullets.careful li::marker { color: var(--amber); }
.mf-plain { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; }
.mf-plain b { color: var(--ink-strong); }
.mf-table td:first-child, .mf-table th:first-child { text-align: left !important; }

/* Bookmaker comparison */
.books { margin: 10px 0; }
.books summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.book-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.book-table th { padding: 5px 4px; color: var(--faint); font-size: 11px; text-align: right; text-transform: uppercase; letter-spacing: .06em; }
.book-table th:first-child, .book-table td:first-child { text-align: left; }
.book-table td { padding: 5px 4px; border-top: 1px solid var(--line); text-align: right; }
.book-table td small { display: block; color: var(--faint); font-size: 11px; }
.book-table td.best { color: var(--accent); font-weight: 800; }
.collapse-btn { display: block; margin: 10px auto 2px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-raised); color: var(--muted); font-size: 12px; font-weight: 700; }
.collapse-btn:hover { color: var(--ink); border-color: var(--accent); }

/* Team stats */
.ts-card { margin-top: 16px; }
.ts-scroll { overflow-x: auto; }
.ts-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 560px; }
.ts-table th { padding: 6px 6px; font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; }
.ts-table th .crest { width: 22px; height: 22px; margin-right: 6px; vertical-align: middle; display: inline-grid; }
.ts-table tr.sub th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.ts-table td { padding: 6px; border-top: 1px solid var(--line); text-align: center; }
.ts-table td:first-child, .ts-table th:first-child { text-align: left; color: var(--ink-soft); }
.ts-table td.avg { color: var(--muted); background: rgba(var(--tint), .03); }
.ts-table td.good { color: var(--accent-text); font-weight: 700; }
.ts-table td.bad { color: var(--bad-text); font-weight: 700; }
.ts-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.timing-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end; }
.tb { display: grid; gap: 2px; text-align: center; }
.tb-up, .tb-down { position: relative; height: 54px; display: flex; justify-content: center; }
.tb-up { align-items: flex-end; }
.tb-down { align-items: flex-start; }
.tb i { display: block; width: 70%; min-height: 2px; border-radius: 3px; }
.tb-up i { background: var(--accent); }
.tb-down i { background: #c95a5a; }
.tb b { position: absolute; font-size: 11px; color: var(--ink); }
.tb-up b { bottom: 2px; }
.tb-down b { top: 2px; }
.tb small { font-size: 10px; color: var(--faint); }
.timing-key { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.timing-key i { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 5px; }
.k-for { background: var(--accent); }
.k-against { background: #c95a5a; }
.ts-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.streaks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.streak { padding: 3px 9px; border-radius: 999px; background: rgba(var(--tint), .06); font-size: 12px; }
.streak.good { background: rgba(63, 174, 125, .16); color: var(--accent-text); }
.streak.bad { background: rgba(224, 90, 90, .16); color: var(--bad-text); }
.facts-col { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(var(--tint), .02); }
.facts-team { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 18px; font-weight: 700; text-transform: uppercase; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.facts-team .crest { width: 26px; height: 26px; }
.facts-group { margin-top: 10px; }
.facts-title { font-size: 13px; font-weight: 700; }
.facts-group.up .facts-title { color: var(--accent-text); }
.facts-group.down .facts-title { color: var(--bad-text); }
.facts-group.poi .facts-title { color: #8ab8ff; }
.facts-group ul { margin: 6px 0 0; padding-left: 18px; }
.facts-group li { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin-bottom: 3px; }
.facts-group li span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 720px) { .ts-two { grid-template-columns: 1fr; } }

/* Risk drivers and weight bands */
.drivers { margin-top: 12px; }
.drivers-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(var(--tint), .06); }
.drivers-bar i { display: block; height: 100%; background: var(--state); border-right: 1px solid rgba(var(--shade), .6); }
.drivers-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.drivers-list b { color: var(--ink); }
.weight.w5, .weight.w4 { background: rgba(224, 160, 60, .18); color: var(--warn-text); }
.weight.w3, .weight.w2 { background: rgba(90, 169, 230, .16); color: var(--info-text); }
.weight.w0 { opacity: .6; }
.pts { padding: 1px 6px; border-radius: 5px; background: rgba(var(--tint), .1); font-size: 11px; font-weight: 800; color: var(--ink); }

/* API-Football: second opinion and match centre */
.cmp { display: grid; gap: 5px; margin: 8px 0; }
.cmp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 54px; gap: 8px; align-items: center; font-size: 12.5px; }
.cmp-row span { color: var(--muted); }
.cmp-row b { text-align: right; font-variant-numeric: tabular-nums; }
.cmp-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(var(--tint), .06); }
.cmp-bar i:first-child { background: var(--accent); }
.cmp-bar i:last-child { background: var(--blue); margin-left: auto; }
.timeline { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.timeline li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: rgba(var(--tint), .04); font-size: 13px; }
.timeline li.away { flex-direction: row-reverse; text-align: right; }
.timeline .min { font-family: var(--display); font-weight: 800; color: var(--muted); min-width: 34px; }

/* How a finished match compared with expectations */
.chk-row { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; position: relative; z-index: 1; }
.chk { padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; background: rgba(var(--tint), .07); color: var(--muted); white-space: nowrap; }
.chk-ok, .chk-hit { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.chk-upset, .chk-miss { color: var(--bad-text); background: color-mix(in srgb, var(--red) 14%, transparent); }
.chk-held { color: var(--warn-text); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.mf-why.post li.info::before { content: "•"; color: var(--muted); }
@media (max-width: 720px) { .chk-row { justify-content: flex-start; } }

/* Compact header with the day's live summary */
.hero.compact { min-height: 0; padding: 34px 0 22px; align-items: center; flex-wrap: wrap; row-gap: 18px; }
/* The header cards get their own full-width row under the headline, so team names and records have room. */
.hero.compact .pulse-strip { flex: 1 1 100%; max-width: none; }
.hero.compact h1 { font-size: clamp(34px, 5vw, 58px); margin: 10px 0 0; }
.pulse-strip { display: grid; grid-template-columns: repeat(2, minmax(150px, 1.45fr)) repeat(2, minmax(112px, 1fr)); gap: 8px; flex: 1; max-width: 760px; align-items: start; }
.pulse-strip:empty { display: none; }
.pulse-card { display: grid; gap: 2px; align-content: start; min-width: 0; overflow: hidden; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(var(--shade), .62); backdrop-filter: blur(8px); text-align: left; }
button.pulse-card:hover { border-color: var(--accent); }
.pulse-card small { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pulse-rate { margin-left: auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-style: normal; font-size: 10.5px; letter-spacing: .02em; text-transform: none; white-space: nowrap; }
.pulse-card b { font-family: var(--display); font-size: 21px; font-weight: 800; line-height: 1.1; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-card span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-card.level-high { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.pulse-card.level-high b { color: var(--bad-text); }
.pulse-card.level-elevated b { color: var(--warn-text); }
.pulse-card.level-low { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.pulse-card.level-low b { color: var(--accent-text); }
.pulse-card.live { border-color: color-mix(in srgb, var(--live) 55%, transparent); }
/* The two pick cards: the card opens its match; the round toggle opens the card across the strip with the detail. */
.pulse-card.pick { position: relative; padding: 0; align-self: stretch; }
.pulse-card.pick:hover { border-color: var(--accent); }
.pulse-main { display: grid; gap: 2px; align-content: start; width: 100%; min-width: 0; padding: 11px 40px 11px 13px; border: 0; background: none; color: inherit; text-align: left; font: inherit; }
.pulse-main .pulse-rate { justify-self: start; margin: 4px 0 0; }
.pulse-more { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(var(--shade), .7); color: var(--muted); }
.pulse-more:hover, .pulse-more[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-text); }
.pulse-more svg { width: 15px; height: 15px; transition: transform .2s ease; }
.pulse-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.pulse-card.pick.expanded { grid-column: 1 / -1; }
.pulse-card.pick.expanded .pulse-main b { white-space: normal; }
.pulse-detail { display: grid; gap: 7px; padding: 0 13px 13px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.pulse-detail p { margin: 0; }
.pulse-detail strong { color: var(--ink); }
.pulse-detail .pulse-record { color: var(--muted); }
.pulse-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pulse-recent i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-style: normal; font-size: 12px; font-weight: 800; }
.pulse-recent i.ok { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--accent-text); }
.pulse-recent i.miss { background: color-mix(in srgb, var(--red) 22%, transparent); color: var(--bad-text); }
.pulse-recent i.open { background: rgba(var(--tint), .08); color: var(--muted); }
.pulse-recent small { margin-left: 4px; color: var(--faint); font-size: 11px; }
.pulse-detail .link-btn { justify-self: start; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .pulse-more svg { transition: none; } }

/* Toolbar dropdowns */
.select select { height: 40px; max-width: 230px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); padding: 0 30px 0 12px; outline: none; color-scheme: var(--scheme); }
.select select:focus { border-color: var(--accent); }
.sort-note { margin: -4px 0 10px; }

/* Live card: appears while matches are live */
.live-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: 100%; margin-bottom: 14px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--live) 50%, transparent); border-radius: var(--radius); background: linear-gradient(90deg, rgba(239, 79, 79, .16), rgba(239, 79, 79, .04)), var(--panel); text-align: left; }
.live-card:hover, .live-card.on { border-color: var(--live); }
.live-card.on { background: linear-gradient(90deg, rgba(239, 79, 79, .28), rgba(239, 79, 79, .08)), var(--panel); }
.lc-head { display: grid; gap: 2px; }
.lc-head b { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 20px; text-transform: uppercase; }
.lc-head small { color: var(--muted); font-size: 12px; }
.lc-head .live-dot { display: none; }
.lc-games { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.lc-game, .lc-more { padding: 5px 10px; border-radius: 999px; background: rgba(var(--tint), .07); font-size: 13px; white-space: nowrap; }
.lc-game small { color: var(--live); font-weight: 700; margin-left: 4px; }

/* Rows: league name in mixed lists, read tags, model chances */
.league-group.flat .match-row::before { opacity: .8; }
.row-league { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-league .league-logo { width: 14px; height: 14px; }
.row-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.row-tag { padding: 1px 7px; border-radius: 999px; background: rgba(var(--tint), .07); color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.row-tag.level-low { color: var(--green); background: rgba(63, 174, 125, .12); }
.row-tag.level-elevated { color: var(--amber); background: rgba(224, 160, 60, .12); }
.row-tag.level-high { color: var(--red); background: rgba(224, 90, 90, .12); }
.row-tag.verdict-strong { color: var(--green); }
.odds.pcts span { background: rgba(90, 169, 230, .1); }
.odds.pcts span.low { background: rgba(90, 169, 230, .22); color: var(--info-text); }
.odds-note { margin-top: -3px; color: var(--faint); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.prob.model { opacity: .75; }
.league-title { display: grid; gap: 1px; min-width: 0; }
.league-title > span { color: var(--muted); font-size: 12px; }
.league-head .league-character, .hero-character .league-character { color: var(--ink-soft); font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Match page: actions at the top and the clubs in the backdrop */
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.hero-btn { padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(var(--shade), .6); font-weight: 600; font-size: 13px; }
.hero-btn:hover { border-color: var(--accent); color: var(--accent); }
.hero-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hero-character { margin-top: 8px; color: var(--ink-soft); font-size: 12.5px; }
.backdrop-clubs { position: absolute; inset: 0; display: none; }
.backdrop-clubs .club { position: absolute; top: 10%; width: 46vw; height: 80vh; background: center / contain no-repeat; filter: blur(1px) saturate(1.15); opacity: .32; }
.backdrop-clubs .club.home { left: -6vw; }
.backdrop-clubs .club.away { right: -6vw; }
body.club-backdrop .backdrop-clubs { display: block; }
body.club-backdrop .backdrop-photo { opacity: 0 !important; }
body.club-backdrop .backdrop-shade { background: linear-gradient(180deg, rgba(var(--shade), .35), rgba(var(--shade), .7) 55%, rgba(var(--shade), .9)); }
/* The match header turns translucent so the two clubs' crests behind it show through, instead of a stadium photo. */
body.club-backdrop .match-hero { background: linear-gradient(180deg, rgba(var(--shade), .3), rgba(var(--shade), .78)); backdrop-filter: blur(3px); }

/* Prices in the market scan, Africa tag, data check */
.mf-price { white-space: nowrap; }
.af-tag { padding: 1px 6px; border-radius: 5px; background: rgba(63, 174, 125, .16); color: var(--accent-text); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.data-check-card.has-issues { border-color: rgba(224, 160, 60, .4); }
.league-form .chips { flex-wrap: wrap; }

@media (max-width: 980px) {
  .pulse-strip { width: 100%; max-width: none; }
}
@media (max-width: 720px) {
  .pulse-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select { flex: 1 1 140px; }
  .select select { width: 100%; max-width: none; }
  .lc-games { margin-left: 0; }
  .row-tags, .row-league { justify-content: flex-start; }
  .backdrop-clubs .club { width: 90vw; height: 50vh; opacity: .14; }
  .backdrop-clubs .club.home { left: -30vw; top: 4%; }
  .backdrop-clubs .club.away { right: -30vw; top: 46%; }
}

/* Account button */
.account-btn { margin-left: 12px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; font-weight: 600; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn:hover { border-color: var(--accent); color: var(--accent); }
.account-btn.signed-in { background: var(--accent-soft); border-color: rgba(63, 174, 125, .45); color: var(--accent-text); }

/* Dialogs */
.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-solid); color: var(--ink); }
.modal::backdrop { background: rgba(5, 8, 12, .7); backdrop-filter: blur(3px); }
.modal-body { display: grid; gap: 12px; padding: 18px 20px 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-family: var(--display); font-size: 24px; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(var(--tint), .06); }
.tab { flex: 1; padding: 7px 10px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--accent); color: var(--accent-ink); }
.field { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.field input, .field select { height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); padding: 0 12px; outline: none; color: var(--ink); color-scheme: var(--scheme); }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 120px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); padding: 10px 12px; outline: none; color: var(--ink); color-scheme: var(--scheme); font: inherit; font-size: 15px; line-height: 1.5; }
.field textarea:focus { border-color: var(--accent); }
.refresh-btn.danger-btn { background: var(--red); border-color: var(--red); color: #fff; }
/* Feedback: a glowing button in the bottom-left corner (the analyst chat has the right). */
.feedback-dock { position: fixed; left: 20px; bottom: 20px; z-index: 39; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
.feedback-dock > * { pointer-events: auto; }
.feedback-dock[hidden], .feedback-nudge[hidden] { display: none; }
.feedback-fab { display: flex; align-items: center; height: 46px; padding: 0 18px 0 15px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 999px; background: var(--panel-solid); color: var(--ink); font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); animation: feedback-glow 2.8s ease-in-out infinite; transition: transform .18s ease; }
.feedback-fab svg { flex: none; width: 20px; height: 20px; margin-right: 8px; color: var(--accent); }
/* On the home page the button opens wide with a request, then settles back to "Feedback". */
.fab-long, .fab-short { display: inline-block; overflow: hidden; white-space: nowrap; transition: max-width .6s ease, opacity .35s ease; }
.fab-long { max-width: 0; opacity: 0; }
.fab-short { max-width: 90px; opacity: 1; }
.feedback-fab.expanded .fab-long { max-width: 400px; opacity: 1; }
.feedback-fab.expanded .fab-short { max-width: 0; opacity: 0; }
.feedback-fab:hover { transform: translateY(-2px); }
.feedback-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes feedback-glow {
  0%, 100% { box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 22px 6px color-mix(in srgb, var(--accent) 35%, transparent); }
}
.feedback-nudge { position: relative; display: grid; gap: 4px; width: min(280px, calc(100vw - 32px)); padding: 14px 34px 14px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel-solid); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); font-size: 13.5px; }
.feedback-nudge span { color: var(--muted); }
.feedback-nudge .link-btn { justify-self: start; margin-top: 4px; font-weight: 700; }
.feedback-nudge-close { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.feedback-nudge-close:hover { background: rgba(var(--tint), .08); color: var(--ink); }
body.detail-mode .feedback-fab span { display: none; }
body.detail-mode .feedback-fab { width: 46px; padding: 0; justify-content: center; }
body.detail-mode .feedback-fab svg { margin-right: 0; }
@media (max-width: 720px) {
  .feedback-dock { left: 16px; bottom: 16px; }
  .feedback-fab { height: auto; min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  /* On a phone the request wraps onto two lines and stops short of the chat bubble on the right. */
  .feedback-fab.expanded .fab-long { max-width: calc(100vw - 170px); white-space: normal; line-height: 1.25; font-size: 13.5px; text-align: left; }
  .fab-long, .fab-short { transition: opacity .35s ease; }
}
@media (prefers-reduced-motion: reduce) { .feedback-fab, .fab-long, .fab-short { animation: none; transition: none; } }
.fb-question { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.fb-question legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.fb-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fb-scale label, .fb-chips label { position: relative; }
.fb-scale input, .fb-chips input { position: absolute; opacity: 0; pointer-events: none; }
.fb-scale span { display: grid; place-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; font-weight: 800; cursor: pointer; }
.fb-scale-ends { display: flex; justify-content: space-between; color: var(--muted); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chips span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-scale input:checked + span, .fb-chips input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.fb-scale input:focus-visible + span, .fb-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal .ask-actions .back, .modal .ask-actions .refresh-btn { margin: 0; width: auto; min-width: 110px; }
/* Quick bet and predictions */
.pick-modal { width: min(560px, calc(100vw - 24px)); }
.pick-group { display: grid; gap: 6px; margin-bottom: 10px; }
.pick-group small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--ink); font-size: 13px; font-weight: 600; }
.pick-chip em { font-style: normal; font-weight: 800; color: var(--accent-text); }
.pick-chip.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.pick-chip.on em { color: var(--accent-ink); }
.pick-more { margin: 2px 0 10px; }
.pick-more > summary { cursor: pointer; padding: 8px 0; color: var(--accent-text); font-size: 13px; font-weight: 700; }
.pick-more[open] > summary { margin-bottom: 6px; }
.pick-score { display: flex; align-items: flex-end; gap: 10px; }
.pick-score label { display: grid; gap: 4px; min-width: 0; }
.pick-score span { overflow: hidden; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pick-score b { padding-bottom: 9px; color: var(--muted); }
.pick-score input, .pick-own { height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(var(--field), .9); padding: 0 12px; outline: none; color: var(--ink); color-scheme: var(--scheme); font: inherit; }
.pick-score input { width: 72px; text-align: center; }
.pick-score input:focus, .pick-own:focus { border-color: var(--accent); }
.pick-own { width: 100%; }
.pick-group .note { margin: 0; }
.pred-own { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.pick-summary { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.record-tabs { display: inline-flex; gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(var(--shade), .5); }
.record-tabs[hidden] { display: none; }
.record-tabs button { padding: 7px 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-weight: 700; }
.record-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.pred-list { display: grid; gap: 8px; }
.pred-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 12px; border-radius: 10px; background: rgba(var(--tint), .03); }
.pred-row .bet-main { display: grid; gap: 2px; }
.pred-row .bet-main span { color: var(--muted); font-size: 12.5px; }
.pred-picks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.pred-pick { padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(var(--tint), .08); color: var(--ink-soft); }
.pred-pick.ok { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--accent-text); }
.pred-pick.miss { background: color-mix(in srgb, var(--red) 22%, transparent); color: var(--bad-text); }
.pred-row .bet-actions { grid-column: 2; grid-row: 1; align-self: start; }
.row-quick { grid-column: 1 / -1; position: relative; z-index: 1; display: flex; gap: 8px; justify-content: flex-end; }
.contact-modal { width: min(680px, calc(100vw - 24px)); }
.contact-fields, .contact-done { display: grid; gap: 12px; }
.contact-fields[hidden], .contact-done[hidden] { display: none; }
.contact-modal .note { margin: 0; }
.signin-card { max-width: 560px; margin: 24px auto; text-align: center; }
.signin-card .refresh-btn { margin-top: 8px; }
.free-note { margin: 0 0 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .refresh-btn { width: 100%; }

/* My bets */
.back.slim { margin: 0; padding: 7px 12px; font-size: 13px; text-decoration: none; }
.file-btn { cursor: pointer; }
.bets-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bets-stats strong.up, .bet-nums .up { color: var(--green); }
.bets-stats strong.down, .bet-nums .down { color: var(--red); }
.pl-chart { width: 100%; height: 170px; margin: 6px 0 10px; }
.pl-chart .zero { stroke: rgba(var(--tint), .18); stroke-dasharray: 4 4; }
.pl-chart .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.pl-chart.up .line { stroke: var(--green); } .pl-chart.down .line { stroke: var(--red); }
.pl-chart .area { stroke: none; opacity: .12; }
.pl-chart.up .area { fill: var(--green); } .pl-chart.down .area { fill: var(--red); }
.breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.bets-intro .bullets { margin: 10px 0 16px; }
.bet-list { display: grid; }
.bet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); }
.bet-main { display: grid; gap: 2px; min-width: 0; }
.bet-main span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.bet-main a { color: var(--ink); }
.bet-nums { display: grid; grid-template-columns: 52px 76px 88px; gap: 6px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bet-actions { display: flex; gap: 5px; align-items: center; position: relative; }
.bet-actions button { padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: none; font-size: 12px; font-weight: 600; }
.bet-actions button:hover { border-color: var(--accent); color: var(--accent); }
.bet-actions .more summary { list-style: none; cursor: pointer; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.bet-actions .more[open] { position: relative; }
.bet-actions .more[open] > button { display: block; width: 100%; margin-top: 4px; }
.bet-actions .more[open] { display: grid; position: absolute; right: 0; top: -4px; z-index: 3; padding: 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-solid); min-width: 120px; }
.bet-row.s-won .state { color: var(--green); } .bet-row.s-lost .state { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 999px; background: var(--panel-raised); border: 1px solid var(--line-strong); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 980px) { .bets-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .breakdowns { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .account-btn { margin-left: 0; max-width: 96px; padding: 6px 10px; }
  .bets-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bet-row { grid-template-columns: 1fr; gap: 6px; }
  .bet-nums { grid-template-columns: repeat(3, auto); justify-content: start; text-align: left; gap: 14px; }
  .field-row { grid-template-columns: 1fr; }
}

/* Google sign-in */
.google-block { display: grid; gap: 12px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 10px; background: #fff; color: #1f1f1f; font-weight: 600; text-decoration: none; }
.google-btn svg { width: 20px; height: 20px; }
.google-btn:hover { background: #f2f2f2; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.topnav button { white-space: nowrap; }
@media (max-width: 900px) { .live-pill { display: none; } .topnav button { padding: 8px 10px; } }
.google-btn.pending { opacity: .55; cursor: not-allowed; }

/* Reminders panel on the Saved page */
.reminder-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.reminder-bar.active { border-color: rgba(63, 174, 125, .45); }
.reminder-bar > div:first-of-type { display: grid; gap: 2px; }
.reminder-bar small { color: var(--muted); font-size: 12.5px; }
.reminder-bar > .refresh-btn { grid-column: 2; justify-self: start; margin-top: 6px; }
.rb-icon { font-size: 22px; grid-row: span 2; }
.rb-chips { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rb-chip { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.rb-chip.action { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rb-chip.on { border-color: rgba(63, 174, 125, .5); color: var(--accent-text); }
.rb-chip.off { color: var(--faint); border-style: dashed; }
.nav-link { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav-link:hover { color: var(--ink); background: rgba(var(--tint), .06); }
.help-link { color: var(--accent-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.help-link:hover { text-decoration: underline; }
.footer a { color: var(--accent-text); }
@media (max-width: 720px) { .nav-link { display: none; } }

/* Half-time and live read */
.card.inplay { margin-top: 12px; border-color: rgba(239, 79, 79, .4); }
.card.inplay.ht { border-color: rgba(224, 160, 60, .5); background: linear-gradient(160deg, rgba(224, 160, 60, .1), transparent 45%), var(--panel); }
.ip-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr 44px 40px; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.ip-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-bars { display: grid; gap: 3px; }
.ip-bars i { display: block; height: 7px; border-radius: 4px; }
i.ip-now { background: var(--amber); } i.ip-before { background: rgba(var(--tint), .25); }
.model-key i.ip-now, .model-key i.ip-before { display: inline-block; width: 12px; height: 6px; margin-right: 5px; border-radius: 3px; }
.ip-row b { text-align: right; } .ip-row em { font-style: normal; font-size: 12px; text-align: right; color: var(--muted); }
.ip-row em.up { color: var(--green); } .ip-row em.down { color: var(--red); }
.row-tag.stale { opacity: .6; border: 1px dashed currentColor; }
.drivers-bar i.s-clear { background: rgba(63, 174, 125, .55); border-right: 0; }
.clerk-body { min-width: min(420px, calc(100vw - 32px)); }
#clerk-signin .cl-rootBox, #clerk-signin .cl-card { width: 100%; box-shadow: none; }

/* Clerk's sign-in opens as a non-modal overlay so its own pop-ups (country codes) stay clickable */
dialog.modal.overlay { position: fixed; inset: 0; z-index: 60; margin: auto; max-height: calc(100vh - 32px); overflow: auto; }
.auth-backdrop { display: none; position: fixed; inset: 0; z-index: 59; background: rgba(5, 8, 12, .7); backdrop-filter: blur(3px); }
body.auth-open .auth-backdrop { display: block; }
#clerk-signin [class*="cl-selectOptionsContainer"] { z-index: 1000 !important; position: relative; }

/* Clerk's sign-in in a light card, readable in bright light */


/* ---------- Light theme (the default; ☀/☾ in the top bar switches) ---------- */
:root[data-theme="light"] {
  --scheme: light;
  --bg: #eef2f5;
  --panel: rgba(255, 255, 255, .9);
  --panel-solid: #ffffff;
  --panel-raised: #f3f6f8;
  --line: rgba(20, 32, 44, .1);
  --line-strong: rgba(20, 32, 44, .2);
  --ink: #15202b;
  --muted: #56636f;
  --faint: #7a8794;
  --accent: #23885e;
  --accent-soft: rgba(35, 136, 94, .12);
  --green: #23885e;
  --amber: #b7791f;
  --red: #c53030;
  --live: #d92d2d;
  --unknown: #8a96a3;
  --blue: #2b78bd;
  --tint: 20, 32, 44;
  --shade: 255, 255, 255;
  --field: 255, 255, 255;
  --ink-soft: #3a4855;
  --ink-strong: #0b141d;
  --accent-text: #1d7a52;
  --bad-text: #b42318;
  --warn-text: #92400e;
  --info-text: #1d5f99;
}
:root[data-theme="light"] .backdrop-light { display: none; }
:root[data-theme="light"] .backdrop-shade { background: linear-gradient(180deg, rgba(var(--shade), .30) 0%, rgba(var(--shade), .50) 30%, rgba(var(--shade), .78) 65%, rgba(var(--shade), .92) 100%); }
:root[data-theme="light"] .hero h1 { text-shadow: none; }
:root[data-theme="light"] .backdrop-photo { filter: saturate(.85); }
:root[data-theme="light"] .crest.logo img { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)); }
:root[data-theme="light"] .backdrop-clubs .club { opacity: .16; }
:root[data-theme="light"] .topbar { box-shadow: 0 1px 0 rgba(20, 32, 44, .06); }

/* Theme switch */
.theme-btn { width: 36px; height: 36px; display: grid; place-items: center; margin-left: 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--ink); font-size: 16px; line-height: 1; }
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* "by Ebenaff" under the brand name */
.brand-text { display: grid; line-height: 1; }
.brand-by { margin-top: 2px; color: var(--faint); font-size: 10.5px; font-weight: 500; letter-spacing: .04em; }
@media (max-width: 1040px) {
  .topbar-inner { gap: 12px; }
  .topnav { margin-left: 0; gap: 2px; }
  .topnav button, .nav-link { padding: 7px 10px; font-size: 14px; }
  .account-btn { max-width: 120px; margin-left: auto; }
  .live-pill { display: none; }
}
@media (max-width: 820px) { .brand-name { font-size: 22px; } .topnav button, .nav-link { padding: 6px 8px; font-size: 13.5px; } }

/* ---------- Phones: nothing may widen the page; the top bar stacks into two rows ---------- */
html, body { overflow-x: clip; }
@media (max-width: 720px) {
  .topbar-inner { height: auto; flex-wrap: wrap; row-gap: 6px; padding: 8px 16px 6px; }
  .brand { margin-right: auto; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 21px; }
  .account-btn { order: 2; }
  .theme-btn { order: 3; margin-left: 0; width: 34px; height: 34px; }
  .topnav { order: 4; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav button, .nav-link { flex: 0 0 auto; padding: 7px 12px; font-size: 14px; }
  .topnav .nav-link { display: inline-flex; align-items: center; }
  .board-tools .search { flex: 1 1 100%; }
  .board-tools .select { flex: 1 1 120px; min-width: 0; }
  .board-tools .date-pick { flex: 1 1 110px; min-width: 0; }
  .board-tools > button, .board-tools .icon-btn { flex: 0 0 40px; }
  .board-tools .date-pick input { width: 100%; }
  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
  #list-view, .board-head, .board-tools, .day-strip { min-width: 0; max-width: 100%; }
}
.side .goals { display: none; }
@media (max-width: 720px) {
  .match-row.scored .centre .score { display: none; }
  .match-row.scored .side.home { flex-direction: row; justify-content: flex-start; }
  .match-row.scored .side .crest { order: 0; }
  .match-row.scored .side .name { order: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .goals { display: block; order: 2; margin-left: auto; padding-left: 10px; font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1; color: var(--ink); }
  .side .goals.live { color: var(--bad-text); }
  .side.lost .goals { color: var(--muted); }
}
/* Phones: the match header lines up both teams row by row (crest, name, position, form) with the score between. */
@media (max-width: 720px) {
  .hero-actions { justify-content: stretch; }
  .hero-btn { flex: 1 1 0; text-align: center; }
  .hero-meta { gap: 4px 10px; font-size: 12.5px; }
  .hero-meta .sep { display: none; }
  .hero-character { font-size: 12.5px; }
  .versus { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 6px; margin: 20px 0 14px; }
  .team-block { display: grid; grid-template-rows: 64px 2.1em auto auto; justify-items: center; align-items: center; gap: 6px; }
  .team-block h2 { font-size: 19px; line-height: 1.05; display: flex; align-items: center; justify-content: center; height: 100%; overflow-wrap: anywhere; }
  .team-block .pos { font-size: 12px; }
  .team-block .chips { gap: 3px; flex-wrap: nowrap; justify-content: center; }
  .team-block .res { width: 19px; height: 19px; font-size: 10px; border-radius: 5px; }
  .kick { padding-top: 18px; min-width: 64px; }
  .kick .big { font-size: 34px; white-space: nowrap; }
  .kick small { font-size: 10.5px; letter-spacing: .06em; }
}
@media (max-width: 720px) {
  .hero-btn { white-space: nowrap; padding: 8px 10px; font-size: 12.5px; }
  /* Card headings: the note drops under the title instead of squeezing it. */
  .card h3 { flex-wrap: wrap; row-gap: 2px; }
  .card h3 .tag { flex: 1 1 100%; margin-left: 0; }
}
@media (max-width: 720px) {
  /* Factor cards: the state badge sits in the top corner so the text can use the full width. */
  .factor > summary { position: relative; grid-template-columns: 4px minmax(0, 1fr); gap: 10px; }
  .factor > summary .state { position: absolute; top: 9px; right: 10px; }
  .factor .f-head { padding-right: 92px; }
  .factor > p { padding-left: 14px; }
}
/* Learning from finished matches */
.learn-misses li { display: grid; gap: 2px; justify-content: stretch; }
.learn-misses li b { font-family: inherit; font-size: 13px; }
.learn-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: rgba(var(--tint), .08); color: var(--ink-soft); }
.learn-status.s-holding, .learn-status.s-no-trend-yet { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--accent-text); }
.learn-status.s-stronger, .learn-status.s-worth-testing { background: color-mix(in srgb, var(--amber, #f5a524) 24%, transparent); color: var(--ink); }
.learn-status.s-weaker { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--bad-text); }
.learn-table th:first-child, .learn-table td:first-child { min-width: 190px; }
