:root {
  --bg: #080c10;
  --surface: #0e1318;
  --card: #111820;
  --border: #1c2530;
  --border2: #243040;
  --green: #00e676;
  --green-dim: rgba(0,230,118,0.12);
  --yellow: #ffd740;
  --red: #ff5252;
  --blue: #40c4ff;
  --orange: #ff9100;
  --text: #f0f4f8;
  --muted: #607080;
  --muted2: #8090a0;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── ANIMATED PITCH BG ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 79px,
      rgba(255,255,255,0.012) 79px,
      rgba(255,255,255,0.012) 80px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 79px,
      rgba(255,255,255,0.012) 79px,
      rgba(255,255,255,0.012) 80px
    );
  pointer-events: none;
  z-index: 0;
}

/* ─── NAV ─── */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(8,12,16,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  animation: slideDown 0.5s ease both;
}

@keyframes slideDown { from { transform: translateY(-60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes countUp { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

.nav-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.nav-leagues {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-leagues li a {
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-leagues li a:hover, .nav-leagues li a.active {
  background: var(--green-dim);
  color: var(--green);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-badge {
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  animation: pulse 1.5s infinite;
}

.search-btn {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.4rem 1rem;
  color: var(--muted);
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.search-btn:hover { border-color: var(--green); color: var(--text); }

/* ─── HERO ─── */
.hero {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s 0.1s ease both;
}

.hero-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-label::before {
  content: '';
  display: block;
  width: 20px; height: 2px;
  background: var(--green);
}

/* ─── FEATURED MATCH CARD ─── */
.featured-match {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  animation: fadeUp 0.5s 0.15s ease both;
  margin-bottom: 2rem;
}

.featured-match::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--yellow));
}

.match-header {
  padding: 1.5rem 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.match-league {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.league-flag {
  font-size: 1.2rem;
}

.league-info .league-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.league-info .match-round {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.match-datetime {
  text-align: right;
}

.match-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.match-time {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--yellow);
  margin-top: 0.15rem;
}

/* TEAMS SECTION */
.match-teams {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

/* Row 1: both team crests + VS side by side */
.match-teams-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.team-crest {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  background: var(--surface);
  border: 2px solid var(--border2);
  transition: transform 0.3s;
}

.team-crest:hover { transform: scale(1.08); }

.team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1;
}

/* Row 2: stats side by side under each team */
.match-teams-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.team-stats-col {
  padding: 1rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.team-stats-col:first-child {
  border-right: 1px solid var(--border);
}

/* Legacy aliases kept for compatibility */
.team-side { display: none; }
.team-side.home, .team-side.away { display: none; }

.team-record {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
}

.record-w { color: var(--green); font-weight: 600; }
.record-d { color: var(--yellow); font-weight: 600; }
.record-l { color: var(--red); font-weight: 600; }

.team-form {
  display: flex;
  gap: 0.3rem;
}

.form-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
}

.form-dot.w { background: rgba(0,230,118,0.2); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.form-dot.d { background: rgba(255,215,64,0.15); color: var(--yellow); border: 1px solid rgba(255,215,64,0.3); }
.form-dot.l { background: rgba(255,82,82,0.15); color: var(--red); border: 1px solid rgba(255,82,82,0.3); }

.match-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.vs-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--border2);
  letter-spacing: 0.05em;
}

.match-status {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

.stadium-info {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.25rem;
}

/* ─── TABS ─── */
.analysis-tabs {
  display: flex;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.atab {
  flex: 1;
  min-width: 100px;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.atab:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.atab.active { color: var(--green); border-bottom-color: var(--green); background: var(--green-dim); }

/* ─── TAB CONTENT ─── */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.3s ease both; }

/* ─── STATS PANEL ─── */
.stats-panel {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stats-section h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-home-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--blue);
  text-align: right;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
}

.stat-away-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--orange);
  text-align: left;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.bar-home {
  height: 6px;
  border-radius: 100px;
  background: rgba(64,196,255,0.2);
  overflow: hidden;
  direction: rtl;
}

.bar-home-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #80d8ff);
  border-radius: 100px;
  transition: width 1s ease;
}

.bar-away {
  height: 6px;
  border-radius: 100px;
  background: rgba(255,145,0,0.2);
  overflow: hidden;
}

.bar-away-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), #ffcc80);
  border-radius: 100px;
  transition: width 1s ease;
}

/* ─── PREDICTION PANEL ─── */
.prediction-panel {
  padding: 2rem;
}

.prediction-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.pred-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: default;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.pred-box:hover { transform: translateY(-3px); }

.pred-box.highlight {
  border-color: var(--green);
  background: rgba(0,230,118,0.06);
}

.pred-box.highlight::before {
  content: '⚡ MOST LIKELY';
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--green);
}

.pred-outcome {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--muted2);
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

.pred-pct {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.pred-box.highlight .pred-pct { color: var(--green); }
.pred-box:not(.highlight) .pred-pct { color: var(--text); }

.pred-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analysis-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.analysis-text .analyst-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.analyst-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.analyst-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.analyst-role {
  font-size: 0.72rem;
  color: var(--muted);
}

.analysis-text p {
  font-size: 0.9rem;
  color: #c0ccd8;
  line-height: 1.75;
  font-weight: 300;
}

.key-factors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.factor-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.factor-item:hover { border-color: var(--border2); }

.factor-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.factor-text .factor-title {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}

.factor-text .factor-desc {
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 300;
}

/* ─── H2H PANEL ─── */
.h2h-panel {
  padding: 2rem;
}

.h2h-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.h2h-stat-big {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.h2h-number {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 3rem;
  line-height: 1;
}

.h2h-number.blue { color: var(--blue); }
.h2h-number.gray { color: var(--muted2); }
.h2h-number.orange { color: var(--orange); }

.h2h-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.4rem;
}

.past-matches { }

.past-match-item {
  display: grid;
  grid-template-columns: 100px 1fr auto 1fr 80px;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: default;
}

.past-match-item:hover { background: var(--surface); }

.pm-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.pm-home {
  font-weight: 600;
  font-size: 0.88rem;
  text-align: right;
}

.pm-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  text-align: center;
  background: var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
}

.pm-away {
  font-weight: 600;
  font-size: 0.88rem;
}

.pm-comp {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}

/* ─── LINEUP PANEL ─── */
.lineup-panel {
  padding: 2rem;
}

.pitch-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pitch {
  background: linear-gradient(180deg, #0d2b1a 0%, #0a2015 50%, #0d2b1a 100%);
  border: 1px solid #1a4025;
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  min-height: 420px;
}

.pitch-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1.5rem;
  color: rgba(255,255,255,0.5);
}

/* Pitch markings */
.pitch::before {
  content: '';
  position: absolute;
  inset: 3.5rem 2rem;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
}

.pitch::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 3.5rem;
  bottom: 3.5rem;
  width: 1px;
  background: rgba(255,255,255,0.06);
  transform: translateX(-50%);
}

.lineup-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.player-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: default;
  transition: transform 0.2s;
}

.player-node:hover { transform: scale(1.1); }

.player-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid rgba(255,255,255,0.15);
  position: relative;
}

.player-circle.home-player { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.player-circle.away-player { background: linear-gradient(135deg, #b71c1c, #7f0000); }
.player-circle.gk { background: linear-gradient(135deg, #f57f17, #e65100) !important; }

.player-name {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  text-align: center;
  max-width: 50px;
  line-height: 1.2;
  font-weight: 500;
}

.player-rating {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--yellow);
}

/* ─── MAIN LAYOUT ─── */
.main-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ─── */
.sidebar {}

.sidebar-section {
  margin-bottom: 1.5rem;
  animation: fadeUp 0.5s 0.3s ease both;
}

.sidebar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* LEAGUE STANDINGS WIDGET */
.standings-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.standings-header {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.standings-league {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

.standings-cols {
  display: grid;
  grid-template-columns: 24px 1fr 28px 28px 28px 32px;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.standing-row {
  display: grid;
  grid-template-columns: 24px 1fr 28px 28px 28px 32px;
  gap: 0.25rem;
  padding: 0.6rem 1rem;
  align-items: center;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  transition: background 0.15s;
  cursor: default;
}

.standing-row:hover { background: rgba(255,255,255,0.02); }
.standing-row.highlight-row { background: rgba(0,230,118,0.04); border-left: 2px solid var(--green); }

.stand-pos { color: var(--muted); font-weight: 600; font-size: 0.72rem; }
.stand-team { font-weight: 600; font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; }
.stand-team-emoji { font-size: 0.85rem; }
.stand-num { text-align: center; color: var(--muted2); }
.stand-pts { text-align: center; font-weight: 700; color: var(--text); }

/* UPCOMING MATCHES */
.upcoming-match {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.upcoming-match:hover {
  border-color: var(--border2);
  background: #13192080;
  transform: translateX(3px);
}

.upcoming-match.active {
  border-color: var(--green);
  background: var(--green-dim);
}

.um-league {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.um-team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  flex: 1;
}

.um-vs {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 0.25rem;
}

.um-time {
  font-size: 0.72rem;
  color: var(--yellow);
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ─── LEAGUE BANNERS ─── */
.league-selector {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
  animation: fadeUp 0.5s 0.2s ease both;
}

@media (max-width: 1200px) { .league-selector { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .league-selector { grid-template-columns: repeat(2, 1fr); } }

.league-pill {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 1.25rem 1rem 1rem;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 110px;
  user-select: none;
}

.league-pill:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Background logo SVG watermark */
.league-pill .bg-logo {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 5.5rem;
  opacity: 0.12;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  filter: grayscale(0.3);
  line-height: 1;
}

.league-pill:hover .bg-logo {
  opacity: 0.2;
  transform: translateY(-50%) scale(1.08);
}

.league-pill .pill-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

.league-pill .pill-country {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

.league-pill .pill-live {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--red);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  animation: pulse 1.5s infinite;
  z-index: 2;
}

/* Per-league color accents */
.league-pill[data-league="pl"]   { border-top: 3px solid #38003c; background: linear-gradient(135deg, #110015 0%, #0d0012 100%); }
.league-pill[data-league="pl"] .pill-name   { color: #e9e0ff; }
.league-pill[data-league="pl"] .pill-country { color: #9070b0; }

.league-pill[data-league="laliga"]  { border-top: 3px solid #ff4500; background: linear-gradient(135deg, #1a0800 0%, #120500 100%); }
.league-pill[data-league="laliga"] .pill-name { color: #ffe0d0; }
.league-pill[data-league="laliga"] .pill-country { color: #a06040; }

.league-pill[data-league="bund"]  { border-top: 3px solid #d20515; background: linear-gradient(135deg, #1a0002 0%, #110002 100%); }
.league-pill[data-league="bund"] .pill-name { color: #ffe0e0; }
.league-pill[data-league="bund"] .pill-country { color: #904040; }

.league-pill[data-league="serie"] { border-top: 3px solid #0066cc; background: linear-gradient(135deg, #001020 0%, #000c18 100%); }
.league-pill[data-league="serie"] .pill-name { color: #d0e8ff; }
.league-pill[data-league="serie"] .pill-country { color: #406080; }

.league-pill[data-league="ligamx"] { border-top: 3px solid #006847; background: linear-gradient(135deg, #001510 0%, #000e0a 100%); }
.league-pill[data-league="ligamx"] .pill-name { color: #c0ffe0; }
.league-pill[data-league="ligamx"] .pill-country { color: #408060; }

.league-pill[data-league="ucl"]   { border-top: 3px solid #00529f; background: linear-gradient(135deg, #000a1a 0%, #000612 100%); }
.league-pill[data-league="ucl"] .pill-name   { color: #c8d8ff; }
.league-pill[data-league="ucl"] .pill-country { color: #405070; }

/* Active glow */
.league-pill.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 8px 32px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}

.league-pill[data-league="pl"].active     { box-shadow: 0 0 0 2px #9060cf, 0 8px 28px rgba(100,0,200,0.3); }
.league-pill[data-league="laliga"].active { box-shadow: 0 0 0 2px #ff4500, 0 8px 28px rgba(255,69,0,0.3); }
.league-pill[data-league="bund"].active   { box-shadow: 0 0 0 2px #d20515, 0 8px 28px rgba(210,5,21,0.3); }
.league-pill[data-league="serie"].active  { box-shadow: 0 0 0 2px #0066cc, 0 8px 28px rgba(0,102,204,0.3); }
.league-pill[data-league="ligamx"].active { box-shadow: 0 0 0 2px #00a060, 0 8px 28px rgba(0,160,96,0.3); }
.league-pill[data-league="ucl"].active    { box-shadow: 0 0 0 2px #4488ff, 0 8px 28px rgba(68,136,255,0.3); }

/* ─── FOOTER ─── */
footer {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

footer .footer-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Stars pulse animation for ratings */
.star-rating { color: var(--yellow); font-size: 0.75rem; letter-spacing: 0.05em; }

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 0 2rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-green { background: rgba(0,230,118,0.12); color: var(--green); border: 1px solid rgba(0,230,118,0.2); }
.tag-red { background: rgba(255,82,82,0.12); color: var(--red); border: 1px solid rgba(255,82,82,0.2); }
.tag-yellow { background: rgba(255,215,64,0.12); color: var(--yellow); border: 1px solid rgba(255,215,64,0.2); }
.tag-blue { background: rgba(64,196,255,0.12); color: var(--blue); border: 1px solid rgba(64,196,255,0.2); }

/* =====================================================
   MOBILE RESPONSIVE FIX (FINAL VERSION)
   ===================================================== */

@media (max-width: 768px) {

  html, body {
    overflow-x: hidden;
  }

  .hero {
    padding: 1.2rem 1rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem 3rem;
  }

  .match-header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .match-teams-top {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 1.5rem;
  }

  .match-teams-stats {
    grid-template-columns: 1fr;
  }

  .team-stats-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .team-name {
    font-size: 1.6rem;
  }

  .vs-text {
    font-size: 1.4rem;
  }

  .analysis-tabs {
    flex-wrap: wrap;
  }

  .atab {
    flex: 1 1 45%;
    font-size: 0.75rem;
  }

  .stats-panel,
  .prediction-hero,
  .key-factors,
  .pitch-container {
    grid-template-columns: 1fr;
  }

  nav {
    padding: 0 1rem;
  }

  .nav-leagues {
    display: none;
  }

  .sidebar {
    margin-top: 2rem;
  }
}
