
:root {
  --bg: #0d1117;
  --surface: #111821;
  --surface-2: #151e29;
  --surface-3: #1b2633;
  --line: #263545;
  --line-soft: #1d2a38;
  --text: #eef3f8;
  --muted: #8b9aad;
  --muted-2: #657589;
  --accent: #2f81f7;
  --accent-2: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --shadow: 0 16px 34px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.layout-shell { width: min(1160px, 100%); margin: 0 auto; padding: 10px 10px 32px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 58px; padding: 8px 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 14px; height: 30px; display: inline-block; background: linear-gradient(180deg, var(--accent) 0%, var(--accent) 48%, var(--accent-2) 48%, var(--accent-2) 100%); }
.brand strong { display: block; font-size: .96rem; line-height: 1; }
.brand small { display: block; margin-top: 4px; color: var(--muted); text-transform: uppercase; font-size: .65rem; letter-spacing: .14em; }
.topnav { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); background: var(--surface); }
.topnav a { padding: 9px 11px; color: var(--muted); font-size: .82rem; border-left: 1px solid transparent; }
.topnav a + a { border-left-color: var(--line); }
.topnav a.active, .topnav a:hover { color: var(--text); background: var(--surface-3); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 18px 0 14px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(1.35rem, 5vw, 2.2rem); line-height: 1.1; font-weight: 800; }
.head-metrics { display: none; gap: 6px; }
.head-metrics > div { min-width: 84px; border: 1px solid var(--line); background: var(--surface); padding: 9px 10px; }
.head-metrics strong { display:block; font-size: 1.18rem; line-height: 1; }
.head-metrics span { display:block; margin-top: 4px; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.roundbar { display: grid; grid-template-columns: 42px 1fr 42px auto; gap: 4px; padding: 6px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.nav-square, .round-current {
  height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-square { font-size: 1.55rem; font-weight: 700; color: var(--accent); }
.nav-square:disabled { opacity: .35; color: var(--muted-2); }
.nav-square:hover:not(:disabled), .round-current:hover { background: var(--surface-3); }
.nav-text { min-width: 68px; padding: 0 14px; font-size: .85rem; color: var(--text); }
.round-current { min-width: 0; flex-direction: column; align-items: flex-start; padding: 0 12px; }
.round-current span { font-size: .92rem; font-weight: 800; white-space: nowrap; }
.round-current small { color: var(--muted); font-size: .68rem; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.round-rail { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 12px; scrollbar-width: thin; }
.round-chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 8px 10px; font-size: .78rem; font-weight: 700; }
.round-chip.active { color: var(--text); background: var(--surface-3); border-color: var(--accent); }
.content-area { padding-top: 4px; }
.section-strip { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 10px; padding: 10px 12px; border:1px solid var(--line); background: var(--surface); }
.section-strip h2 { margin:0; font-size: 1rem; font-weight: 800; }
.section-strip p { margin:3px 0 0; color: var(--muted); font-size: .76rem; }
.section-strip .counts { color: var(--muted); font-size:.75rem; white-space: nowrap; }
.match-list { display: grid; gap: 8px; }
.match-card {
  position: relative; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.match-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--accent); }
.match-card-inner { display:grid; gap: 10px; padding: 12px 12px 12px 14px; }
.match-meta { display:flex; flex-wrap: wrap; align-items:center; gap:5px; color: var(--muted); font-size:.72rem; }
.token { display:inline-flex; align-items:center; min-height: 22px; padding: 3px 6px; border:1px solid var(--line); color: var(--muted); background: #0f1620; font-weight: 700; }
.token-blue { color:#d9e8ff; border-color:#1f6feb; background:#0f2746; }
.token-muted { color: var(--muted-2); }
.fixture-grid { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap: 8px; }
.team { min-width:0; }
.team.away { text-align:right; }
.team-name { font-size: clamp(1rem, 4.4vw, 1.18rem); font-weight: 850; line-height: 1.15; overflow-wrap:anywhere; }
.team-sub { margin-top:4px; color: var(--muted); font-size:.72rem; }
.vs { color: var(--muted-2); font-size:.74rem; text-transform:uppercase; font-weight: 800; }
.forecast-panel { border-top:1px solid var(--line-soft); padding-top:10px; display:grid; gap:8px; }
.forecast-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.forecast-label { color: var(--muted); font-size:.67rem; text-transform:uppercase; letter-spacing:.14em; font-weight: 800; }
.pill-row { display:flex; flex-wrap: wrap; gap:5px; justify-content:flex-end; }
.pill { display:inline-flex; align-items:center; min-height:26px; border:1px solid var(--line); background:#0f1620; color: var(--text); padding: 4px 7px; font-size:.74rem; font-weight:800; }
.pill-primary { border-color:#1f6feb; background:#0f2746; }
.pill-green { border-color:#1f6b41; background:#0d2c20; color:#d2f8de; }
.pill-warn { border-color:#7c5b1e; background:#241b0d; color:#f1d28c; }
.pill-muted { color: var(--muted); }
.detail-link { display:flex; align-items:center; justify-content:center; min-height:34px; border:1px solid var(--line); background: var(--surface-2); color: var(--text); font-size:.78rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.detail-link:hover { border-color: var(--accent); background: var(--surface-3); }
.detail-header { border:1px solid var(--line); background: var(--surface); padding: 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.back-link { display:inline-flex; gap:6px; align-items:center; color: var(--muted); font-size:.78rem; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }
.detail-title { display:grid; grid-template-columns: 1fr auto 1fr; align-items:center; gap:10px; }
.detail-title h1 { font-size: clamp(1.2rem, 6vw, 2rem); }
.detail-title .away { text-align:right; }
.detail-grid { display:grid; gap:10px; }
.panel { border:1px solid var(--line); background: var(--surface); padding: 12px; }
.panel h2 { font-size: .9rem; margin:0 0 10px; text-transform: uppercase; letter-spacing:.12em; color: var(--muted); }
.kv { display:grid; gap: 7px; }
.kv-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line-soft); padding-bottom:7px; }
.kv-row:last-child { border-bottom:0; padding-bottom:0; }
.kv-row span:first-child { color: var(--muted); font-size:.76rem; }
.kv-row span:last-child { min-width:0; text-align:right; font-weight:700; overflow-wrap:anywhere; }
.kv-row-block { display:grid; gap:5px; }
.kv-row-block span:last-child { text-align:left; line-height:1.45; }
.source-list { display:grid; gap:8px; }
.source-item { border:1px solid var(--line-soft); background:#0f1620; padding:10px; }
.source-item-head { display:flex; justify-content:space-between; gap:10px; margin-bottom:8px; min-width:0; }
.source-item-head strong { min-width:0; overflow-wrap:anywhere; }
.source-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color:#c9d1d9; font-size:.72rem; overflow-wrap:anywhere; word-break:break-word; }
.source-link { display:inline-flex; align-items:center; justify-content:center; max-width:100%; padding:4px 7px; border:1px solid var(--line); background:var(--surface-2); color:#d9e8ff; font-size:.72rem; font-weight:800; }
.source-link:hover { border-color:var(--accent); background:var(--surface-3); }
.odds-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; }
.odd-box { border:1px solid var(--line); background: var(--surface); padding:8px; }
.odd-box small { display:block; color: var(--muted); font-size:.64rem; text-transform:uppercase; }
.odd-box strong { display:block; margin-top:2px; font-size:1rem; }
.empty-state { border:1px dashed var(--line); background: var(--surface); color: var(--muted); padding: 14px; }
.bonus-layout { display:grid; gap:10px; }
.bonus-section { border:1px solid var(--line); background: var(--surface); }
.bonus-section h2 { margin:0; padding:10px 12px; border-bottom:1px solid var(--line-soft); font-size:.95rem; }
.bonus-item { padding:12px; border-bottom:1px solid var(--line-soft); }
.bonus-item:last-child { border-bottom:0; }
.bonus-question { margin:0 0 8px; font-weight:750; }
.answer-row { display:flex; flex-wrap:wrap; gap:6px; }
.load-error { border:1px solid var(--danger); color:#ffd8d8; background:#2a1111; padding:12px; }

@media (max-width: 560px) {
  .odds-grid { grid-template-columns: 1fr; }
  .source-item-head { display:grid; gap:4px; }
  .kv-row { display:grid; gap:4px; }
  .kv-row span:last-child { text-align:left; }
}
@media (min-width: 760px) {
  .layout-shell { padding-left: 16px; padding-right: 16px; }
  .head-metrics { display:flex; }
  .match-card-inner { grid-template-columns: 1.1fr 1.3fr .95fr; align-items:center; }
  .match-meta { align-content:center; }
  .forecast-panel { border-top:0; padding-top:0; border-left:1px solid var(--line-soft); padding-left:12px; }
  .forecast-head { display:grid; gap:6px; justify-content:stretch; }
  .pill-row { justify-content:flex-start; }
  .detail-grid { grid-template-columns: .8fr 1.2fr; }
  .source-panel { grid-column: span 2; }
}
.market-title { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; margin-bottom: 6px; }
.odds-grid-two { grid-template-columns: repeat(2, 1fr); }
.odds-grid-score { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) {
  .odds-grid-two, .odds-grid-score { grid-template-columns: 1fr 1fr; }
}


/* Forecast result focus */
.forecast-head-main { align-items: stretch; }
.forecast-head-main > .forecast-label { align-self: start; padding-top: 3px; }
.forecast-hero {
  width: 100%;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.forecast-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border: 1px solid var(--line);
  background: #0b121b;
}
.forecast-hero-empty .forecast-result {
  display: block;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}
.forecast-team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
  color: var(--text);
  font-size: .92rem;
}
.forecast-team-name:last-child { text-align: right; }
.forecast-team-winner { color: #e9fff2; }
.forecast-team-secondary { color: var(--muted); opacity: .76; }
.forecast-team-draw { color: #d9e8ff; }
.forecast-score {
  min-width: 58px;
  text-align: center;
  color: #fff;
  background: #0e3a2a;
  border: 1px solid #238454;
  padding: 7px 10px;
  font-size: 1.28rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .02em;
}
.forecast-winner-row { display: flex; justify-content: flex-end; }
.forecast-winner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid #238454;
  background: #0d2c20;
  color: #d2f8de;
  font-weight: 850;
  font-size: .74rem;
}
.forecast-winner-draw { border-color: #1f6feb; background: #0f2746; color: #d9e8ff; }
.forecast-winner-open { border-color: #7c5b1e; background: #241b0d; color: #f1d28c; }
.forecast-metas {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}
.forecast-metas .pill { min-height: 24px; }
.forecast-hero-compact .forecast-result { padding: 8px; gap: 6px; }
.forecast-hero-compact .forecast-team-name { font-size: .82rem; }
.forecast-hero-compact .forecast-score { min-width: 48px; padding: 6px 8px; font-size: 1.08rem; }
@media (max-width: 560px) {
  .forecast-result { grid-template-columns: 1fr; text-align: center; gap: 6px; }
  .forecast-team-name,
  .forecast-team-name:last-child {
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .forecast-score { justify-self: center; min-width: 74px; }
  .forecast-winner-row,
  .forecast-metas { justify-content: center; }
}
@media (min-width: 760px) {
  .forecast-head-main { display: grid; gap: 6px; }
  .forecast-hero-compact .forecast-metas,
  .forecast-hero-compact .forecast-winner-row { justify-content: flex-start; }
}

/* Score-first forecast header correction */
.score-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.score-center-empty {
  color: var(--muted-2);
  font-size: .74rem;
  text-transform: uppercase;
  font-weight: 800;
}
.score-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #0f1620;
  color: var(--text);
  font-weight: 950;
  font-size: 1.05rem;
  line-height: 1;
}
.score-separator {
  color: var(--muted);
  font-weight: 900;
  font-size: 1rem;
  padding: 0 1px;
}
.score-win {
  border-color: #238454;
  background: #0d2c20;
  color: #d2f8de;
}
.score-loss {
  border-color: #7a2e35;
  background: #2a1114;
  color: #ffd8dd;
}
.score-draw {
  border-color: #1f6feb;
  background: #0f2746;
  color: #d9e8ff;
}
.score-center-detail .score-box {
  min-width: 46px;
  height: 44px;
  font-size: 1.55rem;
}
.score-center-detail .score-separator {
  font-size: 1.35rem;
}
.forecast-metas-only {
  justify-content: flex-end;
}
.forecast-head-main {
  align-items: center;
}
@media (max-width: 560px) {
  .fixture-grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }
  .score-box {
    min-width: 28px;
    height: 28px;
    font-size: .98rem;
  }
  .detail-title {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .detail-title h1 {
    font-size: clamp(1.05rem, 5.2vw, 1.55rem);
  }
  .score-center-detail .score-box {
    min-width: 38px;
    height: 38px;
    font-size: 1.35rem;
  }
  .forecast-head-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .forecast-metas-only {
    justify-content: flex-start;
  }
}
@media (min-width: 760px) {
  .forecast-metas-only { justify-content: flex-start; }
}

.bonus-meta,
.bonus-summary {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}
.bonus-summary {
  color: var(--muted-2);
}

.source-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .25rem 0 1rem;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.source-summary span {
  border: 1px solid var(--line);
  background: rgba(14, 25, 37, .72);
  padding: .35rem .55rem;
}

/* Forecast criteria / source signals */
.criteria-box {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  background: #0f1620;
  padding: 10px;
}
.criteria-title {
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 850;
  margin-bottom: 8px;
}
.criteria-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: start;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
  margin-top: 8px;
}
.criteria-row:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.criteria-row strong { min-width: 0; overflow-wrap: anywhere; }
.criteria-row span,
.criteria-row small {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 2px 6px;
  font-weight: 800;
  white-space: nowrap;
}
.criteria-row small { color: #d9e8ff; }
.criteria-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}
.source-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 10px 0;
}
@media (max-width: 560px) {
  .criteria-row { grid-template-columns: 1fr; }
  .criteria-row span,
  .criteria-row small { justify-self: start; }
}
