:root {
  --ink: #0f172a;
  --soft: #334155;
  --muted: #64748b;
  --paper: #eef2f7;
  --card: #ffffff;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .06);
  --sans: "Segoe UI", "Avenir Next", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(900px 420px at 100% -10%, rgba(37, 99, 235, .08), transparent 50%), var(--paper);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.45;
  letter-spacing: -0.011em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--accent); color: white;
  padding: 8px 12px; z-index: 9; border-radius: 8px;
}
.skip:focus { top: 12px; }
.app { display: flex; min-height: 100vh; }
.rail {
  width: 232px; flex: 0 0 232px; background: var(--card); color: var(--ink);
  padding: 20px 14px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; border-right: 1px solid var(--line); z-index: 24;
}
.rail-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rail-pin {
  display: none; position: relative; align-items: center; gap: 2px; margin: 0;
  padding: 3px 4px 3px 3px; border: 1px solid var(--line); border-radius: 14px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.rail-pin:hover { background: rgba(15, 23, 42, .06); }
.rail-pin-chev { width: 14px; text-align: center; font-weight: 750; font-size: 1.05rem; }
.rail-pin-chev::before { content: "<"; }
html[data-rail="compact"] .rail-pin-chev::before { content: ">"; }
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; padding: 4px 6px 8px; min-width: 0; }
.brand strong { display: block; font-size: 1.05rem; font-weight: 650; letter-spacing: -.03em; }
.brand em { display: block; font-style: normal; color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: white; font-weight: 700; font-size: .72rem;
}
.mark.has-logo { background: transparent; overflow: hidden; padding: 0; }
.mark.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rail nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; margin-top: 22px; }
.rail nav a, .rail-info {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  color: var(--soft); text-decoration: none; padding: 9px 12px; border-radius: 10px;
  font-weight: 550; font-size: .94rem; border: 0; background: transparent; text-align: left;
  cursor: pointer; font: inherit;
}
.rail-info { margin-top: auto; }
.rail nav a:hover, .rail-info:hover { background: rgba(15, 23, 42, .05); color: var(--ink); }
.rail nav a.is-on { background: rgba(37, 99, 235, .12); color: #1d4ed8; }
.nav-ico { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-tip {
  position: absolute; left: calc(100% + 12px); top: 50%; z-index: 5;
  transform: translate(-4px, -50%); width: max-content; max-width: 220px;
  padding: 7px 10px; border-radius: 8px; background: #111827; color: #f8fafc;
  font-size: .75rem; font-weight: 620; line-height: 1.35; pointer-events: none; opacity: 0;
}
.rail nav a:hover .nav-tip, .rail nav a:focus-visible .nav-tip,
.rail-info:hover .nav-tip, .rail-info:focus-visible .nav-tip,
.rail-pin:hover .nav-tip, .rail-pin:focus-visible .nav-tip { opacity: 1; transform: translate(0, -50%); }
.rail-info .nav-tip { top: auto; bottom: 0; }
.rail-pin .nav-tip { top: calc(100% + 8px); left: 0; transform: translateY(-4px); }
.rail-pin:hover .nav-tip { transform: translateY(0); }
.workspace { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 22px; }
.kicker { margin: 0 0 6px; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-size: .7rem; font-weight: 700; }
h1, h2 { font-weight: 680; letter-spacing: -.035em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.05; }
h2 { font-size: 1.15rem; margin-bottom: 10px; }
.top-tools, .tool-row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: var(--muted); font-weight: 600; }
input, select, button { font: inherit; color: inherit; }
input, select {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.btn, button.btn {
  display: inline-flex; align-items: center; border: 0; border-radius: 10px;
  background: var(--accent); color: white; font-weight: 700; padding: 9px 14px; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: .9rem; }
.note { margin: 0 0 14px; max-width: 68rem; }
.stack { display: grid; gap: 16px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px;
}
.team-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.team-grid a {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 10px; font-weight: 650; font-size: .86rem;
}
.team-grid a.is-on { background: rgba(37, 99, 235, .12); color: #1d4ed8; border-color: transparent; }
.info-dialog { border: 0; padding: 0; background: transparent; color: var(--ink); }
.info-dialog[open] { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; max-width: none; max-height: none; }
.info-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.info-card {
  width: min(560px, calc(100vw - 28px)); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow); max-height: min(78vh, 640px); overflow: auto;
}
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.info-card p { margin: 0 0 10px; font-size: .92rem; color: var(--soft); }
.rail-toggle { position: absolute; opacity: 0; pointer-events: none; }
.rail-burger { display: none; }
html[data-theme="night"] {
  color-scheme: dark;
  --ink: #e8eef7; --soft: #cbd5e1; --muted: #94a3b8; --paper: #0b1220; --card: #141c2b; --line: #243044;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.4);
}
html[data-theme="night"] .rail nav a, html[data-theme="night"] .rail-info { color: #cbd5e1; }
html[data-theme="night"] .rail nav a:hover, html[data-theme="night"] .rail-info:hover { background: rgba(255,255,255,.06); color: white; }
html[data-theme="night"] .rail nav a.is-on { background: rgba(37, 99, 235, .22); color: white; }
html[data-theme="night"] .team-grid a.is-on { color: white; }
@media (prefers-color-scheme: dark) {
  html[data-pref="device"] {
    color-scheme: dark;
    --ink: #e8eef7; --soft: #cbd5e1; --muted: #94a3b8; --paper: #0b1220; --card: #141c2b; --line: #243044;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.4);
  }
}
@media (min-width: 821px) {
  .rail-pin { display: inline-flex; }
  html[data-rail="compact"] .rail { width: 76px; flex-basis: 76px; padding-left: 10px; padding-right: 10px; }
  html[data-rail="compact"] .brand span, html[data-rail="compact"] .nav-label { display: none; }
  html[data-rail="compact"] .rail nav a, html[data-rail="compact"] .rail-info { justify-content: center; padding-left: 8px; padding-right: 8px; }
}
.source-line { margin: -8px 0 8px; color: var(--muted); font-size: .82rem; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; background: #fff7ed; border: 1px solid #fed7aa; color: var(--ink); }
.hero-grid { display: grid; grid-template-columns: 1.45fr .9fr; gap: 16px; margin-bottom: 22px; }
.poster {
  display: block; text-decoration: none; color: var(--ink);
  background: linear-gradient(160deg, rgba(37,99,235,.08), transparent 46%), var(--card);
  border: 1px solid var(--line); border-radius: 20px; padding: 22px; min-height: 240px; box-shadow: var(--shadow);
}
.poster:hover { color: var(--ink); }
.poster-static { margin-bottom: 16px; }
.poisson { margin-bottom: 16px; }
.poisson > .muted { margin: -4px 0 12px; }
.poisson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.poisson-grid article {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.poisson-grid span { color: var(--muted); font-size: .78rem; }
.poisson-grid strong { font-size: 1.35rem; letter-spacing: -.03em; }
.poisson-grid i {
  display: block; height: 6px; margin-top: 6px; border-radius: 99px; width: 0; max-width: 100%;
  background: var(--accent);
}
.poisson-grid .draw i { background: #94a3b8; }
.poisson-grid article.away { box-shadow: inset 4px 0 0 #7eb6ff; }
.poisson-grid article.away i,
.pv.away i.bar { background: #7eb6ff !important; }
.inv {
  display: inline-block; margin-left: 1rem; font-weight: 620; font-size: 0.68em;
  color: #475569; letter-spacing: 0.01em; vertical-align: 0.12em;
}
html[data-theme="night"] .inv { color: #cbd5e1; }
@media (prefers-color-scheme: dark) {
  html[data-pref="device"] .inv { color: #cbd5e1; }
}
.poisson h3 { margin: 18px 0 10px; font-size: 1rem; }
.inv-note { margin: 10px 0 0; }
.ou-board, .score-grid { display: grid; gap: 10px; margin-top: 8px; }
.ou-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ou-card, .score-grid article {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.ou-card header, .score-grid span { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.ou-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.ou-pair span, .ou-card > span { color: var(--muted); font-size: .75rem; }
.ou-card strong, .score-grid strong { font-size: 1.02rem; letter-spacing: -.02em; }
.ou-card i, .score-grid i, .pv i.bar {
  display: block; height: 7px; margin-top: 6px; border-radius: 99px; max-width: 100%;
  background: var(--accent);
}
.ou-card i.under, .mark-ng i { background: #94a3b8; }
.mark-gg i { background: #2563eb; }
.score-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.score-grid article.bucket { background: var(--card); }
.score-skip { margin: 36px 0 0; font-size: .8rem; line-height: 1.45; }
.score-skip + .score-skip { margin-top: 10px; }
.row-preview { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.pv { display: flex; flex-direction: column; gap: 1px; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.pv small { color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pv b { font-size: .92rem; font-weight: 720; letter-spacing: -.02em; }
.match-row.has-preview { align-items: center; }
.poisson-xg { margin: 12px 0 0; color: var(--muted); font-size: .86rem; }
.model-detail { margin: 8px 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .82rem; }
.model-opts { display: grid; gap: 10px; margin-top: 16px; border: 0; padding: 0; }
.model-opts .opt-title, .model-opts legend { font-weight: 680; padding: 0; }
.model-opts label { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 2px 8px; align-items: start; }
.model-opts input { margin-top: 3px; }
.model-opts small { grid-column: 2; color: var(--muted); }
.poster-top, .poster-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.poster-teams { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 16px; align-items: center; margin: 28px 0 18px; }
.poster-teams > div { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; min-width: 0; }
.poster-teams > div:last-child { align-items: flex-end; text-align: right; }
.poster-teams strong { font-size: 1.45rem; line-height: 1.1; font-weight: 680; }
.poster-teams a { color: inherit; }
.poster-score { font-size: 2.6rem; letter-spacing: -.05em; font-weight: 720; font-variant-numeric: tabular-nums; text-align: center; }
.panel-head, .section-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin: 22px 0 10px; }
.mini-table { list-style: none; margin: 0; padding: 0; }
.mini-table li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mini-table .rank { width: 1.2rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 650; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.badge {
  display: inline-grid; place-items: center; border-radius: 999px; color: white; font-weight: 750;
  font-size: .68rem; letter-spacing: .02em; flex: 0 0 auto;
}
.flag {
  display: inline-block; width: 28px; height: 18px; object-fit: contain; border-radius: 2px;
  border: 1px solid var(--line); flex: 0 0 auto; background: #fff; vertical-align: middle;
}
.poster-teams .flag { width: 54px; height: 36px; }
.kicker { display: flex; align-items: center; gap: 8px; }
.league-flag { width: 22px; height: 15px; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px;
  font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; width: fit-content;
  background: #0284c7; color: #fff;
}
.pill.pre { background: #0284c7; color: #fff; }
.pill.post { background: #1d4ed8; color: #fff; }
.pill.pending, .pill.postponed { background: #c2410c; color: #fff; }
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 72px; gap: 14px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
  text-decoration: none; color: inherit;
}
.match-row:hover { border-color: #cbd5e1; box-shadow: var(--shadow); color: inherit; }
.when { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.sides { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.side { display: flex; gap: 10px; align-items: center; min-width: 0; }
.club-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 620; }
.score { font-size: 1.2rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 720; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.count-line { margin: 0 0 10px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pager a { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: var(--ink); }
.pager a.is-on { background: rgba(37, 99, 235, .12); border-color: transparent; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.standings { width: 100%; border-collapse: collapse; }
table.standings th, table.standings td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.standings th:nth-child(3), table.standings td:nth-child(3),
table.standings th:nth-child(2), table.standings td:nth-child(2) { text-align: left; }
table.standings th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #f8fafc; }
.team-link { color: inherit; font-weight: 620; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 16px; list-style: none; padding: 12px 0 0; margin: 0; font-size: .82rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.champions { background: #99CBFF; }
.swatch.europa { background: #B0FFB0; }
.swatch.conference { background: #FFFFBB; }
.swatch.relegation { background: #FFCCCC; }
.club-grid, .squad-grid, .stat-grid { display: grid; gap: 10px; }
.club-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.team-card, .stat-grid article {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  color: inherit; box-shadow: var(--shadow);
}
.team-card span, .stat-grid span { color: var(--muted); font-size: .8rem; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
.stat-grid strong { font-size: 1.45rem; letter-spacing: -.03em; }
.squad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.squad-list { list-style: none; margin: 0; padding: 0; }
.squad-list li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.squad-list span { width: 1.6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.team-head h2 { font-size: 1.6rem; }
.place-line { margin: 6px 0 0; font-weight: 680; }
.form-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.form { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: white; font-size: .75rem; font-weight: 750; }
.form.w { background: #16a34a; }
.form.d { background: #94a3b8; }
.form.l { background: #dc2626; }
.team-figures { margin-bottom: 8px; }
.team-figures > .muted { margin: -4px 0 12px; }
.gap-note { margin: 8px 0 0; }
.split-wrap { border: 0; background: transparent; }
table.split { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.split th, table.split td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--line); }
table.split th:first-child, table.split td:first-child { text-align: left; }
table.split th { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: transparent; }
table.split tr.total td { font-weight: 720; }
.figure-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stat-cards, .figure-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.figure-grid { margin-top: 14px; }
.split-boards { display: grid; gap: 16px; }
.split-board h3 { margin: 0 0 8px; font-size: 1rem; }
.split-board .stat-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-cards article, .figure-grid article {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow);
}
.stat-cards span, .figure-grid span, .figure-grid small { color: var(--muted); font-size: .78rem; }
.stat-cards strong, .figure-grid strong { font-size: 1.35rem; letter-spacing: -.03em; line-height: 1.1; }
.stat-cards i, .figure-grid i {
  display: block; height: 7px; margin-top: 6px; border-radius: 99px; max-width: 100%;
  background: #2563eb;
}
.stat-cards i.azure, .figure-grid i.azure { background: #7eb6ff; }
.rate { font-size: .95rem; font-weight: 680; letter-spacing: -.02em; color: var(--ink); }
.figure-grid small a { font-size: inherit; color: var(--accent); }
.news-copy p { margin: 0 0 12px; }
html[data-theme="night"] table.standings th { background: #101828; }
html[data-theme="night"] .alert { background: #2a2118; border-color: #7c4a1e; }
@media (max-width: 820px) {
  .app { display: block; }
  .rail { position: sticky; top: 0; height: auto; width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .rail-burger { display: inline-flex; margin-left: auto; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-weight: 700; cursor: pointer; }
  .rail nav { display: none; margin-top: 10px; }
  .rail-toggle:checked ~ nav { display: flex; }
  .rail-head { width: 100%; }
  .workspace { padding: 16px 12px 32px; }
  h1 { font-size: 1.45rem; }
  .top { display: block; }
  .top-tools { margin-top: 12px; }
  .nav-tip { display: none; }
  .hero-grid, .stat-grid, .squad-grid { grid-template-columns: 1fr; }
  .poisson-grid, .ou-board, .score-grid { grid-template-columns: 1fr; }
  .stat-cards, .figure-grid, .split-board .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-preview { grid-template-columns: 1fr; }
  .team-head { align-items: flex-start; }
  .match-row { grid-template-columns: 96px minmax(0, 1fr) 58px; gap: 8px; padding: 8px 10px; }
  .poster-teams strong { font-size: 1.1rem; }
  .poster-score { font-size: 1.8rem; }
}
