/* ============================================================
   LiveScore Platform — Default Theme
   Dark mode, mobile-first, accessible
   ============================================================ */

/* --- Variables -------------------------------------------- */
:root {
  --bg:          #0f1117;
  --bg-2:        #1c1f26;
  --bg-3:        #252830;
  --border:      #2a2d36;
  --text:        #e8eaf0;
  --text-2:      #9ba3b8;
  --text-3:      #5c6070;
  --primary:     #1a73e8;
  --primary-h:   #1557b0;
  --live:        #e53935;
  --live-glow:   rgba(229,57,53,.25);
  --win:         #43a047;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 2px 8px rgba(0,0,0,.4);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Screen reader only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Header ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px; height: 56px;
}
.site-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.site-logo img { width: 28px; height: 28px; }
.header-sports { display: flex; align-items: center; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.header-sports::-webkit-scrollbar { display: none; }
.sport-link {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.sport-link:hover { background: var(--bg-3); color: var(--text); }
.sport-link.is-active { background: var(--bg-3); color: var(--text); font-weight: 500; }
.sport-icon { font-size: 14px; }
.header-right { flex-shrink: 0; margin-left: auto; }
.live-indicator { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--live); letter-spacing: .06em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{ opacity:1; transform:scale(1); } 50%{ opacity:.5; transform:scale(1.2); } }

.mobile-menu-btn { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.mobile-menu-btn span { display: block; width: 20px; height: 2px; background: var(--text-2); border-radius: 2px; transition: .2s; }
.mobile-nav { display: none; padding: 8px 16px 12px; background: var(--bg-2); border-top: 1px solid var(--border); flex-wrap: wrap; gap: 4px; }
.mobile-nav.is-open { display: flex; }
.mobile-sport-link { padding: 6px 12px; border-radius: var(--radius); font-size: 13px; background: var(--bg-3); }
.mobile-sport-link.is-active { background: var(--primary); color: #fff; }

/* --- Layout ----------------------------------------------- */
.layout { display: flex; max-width: 1280px; margin: 0 auto; padding: 16px; gap: 20px; }
.sidebar { width: 220px; flex-shrink: 0; }
.main-content { flex: 1; min-width: 0; }

/* --- Sidebar ---------------------------------------------- */
.sidebar-section { margin-bottom: 24px; }
.sidebar-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.league-list { display: flex; flex-direction: column; gap: 1px; }
.league-link { display: block; padding: 7px 10px; border-radius: var(--radius); font-size: 13px; color: var(--text-2); transition: background .12s, color .12s; }
.league-link:hover { background: var(--bg-2); color: var(--text); }
.league-link.is-active { background: var(--bg-2); color: var(--text); font-weight: 500; border-left: 2px solid var(--primary); padding-left: 8px; }

.date-nav { display: flex; flex-direction: column; gap: 2px; }
.date-btn { display: block; padding: 6px 10px; border-radius: var(--radius); font-size: 12px; color: var(--text-2); transition: background .12s; }
.date-btn:hover { background: var(--bg-2); color: var(--text); }
.date-btn.is-active { background: var(--primary); color: #fff; font-weight: 500; }

/* --- Page header ------------------------------------------ */
.page-header { margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; margin-top: 2px; }

/* --- Sport/league section headings ------------------------ */
.sport-section { margin-bottom: 28px; }
.sport-section-header, .league-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.sport-section-title, .league-section-title { font-size: 15px; font-weight: 600; }
.see-all-link { font-size: 12px; color: var(--primary); }
.see-all-link:hover { text-decoration: underline; }

/* --- Match card ------------------------------------------- */
.match-list { display: flex; flex-direction: column; gap: 2px; }
.match-card {
  background: var(--bg-2); border-radius: var(--radius);
  border: 1px solid var(--border); transition: border-color .15s, background .15s;
}
.match-card:hover { border-color: var(--primary); background: var(--bg-3); }
.match-card.is-live { border-color: rgba(229,57,53,.4); }
.match-card-link {
  display: grid;
  grid-template-columns: 72px 1fr auto 1fr 24px;
  align-items: center; gap: 8px;
  padding: 10px 14px; color: var(--text);
}
.match-status-col { text-align: center; }
.status-live { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--live); }
.live-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
.status-label { font-size: 11px; color: var(--text-2); display: block; text-align: center; }
.status-scheduled { color: var(--text-2); }
.status-final { color: var(--text-3); }

.team { display: flex; align-items: center; gap: 8px; }
.team-home { justify-content: flex-end; }
.team-away { justify-content: flex-start; }
.team-logo { border-radius: 3px; object-fit: contain; }
.team-name-abbr { display: none; }
.match-score { display: flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 700; font-family: var(--mono); }
.score.winner { color: var(--win); }
.score-sep { color: var(--text-3); font-weight: 400; }
.score-vs { font-size: 13px; color: var(--text-3); font-family: var(--font); font-weight: 400; }
.match-arrow { color: var(--text-3); font-size: 16px; }

/* --- Empty state ------------------------------------------ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-2); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* --- Tab bar ---------------------------------------------- */
.tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 9px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--primary); }

/* --- Date strip (league page) ----------------------------- */
.date-strip { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.date-strip::-webkit-scrollbar { display: none; }
.date-chip { padding: 5px 12px; border-radius: 20px; font-size: 12px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border); transition: background .12s; }
.date-chip:hover { background: var(--bg-3); color: var(--text); }
.date-chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- Standings table -------------------------------------- */
.standings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings-table th { padding: 6px 8px; text-align: right; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--border); }
.standings-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: var(--bg-2); }
.col-pos { width: 28px; text-align: center; color: var(--text-2); }
.col-team { text-align: left !important; display: flex; align-items: center; gap: 8px; }
.col-num { text-align: right; color: var(--text-2); }
.col-pts { color: var(--text); font-weight: 600; }
.col-form { display: flex; gap: 3px; justify-content: flex-end; }
.team-logo-sm { border-radius: 3px; object-fit: contain; }
.form-dot { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.form-w { background: var(--win); }
.form-d { background: #fb8c00; }
.form-l { background: var(--live); }

/* --- Match hero ------------------------------------------- */
.match-hero {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 20px; margin-bottom: 20px;
}
.match-hero.is-live { border-color: rgba(229,57,53,.5); box-shadow: 0 0 20px var(--live-glow); }
.match-league { font-size: 12px; color: var(--text-2); margin-bottom: 16px; }
.match-league a:hover { color: var(--text); }

.match-score-panel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.team-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.team-block.team-home { align-items: flex-start; }
.team-block.team-away { align-items: flex-end; }
.team-logo-xl { border-radius: 6px; object-fit: contain; }
.team-name-hero { font-size: 16px; font-weight: 700; text-align: center; }
.team-name-hero.winner { color: var(--win); }
.team-record { font-size: 11px; color: var(--text-3); }

.score-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-score { display: flex; align-items: center; gap: 10px; font-size: 40px; font-weight: 800; font-family: var(--mono); line-height: 1; }
.hero-score-home, .hero-score-away { min-width: 48px; text-align: center; }
.hero-score-home.winner, .hero-score-away.winner { color: var(--win); }
.hero-score-sep { font-size: 28px; color: var(--text-3); font-weight: 300; }
.hero-kickoff { font-size: 32px; font-weight: 700; font-family: var(--mono); }
.kickoff-tz { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 4px; }

.period-scores { display: flex; flex-direction: column; gap: 2px; align-items: center; font-size: 12px; color: var(--text-2); font-family: var(--mono); }
.period-row { display: flex; gap: 10px; }
.period-score { display: flex; flex-direction: column; align-items: center; }
.period-label { font-size: 9px; color: var(--text-3); }

.match-status-label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.match-status-label.is-live { color: var(--live); }
.period-indicator { font-size: 11px; color: var(--text-3); }

.match-meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }

/* --- Match stats ------------------------------------------ */
.section-heading { font-size: 14px; font-weight: 600; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.stats-grid { display: flex; flex-direction: column; gap: 10px; }
.stat-row { display: grid; grid-template-columns: 60px 1fr 60px; align-items: center; gap: 8px; font-size: 13px; }
.stat-val { font-weight: 600; font-family: var(--mono); }
.stat-home { text-align: left; }
.stat-away { text-align: right; }
.stat-label { text-align: center; color: var(--text-2); font-size: 12px; }

/* --- Events / Timeline ------------------------------------ */
.summary-events { display: flex; flex-direction: column; gap: 2px; }
.event-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-2); border-radius: var(--radius); font-size: 13px; }
.event-clock { font-family: var(--mono); font-size: 12px; color: var(--text-2); min-width: 36px; }
.event-icon { font-size: 15px; }
.event-type { font-weight: 500; }
.event-players { color: var(--text-2); margin-left: auto; }

/* --- Lineups ---------------------------------------------- */
.lineups-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.lineup-team-name { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.lineup-sub-heading { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; margin-top: 12px; }
.player-list { display: flex; flex-direction: column; }
.player-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.player-row:last-child { border-bottom: none; }
.player-number { font-family: var(--mono); font-size: 11px; color: var(--text-3); min-width: 20px; text-align: right; }
.player-name { flex: 1; }
.player-pos { font-size: 11px; color: var(--text-3); background: var(--bg-3); padding: 1px 6px; border-radius: 4px; }
.bench-list .player-name { color: var(--text-2); }

/* --- Odds ------------------------------------------------- */
.odds-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.odds-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; text-align: center; min-width: 90px; }
.odds-label { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.odds-value { display: block; font-size: 20px; font-weight: 700; font-family: var(--mono); }
.odds-disclaimer { font-size: 11px; color: var(--text-3); }
.odds-provider { font-weight: 400; color: var(--text-3); margin-left: 6px; }

/* --- 404 -------------------------------------------------- */
.page-error { display: flex; justify-content: center; align-items: center; min-height: 60vh; }
.error-content { text-align: center; }
.error-code { font-size: 80px; font-weight: 800; color: var(--bg-3); display: block; line-height: 1; }
.error-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.error-desc { color: var(--text-2); font-size: 14px; margin-bottom: 24px; max-width: 360px; }
.error-actions { display: flex; gap: 10px; justify-content: center; }
.btn { display: inline-block; padding: 9px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-secondary { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-3); }

/* --- Footer ----------------------------------------------- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 32px 16px; display: flex; gap: 40px; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 180px; }
.footer-logo-link { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.footer-tagline { font-size: 13px; color: var(--text-2); }
.footer-nav { min-width: 120px; }
.footer-nav-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.footer-nav ul { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { font-size: 13px; color: var(--text-2); transition: color .12s; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { max-width: 1280px; margin: 0 auto; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

/* --- Responsive ------------------------------------------- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .layout { padding: 12px; }
  .sport-label { display: none; }
  .team-name-full { display: none; }
  .team-name-abbr { display: inline; }
  .match-card-link { grid-template-columns: 56px 1fr auto 1fr 18px; gap: 6px; padding: 9px 10px; }
  .hero-score { font-size: 32px; }
  .match-score-panel { gap: 8px; }
  .team-logo-xl { width: 48px; height: 48px; }
  .lineups-grid { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: flex; }
}
@media (max-width: 480px) {
  .match-score-panel { grid-template-columns: 1fr; }
  .team-block.team-home, .team-block.team-away { align-items: center; }
  .score-center { order: -1; }
}
