/* ============================================================
   ScorePulse — Advanced AI and Neural Analytics for Football
   FlashScore-cloned density + custom AI layer
   Mobile-first responsive design
   Phase 0B.5a — Aesthetics Professionalization
   ============================================================ */

/* ---- CSS Custom Properties (Light Theme) ---- */
:root {
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --text: #333333;
  --text-secondary: #666666;
  --text-meta: #999999;
  --accent: #004D7F;
  --accent-red: #E94560;
  --border: #E5E5E5;
  --live: #E94560;
  --live-bg: rgba(233,69,96,0.08);
  --success: #2E7D32;
  --warning: #F57C00;
  --overlay-bg: rgba(0,0,0,0.4);
  --nav-bg: #FAFAFA;
  --nav-hover: #EEEEEE;
  --nav-active: #E8F0FE;
  --calendar-today-bg: var(--accent);
  --calendar-today-text: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-nav: 2px 0 8px rgba(0,0,0,0.06);
  --transition-speed: 0.2s;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --bg: #1A1A2E;
  --surface: #16213E;
  --text: #E0E0E0;
  --text-secondary: #A0A0A0;
  --text-meta: #707070;
  --accent: #0F3460;
  --accent-red: #E94560;
  --border: #2A2A4E;
  --live: #E94560;
  --live-bg: rgba(233,69,96,0.12);
  --success: #4CAF50;
  --warning: #FFA726;
  --overlay-bg: rgba(0,0,0,0.6);
  --nav-bg: #16213E;
  --nav-hover: #1A2744;
  --nav-active: #0F3460;
  --calendar-today-bg: #E94560;
  --calendar-today-text: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-nav: 2px 0 8px rgba(0,0,0,0.4);
  --transition-speed: 0.2s;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  min-height: 100vh;
  transition: background var(--transition-speed), color var(--transition-speed);
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- App Layout (flex column: header → body-row → footer) ---- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Desktop Site Header ---- */
#site-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 110;
  background: #0F3460;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  height: 96px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  max-height: 72px;
  object-fit: contain;
}

.header-tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-date {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.header-match-count {
  font-size: 11px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
}

.header-actions .theme-btn {
  color: rgba(255,255,255,0.85);
}

/* ---- Top Bar (Mobile only) ---- */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  height: 54px;
  padding: 0 12px;
  background: #0F3460;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  box-shadow: var(--shadow);
}

.top-logo {
  max-height: 32px;
  object-fit: contain;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
  z-index: 101;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform var(--transition-speed), opacity var(--transition-speed);
}

#top-bar .theme-btn {
  color: rgba(255,255,255,0.85);
}

/* ---- App Body Row (nav + main + sidebar) ---- */
.app-body {
  display: flex;
  flex: 1;
}

/* ---- Left Navigation ---- */
#left-nav {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-nav);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: left var(--transition-speed);
  padding-bottom: 24px;
}

#left-nav.open {
  left: 0;
}

.nav-brand {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.nav-logo {
  margin: 0 auto 4px;
  max-height: 30px;
  object-fit: contain;
}

.nav-tagline {
  font-size: 11px;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nav-section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 16px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-speed);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--nav-hover);
}

.nav-item.active {
  background: var(--nav-active);
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item.disabled {
  color: var(--text-meta);
  cursor: not-allowed;
  opacity: 0.5;
}

.nav-item.disabled:hover {
  background: transparent;
}

.nav-icon { font-size: 15px; flex-shrink: 0; }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--accent);
  color: #FFFFFF;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.nav-settings { border-bottom: none; }
.nav-btn { width: 100%; text-align: left; }

/* Nav Overlay */
#nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-speed);
}

#nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Theme Toggle ---- */
.theme-btn {
  font-size: 16px;
  padding: 6px;
  line-height: 1;
}

/* ---- Main Content ---- */
#main-content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  padding-bottom: 80px;
  width: 100%;
}

/* ---- Views ---- */
.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.view-title {
  font-size: 16px;
  font-weight: 600;
}

.back-btn {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.back-btn:hover {
  background: var(--surface);
}

.placeholder-text {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-meta);
  font-size: 14px;
}

/* ---- Calendar Date Bar ---- */
.calendar-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0 4px;
}

/* League header — scrolls with content, not sticky */
.league-header {
  z-index: 5;
}

.cal-arrow {
  flex-shrink: 0;
  font-size: 20px;
  padding: 8px;
  color: var(--text-secondary);
  line-height: 1;
}

.cal-arrow:active { color: var(--accent); }

.cal-dates {
  display: flex;
  overflow-x: auto;
  flex: 1;
  gap: 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cal-dates::-webkit-scrollbar { display: none; }

.cal-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 44px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background var(--transition-speed), color var(--transition-speed);
}

.cal-date:hover { background: var(--border); }

.cal-date.today {
  background: var(--calendar-today-bg);
  color: var(--calendar-today-text);
  font-weight: 700;
}

.cal-date.active {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
}

.cal-date .cal-day { font-size: 10px; text-transform: uppercase; }
.cal-date .cal-num { font-size: 16px; font-weight: 700; }

/* ---- Match Listing ---- */
.match-listing {
  padding: 0;
}

/* League / Group Header */
.league-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
}

.league-flag { font-size: 14px; }

/* ---- Match Card (replaces .match-row) ---- */
.match-card {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  margin: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  gap: 8px;
}

.match-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
  border-color: var(--accent);
}

.match-card.live-match {
  border-left: 3px solid var(--live);
  background: var(--live-bg);
}

.match-card:nth-child(even):not(.live-match) {
  background: var(--surface);
}

.match-card .ko-time {
  width: 44px;
  min-width: 44px;
  font-size: 12px;
  color: var(--text-meta);
  text-align: center;
  line-height: 1.3;
}

.match-card .team {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.match-card .team.home { text-align: right; }
.match-card .team.away { text-align: left; }

/* Team Flag Emoji */
.team-flag { font-size: 16px; margin: 0 4px; vertical-align: middle; }

/* ---- Score Hierarchy ---- */
.match-card .score {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  justify-content: center;
  color: var(--text);
}

.match-card .score.live {
  font-size: 32px;
  color: var(--live);
  font-weight: 900;
}

.match-card .score.upcoming {
  font-size: 16px;
  color: var(--text-meta);
  font-weight: 400;
  letter-spacing: 4px;
}


.match-card .home-goals,
.match-card .away-goals {
  display: inline-block;
  min-width: 18px;
  text-align: center;
}

/* ---- HT Score Display ---- */
/* ---- Score Column Wrapper ---- */
.score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  flex-shrink: 0;
}

.ht-score {
  display: block;
  font-size: 11px;
  color: var(--text-meta);
  font-weight: 400;
  text-align: center;
  margin-top: 2px;
}

/* ---- Status Badges ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.ft {
  background: rgba(46,125,50,0.12);
  color: #2E7D32;
}

.status-badge.ht {
  background: rgba(245,124,0,0.12);
  color: #F57C00;
}

.status-badge.live {
  background: rgba(233,69,96,0.12);
  color: #E94560;
  animation: pulse-badge 2s infinite;
}

.status-badge.live .live-dot {
  width: 6px;
  height: 6px;
  background: #E94560;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.status-badge.upcoming {
  background: transparent;
  color: var(--text-meta);
  font-weight: 400;
}

/* ---- Match Events (goal scorers) ---- */
.match-events {
  display: flex;
  justify-content: space-between;
  padding: 2px 12px 6px;
  font-size: 11px;
  color: var(--text-meta);
  gap: 8px;
  margin: 0 8px 4px;
}

.match-events .events-home { text-align: right; flex: 1; }
.match-events .events-away { text-align: left; flex: 1; }
.match-events .event-goal { margin: 0 2px; }

.match-card .ai-icon {
  width: 24px;
  min-width: 24px;
  font-size: 16px;
  color: var(--text-meta);
  text-align: center;
  cursor: pointer;
  transition: color var(--transition-speed);
}

.match-card .ai-icon:hover { color: var(--accent); }
.match-card .ai-icon.has-preview { color: var(--accent); }

/* ---- Past Dates Listing ---- */
.past-dates-listing {
  padding: 16px;
  text-align: center;
}


/* ---- Match Detail Hero ---- */
.match-detail-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
}

.detail-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 200px;
}

.detail-flag { font-size: 40px; line-height: 1; }

.detail-team-name {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.detail-score-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.detail-score-num {
  font-size: 36px;
  font-weight: 900;
  min-width: 40px;
  text-align: center;
}

.detail-score-hero.upcoming .detail-score-num {
  color: var(--text-meta);
  font-weight: 400;
}

.detail-score-divider {
  font-size: 20px;
  color: var(--text-meta);
  font-weight: 400;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-meta-sep { color: var(--border); }

.status-badge.upcoming-detail {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ---- Detail Tab Bar ---- */
.detail-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
}

.detail-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-meta);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab.disabled {
  color: var(--text-meta);
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-tab-content {
  padding: 16px;
}

/* ---- Detail Placeholder Cards ---- */
.detail-placeholder-card {
  text-align: center;
  padding: 32px 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.placeholder-icon { font-size: 32px; margin-bottom: 8px; }

.placeholder-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.placeholder-desc {
  font-size: 13px;
  color: var(--text-meta);
}

/* ---- Coming Soon Section ---- */
.detail-coming-soon {
  padding: 16px;
}

.detail-coming-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-coming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.detail-feature-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-meta);
}

.feature-icon { font-size: 14px; }
.feature-name { font-weight: 500; }

/* ---- Mobile Detail Adjustments ---- */
@media (max-width: 767px) {
  .match-detail-hero { padding: 16px 12px; }
  .detail-teams { gap: 8px; }
  .detail-flag { font-size: 28px; }
  .detail-team-name { font-size: 15px; }
  .detail-score-num { font-size: 28px; min-width: 30px; }
  .detail-tab { padding: 10px 12px; font-size: 12px; }
  .detail-coming-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Match Detail (Stub) ---- */
.match-detail {
  padding: 24px 16px;
  text-align: center;
}

/* ---- Right Sidebar (Desktop) ---- */
#right-sidebar {
  display: none;
  width: 300px;
  min-width: 300px;
  padding: 16px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: sticky;
  top: 96px;
  align-self: flex-start;
}


/* ---- Responsive Ad Images ---- */
.ad-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Left nav / footer vertical banner ad */
.nav-ad {
  padding: 12px 8px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.nav-ad .ad-img {
  width: 100%;
  max-width: 100%;
  max-height: 250px;
  height: auto;
  object-fit: cover;
  margin: 0 auto;
  border-radius: 4px;
}

@media (max-width: 767px) {
  .nav-ad { display: none; }
}

/* ---- Ad Slots ---- */
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  background: var(--surface);
  overflow: hidden;
  margin: 0 auto;
}

.ad-placeholder img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ad-leaderboard {
  width: 100%;
  max-width: 970px;
  height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  padding: 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.ad-leaderboard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-box {
  width: 100%;
  max-width: 688px;
  height: 85px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.ad-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right sidebar ads — both flow naturally inside sticky sidebar, consistent sizing */
.ad-skyscraper {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 4px;
}

.ad-skyscraper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-vertical-banner {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.ad-vertical-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-mobile-sticky {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 50px;
  z-index: 80;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-mobile-sticky img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Ad Responsive Collapse ---- */
@media (max-width: 1023px) {
  .ad-leaderboard { max-width: 728px; height: 90px; }
  .ad-leaderboard img { width: 100%; height: 100%; }
}

@media (max-width: 767px) {
  .ad-leaderboard { max-width: 320px; height: 50px; position: sticky; top: 54px; z-index: 39; padding: 0; }
  .ad-leaderboard img { width: 100%; height: 100%; }
  .ad-box { display: none; }
  #app { padding-bottom: 50px; }
  .calendar-bar { top: 104px; }
}

@media (min-width: 768px) {
  .ad-mobile-sticky { display: none; }
}

/* ---- Site Footer ---- */
#site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-meta);
}

.footer-links { display: flex; gap: 16px; font-size: 11px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { color: var(--text-meta); }

@media (max-width: 767px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

/* ---- Wait Gate (deferred to Phase 0C) ---- */
.wait-gate {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.wait-gate.show { display: flex; }

.wait-gate .gate-logo {
  max-width: 200px;
  margin-bottom: 8px;
}

.wait-gate .gate-message {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
}

.wait-gate .gate-countdown {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

/* ---- Analytics Toggle (deferred to Phase 0C) ---- */
.analytics-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.toggle-pill {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.toggle-option {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-meta);
  transition: background var(--transition-speed), color var(--transition-speed);
}

.toggle-option.active {
  background: var(--accent);
  color: #FFFFFF;
}

/* ---- Live Dot Animations ---- */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--live);
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================================ */
/* RESPONSIVE BREAKPOINTS */
/* ============================================================ */

/* Mobile (<768px): single column, hamburger nav */
@media (max-width: 767px) {
  #site-header { display: none; }

  #left-nav {
    display: flex;
  }

  #nav-overlay { display: block; }

  #right-sidebar { display: none; }

  .match-card {
    height: 52px;
    padding: 0 8px;
    gap: 4px;
    margin: 2px 4px;
  }

  .match-card .team { font-size: 13px; }
  .match-card .score { font-size: 18px; letter-spacing: 1px; }
  .match-card .score.live { font-size: 22px; }
  .match-card .score.upcoming { font-size: 14px; }
  .match-card .ko-time { width: 38px; min-width: 38px; font-size: 11px; }
  .match-card .ai-icon { width: 20px; min-width: 20px; font-size: 14px; }
  .match-card .score-col { width: 46px; min-width: 46px; max-width: 46px; }
  .match-events { margin: 0 4px 2px; padding: 0 8px 4px; font-size: 10px; }
  #app { padding-bottom: 50px; }
}

/* Tablet (768px-1023px): nav as sidebar, no right sidebar, desktop header visible */
@media (min-width: 768px) {
  #site-header { display: block; }
  #top-bar { display: none; }

  #left-nav {
    position: sticky;
    top: 96px;
    left: 0;
    width: 220px;
    min-width: 220px;
    height: auto;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    align-self: flex-start;
    z-index: 90;
    border-right: none;
    box-shadow: none;
  }

  #main-content {
    margin-left: 0;
  }

  #right-sidebar { display: none; }

  body { padding-bottom: 85px; }

  .calendar-bar { top: 186px; }
  .ad-leaderboard { top: 96px; }
  #nav-overlay { display: none; }
}

/* Desktop (1024px+): full 3-column layout */
@media (min-width: 1024px) {
  #left-nav {
    width: 220px;
    min-width: 220px;
  }

  #right-sidebar {
    display: block;
  }

  .calendar-bar { top: 186px; }
  .ad-leaderboard { top: 96px; }
  .match-card { gap: 10px; }
}

/* ---- Utility ---- */
.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;
}
