:root {
  --bg: #0a0e1a;
  --bg2: #141b2d;
  --bg3: #1e2a42;
  --text: #e8edf5;
  --text2: #7b8ba6;
  --accent: #4f8ff7;
  --accent-glow: rgba(79,143,247,0.15);
  --live: #ef4444;
  --win: #22c55e;
  --gold: #fbbf24;
  --border: #1e2a42;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --radius: 14px;
  --radius-sm: 10px;
  --tr: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 52px;
  --bottom-h: 64px;
  --glass: rgba(20,27,45,0.85);
}
[data-theme="light"] {
  --bg: #f0f4fa;
  --bg2: #ffffff;
  --bg3: #e4eaf4;
  --text: #0f172a;
  --text2: #5b6b82;
  --accent: #2563eb;
  --accent-glow: rgba(37,99,235,0.1);
  --border: #d6dde9;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --glass: rgba(255,255,255,0.85);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding-top: var(--nav-h); padding-bottom: var(--bottom-h); transition: background var(--tr), color var(--tr); }

/* TOP NAV */
.nav { position: fixed; top:0; left:0; right:0; height: var(--nav-h); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 8px; z-index: 100; box-shadow: var(--shadow-sm); transition: background var(--tr), border-color var(--tr); }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; color: var(--text); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.nav-brand .trophy { font-size: 1.3rem; }
.nav-brand .title { font-size: 0.95rem; }
.nav-links { display: none; flex: 1; gap: 2px; margin: 0 12px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: var(--text2); text-decoration: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.88rem; white-space: nowrap; transition: var(--tr); font-weight: 500; }
.nav-links a:hover { color: var(--text); background: var(--bg3); }
.nav-links a.active { color: var(--accent); background: rgba(59,130,246,0.1); }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; gap: 6px; flex-shrink: 0; }
.nav-actions button { background: var(--bg3); border: none; color: var(--text); padding: 6px 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; transition: var(--tr); }
.nav-actions button:hover { background: var(--accent); color: white; }

/* BOTTOM NAV */
.bottom-nav { position: fixed; bottom:0; left:0; right:0; height: var(--bottom-h); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0); transition: background var(--tr); }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text2); text-decoration: none; font-size: 0.62rem; font-weight: 500; transition: color var(--tr); position: relative; padding-top: 6px; letter-spacing: 0.3px; }
.bn-item svg { width: 24px; height: 24px; stroke-width: 1.6; transition: transform var(--tr); }
.bn-item:hover { color: var(--text); }
.bn-item:hover svg { transform: translateY(-2px); }
.bn-item.active { color: var(--accent); }
.bn-item.active svg { stroke-width: 2.2; }
.bn-item.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; background: var(--accent); border-radius: 0 0 4px 4px; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.section { margin-bottom: 28px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 1.1rem; font-weight: 700; }
.see-all { color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.see-all:hover { text-decoration: underline; }

/* MATCH CARD */
.matches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.match-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: var(--tr); text-decoration: none; color: var(--text); display: block; position: relative; }
.match-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.match-card.live { border-color: var(--live); }
.live-badge { position: absolute; top: 10px; right: 10px; color: var(--live); font-size: 0.65rem; font-weight: 800; animation: pulse 1.2s infinite; letter-spacing: 0.5px; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.match-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.72rem; color: var(--text2); }
.match-round { background: var(--bg3); padding: 2px 8px; border-radius: 20px; }
.match-teams { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.team-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.team-logo { width: 38px; height: 38px; object-fit: contain; }
.team-name { font-size: 0.8rem; font-weight: 600; text-align: center; line-height: 1.3; word-break: break-word; overflow-wrap: break-word; }
.score-center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 58px; }
.score-val { font-size: 1.4rem; font-weight: 900; letter-spacing: 1px; }
.score-status { font-size: 0.65rem; background: var(--bg3); padding: 2px 7px; border-radius: 20px; font-weight: 700; }
.score-status.live { background: var(--live); color: white; }

/* TEAMS GRID */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.team-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; transition: var(--tr); text-decoration: none; color: var(--text); display: block; }
.team-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.team-card .team-logo { width: 52px; height: 52px; min-width:52px; margin: 0 auto 8px; display: block; object-fit: contain; aspect-ratio: 1 / 1; }
.team-card .team-logo, .team-logo { display: block; width: 38px; height: 38px; min-width:38px; object-fit: contain; aspect-ratio: 1 / 1; }
.team-card .team-name { font-size: 0.85rem; font-weight: 600; }
.team-card .team-group { font-size: 0.72rem; color: var(--accent); margin-top: 4px; }

/* Avatar / avatar image consistency to avoid layout shift */
.fc-avatar, .fc-avatar-img { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fc-avatar { background: var(--accent); color: white; font-weight: 700; font-size: 0.85rem; }
.fc-avatar-img { object-fit: cover; display: block; }

/* Ensure team-side reserves space so images don't shift layout when loading */
.team-side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-height: 64px; }

/* LEAGUES */
.leagues-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 8px; }
.league-card { background: var(--bg2); border:1px solid var(--border); border-radius: var(--radius); padding:12px; display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); transition:var(--tr); cursor:pointer; }
.league-card:hover { border-color:var(--accent); transform:translateY(-2px); box-shadow:var(--shadow); }
.league-avatar { width:40px; height:40px; border-radius:50%; background:var(--accent); color:white; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0; }
.league-name { font-weight:700; }
.league-count { margin-left:auto; color:var(--text2); font-size:0.85rem; }

/* STANDINGS */
.standings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.group-table { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.group-header { background: var(--accent); padding: 8px 14px; font-weight: 700; font-size: 0.85rem; color: white; }
.std-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.std-table th { padding: 6px 8px; text-align: center; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); background: var(--bg3); }
.std-table th:first-child { text-align: left; padding-left: 12px; }
.std-table td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.std-table td:first-child { text-align: left; padding-left: 12px; }
.std-table tr:last-child td { border-bottom: none; }
.std-table tr.q2 td { border-left: 3px solid var(--win); }
.std-table tr.q1 td { border-left: 3px solid var(--accent); }
.std-team { display: flex; align-items: center; gap: 7px; word-break: break-word; overflow-wrap: break-word; }
.std-logo { width: 18px; height: 18px; object-fit: contain; }
.std-link { color: inherit; text-decoration: none; }
.std-link:hover { color: var(--accent); }
.pts-col { font-weight: 800; color: var(--accent); }

/* SEARCH */
.search-box { width: 100%; padding: 11px 16px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 0.95rem; margin-bottom: 16px; transition: var(--tr); }
.search-box::placeholder { color: var(--text2); }
.search-box:focus { outline: none; border-color: var(--accent); }

/* FILTERS */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--text2); padding: 6px 14px; border-radius: 20px; cursor: pointer; white-space: nowrap; font-size: 0.82rem; transition: var(--tr); }
.filter-btn.active, .filter-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

/* DATE NAV */
.date-nav { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 14px; }
.date-nav button { background: var(--bg3); border: none; color: var(--text); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 0.9rem; transition: var(--tr); flex-shrink: 0; }
.date-nav button:hover { background: var(--accent); color: white; }
.date-nav .cur-date { flex: 1; text-align: center; font-weight: 600; font-size: 0.9rem; }

/* MATCH DETAIL */
.match-detail-header { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px; text-align: center; margin-bottom: 20px; }
.match-detail-league { font-size: 0.78rem; color: var(--text2); margin-bottom: 8px; }
.match-detail-round { background: var(--bg3); display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; margin-bottom: 16px; }
.match-detail-teams { display: flex; align-items: center; justify-content: center; gap: 16px; }
.match-detail-team { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; max-width: 140px; }
.match-detail-team img { width: 60px; height: 60px; object-fit: contain; }
.match-detail-team-name { font-size: 0.95rem; font-weight: 700; text-align: center; line-height: 1.3; word-break: break-word; overflow-wrap: break-word; }
.match-detail-score { font-size: 2.2rem; font-weight: 900; min-width: 90px; text-align: center; }
.match-detail-status { display: inline-block; margin-top: 14px; padding: 4px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; background: var(--bg3); }
.match-detail-status.live { background: var(--live); color: white; animation: pulse 1.2s infinite; }
.match-detail-time { font-size: 0.78rem; color: var(--text2); margin-top: 6px; }

/* TABS */
.tabs { display: flex; gap: 3px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; min-width: max-content; padding: 7px 14px; border: none; background: transparent; color: var(--text2); cursor: pointer; border-radius: var(--radius-sm); font-size: 0.83rem; transition: var(--tr); white-space: nowrap; }
.tab.active { background: var(--accent); color: white; font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* EVENTS */
.event-list { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.event-item { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 10px; font-size: 0.83rem; }
.event-item:last-child { border-bottom: none; }
.event-item.away { flex-direction: row-reverse; }
.event-time { background: var(--bg3); padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; min-width: 36px; text-align: center; }
.event-icon { font-size: 1rem; width: 22px; text-align: center; }
.event-player { font-weight: 600; flex: 1; }
.event-assist { color: var(--text2); font-size: 0.75rem; }

/* STATS */
.stats-list { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat-row { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-values { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; margin-bottom: 5px; }
.stat-val { font-weight: 700; }
.stat-name { color: var(--text2); font-size: 0.75rem; text-align: center; }
.stat-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; gap: 2px; }
.stat-bar-home { background: var(--accent); border-radius: 2px; }
.stat-bar-away { background: var(--live); border-radius: 2px; }

/* LINEUP */
.lineup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lineup-team { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lineup-team-header { background: var(--bg3); padding: 9px 14px; font-weight: 700; font-size: 0.83rem; display: flex; align-items: center; gap: 8px; }
.lineup-team-header img { width: 20px; height: 20px; object-fit: contain; }
.lineup-formation { color: var(--accent); font-size: 0.78rem; margin-left: auto; }
.lineup-player { display: flex; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--border); gap: 8px; font-size: 0.82rem; }
.lineup-player:last-child { border-bottom: none; }
.player-num { background: var(--accent); color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; flex-shrink: 0; }
.player-pos-badge { font-size: 0.65rem; color: var(--text2); background: var(--bg3); padding: 1px 5px; border-radius: 3px; }
.subs-header { padding: 6px 14px; background: var(--bg3); font-size: 0.75rem; color: var(--text2); font-weight: 600; }

/* TEAM DETAIL */
.team-detail-header { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.team-detail-logo { width: 80px; height: 80px; object-fit: contain; flex-shrink: 0; }
.team-detail-info h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.team-detail-info p { color: var(--text2); font-size: 0.85rem; margin-top: 3px; }
.squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.player-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.player-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--bg3); flex-shrink: 0; }
.player-name { font-size: 0.83rem; font-weight: 600; word-break: break-word; overflow-wrap: break-word; }
.player-pos { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }
.player-age { font-size: 0.7rem; color: var(--text2); }

/* FAV BUTTON */
.fav-btn { background: transparent; border: 1px solid var(--border); color: var(--text2); padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.8rem; transition: var(--tr); }
.fav-btn.active, .fav-btn:hover { border-color: #f59e0b; color: #f59e0b; }

/* BACK BUTTON */
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); text-decoration: none; font-size: 0.85rem; margin-bottom: 14px; padding: 6px 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: var(--tr); }
.back-btn:hover { color: var(--text); border-color: var(--accent); }

/* LOADING / ERROR / EMPTY */
.loading { text-align: center; padding: 40px; color: var(--text2); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 14px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: var(--radius); padding: 14px 16px; color: #fca5a5; margin-bottom: 14px; line-height: 1.6; }
.error-box strong { display: block; margin-bottom: 4px; }
.error-box code { font-size: 0.8rem; background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 3px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text2); }
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════ */

/* Global fluid typography and spacing */
html { font-size: clamp(14px, 1.4vw, 18px); }
body { line-height: 1.45; }
.container { max-width: 1200px; padding-left: 16px; padding-right: 16px; }

/* Desktop navigation adjustments */
@media (min-width: 640px) {
  .nav-links { display: flex; }
  .nav { padding: 0 24px; }
}
@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .container { max-width: 1400px; }
}

/* Images and avatars: reserve space to avoid layout shift */
img { max-width: 100%; height: auto; display: block; }
.team-logo, .fc-avatar-img, .fc-avatar { width: 38px; height: 38px; min-width: 38px; }
.match-detail-logo { width: 60px; height: 60px; }

/* Odds layout – always horizontal row */
.odds-cells { display:flex; gap:4px; flex-wrap:nowrap; }
.odds-cell { flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:5px 2px; border-radius:6px; }
.odds-cell .odds-type { font-size:0.65rem; color:var(--text2); }
.odds-cell .odds-val { font-size:0.88rem; font-weight:700; }

/* Fixture card: always horizontal teams row */
.fc-teams { display:flex; align-items:center; justify-content:space-between; gap:8px; }

/* Match detail */
.match-detail-teams { gap: 16px; }

/* Improve touch targets */
.filter-btn, .fav-btn, .nav-actions button { padding: 10px 14px; }

/* Make tables and grids more fluid */
.std-table td, .std-table th { padding: 8px 6px; font-size: 0.85rem; }

/* Accessibility: reduce motion for prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* End additions for responsiveness */

/* ── MOBILE (default, < 640px) ── */
.matches-grid    { grid-template-columns: 1fr; }
.teams-grid      { grid-template-columns: repeat(3, 1fr); }
.standings-grid  { grid-template-columns: 1fr; }
.lineup-grid     { grid-template-columns: 1fr; }
.squad-grid      { grid-template-columns: 1fr; }

@media (max-width: 639px) {
  .container { padding: 14px; }
  .section { margin-bottom: 20px; }
  .section-title { font-size: 1rem; font-weight: 700; }
  .section-header { margin-bottom: 12px; }
  
  /* Grid layouts */
  .teams-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .team-card { padding: 12px 10px; }
  .team-card .team-logo { width: 44px; height: 44px; }
  .team-card .team-name { font-size: 0.78rem; line-height: 1.25; }
  .team-group { font-size: 0.68rem; }
  
  /* Match detail */
  .match-detail-header { padding: 18px 14px; margin-bottom: 18px; }
  .match-detail-teams { gap: 14px; }
  .match-detail-team { gap: 8px; }
  .match-detail-team img { width: 52px; height: 52px; }
  .match-detail-team-name { font-size: 0.9rem; }
  .match-detail-score { font-size: 1.9rem; }
  .match-detail-status { font-size: 0.75rem; padding: 4px 12px; }
  .match-detail-time { font-size: 0.75rem; }
  
  /* Team detail */
  .team-detail-header { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .team-detail-logo { width: 64px; height: 64px; }
  .team-detail-info h1 { font-size: 1.15rem; margin-bottom: 4px; }
  .team-detail-info p { font-size: 0.78rem; }
  .squad-grid { grid-template-columns: 1fr; }
  .player-card { padding: 10px 12px; }
  
  /* Tabs */
  .tabs { gap: 2px; padding: 4px; }
  .tab { padding: 8px 10px; font-size: 0.82rem; min-width: fit-content; word-break: break-word; overflow-wrap: break-word; }
  
  /* Fixture cards */
  .fixture-card { padding: 14px; margin-bottom: 12px; }
  .fc-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .fc-league { font-size: 0.72rem; }
  .fc-time { font-size: 0.7rem; }
  .fc-badges { gap: 3px; }
  .fc-teams { gap: 6px; margin-bottom: 8px; }
  .fc-team { flex: 1; gap: 6px; min-width: 0; }
  .fc-avatar { width: 30px; height: 30px; min-width: 30px; font-size: 0.78rem; }
  .fc-tname { font-size: 0.82rem; }
  .fc-vs { font-size: 0.65rem; padding: 0 2px; }
  
  /* Odds in fixture cards */
  .fc-odds { padding-top: 8px; gap: 6px; }
  .odds-block { flex-direction: row; gap: 6px; align-items: center; }
  .odds-label { width: 28px; min-width: 28px; font-size: 0.72rem; }
  .odds-cells { gap: 4px; flex: 1; }
  .odds-cell { padding: 5px 2px; }
  .odds-type { font-size: 0.6rem; }
  .odds-val { font-size: 0.82rem; }
  
  /* Match detail odds */
  .odds-detail-section { margin-bottom: 16px; }
  .odds-detail-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .odds-detail-row { padding: 10px 6px; font-size: 0.85rem; min-height: 58px; }
  .odds-detail-label { margin-bottom: 8px; font-size: 0.75rem; font-weight: 700; }
  .odds-detail-label { width: 100%; }
  .odds-type { font-size: 0.64rem; margin-bottom: 2px; }
  .odds-highlight { font-size: 0.88rem; line-height: 1.1; }
  
  /* Correct scores */
  .cs-section { margin-bottom: 14px; }
  .cs-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .cs-item { padding: 9px 8px; font-size: 0.82rem; min-height: 52px; }
  .cs-score { font-size: 0.87rem; }
  .cs-odds { font-size: 0.72rem; margin-top: 2px; }
  
  /* Search and filters */
  .search-box { padding: 12px 16px; font-size: 0.95rem; margin-bottom: 14px; }
  .filter-bar { gap: 8px; margin-bottom: 14px; padding-bottom: 2px; }
  .filter-btn { padding: 8px 14px; font-size: 0.82rem; }
  
  /* Events */
  .event-item { padding: 10px 12px; gap: 10px; font-size: 0.82rem; }
  .event-time { font-size: 0.7rem; padding: 3px 8px; }
  .event-player { font-size: 0.82rem; }
  
  /* Stats */
  .stat-row { padding: 10px 12px; }
  .stat-values { font-size: 0.82rem; }
  .stat-name { font-size: 0.74rem; }
  
  /* Lineup */
  .lineup-grid { grid-template-columns: 1fr; }
  .lineup-team { margin-bottom: 12px; }
  .lineup-player { padding: 8px 12px; font-size: 0.8rem; gap: 8px; }
  .player-num { width: 22px; height: 22px; font-size: 0.68rem; }
  .player-pos-badge { font-size: 0.64rem; padding: 1px 5px; }
}

/* SMALL MOBILE (< 400px) ── */
@media (max-width: 399px) {
  .container { padding: 8px; }
  
  .nav-brand .title { display: none; }
  .nav-brand .trophy { font-size: 1.2rem; }
  .nav-actions button { padding: 5px 10px; font-size: 0.8rem; }
  
  .section-title { font-size: 0.95rem; }
  .section-header { margin-bottom: 10px; }
  
  .score-val { font-size: 1.2rem; }
  .team-logo { width: 28px; height: 28px; }
  .team-card { padding: 8px 6px; }
  .team-card .team-logo { width: 36px; height: 36px; }
  .team-card .team-name { font-size: 0.7rem; }
  
  /* Match detail - ultra compact */
  .match-detail-header { padding: 12px 10px; }
  .match-detail-team img { width: 40px; height: 40px; }
  .match-detail-score { font-size: 1.6rem; }
  .match-detail-team-name { font-size: 0.78rem; }
  
  /* Team detail ultra compact */
  .team-detail-header { padding: 12px; gap: 10px; }
  .team-detail-logo { width: 50px; height: 50px; }
  .team-detail-info h1 { font-size: 1rem; }
  
  /* Fixture cards ultra compact */
  .fixture-card { padding: 9px 10px; }
  .fc-head { gap: 4px; }
  .fc-league { font-size: 0.68rem; }
  .fc-time { font-size: 0.68rem; }
  .fc-avatar { width: 26px; height: 26px; font-size: 0.7rem; }
  .fc-tname { font-size: 0.8rem; min-width: 50px; }
  .fc-vs { font-size: 0.58rem; }
  
  /* Odds ultra compact */
  .fc-odds { padding-top: 6px; gap: 4px; }
  .odds-block { gap: 4px; }
  .odds-label { font-size: 0.7rem; }
  .odds-cells { gap: 2px; }
  .odds-cell { padding: 6px 3px; min-width: 32px; min-height: 42px; }
  .odds-type { font-size: 0.54rem; }
  .odds-val { font-size: 0.78rem; }
  
  /* Match detail odds ultra compact */
  .odds-detail-grid { grid-template-columns: repeat(5, 1fr); gap: 3px; }
  .odds-detail-row { padding: 8px 3px; font-size: 0.75rem; min-height: 50px; }
  .odds-detail-label { font-size: 0.68rem; margin-bottom: 5px; }
  .odds-type { font-size: 0.56rem; margin-bottom: 1px; }
  .odds-highlight { font-size: 0.73rem; }
  
  /* Correct scores ultra compact */
  .cs-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .cs-item { padding: 7px 5px; min-height: 45px; font-size: 0.75rem; }
  .cs-score { font-size: 0.8rem; }
  .cs-odds { font-size: 0.65rem; }
  
  /* Tabs ultra compact */
  .tabs { gap: 1px; padding: 2px; }
  .tab { padding: 5px 6px; font-size: 0.75rem; }
  
  /* Events ultra compact */
  .event-item { padding: 6px 8px; gap: 6px; font-size: 0.75rem; }
  .event-time { font-size: 0.62rem; }
  
  /* Stats ultra compact */
  .stat-row { padding: 6px 8px; }
  .stat-values { font-size: 0.75rem; }
  .stat-name { font-size: 0.68rem; }
}

/* ── TABLET (640px → 1023px) ── */
@media (min-width: 640px) {
  body { padding-bottom: var(--bottom-h); }
  .container { padding: 16px 20px; }
  .matches-grid   { grid-template-columns: repeat(2, 1fr); }
  .teams-grid     { grid-template-columns: repeat(4, 1fr); }
  .standings-grid { grid-template-columns: repeat(2, 1fr); }
  .squad-grid     { grid-template-columns: repeat(2, 1fr); }
  .lineup-grid    { grid-template-columns: 1fr 1fr; }
  
  /* Better odds display on tablet */
  .odds-block { flex-direction: row; align-items: center; }
  .odds-label { width: 45px; }
  .odds-cell { padding: 8px 5px; min-width: 50px; min-height: 52px; }
  .odds-type { font-size: 0.65rem; }
  .odds-val { font-size: 0.95rem; }
  
  /* Tablet odds detail */
  .odds-detail-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .odds-detail-row { padding: 14px 8px; font-size: 0.88rem; min-height: 70px; }
  .odds-detail-label { font-size: 0.8rem; margin-bottom: 10px; }
  .odds-type { font-size: 0.68rem; }
  .odds-highlight { font-size: 0.95rem; }
}

/* ── DESKTOP (≥ 1024px) — hide bottom nav, show top links ── */
@media (min-width: 1024px) {
  :root { --nav-h: 60px; }
  body { padding-bottom: 0; }

  /* Show top nav links */
  .nav-links { display: flex; }
  /* Hide bottom nav */
  .bottom-nav { display: none; }

  .container { padding: 24px 32px; }
  .section { margin-bottom: 36px; }
  .section-title { font-size: 1.2rem; }

  .matches-grid   { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .teams-grid     { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .standings-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .squad-grid     { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .lineup-grid    { grid-template-columns: 1fr 1fr; gap: 16px; }

  .match-card { padding: 16px; }
  .team-logo { width: 44px; height: 44px; }
  .score-val { font-size: 1.6rem; }

  .match-detail-header { padding: 32px; }
  .match-detail-team img { width: 80px; height: 80px; }
  .match-detail-score { font-size: 3rem; }
  .match-detail-team-name { font-size: 1.1rem; }

  .team-detail-logo { width: 100px; height: 100px; }
  .team-detail-info h1 { font-size: 1.8rem; }
  
  /* Desktop odds detail */
  .odds-detail-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .odds-detail-row { padding: 16px 10px; font-size: 0.9rem; min-height: 75px; }
  .odds-detail-label { font-size: 0.85rem; margin-bottom: 12px; }
  .odds-type { font-size: 0.72rem; }
  .odds-highlight { font-size: 1.05rem; }
  
  /* Desktop fixture card odds */
  .odds-cell { min-height: 55px; padding: 10px 8px; }
}

/* ── WIDE DESKTOP (≥ 1280px) ── */
@media (min-width: 1280px) {
  .container { max-width: 1280px; }
  .teams-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   FIXTURE CARD (new API)
═══════════════════════════════════════════════════════════════ */
.fixtures-list { display: flex; flex-direction: column; gap: 10px; }
.fixture-card {
  display: block; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; text-decoration: none;
  color: var(--text); transition: var(--tr); cursor: pointer;
}
.fixture-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fixture-card.popular { border-color: rgba(251,191,36,0.5); background: linear-gradient(135deg, var(--bg2), rgba(251,191,36,0.04)); }

.fc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.fc-league { font-size: 0.75rem; color: var(--text2); font-weight: 500; flex: 1; min-width: 0; word-break: break-word; overflow-wrap: break-word; }
.fc-time { font-size: 0.75rem; color: var(--text2); white-space: nowrap; }
.fc-badges { display: flex; gap: 4px; flex-shrink: 0; }
.badge-popular { background: rgba(251,191,36,0.15); color: #fbbf24; font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.badge-perlay  { background: rgba(59,130,246,0.15); color: var(--accent); font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; font-weight: 600; }

.fc-teams { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.fc-team { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.fc-team.away { flex-direction: row-reverse; justify-content: flex-start; }
.fc-avatar { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: var(--accent); color: white; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fc-avatar-img { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; }
.team-logo-img { width: 52px; height: 52px; object-fit: contain; display: block; margin: 0 auto 8px; }
.fc-tname { font-size: 0.9rem; font-weight: 600; word-break: break-word; overflow-wrap: break-word; line-height: 1.3; }
.fc-vs { font-size: 0.72rem; color: var(--text2); font-weight: 700; padding: 0 4px; flex-shrink: 0; }

/* Odds section */
.fc-odds { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.odds-block { display: flex; align-items: flex-start; gap: 8px; }
.odds-label { font-size: 0.78rem; color: var(--accent); font-weight: 800; width: 40px; flex-shrink: 0; word-break: break-word; overflow-wrap: break-word; }
.odds-cells { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.odds-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: 1; background: var(--bg3); border-radius: 8px; padding: 8px 6px; min-width: 45px; min-height: 50px; cursor: pointer; transition: var(--tr); border: 1px solid transparent; box-sizing: border-box; }
.odds-cell:hover { background: var(--accent); border-color: var(--accent); }
.odds-cell:hover .odds-type { color: white; }
.odds-cell:hover .odds-val { color: white; }
.odds-type { font-size: 0.68rem; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.odds-val { font-size: 1rem; color: var(--text); font-weight: 700; line-height: 1.1; }

/* Live/FT/HT badges */
.live-badge { background: var(--live); color: white; font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; animation: pulse 1.5s infinite; }
.ft-badge   { background: var(--win); color: white; font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.ht-badge   { background: #f59e0b; color: white; font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* League group header */
.league-group { margin-bottom: 16px; }
.league-group-header { font-size: 0.8rem; font-weight: 700; color: var(--text2); padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* Leagues grid (teams page repurpose) */
.leagues-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.league-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.league-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: white; font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.league-name { font-size: 0.85rem; font-weight: 600; }
.league-count { font-size: 0.72rem; color: var(--text2); }

/* Match detail new styles */
.match-detail-logo { width: 64px; height: 64px; object-fit: contain; }
.match-detail-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: white; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.match-detail-score.live { color: var(--live); }
.ht-score { font-size: 0.78rem; color: var(--text2); }
.match-detail-time-center { font-size: 0.9rem; color: var(--text2); text-align: center; }
.match-detail-venue { font-size: 0.8rem; color: var(--text2); text-align: center; margin-top: 6px; }

/* Odds detail */
.odds-detail-section { margin-bottom: 16px; }
.odds-detail-label { font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.odds-detail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; }
.odds-detail-row { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 6px; background: var(--bg3); border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; transition: var(--tr); border: 1px solid transparent; min-height: 65px; width: 100%; box-sizing: border-box; }
.odds-detail-row:hover { background: var(--accent); border-color: var(--accent); color: white; }
.odds-detail-row:hover .odds-highlight { color: white; }
.odds-detail-row:hover .odds-type { color: white; }
.odds-highlight { font-weight: 700; color: var(--accent); line-height: 1.1; word-break: break-word; }
.odds-type { font-size: 0.68rem; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }

/* Correct scores grid */
.cs-section { margin-bottom: 16px; }
.cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cs-item { background: var(--bg3); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; cursor: pointer; transition: var(--tr); border: 1px solid transparent; }
.cs-item:hover { background: var(--accent); border-color: var(--accent); }
.cs-item:hover .cs-score { color: white; }
.cs-item:hover .cs-odds { color: white; }
.cs-score { display: block; font-weight: 700; font-size: 0.9rem; }
.cs-odds  { display: block; font-size: 0.78rem; color: var(--accent); margin-top: 2px; }

/* Events new style */
.event-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.event-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm); }
.event-icon { font-size: 1rem; flex-shrink: 0; }
.event-text { font-size: 0.85rem; line-height: 1.4; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn { background: var(--bg3); border: none; color: var(--text2); padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 0.82rem; font-weight: 600; white-space: nowrap; transition: var(--tr); }
.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--accent); color: white; }

@media (min-width: 1024px) {
  .leagues-grid { grid-template-columns: repeat(4, 1fr); }
  .cs-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1280px) {
  .leagues-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ═══════════════════════════════════════
   ANIMATIONS & POLISH
═══════════════════════════════════════ */

/* Card entrance animation */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.fixture-card, .league-card, .team-card, .match-card {
  animation: fadeSlideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.fixtures-list .fixture-card:nth-child(1) { animation-delay: 0s; }
.fixtures-list .fixture-card:nth-child(2) { animation-delay: 0.05s; }
.fixtures-list .fixture-card:nth-child(3) { animation-delay: 0.1s; }
.fixtures-list .fixture-card:nth-child(4) { animation-delay: 0.15s; }
.fixtures-list .fixture-card:nth-child(5) { animation-delay: 0.2s; }
.fixtures-list .fixture-card:nth-child(6) { animation-delay: 0.25s; }
.fixtures-list .fixture-card:nth-child(n+7) { animation-delay: 0.3s; }

/* Section fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.section { animation: fadeIn 0.5s ease both; }
.section:nth-child(2) { animation-delay: 0.15s; }
.section:nth-child(3) { animation-delay: 0.3s; }

/* Skeleton loading shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius);
}
.skeleton-card { height: 120px; margin-bottom: 10px; }
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-line.short { width: 60%; }

/* Enhanced card hover */
.fixture-card { transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease; }
.fixture-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); border-color: var(--accent); }
.fixture-card:active { transform: translateY(-1px) scale(0.99); }
.fixture-card.popular:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(251,191,36,0.15); }

/* Odds cell press effect */
.odds-cell { transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease; }
.odds-cell:active { transform: scale(0.95); }

/* Nav brand icon bounce on hover */
.nav-brand .trophy { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); display: inline-block; }
.nav-brand:hover .trophy { transform: rotate(-12deg) scale(1.15); }

/* Bottom nav item tap */
.bn-item { transition: color var(--tr), transform 0.15s ease; }
.bn-item:active { transform: scale(0.92); }
.bn-item.active::before { transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Theme toggle spin */
#themeToggle { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background var(--tr); display: inline-flex; align-items: center; justify-content: center; }
#themeToggle:active { transform: rotate(180deg) scale(0.9); }

/* Filter button */
.filter-btn { transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease; }
.filter-btn.active { box-shadow: 0 2px 12px var(--accent-glow); }
.filter-btn:active { transform: scale(0.95); }

/* Tab switch animation */
.tab { transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease; }
.tab.active { box-shadow: 0 2px 8px var(--accent-glow); }
.tab:active { transform: scale(0.96); }

/* Tab pane content fade */
.tab-pane.active { animation: fadeIn 0.3s ease; }

/* Match detail header glow */
.match-detail-header { transition: background var(--tr), border-color var(--tr); }

/* Score pulse for live matches */
@keyframes scorePulse {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 16px var(--live); }
}
.match-detail-score.live { animation: scorePulse 2s ease infinite; }

/* Badge shimmer */
.badge-popular { transition: background 0.2s ease; }
.badge-popular:hover { background: rgba(251,191,36,0.25); }

/* Loading spinner improved */
.loading { animation: fadeIn 0.3s ease; }
.spinner { border-width: 3px; border-color: var(--border); border-top-color: var(--accent); filter: drop-shadow(0 0 4px var(--accent-glow)); }

/* Empty state animation */
.empty-state { animation: fadeIn 0.5s ease; }
.empty-icon { animation: fadeSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Theme transition for all themed elements */
.nav, .bottom-nav, .fixture-card, .match-card, .team-card, .league-card,
.tabs, .tab, .odds-cell, .filter-btn, .search-box, .back-btn, .fav-btn,
.event-item, .stat-row, .stats-list, .event-list, .match-detail-header,
.league-group-header, .group-table, .cs-item, .odds-detail-row {
  transition: background var(--tr), border-color var(--tr), color var(--tr), transform 0.2s ease, box-shadow 0.25s ease;
}
