:root {
  --bg: #0b1020;
  --bg-elev: #131a30;
  --bg-card: #1a2240;
  --text: #e8ecf6;
  --text-dim: #9aa4c2;
  --accent: #ff6a00;
  --accent-2: #ffb347;
  --live: #ff3b3b;
  --completed: #4ade80;
  --scheduled: #60a5fa;
  --abandoned: #9ca3af;
  --border: #25304f;
  --shadow: 0 6px 20px rgba(0,0,0,0.35);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
               Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(180deg, #131a30 0%, #0b1020 100%);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand .brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* ── Main container ──────────────────────────────────────────────────── */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
p { color: var(--text-dim); }

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 16px;
  border-bottom: 1px solid var(--border);
}
.tab {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tab .count {
  display: inline-block;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

/* ── Match cards ─────────────────────────────────────────────────────── */
.match-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 700px) {
  .match-list { grid-template-columns: 1fr 1fr; }
}

.match-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.match-card:hover {
  transform: translateY(-1px);
  border-color: #354068;
  text-decoration: none;
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.sport-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 999px;
}
.status-pill {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.status-pill.LIVE       { background: rgba(255,59,59,.15);  color: var(--live); }
.status-pill.LIVE::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 1.2s ease-in-out infinite;
}
.status-pill.COMPLETED  { background: rgba(74,222,128,.12); color: var(--completed); }
.status-pill.SCHEDULED  { background: rgba(96,165,250,.12); color: var(--scheduled); }
.status-pill.ABANDONED  { background: rgba(156,163,175,.15); color: var(--abandoned); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

.match-title { font-weight: 700; font-size: 16px; margin: 2px 0 8px; }
.teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.team { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.team-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-score { font-weight: 700; font-size: 16px; color: var(--text); white-space: nowrap; }
.vs { color: var(--text-dim); font-size: 12px; padding: 0 4px; }
.score-line {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 13px;
}
.venue {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ── State messages ──────────────────────────────────────────────────── */
.empty, .loading, .error {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 15px;
}
.error { color: #ff7a7a; }
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Match detail page ───────────────────────────────────────────────── */
.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.detail-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.detail-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.detail-team.right { align-items: center; }
.detail-team .name { font-size: 14px; color: var(--text-dim); }
.detail-team .score { font-size: 28px; font-weight: 800; }
.detail-vs { font-size: 14px; color: var(--text-dim); }
.detail-status-line {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--accent-2);
}

.kv-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.kv-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding: 6px 0;
  font-size: 13px;
}
.kv-list .k { color: var(--text-dim); }
.kv-list .v { color: var(--text); font-weight: 600; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 10px;
}

/* ── Static content pages ────────────────────────────────────────────── */
.prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.prose h1, .prose h2 { color: var(--text); }
.prose p, .prose li { color: var(--text-dim); }
.prose ul { padding-left: 20px; }

/* ── Video embed ─────────────────────────────────────────────────────── */
.video-wrap {
  margin: 0 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.video-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}
.video-frame iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
  background: #000;
}
.video-placeholder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.placeholder-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.7; }
.placeholder-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.placeholder-sub   { font-size: 13px; color: var(--text-dim); }

.video-fallback {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}
.video-fallback .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 6px;
}
.video-fallback .btn:hover { background: var(--accent-2); text-decoration: none; }

/* ── Ticker (TV-broadcast lower-third) ───────────────────────────────── */
.ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #16213a 0%, #0e1731 50%, #16213a 100%);
  border: 1px solid var(--border);
  border-top: 0;
  padding: 12px 16px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  position: relative;
  margin-bottom: 18px;
}
/* When ticker sits below the video, remove the top radius so they look joined. */
.video-wrap + .ticker {
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}
/* When ticker has no video above, give it a full radius. */
.ticker:first-child,
.back-link + .ticker {
  border-radius: var(--radius);
  border-top: 1px solid var(--border);
}

.ticker-team {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ticker-tag {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
}
.ticker-score {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.ticker-sub {
  font-size: 12px;
  color: var(--text-dim);
}
.ticker-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
}
.ticker-status {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticker-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: var(--live);
  padding: 3px 8px;
  border-radius: 4px;
}
.ticker-live .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}

@media (max-width: 520px) {
  .ticker { gap: 10px; padding: 10px 12px; }
  .ticker-score { font-size: 18px; }
  .ticker-status { width: 100%; min-width: 0; flex-basis: 100%; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 18px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); margin: 0 8px; }
