:root {
  --bg: #0e1512;
  --panel: #16211c;
  --line: #2a3b33;
  --text: #e7f0ea;
  --muted: #8aa396;
  --live: #3dce7a;
  --accent: #d7e36a;
  --danger: #ff8a7a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #1c3a2c 0%, transparent 55%),
    var(--bg);
  color: var(--text);
}

.top, .toolbar, .meta, #board, .empty, .error {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 28px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7f74;
}
.dot.ok { background: var(--live); box-shadow: 0 0 0 4px rgba(61, 206, 122, 0.15); }
.dot.err { background: var(--danger); }

.push-btn {
  margin-left: 8px;
  border: 1px solid var(--line);
  background: #101a16;
  color: var(--text);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
}
.push-btn:hover { background: #18241f; }
.push-btn.is-on {
  background: var(--live);
  color: #062113;
  border-color: transparent;
  font-weight: 700;
  cursor: default;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.stats {
  display: flex;
  gap: 18px;
}
.stats article {
  min-width: 88px;
}
.stats strong {
  display: block;
  font-size: 26px;
}
.stats span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.search span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.search input, .tab {
  border: 1px solid var(--line);
  background: #101a16;
  color: var(--text);
  border-radius: 10px;
  font: inherit;
}
.search input {
  padding: 10px 12px;
  min-width: 220px;
}
.tabs { display: flex; gap: 8px; }
.tab {
  padding: 10px 12px;
  cursor: pointer;
}
.tab.is-active {
  background: var(--live);
  color: #062113;
  border-color: transparent;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  min-height: 1.4em;
}

.league {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #121c18;
}
.league header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #1a2822;
  font-size: 14px;
}
.league header strong { display: block; }
.league header span { color: var(--muted); font-size: 12px; }

.match-card { background: #121c18; }
.match {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  font: inherit;
  text-align: inherit;
}
button.match { cursor: pointer; appearance: none; }
.match.live { grid-template-columns: 72px 1fr auto 16px; }
.match:hover { background: #18241f; }
.match .time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.match.live .time {
  color: var(--live);
  font-weight: 700;
}
.teams { display: grid; gap: 2px; }
.team-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pick-star {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(61, 206, 122, 0.45);
}
.score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 42px;
  text-align: right;
}
.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  justify-self: end;
}
.match-card.is-open .chevron { transform: rotate(-135deg); }
.match-details {
  padding: 4px 14px 16px;
  border-top: 1px dashed var(--line);
  background: #0f1915;
}
.match-card.is-open .match-details:not([hidden]) { display: block; }
.match-card.is-focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}

.events {
  list-style: none;
  margin: 10px 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.events li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.events li.away { grid-template-columns: 1fr 48px; text-align: right; }
.events li.away .ev-time { order: 2; }
.ev-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.events .muted { color: var(--muted); }

.period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.period-tab {
  border: 1px solid var(--line);
  background: #101a16;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.period-tab.is-active {
  background: var(--live);
  color: #062113;
  border-color: transparent;
  font-weight: 700;
}

.stats-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.stat-group { margin: 12px 0 4px; }
.stat-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.stat-row { margin: 0 0 10px; }
.stat-label {
  text-align: center;
  font-size: 13px;
  margin-bottom: 4px;
}
.stat-values {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
}
.stat-values .is-lead { color: var(--live); }
.stat-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: #24352d;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: #4d6a5c;
  max-width: 100%;
}
.bar-away i { margin-left: auto; }
.bar i.is-lead { background: var(--live); }
.stats-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0;
}
.ext {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
}

.odds-box {
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #132019;
}
.odds-box h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.odds-next {
  margin: 0 0 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
}
.odds-next span { color: var(--muted); font-size: 13px; }
.odds-quota {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.odds-quota em {
  font-style: normal;
  color: var(--live);
  font-weight: 700;
}
.odds-reason {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.odds-notified {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 12px;
}
.odds-empty, .odds-source {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.odds-source { margin-top: 8px; font-size: 11px; }

.empty, .error {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}
.empty h2, .error h2 { margin: 0 0 8px; color: var(--text); }
pre {
  overflow-x: auto;
  background: #0b120f;
  color: var(--accent);
  padding: 12px;
  border-radius: 10px;
}

@media (max-width: 720px) {
  .toolbar, .top { grid-template-columns: 1fr; display: grid; }
  .match { grid-template-columns: 64px 1fr auto; }
  .match.live { grid-template-columns: 64px 1fr auto 16px; }
  .search input { min-width: 0; width: 100%; }
}
