@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #1a1a2e;
  --primary-light: #252545;
  --accent: #0D8ABC;
  --accent-soft: #EBF7FC;
  --accent-muted: #3CA8D6;
  --blue: #457B9D;
  --blue-light: #A8DADC;
  --bg: #F4F5F7;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6B7280;
  --border: #E8EAF0;
  --live-pulse: #E63946;
  --green: #10B981;
  --amber: #F59E0B;
  --radius: 20px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 40px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Monospace Numbers ─── */
.match-score,
.standing-pts-num,
.stat-val,
.compact-val,
.scorer-goals-num,
.scorer-rank,
.standing-pos,
.detail-val,
.summary-num,
.h2h-stat-num,
.h2h-goals-num,
.h2h-bar-seg,
.overview-stat-value,
.overview-stat-rank,
.table-score,
td.col-pos,
td.col-pts,
.stats-limit-btn,
.match-status .match-date,
.standings-table td:not(.col-team):not(.col-form):not(.col-next),
.results-table td.col-score,
.scorers-table td:not(.col-player):not(.col-team) {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */
.header {
  background: linear-gradient(135deg, #0a0a1a 0%, #121230 30%, #0D8ABC 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }

/* Language Toggle Button */
.lang-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.logo-text { display: flex; flex-direction: column; }

.logo h1 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.logo .ae { color: #0D8ABC; }

.season-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--blue-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─── Season heading (above page content) ─── */
.page-season {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
  padding: 0.55rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.07);
  white-space: nowrap;
}
.page-season::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

/* ─── Cup ─── */
.cup-hero .archive-hero-icon { color: #E9C46A; }
.cup-champion {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.18);
}
.cup-champion-trophy { color: #E9C46A; flex: 0 0 auto; }
.cup-champion-logo {
  width: 46px; height: 46px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 3px;
  flex: 0 0 auto;
}
.cup-champion-text { display: flex; flex-direction: column; line-height: 1.25; }
.cup-champion-label {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: #E9C46A;
}
.cup-champion-name { font-size: 1.3rem; font-weight: 800; }

/* Collapsible rounds */
.cup-rounds { display: flex; flex-direction: column; gap: 0.55rem; }
.cup-round {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  overflow: hidden;
}
.cup-round-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--primary);
  text-align: start;
}
.cup-round.open .cup-round-header { border-bottom: 1px solid var(--border); }
.cup-round-title { flex: 1; font-weight: 800; font-size: 1.02rem; }
.cup-round-count { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.cup-round-chevron { flex: 0 0 auto; color: var(--text-secondary); transition: transform 0.2s ease; }
.cup-round.open .cup-round-chevron { transform: rotate(180deg); }
.cup-round-body { padding: 0.7rem 0.6rem 0.4rem; }
.week-header-row.clickable { cursor: pointer; }
.week-header-row.clickable:hover td { filter: brightness(0.97); }
.week-header-chevron { display: inline-block; width: 1.2em; color: var(--text-secondary); }

/* ─── Navigation ─── */
.nav {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  display: flex;
  justify-content: space-around;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 0.75rem 0.4rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  text-align: center;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--bg);
}

.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-link svg { opacity: 0.65; }
.nav-link.active svg { opacity: 1; }

/* ─── Main ─── */
.main {
  flex: 1;
  padding: 1rem 0 2rem;
}

/* ─── Section Titles ─── */
.section-title {
  font-size: 1.62rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.section-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: auto;
}

/* ═══════════════════════════════════════════
   MATCH CARDS — Mobile-first, big & bold
   ═══════════════════════════════════════════ */
.match-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.15s, transform 0.1s;
}

.match-card:active {
  transform: scale(0.985);
}

.match-card.live {
  border-left: 4px solid var(--live-pulse);
  background: linear-gradient(135deg, #fff5f5 0%, var(--card-bg) 40%);
  box-shadow: 0 2px 12px rgba(13, 138, 188, 0.12);
}

.match-status {
  font-size: 0.94rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  letter-spacing: 0.5px;
}

.match-status.is-live { color: var(--live-pulse); }
.match-status.is-finished { color: var(--text-secondary); }
.match-status.is-scheduled { color: var(--blue); }

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.team.away {
  flex-direction: column;
  text-align: center;
}

.team-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
}

.team-name {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}

.match-score {
  font-size: 2rem;
  font-weight: 900;
  min-width: 75px;
  text-align: center;
  color: var(--text);
  letter-spacing: 3px;
  flex-shrink: 0;
}

.match-score.live-score { color: var(--live-pulse); }

.match-score.vs-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.match-venue {
  text-align: center;
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Match Capsules (Venue + H2H) ─── */
.match-capsules {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.match-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  cursor: default;
}

.venue-capsule {
  background: var(--bg);
  color: var(--text-secondary);
}

.stat-capsule {
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.stat-capsule:hover {
  background: var(--accent);
  color: #fff;
}

.stat-capsule.active {
  background: var(--accent);
  color: #fff;
}

.stat-capsule svg {
  flex-shrink: 0;
}

/* ─── H2H Panel ─── */
.h2h-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}

.h2h-panel.open {
  max-height: 500px;
  opacity: 1;
}

.h2h-loading {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.spinner.small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.h2h-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 0.8rem 0;
}

.h2h-content {
  margin-top: 0.6rem;
  padding: 0.8rem;
  background: var(--bg);
  border-radius: 16px;
}

.h2h-summary-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.h2h-summary-text strong {
  color: var(--accent);
  font-weight: 700;
}

/* Win/Draw/Loss bar */
.h2h-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.h2h-bar-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 0;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h2h-bar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.h2h-bar {
  flex: 1;
  display: flex;
  height: 26px;
  border-radius: 50px;
  overflow: hidden;
  background: var(--border);
}

.h2h-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  min-width: 24px;
  transition: width 0.4s ease;
}

.h2h-bar-seg.win {
  background: var(--green);
}

.h2h-bar-seg.draw {
  background: var(--amber);
}

.h2h-bar-seg.lose {
  background: var(--live-pulse);
}

/* Stats grid */
.h2h-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.h2h-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0;
}

.h2h-stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.h2h-stat-num.win { color: var(--green); }
.h2h-stat-num.draw { color: var(--amber); }
.h2h-stat-num.lose { color: var(--live-pulse); }

.h2h-stat-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Goals row */
.h2h-goals-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.h2h-goals-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.h2h-goals-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Biggest win */
.h2h-biggest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem;
  background: var(--card-bg);
  border-radius: 12px;
}

.h2h-biggest-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.h2h-biggest-score {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.h2h-biggest-season {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
}

.match-date {
  font-size: 0.94rem;
  color: var(--blue);
  font-weight: 600;
}

/* ─── Upcoming section ─── */
.upcoming-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.5rem 0 0.85rem;
  color: var(--blue);
  font-size: 1rem;
  font-weight: 800;
}

.upcoming-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}

/* ═══════════════════════════════════════════
   STANDINGS — Mobile card layout
   ═══════════════════════════════════════════ */
.standings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.standing-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 0;
  align-items: center;
}

.standing-card.top-rank {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--card-bg) 50%);
}

.standing-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.standing-right {
  grid-column: 2;
  grid-row: 1;
}

.standing-pos {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--text-secondary);
  min-width: 22px;
  text-align: center;
}

.standing-pos.gold {
  color: var(--accent);
  font-size: 1.4rem;
}

.standing-logo {
  width: 47px;
  height: 47px;
  object-fit: contain;
  flex-shrink: 0;
}

.standing-name {
  font-weight: 700;
  font-size: 1.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-pts-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  padding: 0.3rem 0.65rem;
  min-width: 44px;
}

.standing-pts-num {
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1.1;
}

.standing-pts-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.standing-stats {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  gap: 0.25rem;
}

.standing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-val {
  font-weight: 800;
  font-size: 1.06rem;
  color: var(--text);
}

.stat-val.win { color: var(--green); }
.stat-val.draw { color: var(--amber); }
.stat-val.lose { color: var(--live-pulse); }

.stat-key {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 1px;
}

/* Form + Next Match bottom row in mobile cards */
.standing-bottom-row {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  gap: 0.75rem;
}

.standing-form {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Archive form row: centered under divider */
.standing-form-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}

.standing-form.centered {
  justify-content: center;
}

.standing-next {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.next-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
}

.next-logo {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.next-ha {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.next-ha.home {
  background: var(--green);
  color: white;
}

.next-ha.away {
  background: var(--blue);
  color: white;
}

.form-badge {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-badge.W { background: var(--green); }
.form-badge.D { background: var(--amber); }
.form-badge.L { background: var(--live-pulse); }

/* ═══════════════════════════════════════════
   TOP SCORERS — Large cards, club badges
   ═══════════════════════════════════════════ */
.scorers-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.scorer-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.scorer-card.scorer-top {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--card-bg) 50%);
}

.scorer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scorer-rank {
  font-size: 1.32rem;
  font-weight: 900;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: center;
}

.scorer-rank.top-3 {
  color: var(--accent);
  font-size: 1.5rem;
}

.scorer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.scorer-photo {
  width: 73px;
  height: 73px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.scorer-club-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 29px;
  height: 29px;
  object-fit: contain;
  background: white;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.scorer-info {
  flex: 1;
  min-width: 0;
}

.scorer-name {
  font-weight: 800;
  font-size: 1.32rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scorer-team-name {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  font-weight: 500;
}

.scorer-goals-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent);
  color: white;
  border-radius: 14px;
  padding: 0.35rem 0.7rem;
  min-width: 48px;
}

.scorer-goals-num {
  font-weight: 900;
  font-size: 1.62rem;
  line-height: 1.1;
}

.scorer-goals-label {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.scorer-details {
  display: flex;
  justify-content: space-around;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.scorer-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-val {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

.detail-key {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 1px;
}

/* ═══════════════════════════════════════════
   ARCHIVE — Season picker, hero header, sub-tabs
   ═══════════════════════════════════════════ */

/* Archive Hero Header — Large league name + season */
.archive-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.archive-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(13, 138, 188, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.archive-hero-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.archive-hero-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.archive-hero-league {
  font-size: 1.68rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.archive-hero-season {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-muted);
  letter-spacing: 0.3px;
}

.archive-hero-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  margin-top: 0.15rem;
}

/* Season Picker — Modern dropdown */
.season-picker {
  position: relative;
  margin-bottom: 1rem;
}

.season-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.season-picker-btn:hover {
  border-color: var(--accent);
}

.season-picker-btn.open {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius) var(--radius) 0 0;
}

.season-picker-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.season-picker-value {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--text);
  flex: 1;
}

.season-picker-arrow {
  transition: transform 0.2s;
  color: var(--text-secondary);
}

.season-picker-btn.open .season-picker-arrow {
  transform: rotate(180deg);
}

.season-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 2px solid var(--accent);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}

.season-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}

.season-picker-option:last-child {
  border-bottom: none;
}

.season-picker-option:hover {
  background: var(--bg);
}

.season-picker-option.active {
  background: var(--accent);
  color: white;
}

.season-picker-option.active:hover {
  background: var(--accent-muted);
}

.season-picker-option svg {
  flex-shrink: 0;
}

/* Archive sub-tabs */
.archive-tabs {
  display: flex;
  gap: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1rem;
}

.archive-tab {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1.02rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.15s;
  border-bottom: 3px solid transparent;
}

.archive-tab:hover {
  background: var(--bg);
  color: var(--text);
}

.archive-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

.archive-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Season option league name in dropdown */
.season-option-league {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  white-space: nowrap;
}

.season-picker-option.active .season-option-league {
  color: rgba(255, 255, 255, 0.7);
}

/* ═══════════════════════════════════════════
   SEASON SUMMARY — Stats cards (clean, no borders)
   ═══════════════════════════════════════════ */
.season-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.summary-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.2rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.summary-num {
  font-size: 2.64rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -1px;
}

.summary-label {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   SECTION TITLE ROW — title + controls inline
   ═══════════════════════════════════════════ */
.section-title-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

/* ═══════════════════════════════════════════
   STATS LIMIT BAR — Top 5/10/20 toggle
   ═══════════════════════════════════════════ */
.stats-limit-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0;
}

.stats-limit-label {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-limit-btn {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.45rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.stats-limit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.stats-limit-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(13, 138, 188, 0.25);
}

/* ═══════════════════════════════════════════
   PLAYER & CLUB STATS OVERVIEW
   ═══════════════════════════════════════════ */
.overview-stats-section {
  margin-bottom: 1.2rem;
}

.overview-stats-title {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.overview-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* Horizontal scroll wrapper for stats on tablets */
@media (min-width: 640px) and (max-width: 959px) {
  .overview-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.overview-stat-col {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.85rem 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}

.overview-stat-category {
  font-size: 1.26rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.overview-stat-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.overview-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  border-radius: 12px;
  transition: background 0.1s;
}

.overview-stat-item.top-3 {
  background: var(--accent-soft);
}

.overview-stat-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  min-width: 18px;
  text-align: center;
}

.overview-stat-item.top-3 .overview-stat-rank {
  color: var(--accent);
}

.overview-stat-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.overview-stat-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.overview-stat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.overview-stat-name {
  font-weight: 700;
  font-size: 1.06rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.overview-stat-team {
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-stat-value {
  font-weight: 900;
  font-size: 1.38rem;
  color: var(--accent);
  min-width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ─── Stat Hero — Featured #1 entry in each stat card ─── */
.stat-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--card-bg) 100%);
  border-radius: 20px;
  border: 1px solid rgba(13, 138, 188, 0.12);
  gap: 0.75rem;
  position: relative;
}

.stat-hero-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 10px rgba(13, 138, 188, 0.15);
  flex-shrink: 0;
}

.stat-hero-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
}

.stat-hero-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.stat-hero-name {
  font-weight: 800;
  font-size: 1.32rem;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-hero-team-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-hero-team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.stat-hero-value {
  font-weight: 900;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -1px;
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}

/* Two columns on phones > 480px */
@media (min-width: 480px) {
  .overview-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════
   ARCHIVE RESULTS — Gameweek grouping
   ═══════════════════════════════════════════ */
.results-week-group {
  margin-bottom: 1.25rem;
}

.results-week-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  padding: 0.55rem 0.85rem;
  background: linear-gradient(135deg, var(--primary) 0%, #16213e 100%);
  border-radius: 14px;
  border-bottom: none;
}

.results-week-label {
  font-size: 0.94rem;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.results-week-line {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.results-week-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   DESKTOP TABLES — Archive & shared
   ═══════════════════════════════════════════ */
/* Hide desktop tables on mobile, hide mobile cards on desktop */
.standings-desktop,
.results-desktop,
.scorers-desktop {
  display: none;
}

.standings-mobile,
.results-mobile,
.scorers-mobile {
  display: block;
}

/* Shared table styles */
.standings-table,
.results-table,
.scorers-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.standings-table th,
.results-table th,
.scorers-table th {
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  white-space: nowrap;
}

.standings-table td,
.results-table td,
.scorers-table td {
  padding: 0.6rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
}

.standings-table tbody tr:last-child td,
.results-table tbody tr:last-child td,
.scorers-table tbody tr:last-child td {
  border-bottom: none;
}

.standings-table tbody tr:hover,
.results-table tbody tr:hover,
.scorers-table tbody tr:hover {
  background: var(--bg);
}

/* Positional column */
.col-pos {
  width: 36px;
  font-weight: 900;
  color: var(--text-secondary);
}

td.col-pos.gold {
  color: var(--accent);
}

/* Team column with logo */
td.col-team,
td.col-player {
  text-align: left !important;
  font-weight: 700;
}

td.col-team > *,
td.col-player > * {
  vertical-align: middle;
}

td.col-team img,
td.col-player img {
  margin-right: 0.5rem;
}

th.col-team,
th.col-player {
  text-align: left !important;
}

/* Points column highlighted */
td.col-pts {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--accent);
}

/* Table color coding */
td.win { color: var(--green); }
td.draw { color: var(--amber); }
td.lose { color: var(--live-pulse); }

/* Top rank row */
.top-rank-row td {
  background: var(--accent-soft);
}

.top-rank-row td:first-child {
  border-left: 3px solid var(--accent);
}

/* Table team logo */
.table-team-logo {
  width: 31px;
  height: 31px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}

.table-player-photo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
  vertical-align: middle;
}

.table-team-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Form column in desktop table */
.col-form {
  white-space: nowrap;
}

.table-form {
  display: flex;
  gap: 3px;
  justify-content: center;
}

/* Next match column in desktop table */
.col-next {
  white-space: nowrap;
}

.table-next {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
}

.next-opponent-logo {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

/* Results table specific */
td.col-home {
  text-align: right !important;
  font-weight: 700;
}

td.col-home > * {
  vertical-align: middle;
}

td.col-home img {
  margin-left: 0.5rem;
}

th.col-home { text-align: right !important; }

td.col-away {
  text-align: left !important;
  font-weight: 700;
}

td.col-away > * {
  vertical-align: middle;
}

td.col-away img {
  margin-right: 0.5rem;
}

th.col-away { text-align: left !important; }

.col-score {
  width: 70px;
  white-space: nowrap;
}

.table-score {
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.col-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  width: 100px;
}

.col-venue {
  font-size: 0.72rem;
  color: var(--text-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.upcoming-time {
  color: var(--blue);
  font-weight: 700;
}

/* ─── Gameweek header row in desktop results table ─── */
.results-table .week-header-row td {
  background: var(--bg);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-align: left !important;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border);
}

/* ─── Loading / Empty ─── */
.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 1.05rem;
  line-height: 1.5;
  font-weight: 500;
}

.empty-state .sub {
  font-size: 0.88rem;
  margin-top: 0.4rem;
  opacity: 0.7;
}

/* ─── Footer ─── */
.footer {
  background: linear-gradient(135deg, #0a0a1a 0%, #121230 30%, #0D8ABC 100%);
  color: #ffffff;
  padding: 1.15rem 0;
  margin-top: auto;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  font-size: 0.8rem;
  color: #ffffff;
}

.last-updated { font-size: 0.72rem; color: rgba(255,255,255,0.7); }

.footer-disclaimer {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.35rem;
}

/* ═══════════════════════════════════
   STANDINGS VIEW TOGGLE — Full/Compact
   ═══════════════════════════════════ */
.standings-view-toggle {
  display: flex;
  gap: 3px;
  background: var(--bg);
  border-radius: 50px;
  padding: 3px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.view-toggle-btn {
  padding: 0.4rem 1rem;
  border: none;
  background: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  border-radius: 50px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.view-toggle-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.04);
}

.view-toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(13, 138, 188, 0.3);
}

/* Compact mode — larger P/W/D/L values */
.standing-card.compact {
  transition: all 0.3s ease;
}

.standing-card.compact .standing-stats {
  justify-content: center;
  gap: 1.5rem;
}

.compact-val {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
}

.compact-stat .stat-key {
  font-size: 0.72rem;
  font-weight: 700;
}

/* Animated transition for standings cards */
.standings-list {
  transition: all 0.3s ease;
}

.standing-card {
  transition: all 0.3s ease;
}

.standing-stats-animated {
  transition: all 0.3s ease;
}

.standing-bottom-row {
  transition: all 0.3s ease;
}

/* ═══════════════════════════════════
   TABLET — 640px+
   ═══════════════════════════════════ */
@media (min-width: 640px) {
  .container {
    max-width: 720px;
    padding: 0 1.5rem;
  }

  .logo h1 { font-size: 1.7rem; }

  .nav-link {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.78rem;
    padding: 0.85rem 0.75rem;
  }

  .match-card { padding: 1.2rem 1.5rem; }
  .team-logo { width: 68px; height: 68px; }
  .team-name { font-size: 0.88rem; }
  .match-score { font-size: 2.2rem; }

  .scorer-photo { width: 81px; height: 81px; }
  .scorer-club-badge { width: 31px; height: 31px; }
  .scorer-name { font-size: 1.05rem; }
  .scorer-goals-num { font-size: 1.5rem; }

  .archive-hero { padding: 1.75rem 1.5rem; gap: 1.25rem; }
  .archive-hero-league { font-size: 1.5rem; }
  .archive-hero-season { font-size: 1rem; }

  .season-summary { grid-template-columns: repeat(4, 1fr); }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ═══════════════════════════════════
   DESKTOP — 960px+
   ═══════════════════════════════════ */
@media (min-width: 960px) {
  .container {
    max-width: 1200px;
    padding: 0 2.5rem;
  }

  .header { padding: 1.6rem 0; }
  .logo h1 { font-size: 2.5rem; }
  .logo-icon { width: 56px !important; height: 56px !important; }
  .season-badge { font-size: 0.78rem; letter-spacing: 1px; }

  .nav-link {
    font-size: 0.95rem;
    padding: 1.1rem 1.6rem;
    gap: 0.5rem;
  }

  .main { padding: 2rem 0 3.5rem; }
  .section-title { font-size: 1.8rem; gap: 0.65rem; margin-bottom: 1.2rem; }

  .section-title-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
  }
  .stats-limit-bar { gap: 0.6rem; }
  .stats-limit-label { font-size: 1rem; }
  .stats-limit-btn { font-size: 1.05rem; padding: 0.5rem 1.4rem; }

  .match-card {
    padding: 1.5rem 2rem;
    margin-bottom: 1rem;
    border-radius: 20px;
  }

  .team {
    flex-direction: row;
    gap: 1rem;
  }

  .team.away {
    flex-direction: row-reverse;
    text-align: right;
  }

  .team-logo { width: 73px; height: 73px; }
  .team-name {
    font-size: 1.15rem;
    text-align: left;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }
  .team.away .team-name { text-align: right; }

  .match-score { font-size: 2.4rem; letter-spacing: 4px; }

  .standing-logo { width: 62px; height: 62px; }
  .standing-name { font-size: 1.1rem; }
  .standing-pos { font-size: 1.2rem; }
  .standing-pts-num { font-size: 1.65rem; }
  .standing-card { padding: 1rem 1.2rem; border-radius: 20px; }

  .scorer-photo { width: 109px; height: 109px; border-width: 3px; }
  .scorer-club-badge { width: 44px; height: 44px; }
  .scorer-name { font-size: 1.3rem; }
  .scorer-team-name { font-size: 0.92rem; }
  .scorer-goals-num { font-size: 1.9rem; }
  .scorer-goals-box { padding: 0.5rem 0.9rem; min-width: 60px; border-radius: 12px; }
  .scorer-card { padding: 1.2rem 1.4rem; border-radius: 20px; }
  .detail-val { font-size: 1.15rem; }
  .detail-key { font-size: 0.68rem; }

  /* Desktop: switch to tables */
  .standings-desktop,
  .results-desktop,
  .scorers-desktop {
    display: block;
  }

  .standings-mobile,
  .results-mobile,
  .scorers-mobile {
    display: none;
  }

  /* Wider season picker on desktop */
  .season-picker {
    max-width: 400px;
  }

  .season-picker-btn {
    padding: 1rem 1.2rem;
  }

  .season-picker-value {
    font-size: 1.25rem;
  }

  .standings-table-wrap {
    overflow-x: auto;
  }

  /* ── Bigger desktop table elements ── */
  .standings-table,
  .results-table,
  .scorers-table {
    border-radius: 20px;
    font-size: 1rem;
  }

  .standings-table th,
  .results-table th,
  .scorers-table th {
    font-size: 0.85rem;
    padding: 1rem 0.85rem;
    letter-spacing: 0.8px;
  }

  .standings-table td,
  .results-table td,
  .scorers-table td {
    padding: 0.9rem 0.85rem;
    font-size: 1rem;
  }

  .table-team-logo {
    width: 49px;
    height: 49px;
  }

  .table-player-photo {
    width: 62px;
    height: 62px;
    border-width: 2px;
  }

  td.col-pts {
    font-size: 1.2rem;
  }

  .col-pos {
    width: 44px;
    font-size: 1.05rem;
  }

  .table-score {
    font-size: 1.15rem;
    letter-spacing: 2px;
  }

  td.col-team,
  td.col-player {
    font-size: 1.05rem;
  }

  td.col-team img,
  td.col-player img {
    margin-right: 0.85rem;
  }

  .col-date {
    font-size: 0.85rem;
    width: 120px;
  }

  .col-venue {
    font-size: 0.85rem;
    max-width: 240px;
  }

  .col-score {
    width: 90px;
  }

  .upcoming-time {
    color: var(--blue);
    font-weight: 800;
    font-size: 1.05rem;
  }

  /* Archive hero on desktop */
  .archive-hero {
    padding: 2.5rem 2.5rem;
    gap: 1.5rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
  }

  .archive-hero::before {
    width: 300px;
    height: 300px;
  }

  .archive-hero-icon svg {
    width: 52px !important;
    height: 52px !important;
  }

  .archive-hero-league {
    font-size: 2.2rem;
    letter-spacing: -0.5px;
  }

  .archive-hero-season {
    font-size: 1.25rem;
  }

  .archive-hero-badge {
    font-size: 0.72rem;
    letter-spacing: 1.5px;
  }

  /* Archive tabs bigger on desktop */
  .archive-tab {
    font-size: 0.95rem;
    padding: 1rem 0.85rem;
    gap: 0.5rem;
  }

  .archive-count {
    font-size: 1rem;
  }

  /* Season summary on desktop */
  .season-summary {
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .summary-card {
    padding: 1.5rem 1rem;
    border-radius: 20px;
  }

  .summary-num {
    font-size: 2.8rem;
    letter-spacing: -1px;
  }

  .summary-label {
    font-size: 0.78rem;
    letter-spacing: 0.5px;
  }

  /* Season picker dropdown on desktop */
  .season-picker-option {
    padding: 0.85rem 1.2rem;
    font-size: 1rem;
  }

  .season-option-league {
    font-size: 0.72rem;
  }

  /* Player & Club Stats on desktop */
  .overview-stats-section {
    margin-bottom: 1.8rem;
  }

  .overview-stats-title {
    font-size: 1.35rem;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .overview-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-x: visible;
  }

  .overview-stat-col {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .overview-stat-category {
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
  }

  .overview-stat-photo {
    width: 52px;
    height: 52px;
  }

  .overview-stat-logo {
    width: 47px;
    height: 47px;
  }

  .overview-stat-name {
    font-size: 0.9rem;
  }

  .overview-stat-team {
    font-size: 0.72rem;
  }

  .overview-stat-value {
    font-size: 1.3rem;
  }

  .overview-stat-rank {
    font-size: 0.85rem;
  }

  /* Stat hero on desktop — vertical layout */
  .stat-hero {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 20px;
    gap: 0.4rem;
  }

  .stat-hero-photo {
    width: 100px;
    height: 100px;
  }

  .stat-hero-logo {
    width: 92px;
    height: 92px;
  }

  .stat-hero-info {
    align-items: center;
  }

  .stat-hero-name {
    font-size: 1.15rem;
    white-space: normal;
    text-align: center;
  }

  .stat-hero-team-row {
    font-size: 0.82rem;
    justify-content: center;
  }

  .stat-hero-team-logo {
    width: 22px;
    height: 22px;
  }

  .stat-hero-value {
    font-size: 2.8rem;
    text-align: center;
    min-width: unset;
  }

  /* Next match + form in desktop table */
  .next-opponent-logo {
    width: 32px;
    height: 32px;
  }

  .next-logo {
    width: 32px;
    height: 32px;
  }

  .form-badge {
    width: 22px;
    height: 22px;
    font-size: 0.68rem;
    border-radius: 5px;
  }

  /* Gameweek header in desktop table */
  .results-table .week-header-row td {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
  }

  /* Footer */
  .footer-inner {
    font-size: 0.88rem;
  }
}

/* ═══════════════════════════════════
   LARGE DESKTOP — 1280px+
   ═══════════════════════════════════ */
@media (min-width: 1280px) {
  .container {
    max-width: 1400px;
  }

  .team-logo { width: 83px; height: 83px; }
  .team-name { font-size: 1.25rem; }
  .match-score { font-size: 2.8rem; min-width: 100px; }
  .match-card { padding: 1.8rem 2.5rem; }
  .match-venue { font-size: 0.82rem; }
  .match-capsule { font-size: 0.72rem; padding: 0.2rem 0.65rem; }
  .match-status { font-size: 0.78rem; }

  .table-team-logo { width: 55px; height: 55px; }
  .table-player-photo { width: 68px; height: 68px; }

  .standings-table td,
  .results-table td,
  .scorers-table td {
    padding: 1rem 0.9rem;
    font-size: 1.05rem;
  }

  .standings-table th,
  .results-table th,
  .scorers-table th {
    padding: 1.1rem 0.9rem;
    font-size: 0.88rem;
  }

  td.col-team,
  td.col-player {
    font-size: 1.1rem;
  }

  td.col-team img,
  td.col-player img {
    margin-right: 1rem;
  }

  td.col-pts {
    font-size: 1.3rem;
  }

  .table-score {
    font-size: 1.25rem;
  }

  .archive-hero {
    padding: 3rem 3rem;
  }

  .archive-hero-league {
    font-size: 2.6rem;
  }

  .archive-hero-season {
    font-size: 1.4rem;
  }

  .summary-num {
    font-size: 3.2rem;
  }

  .summary-label {
    font-size: 0.85rem;
  }
}

/* ═══════════════════════════════════
   SMALL PHONES — < 380px
   ═══════════════════════════════════ */
@media (max-width: 380px) {
  .container { padding: 0 0.65rem; }
  .logo h1 { font-size: 1.25rem; }
  .logo-icon { width: 30px !important; height: 30px !important; }

  .team-logo { width: 52px; height: 52px; }
  .team-name { font-size: 0.86rem; }
  .match-score { font-size: 1.98rem; min-width: 60px; }

  .nav-link { padding: 0.65rem 0.2rem; font-size: 0.72rem; }

  .scorer-photo { width: 62px; height: 62px; }
  .scorer-club-badge { width: 26px; height: 26px; }
  .scorer-name { font-size: 1.06rem; }

  .season-picker-value { font-size: 1.14rem; }

  .archive-hero { padding: 1.2rem 1rem; gap: 0.75rem; }
  .archive-hero-league { font-size: 1.26rem; }
  .archive-hero-season { font-size: 0.94rem; }

  .season-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════
   RTL (Arabic) SUPPORT
   ═══════════════════════════════════ */
html[dir="rtl"],
html[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

html[dir="rtl"] .lang-toggle,
html[dir="rtl"] .nav-link,
html[dir="rtl"] .season-badge,
html[dir="rtl"] .section-title,
html[dir="rtl"] .standing-name,
html[dir="rtl"] .scorer-name,
html[dir="rtl"] .scorer-team-name,
html[dir="rtl"] .team-name,
html[dir="rtl"] .match-venue,
html[dir="rtl"] .match-capsule,
html[dir="rtl"] .h2h-summary-text,
html[dir="rtl"] .h2h-bar-label,
html[dir="rtl"] .h2h-stat-label,
html[dir="rtl"] .h2h-goals-label,
html[dir="rtl"] .h2h-biggest-label,
html[dir="rtl"] .h2h-biggest-score,
html[dir="rtl"] .h2h-biggest-season,
html[dir="rtl"] .h2h-empty,
html[dir="rtl"] .stat-hero-name,
html[dir="rtl"] .overview-stat-name,
html[dir="rtl"] .overview-stat-team,
html[dir="rtl"] .overview-stat-category,
html[dir="rtl"] .overview-stats-title,
html[dir="rtl"] .archive-hero-league,
html[dir="rtl"] .archive-hero-season,
html[dir="rtl"] .archive-hero-badge,
html[dir="rtl"] .summary-label,
html[dir="rtl"] .stat-key,
html[dir="rtl"] .detail-key,
html[dir="rtl"] .standing-pts-label,
html[dir="rtl"] .scorer-goals-label,
html[dir="rtl"] .season-picker-label,
html[dir="rtl"] .season-picker-value,
html[dir="rtl"] .season-option-label,
html[dir="rtl"] .season-option-league,
html[dir="rtl"] .archive-tab,
html[dir="rtl"] .archive-count,
html[dir="rtl"] .loading p,
html[dir="rtl"] .empty-state p,
html[dir="rtl"] .footer-inner,
html[dir="rtl"] .results-week-label,
html[dir="rtl"] .results-week-count,
html[dir="rtl"] .next-label,
html[dir="rtl"] .match-status,
html[dir="rtl"] .match-date,
html[dir="rtl"] .table-team-name,
html[dir="rtl"] th,
html[dir="rtl"] td,
html[dir="rtl"] .stats-limit-label,
html[dir="rtl"] .stats-limit-btn,
html[dir="rtl"] .view-toggle-btn {
  font-family: 'IBM Plex Sans Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

/* ── Stats limit bar ── */
html[dir="rtl"] .stats-limit-bar { direction: rtl; }
html[dir="rtl"] .section-title-row { direction: rtl; }
html[dir="rtl"] .standings-view-toggle { direction: rtl; }

/* ── Header & Logo ── */
html[dir="rtl"] .header-inner { direction: rtl; }
html[dir="rtl"] .logo { flex-direction: row-reverse; }
html[dir="rtl"] .logo-text { text-align: right; }

/* ── Navigation ── */
html[dir="rtl"] .nav-inner { direction: rtl; }

/* ── Section titles ── */
html[dir="rtl"] .section-title { direction: rtl; }
html[dir="rtl"] .section-subtitle { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .overview-stats-title { direction: rtl; }

/* ── Match cards ── */
html[dir="rtl"] .match-card.live {
  border-left: none;
  border-right: 4px solid var(--live-pulse);
}
html[dir="rtl"] .match-teams { direction: rtl; }

/* ── Standings cards ── */
html[dir="rtl"] .standing-card { direction: rtl; }
html[dir="rtl"] .standing-left { direction: rtl; }
html[dir="rtl"] .standing-name { text-align: right; }
html[dir="rtl"] .standing-bottom-row { direction: rtl; }
html[dir="rtl"] .standing-next { direction: rtl; }
html[dir="rtl"] .standing-form { direction: rtl; }
html[dir="rtl"] .standing-form-row { direction: rtl; }

/* ── Scorer cards ── */
html[dir="rtl"] .scorer-header { direction: rtl; }
html[dir="rtl"] .scorer-info { text-align: right; }
html[dir="rtl"] .scorer-club-badge {
  right: auto;
  left: -4px;
}
html[dir="rtl"] .scorer-details { direction: rtl; }

/* ── Stat hero ── */
html[dir="rtl"] .stat-hero { direction: rtl; }
html[dir="rtl"] .stat-hero-info { text-align: right; }
html[dir="rtl"] .stat-hero-team-row { direction: rtl; }
html[dir="rtl"] .stat-hero-value { text-align: left; }

/* ── Overview stat items ── */
html[dir="rtl"] .overview-stat-item { direction: rtl; }
html[dir="rtl"] .overview-stat-info { text-align: right; }
html[dir="rtl"] .overview-stat-value { text-align: left; }

/* ── Archive hero ── */
html[dir="rtl"] .archive-hero { direction: rtl; }
html[dir="rtl"] .archive-hero::before {
  right: auto;
  left: -10%;
}
html[dir="rtl"] .archive-hero-text { text-align: right; }

/* ── Season picker ── */
html[dir="rtl"] .season-picker-btn { direction: rtl; }
html[dir="rtl"] .season-picker-option { direction: rtl; }
html[dir="rtl"] .season-option-league { margin-left: 0; margin-right: 0.5rem; }

/* ── Archive tabs ── */
html[dir="rtl"] .archive-tabs { direction: rtl; }

/* ── Season summary ── */
html[dir="rtl"] .season-summary { direction: rtl; }

/* ── Week headers (archive results) ── */
html[dir="rtl"] .results-week-header { direction: rtl; }

/* ── Upcoming divider ── */
html[dir="rtl"] .upcoming-divider { direction: rtl; }
html[dir="rtl"] .upcoming-divider::after { content: ''; }

/* ── Footer ── */
html[dir="rtl"] .footer-inner { direction: rtl; text-align: center; }

/* ── Desktop tables RTL ── */
html[dir="rtl"] td.col-team,
html[dir="rtl"] td.col-player {
  text-align: right !important;
}
html[dir="rtl"] th.col-team,
html[dir="rtl"] th.col-player {
  text-align: right !important;
}
html[dir="rtl"] td.col-team img,
html[dir="rtl"] td.col-player img {
  margin-right: 0;
  margin-left: 0.5rem;
}
html[dir="rtl"] td.col-home {
  text-align: left !important;
}
html[dir="rtl"] th.col-home {
  text-align: left !important;
}
html[dir="rtl"] td.col-home img {
  margin-left: 0;
  margin-right: 0.5rem;
}
html[dir="rtl"] td.col-away {
  text-align: right !important;
}
html[dir="rtl"] th.col-away {
  text-align: right !important;
}
html[dir="rtl"] td.col-away img {
  margin-right: 0;
  margin-left: 0.5rem;
}
html[dir="rtl"] .table-team-cell { direction: rtl; }
html[dir="rtl"] .table-next { direction: rtl; }
html[dir="rtl"] .table-form { direction: rtl; }

/* Desktop table — first-child left accent border flips */
html[dir="rtl"] .top-rank-row td:first-child {
  border-left: none;
  border-right: 3px solid var(--accent);
}

/* Gameweek header in desktop table */
html[dir="rtl"] .results-table .week-header-row td {
  text-align: right !important;
}

/* ── Desktop overrides ── */
@media (min-width: 960px) {
  html[dir="rtl"] .stat-hero { flex-direction: column; text-align: center; direction: ltr; }
  html[dir="rtl"] .stat-hero-info { text-align: center; align-items: center; }
  html[dir="rtl"] .stat-hero-team-row { direction: rtl; justify-content: center; }
  html[dir="rtl"] .stat-hero-value { text-align: center; }

  html[dir="rtl"] td.col-team img,
  html[dir="rtl"] td.col-player img {
    margin-left: 0.85rem;
    margin-right: 0;
  }

  html[dir="rtl"] td.col-home img {
    margin-right: 0.85rem;
    margin-left: 0;
  }

  html[dir="rtl"] td.col-away img {
    margin-left: 0.85rem;
    margin-right: 0;
  }

  /* Team text alignment for desktop */
  html[dir="rtl"] .team.away .team-name { text-align: left; }
  html[dir="rtl"] .team-name { text-align: right; }
}

@media (min-width: 1280px) {
  html[dir="rtl"] td.col-team img,
  html[dir="rtl"] td.col-player img {
    margin-left: 1rem;
    margin-right: 0;
  }
}
