/* =========================================
   GoalTime Live - Premium Sports App CSS
   Dark Theme | Mobile-First
   ========================================= */

/* === CSS VARIABLES === */
:root {
  --bg-primary: #080c18;
  --bg-secondary: #0d1225;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --bg-glass: rgba(17, 24, 39, 0.85);
  --bg-header: rgba(8, 12, 24, 0.96);

  --accent-green: #00e676;
  --accent-green-dim: #00b85c;
  --accent-green-glow: rgba(0, 230, 118, 0.15);
  --accent-red: #ff1744;
  --accent-red-dim: #d50000;
  --accent-red-glow: rgba(255, 23, 68, 0.15);
  --accent-gold: #ffc107;
  --accent-blue: #2979ff;

  --text-primary: #f0f4ff;
  --text-secondary: #8899bb;
  --text-muted: #4a5568;
  --text-white: #ffffff;

  --border-color: rgba(255,255,255,0.06);
  --border-active: rgba(0,230,118,0.3);

  --header-height: 56px;
  --tabs-height: 52px;
  --bottom-nav-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow-green: 0 0 20px rgba(0,230,118,0.2);
  --shadow-glow-red: 0 0 20px rgba(255,23,68,0.2);

  --transition: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4,0,0.2,1);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Rajdhani', 'Inter', sans-serif;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
input { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 99px; }

/* === APP CONTAINER === */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg-primary);
}

/* === HEADER === */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--header-height);
  padding-top: var(--safe-top);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 12px;
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.app-header.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.6); }

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: #fff;
  box-shadow: var(--shadow-glow-green);
}
.logo-icon .fa-spin-pulse { animation: none; }
.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 0.5px;
}
.logo-live {
  font-size: 9px;
  font-weight: 800;
  background: var(--accent-red);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 1px;
  animation: pulse-badge 2s ease-in-out infinite;
}

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

.header-right { display: flex; align-items: center; gap: 4px; }
.header-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  transition: all var(--transition);
  position: relative;
}
.header-btn:active { background: var(--bg-card); transform: scale(0.92); }
.notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 16px; height: 16px;
  background: var(--accent-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* === SEARCH OVERLAY === */
.search-overlay {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 100%; max-width: 480px;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 2000;
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}
.search-overlay.active { transform: translateX(-50%) translateY(0); }

.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.search-back, .search-clear {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  padding: 0 12px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent-green); }
.search-results { flex: 1; overflow-y: auto; padding: 16px; }
.search-hint {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px;
  color: var(--text-muted);
  gap: 12px;
  font-size: 14px;
}
.search-hint i { font-size: 40px; opacity: 0.3; }

/* === SPORTS TABS === */
.sports-tabs-wrap {
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--tabs-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  overflow: hidden;
}
.sports-tabs {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sports-tabs::-webkit-scrollbar { display: none; }

.sport-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 20px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  flex-shrink: 0;
  min-width: 80px;
}
.sport-tab i { font-size: 18px; }
.sport-tab.active {
  color: var(--accent-green);
  border-bottom-color: var(--accent-green);
}
.sport-tab:active { transform: scale(0.95); }

/* === MAIN CONTENT === */
.main-content {
  padding-top: calc(var(--header-height) + var(--tabs-height) + var(--safe-top) + 8px);
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  min-height: 100vh;
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  z-index: 1000;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--bottom-nav-height);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-item i { font-size: 20px; }
.nav-item .live-dot-wrap { position: relative; display: flex; align-items: center; }
.nav-item .live-dot-wrap i { font-size: 20px; }
.live-pulse {
  position: absolute;
  top: 0; right: -2px;
  width: 8px; height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}
.nav-item.active { color: var(--accent-green); }
.nav-item:active { transform: scale(0.92); }

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--accent-green); }
.section-more {
  font-size: 12px;
  color: var(--accent-green);
  font-weight: 600;
}

/* === LIVE BANNER === */
.live-banner {
  margin: 8px 16px 4px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255,23,68,0.12), rgba(255,23,68,0.05));
  border: 1px solid rgba(255,23,68,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
.live-banner-dot {
  width: 8px; height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: live-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.live-banner-text { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.live-banner-count {
  margin-left: auto;
  background: var(--accent-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}

/* === LEAGUE GROUP === */
.league-group {
  margin: 8px 0;
}
.league-group-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.league-logo-wrap {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}
.league-logo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.league-logo-fallback { font-size: 14px; color: var(--accent-gold); }
.league-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.league-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 99px;
}
.league-toggle {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform var(--transition);
}
.league-group.collapsed .league-toggle { transform: rotate(-90deg); }
.league-matches { overflow: hidden; }
.league-group.collapsed .league-matches { display: none; }

/* === MATCH CARD === */
.match-card {
  margin: 2px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.match-card:active { transform: scale(0.98); background: var(--bg-card-hover); }
.match-card.is-live {
  border-color: rgba(255,23,68,0.25);
  box-shadow: 0 2px 16px rgba(255,23,68,0.1);
}
.match-card.is-live::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-red), transparent);
}
.match-card + .match-card { margin-top: 2px; }

.match-card-inner { padding: 10px 12px; }

.match-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.match-live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-red);
  letter-spacing: 0.5px;
}
.badge-dot {
  width: 6px; height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: live-pulse 1.2s ease-in-out infinite;
}
.match-time-text {
  font-size: 11px;
  color: var(--text-muted);
}
.match-period-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 7px;
  border-radius: 99px;
}
.match-status-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* === MATCH TEAMS === */
.match-teams {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.team-side.home { align-items: flex-start; flex-direction: row; align-items: center; }
.team-side.away { align-items: flex-end; flex-direction: row-reverse; align-items: center; }

.team-logo-wrap {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.team-logo-wrap img { width: 28px; height: 28px; object-fit: contain; }
.team-logo-fallback { font-size: 16px; }
.team-name-wrap { flex: 1; }
.team-side.home .team-name-wrap { padding-left: 4px; }
.team-side.away .team-name-wrap { padding-right: 4px; text-align: right; }
.team-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.team-form { display: flex; gap: 2px; margin-top: 3px; }
.form-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
}
.form-dot.w { background: var(--accent-green); }
.form-dot.l { background: var(--accent-red); }
.form-dot.d { background: var(--text-muted); }

/* === SCORE DISPLAY === */
.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
  flex-shrink: 0;
}
.score-numbers {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: 2px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.score-numbers.live-score { color: var(--accent-green); }
.score-sep { color: var(--text-muted); font-size: 24px; font-weight: 300; }
.score-period {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
.score-vs {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* === MATCH FOOTER === */
.match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.match-id { font-size: 10px; color: var(--text-muted); }
.match-actions { display: flex; gap: 12px; }
.match-action-btn {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--transition);
  padding: 4px;
}
.match-action-btn.active { color: var(--accent-gold); }
.match-action-btn:active { color: var(--accent-green); }

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  margin: 4px 12px;
  height: 88px;
  border-radius: var(--radius-md);
}
.skeleton-header {
  margin: 8px 12px;
  height: 36px;
  border-radius: var(--radius-sm);
}
.skeleton-text {
  height: 12px;
  border-radius: 6px;
  margin: 4px 0;
}

/* === EMPTY / ERROR STATES === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.empty-state p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.empty-state .retry-btn {
  margin-top: 8px;
  padding: 10px 24px;
  background: var(--accent-green);
  color: #000;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}
.empty-state .retry-btn:active { transform: scale(0.95); }

.offline-banner {
  margin: 8px 16px;
  padding: 10px 14px;
  background: rgba(255,23,68,0.1);
  border: 1px solid rgba(255,23,68,0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--accent-red);
  font-weight: 600;
}

/* === TRENDING SECTION === */
.trending-scroll {
  display: flex;
  gap: 10px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.trending-scroll::-webkit-scrollbar { display: none; }
.trending-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.trending-card:active { transform: scale(0.96); }
.trending-card-header {
  background: linear-gradient(135deg, rgba(0,230,118,0.1), rgba(41,121,255,0.1));
  padding: 8px 10px;
  display: flex; align-items: center; gap: 6px;
}
.trending-card-header .live-badge {
  font-size: 9px; font-weight: 800;
  background: var(--accent-red);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.trending-league { font-size: 10px; color: var(--text-secondary); font-weight: 600; }
.trending-teams {
  padding: 8px 10px;
}
.trending-team {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 0;
}
.trending-team-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.trending-score {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700; color: var(--accent-green);
}

/* === RECENTLY VIEWED === */
.recent-matches {
  display: flex;
  gap: 8px;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.recent-matches::-webkit-scrollbar { display: none; }
.recent-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.recent-chip:active { background: var(--bg-card-hover); }

/* === MATCH DETAIL PAGE === */
.match-detail-hero {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-color);
}
.match-detail-league {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.match-detail-league img { width: 20px; height: 20px; border-radius: 50%; }
.match-detail-league-name { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.match-detail-teams {
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-team { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.detail-team-logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-color);
  overflow: hidden;
}
.detail-team-logo img { width: 52px; height: 52px; object-fit: contain; }
.detail-team-name { font-size: 14px; font-weight: 700; color: var(--text-primary); text-align: center; }
.detail-score {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 100px;
}
.detail-score-numbers {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 700;
  color: var(--text-white);
  letter-spacing: 4px;
  line-height: 1;
}
.detail-score-numbers.live { color: var(--accent-green); }
.detail-score-period { font-size: 12px; color: var(--text-muted); }
.detail-live-badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,23,68,0.15);
  border: 1px solid rgba(255,23,68,0.3);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px; font-weight: 800;
  color: var(--accent-red);
}

/* === STATS === */
.stats-section {
  padding: 16px;
}
.stat-bar-item {
  margin-bottom: 14px;
}
.stat-bar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
  font-size: 12px;
}
.stat-val { font-weight: 700; color: var(--text-primary); }
.stat-name { color: var(--text-secondary); font-weight: 600; }
.stat-bar-track {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  display: flex;
  gap: 4px;
  overflow: hidden;
}
.stat-bar-home {
  height: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.stat-bar-away {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: width 0.5s ease;
  margin-left: auto;
}

/* === TIMELINE === */
.timeline {
  padding: 16px;
}
/* Period divider label */
.timeline-period-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0,230,118,0.07);
  border-radius: 99px;
  padding: 4px 12px;
  margin: 12px auto 10px;
  width: fit-content;
}
/* Each row: [minute] [icon] [content] [minute-placeholder]  (home)
             [minute-placeholder] [icon] [content] [minute]  (away) */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.timeline-minute {
  width: 36px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.timeline-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.timeline-icon.goal        { background: rgba(0,230,118,0.15); color: var(--accent-green); }
.timeline-icon.card        { background: rgba(255,193,7,0.15);  color: var(--accent-gold); }
.timeline-icon.yellow-card { background: rgba(255,193,7,0.2);   color: #ffc107; }
.timeline-icon.red-card    { background: rgba(255,50,50,0.18);  color: #ff3232; }
.timeline-icon.sub         { background: rgba(41,121,255,0.15); color: var(--accent-blue); }
.timeline-icon.corner      { background: rgba(120,120,255,0.15); color: #9090ff; }
.timeline-icon.info        { background: var(--bg-card); color: var(--text-muted); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-content.away-content { text-align: right; }
.timeline-text { font-size: 13px; color: var(--text-primary); font-weight: 600; line-height: 1.4; }
.timeline-sub-text { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* === SETTINGS PAGE === */
.settings-list {
  padding: 8px 0;
}
.settings-group {
  margin-bottom: 8px;
}
.settings-group-title {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.settings-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}
.settings-item:active { background: var(--bg-card); }
.settings-item-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.settings-item-icon.green { background: rgba(0,230,118,0.12); color: var(--accent-green); }
.settings-item-icon.red { background: rgba(255,23,68,0.12); color: var(--accent-red); }
.settings-item-icon.blue { background: rgba(41,121,255,0.12); color: var(--accent-blue); }
.settings-item-icon.gold { background: rgba(255,193,7,0.12); color: var(--accent-gold); }
.settings-item-text { flex: 1; }
.settings-item-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.settings-item-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.settings-item-right {
  font-size: 14px;
  color: var(--text-muted);
}
.toggle-switch {
  width: 44px; height: 24px;
  background: var(--bg-card);
  border-radius: 99px;
  position: relative;
  transition: background var(--transition);
  border: 1px solid var(--border-color);
}
.toggle-switch.active { background: var(--accent-green); border-color: var(--accent-green); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle-switch.active::after { transform: translateX(20px); }

/* === FAVORITES PAGE === */
.fav-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 24px;
  gap: 12px; text-align: center;
}
.fav-empty-icon {
  font-size: 56px;
  color: var(--accent-gold);
  opacity: 0.3;
}

/* === LEAGUES PAGE === */
.leagues-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
}
.league-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.league-tile:active { transform: scale(0.95); background: var(--bg-card-hover); }
.league-tile-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 2px solid var(--border-color);
}
.league-tile-logo img { width: 40px; height: 40px; object-fit: contain; }
.league-tile-name { font-size: 12px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.league-tile-count { font-size: 11px; color: var(--text-muted); }

/* === PULL TO REFRESH === */
.ptr-indicator {
  position: fixed;
  top: calc(var(--header-height) + var(--tabs-height) + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  z-index: 900;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-card);
}
.ptr-indicator.visible { transform: translateX(-50%) translateY(10px); }
.ptr-indicator i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === TOAST === */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--tabs-height) + var(--safe-top) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  animation: toast-in 0.3s ease;
  pointer-events: all;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }
.toast i { font-size: 16px; }
.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.info i { color: var(--accent-blue); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-10px); }
}

/* === REFRESH INDICATOR === */
.refresh-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.refresh-dot {
  width: 6px; height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: refresh-dot 1s ease-in-out infinite;
}
@keyframes refresh-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* === TABS NAVIGATION (within page) === */
.page-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}
.page-tab.active { color: var(--accent-green); border-bottom-color: var(--accent-green); }

/* === BACK BUTTON === */
.back-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
}
.back-btn:active { background: var(--bg-card); }
.back-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* === SHARE BUTTON === */
.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.share-btn:active { background: var(--bg-card-hover); }

/* === PAGE TRANSITIONS === */
.main-content { animation: page-in 0.3s ease; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SCORE UPDATED FLASH === */
@keyframes score-flash {
  0% { color: var(--text-white); }
  50% { color: var(--accent-green); text-shadow: 0 0 10px var(--accent-green); }
  100% { color: var(--accent-green); }
}
.score-updated { animation: score-flash 0.6s ease; }

/* === RESPONSIVE === */
@media (min-width: 481px) {
  #app, .app-header, .sports-tabs-wrap, .bottom-nav, .ptr-indicator, .toast-container {
    max-width: 480px;
  }
}

/* Safe areas for notch phones */
@supports (padding-top: env(safe-area-inset-top)) {
  .app-header { padding-top: calc(var(--safe-top) + 8px); height: calc(var(--header-height) + var(--safe-top)); }
  .sports-tabs-wrap { top: calc(var(--header-height) + var(--safe-top)); }
  .main-content { padding-top: calc(var(--header-height) + var(--tabs-height) + var(--safe-top) + 8px); }
}

/* ── Betting Odds Row ── */
.match-odds-row {
  display: flex;
  gap: 5px;
  padding: 7px 12px 10px;
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}
.match-odds-row::-webkit-scrollbar { display: none; }
.odds-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(0,230,118,.07);
  border: 1px solid rgba(0,230,118,.18);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 48px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.odds-btn:active { background: rgba(0,230,118,.18); }
.odds-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.odds-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-green);
  font-family: 'Rajdhani', sans-serif;
}
.odds-total { background: rgba(255,214,0,.06); border-color: rgba(255,214,0,.2); }
.odds-total .odds-val { color: var(--accent-gold, #ffd600); }
