/* ============================================================
   FIFA WORLD CUP 2026 — styles.css
   Fully Optimised & Responsive for Every Screen
   ============================================================ */

:root {
  --gold: #FFD700;
  --gold-light: #FFE55C;
  --gold-dark: #C9A000;
  --red: #CC0000;
  --red-bright: #FF1A1A;
  --navy: #001D4A;
  --navy-mid: #002966;
  --navy-light: #003580;
  --dark: #050D1A;
  --darker: #020810;
  --white: #FFFFFF;
  --off-white: #F0F4FF;
  --text-muted: #8899BB;
  --card-bg: rgba(0, 30, 80, 0.6);
  --card-border: rgba(255, 215, 0, 0.15);
  --glass: rgba(0, 20, 60, 0.7);

  /* Spacing tokens */
  --page-padding: clamp(5px, 4vw, 5%);
  --body-min-margin: 5px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--darker);
  color: var(--white);
  overflow-x: hidden;
  /* Minimum 5px breathing room on all sides */
  padding: 0 var(--body-min-margin);
  min-width: 320px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
}

/* ============================================================
   PARTICLES
   ============================================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

/* ============================================================
   NAVBAR
   ============================================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--page-padding);
  background: rgba(2, 8, 16, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 12px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo .trophy-icon {
  font-size: 28px;
  animation: glow-pulse 2s ease-in-out infinite;
}

nav .nav-logo-img {
  height: 40px !important;
  width: auto !important;
  display: inline-block !important;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
  transition: filter 0.2s;
}

.nav-logo-img:hover {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5)); }
  50%       { filter: drop-shadow(0 0 14px rgba(255, 215, 0, 1)); }
}

.nav-logo span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1rem, 3vw, 1.4rem);
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), var(--white), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--off-white);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.25s;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--gold);
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.05);
}

.nav-links a.active {
  color: var(--gold);
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(255, 215, 0, 0.08);
}

.blog-nav-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 229, 92, 0.08));
    border: 1px solid var(--gold);
    color: var(--gold) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
    animation: blog-glow-pulse 1.8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
  }

  .blog-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    transition: left 0.5s;
  }

  .blog-nav-btn:hover::before {
    left: 100%;
  }

  .blog-nav-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.7);
    transform: scale(1.02);
  }

  @keyframes blog-glow-pulse {
    0% {
      box-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
      border-color: rgba(255, 215, 0, 0.6);
    }
    50% {
      box-shadow: 0 0 14px rgba(255, 215, 0, 0.8);
      border-color: var(--gold);
    }
    100% {
      box-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
      border-color: rgba(255, 215, 0, 0.6);
    }
  }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: transparent;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
#hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 100px clamp(10px, 4vw, 40px) 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 50, 150, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 20% 100%, rgba(204, 0, 0, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 100%, rgba(0, 100, 200, 0.2) 0%, transparent 60%),
    linear-gradient(180deg, #020810 0%, #001230 40%, #020810 100%);
  z-index: 1;
}

.hero-pitch-lines {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255, 255, 255, 0.5) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255, 255, 255, 0.5) 60px);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.6rem, 2vw, 0.75rem);
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 7vw, 6rem);
  line-height: 0.9;
  letter-spacing: 6px;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-title .fifa {
  color: var(--white);
  margin-right: 16px;
  font-size: 0.55em;
}

.hero-title .world-cup {
  display: block;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shimmer 3s linear infinite, fadeUp 0.8s ease forwards 0.4s;
}

.year {
  display: block;
  color: var(--white);
  font-size: 0.55em;
  letter-spacing: 2px;
  margin-top: 8px;
  margin-left: 16px;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.hero-hosts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.5s;
  flex-wrap: wrap;
}

.host-flag { font-size: clamp(1.2rem, 4vw, 1.8rem); }

.host-sep {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.host-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  letter-spacing: 2px;
  color: var(--off-white);
  text-transform: uppercase;
}

.hero-desc {
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
  padding: 0 10px;
}

.hero-desc strong {
  color: var(--gold);
  font-weight: 600;
}

/* ============================================================
   COUNTDOWN
   ============================================================ */
.countdown-wrapper {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
  margin-bottom: 50px;
  padding: 0 5px;
}

.countdown-label {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.6rem, 2vw, 0.7rem);
  letter-spacing: 4px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.countdown-match-name {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.78rem, 2.5vw, 0.95rem);
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 16px;
  min-height: 1.4em;
  padding: 0 8px;
}

.countdown-grid {
  display: flex;
  gap: clamp(6px, 2vw, 16px);
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.countdown-item {
  background: linear-gradient(135deg, rgba(0, 40, 120, 0.8), rgba(0, 20, 60, 0.9));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: clamp(12px, 3vw, 20px) clamp(12px, 3vw, 24px);
  min-width: clamp(60px, 15vw, 90px);
  position: relative;
  overflow: hidden;
}

.countdown-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.countdown-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  display: block;
}

.countdown-unit {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.5rem, 1.5vw, 0.65rem);
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

.countdown-sep {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  color: var(--gold);
  opacity: 0.4;
  line-height: 1;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.timezone-note {
  font-size: clamp(0.62rem, 2vw, 0.72rem);
  color: var(--text-muted);
  margin-top: 12px;
  letter-spacing: 1px;
  padding: 0 8px;
  line-height: 1.5;
}
/* Live pulse badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(204, 0, 0, 0.2);
  border: 1px solid rgba(255, 50, 50, 0.5);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #FF4444;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FF4444;
  animation: live-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.7); }
}

/* ============================================================
   STATS BANNER
   ============================================================ */
.stats-banner {
  position: relative;
  z-index: 3;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.15), rgba(0, 40, 120, 0.3), rgba(204, 0, 0, 0.15));
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  padding: clamp(16px, 4vw, 30px) var(--page-padding);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 1s;
}

.stat-item {
  text-align: center;
  padding: 10px clamp(8px, 2vw, 20px);
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: rgba(255, 215, 0, 0.2);
}

.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--gold);
  line-height: 1;
  display: block;
}

.stat-label {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.58rem, 1.5vw, 0.75rem);
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   SECTIONS — base layout
   ============================================================ */
section {
  position: relative;
  z-index: 5;
  padding: clamp(40px, 8vw, 80px) var(--page-padding);
}

.section-header {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 50px);
  padding: 0 5px;
}

.section-eyebrow {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.62rem, 2vw, 0.7rem);
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  letter-spacing: 3px;
  color: var(--white);
  line-height: 1;
}

.section-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 16px auto 0;
  border-radius: 2px;
}

/* ============================================================
   LIVE SCORES SECTION
   ============================================================ */
#live-scores {
  padding: clamp(40px, 6vw, 60px) var(--page-padding) clamp(20px, 4vw, 40px);
  max-width: 1300px;
  margin: 0 auto;
}

.live-scores-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.ls-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aaa;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ls-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ls-btn.active {
  background: linear-gradient(135deg, #c8a84b, #f0d070);
  border-color: transparent;
  color: #0a0a12;
  font-weight: 600;
}

.ls-btn.ls-refresh {
  background: rgba(100, 150, 255, 0.12);
  border-color: rgba(100, 150, 255, 0.3);
  color: #88aaff;
}

.ls-btn.ls-refresh:hover {
  background: rgba(100, 150, 255, 0.2);
}

.ls-last-updated {
  font-size: 0.68rem;
  color: #444;
  font-family: 'Inter', sans-serif;
  margin-left: auto;
  white-space: nowrap;
}

.live-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

/* Live Score Card */
.ls-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.3s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.ls-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 168, 75, 0.3);
}

.ls-card-live {
  border-color: rgba(255, 60, 60, 0.4) !important;
  animation: ls-pulse-border 2.5s ease-in-out infinite;
}

@keyframes ls-pulse-border {
  0%, 100% { border-color: rgba(255, 60, 60, 0.4); box-shadow: 0 0 0 rgba(255, 60, 60, 0); }
  50%       { border-color: rgba(255, 60, 60, 0.8); box-shadow: 0 0 12px rgba(255, 60, 60, 0.15); }
}

.ls-card-live::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #ff3c3c, #ff8800);
  border-radius: 12px 0 0 12px;
}

.ls-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 6px;
}

.ls-stage {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #556;
}

/* Status badges */
.ls-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ls-badge-live {
  background: rgba(255, 50, 50, 0.15);
  color: #ff6666;
  border: 1px solid rgba(255, 50, 50, 0.3);
}

.ls-badge-ht {
  background: rgba(255, 165, 0, 0.15);
  color: #ffaa44;
  border: 1px solid rgba(255, 165, 0, 0.3);
}

.ls-badge-ft {
  background: rgba(80, 200, 80, 0.12);
  color: #66cc66;
  border: 1px solid rgba(80, 200, 80, 0.25);
}

.ls-badge-sched {
  background: rgba(100, 150, 255, 0.1);
  color: #7799dd;
  border: 1px solid rgba(100, 150, 255, 0.2);
}

.ls-badge-pp {
  background: rgba(200, 100, 50, 0.1);
  color: #cc8844;
  border: 1px solid rgba(200, 100, 50, 0.2);
}

.ls-teams-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.ls-team-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ls-team-name {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #ccc;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}

.ls-score-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 72px;
  flex-shrink: 0;
}

.ls-score-live {
  background: rgba(255, 50, 50, 0.08);
  border-color: rgba(255, 50, 50, 0.3);
}

.ls-score-nums {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
}

.ls-score-dash {
  color: #556;
  margin: 0 2px;
}

.ls-ht-score {
  font-size: 0.58rem;
  color: #556;
  font-family: 'Inter', sans-serif;
  margin-top: 3px;
}

.ls-score-time {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  color: #7799dd;
  line-height: 1.4;
}

.ls-venue {
  margin-top: 10px;
  font-size: 0.6rem;
  color: #445;
  font-family: 'Inter', sans-serif;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 8px;
}

/* Loading / Empty / Error states */
.ls-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 50px 20px;
  color: #556;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
}

.ls-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: #c8a84b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ls-empty,
.ls-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #556;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.8;
}

.ls-retry-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aaa;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  font-size: 0.75rem;
}

.ls-retry-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* API status dot */
.ls-api-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #556;
  margin-right: 5px;
  vertical-align: middle;
  transition: background 0.3s;
  flex-shrink: 0;
}

.ls-api-dot.ok  { background: #44dd44; box-shadow: 0 0 6px #44dd44; }
.ls-api-dot.err { background: #dd4444; }

/* ============================================================
   FILTER TABS — SCROLL CONTAINER
   ============================================================ */
.filter-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
  /* account for body padding */
  margin-left: calc(-1 * var(--body-min-margin));
  margin-right: calc(-1 * var(--body-min-margin));
  padding-left: var(--body-min-margin);
  padding-right: var(--body-min-margin);
}

.filter-scroll::-webkit-scrollbar {
  height: 4px;
}
.filter-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.filter-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 4px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  /* Never wrap — scroll instead */
  flex-wrap: nowrap;
  width: max-content;
  padding: 4px 2px 2px;
}

/* Squad tabs CAN wrap on large screens */
#squad-tabs.filter-tabs {
  flex-wrap: wrap;
  width: auto;
  justify-content: center;
}

.tab-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: rgba(0, 20, 60, 0.5);
  color: var(--text-muted);
  transition: all 0.2s;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  border-color: rgba(255, 215, 0, 0.5);
  color: var(--gold);
  background: rgba(255, 215, 0, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  color: var(--dark);
  font-weight: 700;
}

.tab-btn.today-btn {
  border-color: rgba(255, 80, 80, 0.5);
  color: #FF8888;
  background: rgba(255, 50, 50, 0.08);
}

.tab-btn.today-btn.active {
  background: linear-gradient(135deg, #990000, #CC0000);
  border-color: #FF4444;
  color: var(--white);
}

/* ============================================================
   SORT ROW
   ============================================================ */
.sort-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  max-width: 1300px;
  margin: 0 auto 12px;
  padding: 0 var(--body-min-margin);
  flex-wrap: wrap;
}

.sort-toggle-row span {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sort-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}

.sort-btn:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  color: #ffd700;
}

.sort-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  color: #ffd700;
}

/* ============================================================
   MATCHES
   ============================================================ */
#matches {
  background: linear-gradient(180deg, #020810 0%, #010820 50%, #020810 100%);
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 14px;
}

.match-date-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.72rem, 2.5vw, 0.85rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffd700;
  opacity: 0.85;
}

.match-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(255, 215, 0, 0.3), transparent);
}

.match-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.match-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
}

.match-card:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.05);
}

.match-card.today-match {
  border-color: rgba(255, 215, 0, 0.35);
  background: rgba(0, 40, 100, 0.75);
}

.match-card.today-match::before {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.7), transparent);
}

.match-card.live-match {
  border-color: rgba(255, 50, 50, 0.5);
  background: rgba(80, 0, 0, 0.35);
}

.match-card.live-match::before {
  background: linear-gradient(90deg, transparent, rgba(255, 60, 60, 0.7), transparent);
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 6px;
}

.match-stage {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  background: rgba(255, 215, 0, 0.1);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-matchday {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-live {
  background: rgba(255, 30, 30, 0.2);
  color: #FF5555;
  border: 1px solid rgba(255, 50, 50, 0.4);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.status-ft {
  background: rgba(0, 200, 100, 0.1);
  color: #44CC88;
  border: 1px solid rgba(0, 200, 100, 0.3);
}

.status-today {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.status-soon {
  background: rgba(100, 150, 255, 0.1);
  color: #99BBFF;
  border: 1px solid rgba(100, 150, 255, 0.3);
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.team-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.team-flag-img {
  width: 40px;
  height: 30px;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.team-flag-img span.fi {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.team-name {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.7rem, 2.5vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--off-white);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

.match-vs-box {
  text-align: center;
  flex: 0 0 auto;
  min-width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vs-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 3px;
  line-height: 1;
}

.vs-text.score-ft {
  color: var(--gold);
  font-size: 1.5rem;
  letter-spacing: 4px;
}

.match-score-bottom {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  line-height: 1;
}

.match-info {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.match-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 110px;
}

.match-venue {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  flex: 1;
  min-width: 110px;
}

.match-footer {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 6px;
}

.match-status-tag {
  font-family: 'Oswald', sans-serif;
  font-size: 0.56rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 200, 100, 0.08);
  color: #44cc88;
  border: 1px solid rgba(0, 200, 100, 0.2);
  flex-shrink: 0;
}

.match-status-live {
  background: rgba(255, 30, 30, 0.12);
  color: #ff5555;
  border-color: rgba(255, 50, 50, 0.3);
}

.no-matches {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  grid-column: 1 / -1;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 2px;
  font-size: 1rem;
}

/* ============================================================
   TEAMS
   ============================================================ */
#teams {
  background: linear-gradient(180deg, #020810 0%, #00101E 100%);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 12px;
}

.team-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.team-card:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.team-card .flag-wrap {
  width: 52px;
  height: 39px;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.team-card .flag-wrap span.fi {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.team-card .t-name {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.78rem, 2.5vw, 0.88rem);
  font-weight: 600;
  color: var(--white);
  display: block;
  letter-spacing: 0.5px;
  word-break: break-word;
  hyphens: auto;
}

.team-card .t-group {
  font-size: 0.7rem;
  color: var(--gold);
  display: block;
  margin: 3px 0;
  letter-spacing: 1px;
}

.team-card .t-code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  display: block;
}

/* ============================================================
   GROUP STANDINGS
   ============================================================ */
#groups {
  background: linear-gradient(180deg, #00101E 0%, #020810 100%);
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 20px;
}

.group-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s;
}

.group-card:hover {
  border-color: rgba(255, 215, 0, 0.35);
}

.group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.2), rgba(0, 40, 120, 0.4));
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.group-card-header .g-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 3px;
  color: var(--gold);
}

.group-card-header .trophy {
  font-size: 1.1rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
}

.standings-table th {
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-table th:nth-child(2) {
  text-align: left;
}

.standings-table td {
  padding: 8px 6px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--off-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.standings-table td:nth-child(2) {
  text-align: left;
}

.standings-table tr:last-child td {
  border-bottom: none;
}

.standings-table tr:hover td {
  background: rgba(255, 215, 0, 0.04);
}

.pos-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
}

.pos-num.top   { color: var(--gold); }
.pos-num.third { color: #88AADD; }

.s-team {
  display: flex;
  align-items: center;
  gap: 5px;
}

.s-flag-img {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.s-flag-img span.fi {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.s-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.qual-marker {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

.qual-q { background: var(--gold); }
.qual-3 { background: #88AADD; }

/* ============================================================
   STADIUMS
   ============================================================ */
#stadiums {
  background: linear-gradient(180deg, #020810 0%, #010820 100%);
}

.stadiums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 18px;
}

.stadium-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px 18px;
  transition: all 0.25s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.stadium-card::after {
  content: '🏟️';
  position: absolute;
  bottom: -10px;
  right: 10px;
  font-size: 4.5rem;
  opacity: 0.04;
  pointer-events: none;
}

.stadium-card:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.stadium-country {
  font-size: 0.63rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-family: 'Oswald', sans-serif;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stadium-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stadium-city {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.stadium-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.st-stat {
  background: rgba(0, 30, 80, 0.5);
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.st-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.st-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================================================
   SQUADS
   ============================================================ */
#squads {
  background: linear-gradient(180deg, #010820 0%, #020810 100%);
}

.squads-filter-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 4vw, 40px);
  padding: 0 5px;
}

.squad-search {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  background: rgba(0, 20, 60, 0.6);
  color: var(--white);
  width: min(260px, 100%);
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.squad-search::placeholder {
  color: var(--text-muted);
}

.squad-search:focus {
  border-color: rgba(255, 215, 0, 0.7);
}

/* Squad filter tabs — scrollable on small screens */
#squad-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
  /* Allow full-width scrolling on mobile */
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-bottom: 4px;
}

/* On very small screens, switch to horizontal scroll */
@media (max-width: 600px) {
  #squad-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 4px 0 6px;
    /* Extend beyond body padding so edge-to-edge scroll works */
    margin-left: calc(-1 * var(--body-min-margin));
    margin-right: calc(-1 * var(--body-min-margin));
    padding-left: var(--body-min-margin);
    padding-right: var(--body-min-margin);
    width: calc(100% + 2 * var(--body-min-margin));
  }
}

.squads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.squad-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s, transform 0.25s;
}

.squad-card:hover {
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-3px);
}

.squad-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(0, 40, 120, 0.5), rgba(204, 0, 0, 0.15));
  border-bottom: 1px solid rgba(255, 215, 0, 0.12);
  cursor: pointer;
  user-select: none;
}

.squad-flag-wrap {
  width: 48px;
  height: 36px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.squad-flag-wrap span.fi {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.squad-header-info {
  flex: 1;
  min-width: 0;
}

.squad-country-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 2px;
  color: var(--white);
  display: block;
  line-height: 1;
}

.squad-group-badge {
  font-family: 'Oswald', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
}

.squad-toggle-icon {
  font-size: 1.1rem;
  color: var(--gold);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.squad-toggle-icon.open {
  transform: rotate(180deg);
}

.squad-body {
  display: none;
  padding: 0 18px 16px;
}

.squad-body.open {
  display: block;
}

.squad-pos-group {
  margin-top: 14px;
}

.squad-pos-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.63rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.squad-players {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.player-chip {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--off-white);
  background: rgba(0, 30, 90, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.player-chip:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
  color: var(--gold);
}

.player-chip.highlight {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.5);
  color: var(--gold);
}

/* ============================================================
   API DATA SECTION
   ============================================================ */
#api-data {
  padding: clamp(40px, 6vw, 60px) var(--page-padding) clamp(40px, 8vw, 80px);
  max-width: 1400px;
  margin: 0 auto;
}

/* Tab nav */
.api2-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.api2-nav.reveal.visible {
  display: flex;
}

.api2-tab {
  font-family: 'Oswald', sans-serif;
  font-size: 0.76rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: rgba(0, 20, 60, 0.5);
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.api2-tab:hover {
  border-color: rgba(255, 215, 0, 0.5);
  color: var(--gold);
  background: rgba(255, 215, 0, 0.06);
}

.api2-tab.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-color: var(--gold);
  color: var(--dark);
  font-weight: 700;
}

.api2-panel {
  display: none;
}

.api2-panel.active {
  display: block;
  animation: fadeUp 0.4s ease forwards;
}

.api2-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(204, 0, 0, 0.15), rgba(0, 40, 120, 0.4));
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 10px 10px 0 0;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  color: var(--gold);
  text-transform: uppercase;
  gap: 10px;
  flex-wrap: wrap;
}

.api2-refresh {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid rgba(100, 150, 255, 0.3);
  background: rgba(100, 150, 255, 0.1);
  color: #88aaff;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.api2-refresh:hover {
  background: rgba(100, 150, 255, 0.22);
  border-color: rgba(100, 150, 255, 0.6);
  color: #bbccff;
}

.api2-loader-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 20px 16px;
  min-height: 160px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-x: auto;
}

.api2-error {
  text-align: center;
  color: #cc6644;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  padding: 40px 20px;
  background: rgba(200, 50, 20, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(200, 80, 40, 0.2);
  margin: 8px 0;
}

/* Standings panel */
.api2-standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

#api2-standings-body .group-card {
  margin-bottom: 0;
  border-radius: 12px;
}

#api2-standings-body .standings-table th {
  background: rgba(0, 20, 60, 0.6);
  padding: 9px 8px;
}

#api2-standings-body .standings-table td {
  padding: 9px 8px;
}

#api2-scorers-body .standings-table th,
#api2-scorers-body .standings-table td {
  padding: 9px 8px;
}

#api2-scorers-body .standings-table tbody tr:first-child td {
  background: rgba(255, 215, 0, 0.07);
}

#api2-scorers-body .standings-table tbody tr:nth-child(2) td,
#api2-scorers-body .standings-table tbody tr:nth-child(3) td {
  background: rgba(255, 215, 0, 0.03);
}

/* Crests panel */
#api2-crests-body .team-card {
  width: 100%;
  padding: 16px 10px;
}

#api2-crests-body .team-card img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin: 0 auto 8px;
}

/* ============================================================
   HEAD-TO-HEAD
   ============================================================ */
.h2h-match-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s;
}

.h2h-match-block:last-child {
  margin-bottom: 0;
}

.h2h-match-block:hover {
  border-color: rgba(255, 215, 0, 0.35);
}

.h2h-match-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(0, 40, 120, 0.5), rgba(204, 0, 0, 0.12));
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.h2h-fixture {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.h2h-team {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--off-white);
}

.h2h-wc-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  letter-spacing: 3px;
  color: var(--gold);
  padding: 0 6px;
}

.h2h-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.h2h-date {
  font-family: 'Oswald', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.h2h-status-tag {
  font-family: 'Oswald', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.h2h-status-ft {
  background: rgba(0, 200, 100, 0.1);
  color: #44cc88;
  border: 1px solid rgba(0, 200, 100, 0.3);
}

.h2h-status-live {
  background: rgba(255, 30, 30, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 50, 50, 0.35);
  animation: badge-pulse 1.5s ease-in-out infinite;
}

.h2h-status-sched {
  background: rgba(100, 150, 255, 0.1);
  color: #7799dd;
  border: 1px solid rgba(100, 150, 255, 0.2);
}

.h2h-history-area {
  padding: 12px 16px;
}

.h2h-agg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 12px;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.h2h-agg-team {
  font-family: 'Oswald', sans-serif;
  font-size: 0.76rem;
  letter-spacing: 1px;
  color: var(--off-white);
  flex: 1;
}

.h2h-agg-team:last-child {
  text-align: right;
}

.h2h-agg-wins {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 1px;
  padding: 0 5px;
}

.h2h-agg-draws {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.h2h-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.h2h-row:last-child {
  border-bottom: none;
}

.h2h-row-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}

.h2h-row-match {
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  color: var(--off-white);
  flex: 1;
  min-width: 0;
}

.h2h-row-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin: 0 4px;
}

.h2h-row-comp {
  font-size: 0.6rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.h2h-no-history {
  text-align: center;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  padding: 14px 0;
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--darker);
  border-top: 1px solid rgba(255, 215, 0, 0.15);
  position: relative;
  z-index: 5;
  padding: clamp(36px, 6vw, 60px) var(--page-padding) 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-nav-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.footer-nav-title {
  font-family: 'Oswald', sans-serif;
  font-size: 0.63rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.footer-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  display: block;
}

.footer-nav a:hover {
  color: var(--gold);
}

.footer-brand-col {
  flex: 0 0 auto;
  align-items: flex-start;
  text-align: left;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.3));
}

.footer-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  line-height: 1.9;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  color: rgba(136, 153, 187, 0.5);
  letter-spacing: 0.5px;
  text-align: center;
}

.footer-bottom-sep { opacity: 0.3; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Large desktops (1200px+) ── */
@media (min-width: 1200px) {
  .groups-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Tablets landscape / small desktops (1024px and below) ── */
@media (max-width: 1024px) {
  .groups-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .api2-standings-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  }
}

/* ── Tablets portrait (768px and below) ── */
@media (max-width: 768px) {
  :root {
    --page-padding: clamp(5px, 3vw, 20px);
  }

  /* Nav: switch to hamburger */
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(2, 8, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    flex-direction: column;
    padding: 14px var(--page-padding);
    gap: 4px;
    z-index: 999;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  /* Groups: 1 column */
  .groups-grid {
    grid-template-columns: 1fr;
  }

  /* Matches: 1 column on very narrow, 2 on tablet */
  .matches-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  }

  /* Squads */
  .squads-grid {
    grid-template-columns: 1fr;
  }

  /* API panel header */
  .api2-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* H2H */
  .h2h-match-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .h2h-agg-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .h2h-agg-team:last-child {
    text-align: center;
  }

  .h2h-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .h2h-row-date {
    min-width: unset;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .footer-nav-col {
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }

  .footer-bottom-sep {
    display: none;
  }
}

/* ── Mobile (600px and below) ── */
@media (max-width: 600px) {
  :root {
    --page-padding: 5px;
  }

  /* Stats banner: 2 columns */
  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  /* Countdown */
  .countdown-grid {
    gap: 6px;
  }

  .countdown-item {
    padding: 12px 10px;
    min-width: 56px;
    border-radius: 8px;
  }

  .countdown-num {
    font-size: 1.9rem;
  }

  .countdown-unit {
    font-size: 0.5rem;
    letter-spacing: 1px;
  }

  .countdown-sep {
    font-size: 1.6rem;
  }

  /* Live scores controls: wrap tightly */
  .live-scores-controls {
    gap: 6px;
  }

  .ls-btn {
    font-size: 0.7rem;
    padding: 7px 11px;
  }

  .ls-last-updated {
    width: 100%;
    margin-left: 0;
    text-align: right;
  }

  /* Match cards: single column */
  .matches-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Teams: 2 columns */
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Stadiums: 1 column */
  .stadiums-grid {
    grid-template-columns: 1fr;
  }

  /* Squads: 1 column */
  .squads-grid {
    grid-template-columns: 1fr;
  }

  /* Squad search full width */
  .squad-search {
    width: 100%;
  }

  /* Squad tabs: horizontal scroll on mobile */
  #squad-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    width: calc(100% + 10px);
    margin-left: -5px;
    margin-right: -5px;
    padding-left: 5px;
    padding-right: 5px;
    padding-bottom: 6px;
  }

  /* Tab buttons: slightly smaller on mobile */
  .tab-btn {
    font-size: 0.7rem;
    padding: 7px 12px;
  }

  /* API tabs: 2 per row */
  .api2-tab {
    font-size: 0.7rem;
    padding: 8px 12px;
  }

  /* Group card: tighter */
  .groups-grid {
    gap: 14px;
  }

  /* Standings table: smaller text */
  .standings-table th,
  .standings-table td {
    font-size: 0.72rem;
    padding: 6px 4px;
  }

  .s-name {
    max-width: 70px;
    font-size: 0.72rem;
  }

  /* Hero */
  .hero-title .fifa {
    margin-right: 8px;
  }

  .year {
    margin-left: 8px;
  }

  /* Sort row */
  .sort-toggle-row {
    justify-content: flex-start;
  }

  /* Footer */
  .footer-brand {
    flex-wrap: wrap;
    gap: 8px;
  }

  .footer-logo-text {
    font-size: 1.2rem;
  }
}

/* ── Very small phones (380px and below) ── */
@media (max-width: 380px) {
  .countdown-item {
    padding: 10px 8px;
    min-width: 50px;
  }

  .countdown-num {
    font-size: 1.6rem;
  }

  .countdown-sep {
    font-size: 1.3rem;
  }

  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .team-card {
    padding: 14px 8px;
  }

  .team-card .flag-wrap {
    width: 44px;
    height: 33px;
  }

  .match-card {
    padding: 14px 12px;
  }

  .tab-btn {
    font-size: 0.66rem;
    padding: 6px 10px;
  }

  .ls-btn {
    font-size: 0.66rem;
    padding: 6px 9px;
  }

  .section-title {
    font-size: 1.6rem;
    letter-spacing: 2px;
  }

  .hero-title {
    letter-spacing: 3px;
  }

  .hero-title .fifa,
  .year {
    margin: 0;
  }
}

/* ============================================================
   PRINT / ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Ensure tap targets are large enough on touch devices */
@media (hover: none) and (pointer: coarse) {
  .tab-btn,
  .ls-btn,
  .api2-tab,
  .sort-btn,
  .nav-links a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .player-chip {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
}