:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12101e;
  --bg-card: #1a1730;
  --bg-card-hover: #201d3a;
  --purple-bright: #7c3aed;
  --purple-light: #a855f7;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-orange: #f97316;
  --accent-conf: #06b6d4;
  --accent-red: #ef4444;
  --text-primary: #ffffff;
  --text-secondary: #c4b5fd;
  --text-muted: #6b7280;
  --border: rgba(124, 58, 237, 0.2);
  --border-bright: rgba(124, 58, 237, 0.5);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-purple: 0 4px 24px rgba(124, 58, 237, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 140px; /* Offset for sticky header when scrolling to hash targets */
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(88,28,235,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(124,58,237,0.15) 0%, transparent 50%);
  background-attachment: fixed;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* HEADER */
.site-header {
  padding: 20px 0 0;
  background: linear-gradient(180deg, rgba(10,8,20,0.98) 0%, transparent 100%);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: 0 20px 14px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo {
  width: 64px; height: 64px; border-radius: 12px;
  overflow: hidden; border: 2px solid var(--purple-bright);
  box-shadow: 0 0 20px rgba(124,58,237,0.4);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-fallback { display: none; font-size: 1.8rem; }
.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 2.4rem; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 0%, var(--purple-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.brand-subtitle { color: var(--purple-light); font-size: 0.85rem; font-weight: 500; margin-top: 4px; }
.league-selector-wrapper { margin-top: 4px; position: relative; }
.league-selector {
  appearance: none;
  background: rgba(124,58,237,0.15);
  border: 1px solid var(--border);
  color: var(--purple-light);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 30px 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
.league-selector:hover, .league-selector:focus {
  background: rgba(124,58,237,0.25);
  border-color: var(--purple-bright);
}
.league-selector-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: var(--purple-light);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.league-selector option {
  background: var(--bg-card);
  color: var(--text-primary);
}
.main-nav { display: flex; gap: 8px; }
.nav-link {
  color: var(--text-secondary); text-decoration: none;
  padding: 8px 18px; border-radius: 8px; font-weight: 500; font-size: 0.9rem;
  transition: all 0.2s; border: 1px solid transparent;
}
.nav-link:hover, .nav-link.active {
  color: #fff; background: rgba(124,58,237,0.2);
  border-color: var(--border-bright);
}
.header-tagline {
  text-align: center; color: var(--text-secondary); font-size: 0.95rem;
  padding: 10px 0 14px; opacity: 0.85;
}
.mobile-menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: var(--text-secondary); border-radius: 2px; }

/* FEATURES */
.features-section { padding: 32px 20px; }
.section-title {
  text-align: center; font-family: 'Outfit', sans-serif;
  font-size: 1.4rem; font-weight: 700; margin-bottom: 24px;
}
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  max-width: 960px; margin: 0 auto;
}
.feature-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 20px 18px; border: 1px solid var(--border);
  cursor: pointer; transition: all 0.3s;
}
.feature-card:hover {
  background: var(--bg-card-hover); border-color: var(--border-bright);
  transform: translateY(-2px); box-shadow: var(--shadow-purple);
}
.feature-icon { margin-bottom: 12px; }
.feature-icon svg { width: 34px; height: 34px; }
.live-icon svg { stroke: #ef4444; }
.trophy-icon svg { stroke: var(--accent-gold); }
.calendar-icon svg { stroke: var(--accent-blue); }
.stats-icon svg { stroke: var(--accent-green); }
.squad-icon svg { stroke: var(--purple-light); }
.lineup-icon svg { stroke: var(--accent-gold); }
.feature-title { font-weight: 700; font-size: 0.98rem; margin-bottom: 5px; }
.feature-desc { color: var(--text-muted); font-size: 0.8rem; }

/* MAIN CONTENT */
.main-content { padding: 0 0 60px; }
.content-section {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
  scroll-margin-top: 140px; /* Offset to prevent sticky header from overlapping scrolled sections */
}
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.section-header-left { display: flex; align-items: center; gap: 10px; }
.section-header-left h2 { font-family: 'Outfit', sans-serif; font-size: 1.25rem; font-weight: 700; }
.section-icon { width: 22px; height: 22px; stroke: var(--purple-light); flex-shrink: 0; }
.section-icon.trophy { stroke: var(--accent-gold); }


/* DATE TABS */
.date-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.date-tab {
  padding: 7px 18px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  font-size: 0.85rem; font-weight: 500; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.date-tab:hover { border-color: var(--border-bright); color: #fff; }
.date-tab.active { background: var(--purple-bright); border-color: var(--purple-bright); color: #fff; }

/* FIXTURES */
.fixtures-container { min-height: 120px; }
.fixture-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 8px;
  cursor: pointer; transition: all 0.2s;
}
.fixture-card:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.fixture-teams { display: flex; align-items: center; gap: 14px; flex: 1; }
.team-side { display: flex; align-items: center; gap: 8px; flex: 1; }
.team-side.away { justify-content: flex-end; }
.team-crest {
  width: 30px; height: 30px; border-radius: 4px;
  object-fit: contain; background: rgba(255,255,255,0.05); padding: 2px;
}
.crest-placeholder {
  width: 30px; height: 30px; border-radius: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: var(--text-muted); font-weight: 700;
}
.team-name { font-weight: 600; font-size: 0.92rem; }
.fixture-score {
  text-align: center; min-width: 80px;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.3rem; color: #fff;
}
.score-live { color: var(--accent-green) !important; }
.fixture-meta { text-align: right; min-width: 90px; }
.fixture-time { color: var(--purple-light); font-weight: 600; font-size: 0.88rem; }
.fixture-status {
  font-size: 0.7rem; padding: 2px 7px; border-radius: 4px;
  margin-top: 4px; display: inline-block; font-weight: 600;
}
.status-live { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.3); }
.status-ft { background: rgba(107,114,128,0.15); color: var(--text-muted); }
.status-scheduled { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.status-ht { background: rgba(245,158,11,0.15); color: var(--accent-gold); }
.match-minute { color: var(--accent-green); font-size: 0.73rem; font-weight: 700; display: block; }
.view-more-btn {
  display: block; width: 100%; margin-top: 10px;
  background: rgba(124,58,237,0.1); border: 1px dashed var(--border-bright);
  color: var(--purple-light); padding: 10px; border-radius: 8px;
  cursor: pointer; font-weight: 600; text-align: center; transition: all 0.2s;
  font-family: 'Inter', sans-serif; font-size: 0.85rem;
}
.view-more-btn:hover {
  background: rgba(124,58,237,0.2); color: #fff; border-style: solid;
}

/* LEAGUE TABLE */
.two-col-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.table-wrapper { overflow-x: auto; }
.league-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.league-table th {
  color: var(--text-muted); font-weight: 600; padding: 7px 5px;
  text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.league-table th:nth-child(2) { text-align: left; }
.league-table td {
  padding: 7px 5px; text-align: center;
  border-bottom: 1px solid rgba(124,58,237,0.07);
}
.league-table td:nth-child(2) { text-align: left; }
.league-table tbody tr:hover { background: rgba(124,58,237,0.07); }
.pos-number { font-weight: 700; font-size: 0.78rem; }
.pos-cl { color: var(--accent-blue) !important; font-weight: 800; }
.pos-el { color: var(--accent-orange) !important; font-weight: 800; }
.pos-conf { color: var(--accent-conf) !important; font-weight: 800; }
.pos-rel { color: var(--accent-red) !important; font-weight: 800; }

/* Zone separator — thin colored line between qualification zones */
.zone-separator td { border-top: 2px solid rgba(124, 58, 237, 0.35) !important; }
.team-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.team-row img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.pts-bold { font-weight: 800; color: #fff; }
.form-badges { display: flex; gap: 2px; justify-content: center; }
.form-badge {
  width: 15px; height: 15px; border-radius: 3px; font-size: 0.58rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.form-w { background: var(--accent-green); }
.form-d { background: var(--text-muted); }
.form-l { background: var(--accent-red); }
.table-legend { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.73rem; color: var(--text-muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.champions { background: var(--accent-blue); }
.legend-dot.europa { background: var(--accent-orange); }
.legend-dot.conference { background: var(--accent-conf); }
.legend-dot.relegation { background: var(--accent-red); }

/* PLAYER STATS */
.stats-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.stats-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  font-size: 0.78rem; font-weight: 500; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.stats-tab svg { width: 13px; height: 13px; }
.stats-tab:hover { border-color: var(--border-bright); color: #fff; }
.stats-tab.active { background: var(--purple-bright); border-color: var(--purple-bright); color: #fff; }
.stats-content { min-height: 200px; }
.player-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border); transition: all 0.2s;
}
.player-row:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.player-rank { width: 22px; text-align: center; font-weight: 700; color: var(--text-muted); font-size: 0.82rem; flex-shrink: 0; }
.player-rank.top3 { color: var(--accent-gold); }
.player-info { flex: 1; }
.player-name { font-weight: 600; font-size: 0.88rem; }
.player-team { color: var(--text-muted); font-size: 0.73rem; margin-top: 2px; }
.player-stat {
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 1.1rem; color: var(--purple-light);
}

/* SQUADS */
.teams-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.team-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 10px; text-align: center;
  cursor: pointer; transition: all 0.25s;
}
.team-card:hover {
  border-color: var(--border-bright); background: var(--bg-card-hover);
  transform: translateY(-2px); box-shadow: var(--shadow-purple);
}
.team-card img { width: 44px; height: 44px; object-fit: contain; margin: 0 auto 8px; display: block; }
.team-crest-placeholder {
  width: 44px; height: 44px; border-radius: 50%; background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--text-muted); font-size: 0.75rem; margin: 0 auto 8px;
}
.team-card-name { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); line-height: 1.3; }
.squad-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(124,58,237,0.12); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 7px 14px; border-radius: 8px;
  cursor: pointer; font-size: 0.83rem; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.back-btn:hover { background: rgba(124,58,237,0.28); color: #fff; }
.squad-team-info { display: flex; align-items: center; gap: 12px; }
.squad-team-info img { width: 38px; height: 38px; object-fit: contain; }
.squad-team-info h3 { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 700; }
.squad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.squad-player {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  display: flex; align-items: center; gap: 10px; transition: all 0.2s;
}
.squad-player:hover { border-color: var(--border-bright); }
.squad-player-num {
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 800;
  color: var(--purple-light); min-width: 22px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.squad-player-num.jersey-updated {
  color: var(--accent-gold);
  transform: scale(1.15);
  animation: jersey-pulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes jersey-pulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.4); filter: brightness(1.6); color: var(--accent-gold); }
  100% { transform: scale(1.15); filter: brightness(1); }
}
.squad-player-info .player-name { font-weight: 600; font-size: 0.83rem; }
.squad-player-info .player-pos { color: var(--text-muted); font-size: 0.7rem; margin-top: 2px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.match-modal {
  background: var(--bg-secondary); border: 1px solid var(--border-bright);
  border-radius: var(--radius); width: 100%; max-width: 660px;
  max-height: 85vh; overflow-y: auto; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124,58,237,0.2);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.08); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 10;
}
.modal-close:hover { background: rgba(255,255,255,0.18); }
.modal-content { padding: 28px; }
.modal-score-header { text-align: center; margin-bottom: 20px; }
.modal-teams { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 10px; }
.modal-team { text-align: center; min-width: 100px; }
.modal-team img { width: 52px; height: 52px; object-fit: contain; margin-bottom: 8px; }
.modal-team-name { font-weight: 700; font-size: 0.88rem; }
.modal-score-display {
  font-family: 'Outfit', sans-serif; font-size: 2.8rem; font-weight: 900; color: var(--purple-light);
}
.modal-status-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 7px 18px; background: rgba(124,58,237,0.12);
  border-radius: 20px; margin: 10px auto 0; width: fit-content; font-size: 0.82rem;
}
.modal-events h4 {
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 20px;
}
.event-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.83rem;
}
.event-minute { color: var(--purple-light); font-weight: 700; min-width: 32px; }
.event-icon { font-size: 0.95rem; }
.event-player { font-weight: 600; }
.event-team { color: var(--text-muted); font-size: 0.73rem; margin-left: auto; }
.modal-stats-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 20px; }
.stat-row { display: contents; }
.stat-home, .stat-away { font-size: 0.88rem; font-weight: 600; }
.stat-home { text-align: right; }
.stat-label { text-align: center; color: var(--text-muted); font-size: 0.75rem; padding: 4px 10px; }

/* LOADING & EMPTY */
.loading-state, .empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 44px; gap: 12px; color: var(--text-muted);
}
.empty-state svg { opacity: 0.25; }
/* ── Universal Soccer Ball Loader ────────────────────────────────────────
   Use: <div class="ball-loader"><div class="bl-spin"><svg…</svg></div><div class="bl-shadow"></div></div>
   Size variants: .ball-loader--sm (24px)  |  default (38px)  |  .ball-loader--lg (56px)
   ─────────────────────────────────────────────────────────────────────── */
.ball-loader {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ball-loader--sm { width: 24px; height: 24px; }
.ball-loader--lg { width: 56px; height: 56px; }

/* The rotating wrapper — transform ONLY, zero filter */
.bl-spin {
  width: 100%; height: 100%;
  animation: blSpin 0.7s linear infinite;
  will-change: transform;
}
@keyframes blSpin { to { transform: rotate(360deg); } }

/* Inline SVG inside .bl-spin — no CSS filter applied */
.bl-spin svg { width: 100%; height: 100%; display: block; }

/* Subtle ground shadow that bounces — opacity only */
.bl-shadow {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 70%; height: 6px;
  border-radius: 50%;
  background: rgba(168,85,247,0.35);
  filter: blur(4px);
  animation: blShadow 0.7s ease-in-out infinite alternate;
  will-change: opacity;
}
@keyframes blShadow {
  from { opacity: 0.25; transform: translateX(-50%) scaleX(0.6); }
  to   { opacity: 0.6;  transform: translateX(-50%) scaleX(1); }
}

/* ── Legacy .spinner kept for backwards safety — maps to ball-loader look ── */
.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23fff' stroke='%23111' stroke-width='3'/%3E%3Cpolygon points='50,30 33,42 40,63 60,63 67,42' fill='%23111'/%3E%3Cline x1='50' y1='30' x2='50' y2='5' stroke='%23111' stroke-width='2'/%3E%3Cline x1='33' y1='42' x2='10' y2='35' stroke='%23111' stroke-width='2'/%3E%3Cline x1='40' y1='63' x2='25' y2='85' stroke='%23111' stroke-width='2'/%3E%3Cline x1='60' y1='63' x2='75' y2='85' stroke='%23111' stroke-width='2'/%3E%3Cline x1='67' y1='42' x2='90' y2='35' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: blSpin 0.7s linear infinite;
  will-change: transform;
}
.hidden { display: none !important; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 10px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-brand .footer-logo { font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 800; }
.footer-brand p { color: var(--text-muted); font-size: 0.78rem; margin-top: 3px; }
.footer-copy { color: var(--text-muted); font-size: 0.76rem; }



/* RESPONSIVE */
@media (max-width: 1024px) {
  .teams-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .two-col-layout { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .teams-grid { grid-template-columns: repeat(3, 1fr); }
  .squad-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .brand-name { font-size: 1.7rem; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .teams-grid { grid-template-columns: repeat(2, 1fr); }
  .squad-grid { grid-template-columns: 1fr; }
  .fixture-teams { flex-direction: column; gap: 6px; }
  .fixture-card { flex-wrap: wrap; }
  .modal-teams { gap: 10px; }
}

/* WORLD CUP / TOURNAMENT STYLES — Fully Animated */
.world-cup-groups-grid {
  margin-top: 15px;
}

/* ── Tournament Banner ── */
.wc-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 20px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245,158,11,0.4);
  animation: wcBannerIn 0.6s ease both;
}
@keyframes wcBannerIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Real photo banner */
.wc-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.85;
  filter: brightness(0.65) saturate(1.2);
}
/* Gradient overlay on top of the photo so text pops */
.wc-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,15,0.35) 0%,
    rgba(10,10,15,0.6) 100%
  );
  pointer-events: none;
}
/* Fallback gradient (no image) */
.wc-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(245,158,11,0.18) 0%,
    rgba(124,58,237,0.15) 50%,
    rgba(245,158,11,0.08) 100%
  );
  background-size: 200% 200%;
  animation: wc-gradient-shift 4s ease infinite alternate;
}
@keyframes wc-gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.wc-banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px;
}
.wc-banner-over-img .wc-banner-title {
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}
.wc-banner-over-img .wc-banner-sub {
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.wc-banner-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #fff, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.wc-banner-sub {
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.85;
}
.wc-banner-balls {
  font-size: 1.4rem;
  margin-top: 8px;
  animation: wc-balls-bounce 2s ease-in-out infinite;
}
@keyframes wc-balls-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ── WC Legend ── */
.wc-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.wc-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}
.wc-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.wc-legend-dot.advance { background: rgba(59,130,246,0.8); }
.wc-legend-dot.third   { background: rgba(245,158,11,0.8); }

/* ── Groups Inner Grid ── */
.wc-groups-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

/* ── Group Card ── */
.wc-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(24px);
  animation: wcCardIn 0.45s ease var(--g-delay, 0ms) both;
}
@keyframes wcCardIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wc-group-card:hover {
  border-color: rgba(245,158,11,0.45);
  box-shadow: 0 8px 32px rgba(245,158,11,0.12), 0 0 0 1px rgba(245,158,11,0.1);
  transform: translateY(-3px);
}

/* ── Group Header ── */
.wc-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, rgba(245,158,11,0.15) 0%, rgba(124,58,237,0.1) 100%);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}
.wc-group-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4);
}
.wc-group-trophy {
  margin-left: auto;
  font-size: 1.1rem;
  opacity: 0.7;
}

/* ── Group Table ── */
.wc-group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.wc-group-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.wc-group-table th:nth-child(2),
.wc-group-table td:nth-child(2) {
  text-align: left;
}
.wc-group-table td {
  padding: 9px 6px;
  text-align: center;
  transition: background 0.2s;
}

/* ── Row Status Colors ── */
.wc-row-advance {
  border-left: 3px solid rgba(59,130,246,0.7);
}
.wc-row-advance td:first-child { padding-left: 10px; }
.wc-row-third {
  border-left: 3px solid rgba(245,158,11,0.6);
}
.wc-row-third td:first-child { padding-left: 10px; }
.wc-row-out {
  border-left: 3px solid transparent;
  opacity: 0.7;
}
.wc-group-table tbody tr:not(:last-child) td {
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.wc-team-row-clickable {
  cursor: pointer;
  opacity: 0;
  animation: wcRowIn 0.35s ease var(--r-delay, 0ms) both;
}
@keyframes wcRowIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.wc-row-out { animation-name: wcRowIn; } /* reset opacity for out-rows too */
.wc-team-row-clickable:hover { background: rgba(255,255,255,0.04); }
.wc-row-advance:hover { background: rgba(59,130,246,0.06) !important; }
.wc-row-third:hover   { background: rgba(245,158,11,0.06) !important; }

/* ── Position Badges ── */
.wc-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.75rem;
}
.wc-pos-1 { background: linear-gradient(135deg, #f59e0b, #fcd34d); color: #000; }
.wc-pos-2 { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #000; }
.wc-pos-3 { background: linear-gradient(135deg, #92400e, #b45309); color: #fff; }
.wc-pos-other { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* ── Other WC Table Cells ── */
.wc-team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}
.wc-crest {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.wc-crest-fallback {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wc-team-name {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.wc-num { color: var(--text-muted); }
.wc-gd { font-weight: 700; }
.wc-pts {
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

/* ── AI MATCH PREVIEW ─────────────────────────────────────────────────────── */
.modal-ai-section {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.ai-preview-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,0.18) 0%, rgba(168,85,247,0.12) 100%);
  border: 1px solid var(--border-bright);
  color: var(--purple-light); padding: 14px 20px; border-radius: 12px;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 700;
  transition: all 0.25s; position: relative; overflow: hidden;
  flex-direction: column; gap: 2px;
}
.ai-preview-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.0), rgba(168,85,247,0.1));
  opacity: 0; transition: opacity 0.3s;
}
.ai-preview-btn:hover:not(:disabled)::before { opacity: 1; }
.ai-preview-btn:hover:not(:disabled) {
  border-color: var(--purple-light); color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.ai-preview-btn:disabled { opacity: 0.7; cursor: wait; }
.ai-btn-icon { font-size: 1.3rem; }
.ai-btn-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.ai-preview-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.1) 0%, rgba(10,8,20,0.6) 100%);
  border: 1px solid var(--border-bright); border-radius: 12px; padding: 18px;
  animation: slideUp 0.3s ease;
}
.ai-preview-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.ai-gemini-badge {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff; font-size: 0.72rem; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; letter-spacing: 0.5px;
}
.ai-style-tag {
  font-size: 0.72rem; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px;
}
.ai-preview-text {
  font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 14px;
}
.ai-key-battle {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 8px; padding: 10px 12px; font-size: 0.83rem;
  color: var(--text-secondary); margin-bottom: 14px;
}
.ai-battle-label { color: var(--accent-gold); font-weight: 700; white-space: nowrap; }
.ai-odds { margin-bottom: 14px; }
.ai-odds-bar {
  display: flex; border-radius: 8px; overflow: hidden;
  height: 30px; font-size: 0.7rem; font-weight: 700;
}
.ai-odds-home { background: rgba(59,130,246,0.55); display:flex; align-items:center; justify-content:center; color:#fff; min-width:60px; padding:0 6px; }
.ai-odds-draw { background: rgba(107,114,128,0.55); display:flex; align-items:center; justify-content:center; color:#fff; min-width:50px; padding:0 6px; }
.ai-odds-away { background: rgba(239,68,68,0.55); display:flex; align-items:center; justify-content:center; color:#fff; min-width:60px; padding:0 6px; }
.ai-prediction {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.25);
  border-radius: 8px; padding: 10px 12px; font-size: 0.84rem; color: var(--text-secondary);
}
.ai-pred-icon { font-size: 1rem; flex-shrink: 0; }

/* ── SQUAD AI HINT ──────────────────────────────────────────────────────── */
.squad-ai-hint {
  font-size: 0.72rem; color: var(--purple-light); opacity: 0.75; margin-top: 4px; display: block;
}
.squad-player {
  cursor: pointer; position: relative;
}
.squad-player:hover {
  border-color: var(--purple-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.2);
}
.squad-scout-icon {
  margin-left: auto; font-size: 0.85rem; opacity: 0;
  transition: opacity 0.2s;
}
.squad-player:hover .squad-scout-icon { opacity: 1; }

/* ── SCOUT OVERLAY ──────────────────────────────────────────────────────── */
.scout-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.82);
  backdrop-filter: blur(10px); z-index: 1100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.scout-overlay.hidden { display: none !important; }
.scout-card {
  background: linear-gradient(160deg, #1a1730 0%, #0f0d1e 100%);
  border: 1px solid var(--border-bright); border-radius: 20px;
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  padding: 28px; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 50px rgba(124,58,237,0.18);
  animation: slideUp 0.28s ease;
}
.scout-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 44px; color: var(--text-muted);
}
.scout-spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='45' fill='%23fff' stroke='%23111' stroke-width='3'/%3E%3Cpolygon points='50,30 33,42 40,63 60,63 67,42' fill='%23111'/%3E%3Cline x1='50' y1='30' x2='50' y2='5' stroke='%23111' stroke-width='2'/%3E%3Cline x1='33' y1='42' x2='10' y2='35' stroke='%23111' stroke-width='2'/%3E%3Cline x1='40' y1='63' x2='25' y2='85' stroke='%23111' stroke-width='2'/%3E%3Cline x1='60' y1='63' x2='75' y2='85' stroke='%23111' stroke-width='2'/%3E%3Cline x1='67' y1='42' x2='90' y2='35' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: blSpin 0.7s linear infinite;
  will-change: transform;
}
.scout-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.08); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 0.95rem; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.scout-close:hover { background: rgba(255,255,255,0.2); }
.scout-top {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.scout-avatar {
  width: 60px; height: 60px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple-light));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 1.4rem; font-weight: 900; color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}
.scout-bio { flex: 1; }
.scout-name { font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 800; margin-bottom: 3px; }
.scout-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 5px; }
.scout-archetype {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  color: #fff; padding: 3px 10px; border-radius: 20px;
}
.scout-rating {
  font-family: 'Outfit', sans-serif; font-size: 2.2rem; font-weight: 900;
  color: var(--accent-gold); line-height: 1; text-align: center; flex-shrink: 0;
}
.scout-rating small { display: block; font-size: 0.6rem; color: var(--text-muted); font-family: 'Inter', sans-serif; font-weight: 600; }
.scout-summary { font-size: 0.84rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; }

.scout-market {
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px; padding: 12px; margin-bottom: 16px;
}
.scout-market-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.scout-market-label { color: var(--text-muted); font-weight: 600; }
.scout-market-val { color: var(--text-main); font-weight: 700; text-align: right; max-width: 60%; }
.scout-market-val.value { color: var(--accent-green); }

.scout-lists { display: flex; gap: 12px; margin-bottom: 16px; }
.scout-strengths, .scout-weaknesses { flex: 1; }
.scout-list-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.scout-tag {
  display: inline-block; font-size: 0.74rem; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; margin: 2px 2px 0 0;
}
.strength-tag { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--accent-green); }
.weakness-tag { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: var(--accent-red); }
.scout-stats { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.scout-stat-row { display: flex; align-items: center; gap: 8px; }
.scout-stat-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); width: 28px; flex-shrink: 0; }
.scout-stat-bar { flex: 1; background: rgba(255,255,255,0.07); border-radius: 4px; height: 8px; overflow: hidden; }
.scout-stat-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--purple-bright), var(--purple-light));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.scout-stat-val { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); width: 24px; text-align: right; flex-shrink: 0; }
.scout-legend {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 10px; padding: 10px 12px; font-size: 0.82rem;
  color: var(--text-secondary); margin-bottom: 12px;
}
.scout-legend-icon { font-size: 1rem; flex-shrink: 0; }
.scout-potential { text-align: right; font-size: 0.8rem; color: var(--text-muted); }
.scout-pot-val { color: var(--purple-light); font-weight: 700; font-size: 0.95rem; }

/* ── FOOTYCHAT ──────────────────────────────────────────────────────────── */
.footychat-bubble {
  position: fixed; bottom: 22px; right: 72px; z-index: 500;
  background: linear-gradient(135deg, var(--purple-bright), var(--purple-light));
  border-radius: 30px; padding: 12px 18px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; box-shadow: 0 4px 24px rgba(124,58,237,0.5);
  transition: all 0.25s; user-select: none;
  animation: floatBubble 3s ease-in-out infinite;
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.footychat-bubble:hover {
  box-shadow: 0 6px 30px rgba(124,58,237,0.7);
  transform: scale(1.05) translateY(-2px);
  animation: none;
}
.footychat-bubble-icon { font-size: 1.2rem; }
.footychat-bubble-label { font-size: 0.82rem; font-weight: 700; color: #fff; }

.footychat-panel {
  position: fixed; bottom: 80px; right: 22px; z-index: 500;
  width: 340px; max-height: 500px;
  background: linear-gradient(160deg, #1a1730 0%, #0f0d1e 100%);
  border: 1px solid var(--border-bright); border-radius: 18px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(124,58,237,0.15);
  animation: slideUp 0.25s ease;
  overflow: hidden;
}
.footychat-panel.hidden { display: none !important; }
.footychat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: rgba(124,58,237,0.1);
}
.footychat-title { display: flex; align-items: center; gap: 10px; }
.footychat-icon { font-size: 1.4rem; }
.footychat-name { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.95rem; }
.footychat-sub { font-size: 0.68rem; color: var(--purple-light); }
.footychat-close {
  background: rgba(255,255,255,0.08); border: none; color: var(--text-muted);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 0.85rem; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.footychat-close:hover { background: rgba(255,255,255,0.18); color: #fff; }
.footychat-messages {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-msg { display: flex; max-width: 88%; }
.user-msg { align-self: flex-end; }
.bot-msg  { align-self: flex-start; }
.chat-msg span {
  display: block; padding: 9px 13px; border-radius: 14px;
  font-size: 0.82rem; line-height: 1.5;
}
.user-msg span {
  background: linear-gradient(135deg, var(--purple-bright), var(--purple-light));
  color: #fff; border-bottom-right-radius: 4px;
}
.bot-msg span {
  background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  color: var(--text-secondary); border-bottom-left-radius: 4px;
}
.chat-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.chat-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple-light); animation: chatDot 1.2s infinite;
  padding: 0;
}
.chat-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.footychat-input-row {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border);
}
.footychat-input {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.83rem; outline: none;
  transition: border-color 0.2s;
}
.footychat-input:focus { border-color: var(--purple-bright); }
.footychat-input::placeholder { color: var(--text-muted); }
.footychat-send {
  background: linear-gradient(135deg, var(--purple-bright), var(--purple-light));
  border: none; color: #fff; width: 38px; height: 38px; border-radius: 10px;
  cursor: pointer; font-size: 1rem; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.footychat-send:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(124,58,237,0.45); transform: scale(1.05); }
.footychat-send:disabled { opacity: 0.5; cursor: wait; }

/* ── MOBILE RESPONSIVENESS ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Header */
  .header-inner { flex-direction: column; gap: 16px; align-items: center; }
  .brand { flex-direction: column; text-align: center; gap: 8px; }
  .brand-logo { width: 50px; height: 50px; }
  .brand-name { font-size: 2rem; }
  
  /* Navigation */
  .main-nav {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px; /* space for scrollbar */
    justify-content: flex-start;
  }
  .nav-link { font-size: 0.85rem; padding: 8px 12px; }
  
  /* Features Grid */
  .features-grid { grid-template-columns: 1fr; padding: 16px; }
  
  /* World Cup Grid & Squad Grid */
  .wc-groups-inner, .squad-grid { grid-template-columns: 1fr; gap: 12px; }
  .teams-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  
  /* Table Responsiveness */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
  }
  .league-table th, .league-table td { padding: 8px 6px; font-size: 0.8rem; }
  .team-name-col { max-width: 110px; }
  .form-badge { width: 16px; height: 16px; font-size: 0.5rem; }
  
  /* Stat Cards */
  .stats-grid { grid-template-columns: 1fr; }
  
  /* Modals (Scout) */
  .scout-card { width: 95%; height: auto; max-height: 90vh; padding: 16px; }
  .scout-rating { font-size: 1.8rem; }
  .scout-name { font-size: 1rem; }
  .scout-stats { gap: 4px; }
  .scout-lists { flex-direction: column; gap: 10px; }
  
  /* FootyChat */
  .footychat-bubble { bottom: 16px; right: 16px; padding: 10px 14px; }
  .footychat-panel {
    width: calc(100vw - 32px);
    max-height: 75vh;
    right: 16px;
    bottom: 76px;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   INTRO ANIMATION — ABSOLUTELY SMOOTH EDITION
   Rule: every animated element touches EXACTLY ONE CSS property.
   No filters on moving elements. No dual-transform conflicts.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay container — paint-isolated compositing layer */
#intro-overlay {
  position: fixed; inset: 0;
  background: #06050b;
  z-index: 99999;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* Isolate so the overlay never triggers main-page repaints */
  contain: strict;
  will-change: opacity;
  transition: opacity 0.7s ease, visibility 0.7s;
}
#intro-overlay.fade-out { opacity: 0; visibility: hidden; }

/* Skip button */
#intro-skip {
  position: absolute; top: 20px; right: 20px; z-index: 10;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  padding: 7px 16px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
#intro-skip:hover { background: rgba(255,255,255,0.18); }

/* ── Static background elements (zero animation cost) ── */
.intro-bg-effect {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 60%,
    rgba(109,40,217,0.18) 0%, transparent 70%);
}

/* Speed lines via a translateX-only pseudo-element — no background-position */
.intro-speed-lines {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.intro-speed-lines::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 300%; height: 100%;
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent 38px,
    rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 41px
  );
  /* skewX is baked into the static background; only translateX animates */
  transform: skewX(-12deg) translateX(0);
  animation: speedSlide 1s linear infinite;
  will-change: transform;
}
@keyframes speedSlide {
  to { transform: skewX(-12deg) translateX(-33.33%); }
}

/* Static perspective field — no animation needed, looks great as-is */
.intro-field-perspective {
  position: absolute; bottom: 0; left: -50%; width: 200%; height: 38%;
  background:
    linear-gradient(0deg, rgba(109,40,217,0.12) 0%, transparent 100%),
    repeating-linear-gradient(0deg,
      transparent 0, transparent 48px,
      rgba(255,255,255,0.045) 49px, rgba(255,255,255,0.045) 51px);
  transform: perspective(280px) rotateX(58deg);
  transform-origin: top center;
}

/* ── Scene — fixed size, centred ── */
.intro-scene {
  position: relative;
  width: 640px; height: 280px;
}

/* ─────────────────────────────────────────────────────────────────────────
   PLAYER LAYER SPLIT:
     .intro-player  → handles X-axis only  (run-in animation)
     .player-bob    → handles Y-axis only  (bob animation)
     .player-svg    → STATIC, zero animation, zero filter
     .aura          → handles opacity only (pulse animation)
   Each layer animates exactly ONE property → 100% compositor thread.
   ───────────────────────────────────────────────────────────────────────── */

.intro-player {
  position: absolute;
  bottom: 20px;
  width: 180px; height: 200px;
  display: flex; align-items: flex-end; justify-content: center;
  will-change: transform;
}

/* Layer 1: X translation (run-in) */
.left-player  {
  left: 0;
  animation: leftRunIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.right-player {
  right: 0;
  animation: rightRunIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes leftRunIn {
  from { transform: translateX(-240px); }
  to   { transform: translateX(80px); }
}
@keyframes rightRunIn {
  from { transform: translateX(240px); }
  to   { transform: translateX(-80px); }
}

/* Layer 2: Y bob — on a SEPARATE child div */
.player-bob {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  animation: playerBob 0.5s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes playerBob {
  from { transform: translateY(0);    }
  to   { transform: translateY(-6px); }
}

/* Layer 3: SVG — completely static, NO filter, NO animation */
.player-svg {
  width: 140px; height: 160px;
  display: block;
  /* Coloured outline glow achieved via stroke on the SVG path — not CSS filter */
}
/* Give each SVG its glow colour via a CSS custom property on the stroke */
.purple-svg { --svg-stroke: #a855f7; }
.blue-svg   { --svg-stroke: #3b82f6; }

/* Layer 4: Aura blob — opacity only, no scale, no blur animation */
.aura {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  /* The blur is applied ONCE at paint time — never re-blurred during animation */
  filter: blur(32px);
  animation: auraPulse 1.4s ease-in-out infinite alternate;
  will-change: opacity;
}
.purple-aura {
  background: radial-gradient(circle, rgba(168,85,247,0.9) 0%, transparent 65%);
}
.blue-aura {
  background: radial-gradient(circle, rgba(59,130,246,0.9) 0%, transparent 65%);
}
@keyframes auraPulse {
  /* Opacity only — the blur layer is NEVER invalidated or re-painted */
  from { opacity: 0.35; }
  to   { opacity: 0.72; }
}

/* ─────────────────────────────────────────────────────────────────────────
   BALL LAYER SPLIT:
     .intro-ball         → Y-axis only (hover)
     .ball-spin-wrapper  → Z-rotation only (spin)
     .ball-svg           → STATIC, no filter
     .ball-glow          → opacity only (pulse)
   ───────────────────────────────────────────────────────────────────────── */

.intro-ball {
  position: absolute;
  bottom: 30px;
  left: 50%; transform: translateX(-50%);
  width: 68px; height: 68px;
  z-index: 5;
  animation: ballHover 0.7s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ballHover {
  from { transform: translateX(-50%) translateY(0);    }
  to   { transform: translateX(-50%) translateY(-9px); }
}

.ball-spin-wrapper {
  width: 100%; height: 100%;
  animation: ballSpin 0.8s linear infinite;
  will-change: transform;
}
@keyframes ballSpin {
  to { transform: rotate(360deg); }
}

/* SVG — static, no filter */
.ball-svg {
  width: 100%; height: 100%;
  display: block;
}

/* Glow ring — opacity only, no scale (scale causes blur layer repaint) */
.ball-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251,191,36,0.55) 0%, transparent 70%);
  filter: blur(10px);
  animation: ballGlowPulse 0.7s ease-in-out infinite alternate;
  will-change: opacity;
}
@keyframes ballGlowPulse {
  from { opacity: 0.4; }
  to   { opacity: 0.9; }
}

/* ── Strike phase: .zoom-in added by JS at 1.5 s ── */
/* Players push outward via X only (still a single-property animation) */
.intro-scene.zoom-in .left-player {
  animation: leftStrike 0.35s ease-out forwards;
}
.intro-scene.zoom-in .right-player {
  animation: rightStrike 0.35s ease-out forwards;
}
/* Bob stops — override via a frozen translateY(0) */
.intro-scene.zoom-in .player-bob {
  animation: none;
  transform: translateY(0);
}

@keyframes leftStrike {
  from { transform: translateX(80px);  }
  to   { transform: translateX(155px); }
}
@keyframes rightStrike {
  from { transform: translateX(-80px);  }
  to   { transform: translateX(-155px); }
}

/* Ball: scale + opacity only on the outer wrapper (hover stops, scale takes over) */
.intro-scene.zoom-in .intro-ball {
  animation: ballLaunch 1.1s cubic-bezier(0.9, 0, 0.1, 1) forwards;
  will-change: transform, opacity;
}
@keyframes ballLaunch {
  0%   { transform: translateX(-50%) scale(1);   opacity: 1; }
  12%  { transform: translateX(-50%) scale(0.85); opacity: 1; }
  100% { transform: translateX(-50%) scale(85);   opacity: 0; }
}

/* ── White shockwave flash ── */
.intro-flash {
  position: absolute; inset: 0;
  background: #fff;
  opacity: 0; pointer-events: none; z-index: 9;
  transition: opacity 0.1s linear;
  will-change: opacity;
}
.intro-flash.trigger { opacity: 1; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .intro-scene { transform: scale(0.5); transform-origin: center center; }
}