/* ================================================================
   MILA MPALA — Design System 3.0
   "Mila Mpala" — premium football data aesthetic
   Dark-first dual theme · cool purple / arctic blue palette
   ================================================================ */

/* --- Font imports --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ================================================================
   1. DESIGN TOKENS — DARK THEME (default)
   ================================================================ */
:root {
  /* --- Palette: Cool Purple Dark --- */
  --c-bg-abyss:       #1a1520;
  --c-bg-deep:        #1f1a28;
  --c-bg-base:        #252030;
  --c-bg-surface:     #2a2535;
  --c-bg-raised:      #352f42;
  --c-bg-hover:       #403850;

  /* --- Nav gradient anchors --- */
  --c-nav-from:       #1a1520;
  --c-nav-to:         #252030;

  /* --- Accent spectrum --- */
  --c-accent-purple:  #6366f1;
  --c-accent-blue:    #8b5cf6;
  --c-accent-indigo:  #a78bfa;
  --c-accent-violet:  #c4b5fd;

  /* --- Score / highlight / live --- */
  --c-score:          #ec4899;
  --c-live:           #ec4899;
  --c-live-glow:      rgba(236, 72, 153, 0.4);
  --c-gold:           #fbbf24;
  --c-finished:       #64748b;
  --c-scheduled:      #38bdf8;

  /* --- Text --- */
  --c-text-primary:   #f1f5f9;
  --c-text-secondary: #94a3b8;
  --c-text-muted:     #64748b;

  /* --- Borders --- */
  --c-border:         rgba(99, 102, 241, 0.10);
  --c-border-hover:   rgba(99, 102, 241, 0.30);
  --c-border-active:  rgba(99, 102, 241, 0.55);

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-score: 0 0 12px rgba(236, 72, 153, 0.3);

  /* --- Typography --- */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* --- Spacing --- */
  --sp-2xs: 2px;
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;

  /* --- Radii --- */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* --- Transitions --- */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:  150ms;
  --dur-norm:  250ms;
  --dur-slow:  400ms;

  /* --- Layout --- */
  --nav-h:       80px;
  --sidebar-w:   300px;
  --content-max: 1200px;
  --footer-h:    48px;

  /* --- Noise texture (inline SVG) --- */
  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ================================================================
   2. DESIGN TOKENS — LIGHT THEME
   ================================================================ */
[data-theme="light"] {
  --c-bg-abyss:       #f0f4f8;
  --c-bg-deep:        #e8eef5;
  --c-bg-base:        #ffffff;
  --c-bg-surface:     #ffffff;
  --c-bg-raised:      #f8fafc;
  --c-bg-hover:       #f1f5f9;

  --c-nav-from:       #ffffff;
  --c-nav-to:         #f8fafc;

  --c-accent-purple:  #0066ff;
  --c-accent-blue:    #00d4ff;
  --c-accent-indigo:  #0ea5e9;
  --c-accent-violet:  #06b6d4;

  --c-score:          #ff3366;
  --c-live:           #ff3366;
  --c-live-glow:      rgba(255, 51, 102, 0.3);
  --c-gold:           #d97706;
  --c-finished:       #64748b;
  --c-scheduled:      #0284c7;

  --c-text-primary:   #1a202c;
  --c-text-secondary: #4a5568;
  --c-text-muted:     #718096;

  --c-border:         rgba(0, 102, 255, 0.10);
  --c-border-hover:   rgba(0, 102, 255, 0.30);
  --c-border-active:  rgba(0, 102, 255, 0.55);

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 20px rgba(0, 102, 255, 0.1);
  --shadow-score: 0 0 12px rgba(255, 51, 102, 0.15);

  --noise: none;
}

/* ================================================================
   3. RESET
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================================
   4. BASE
   ================================================================ */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--c-bg-deep);
  color: var(--c-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background var(--dur-norm) var(--ease-out),
    color var(--dur-norm) var(--ease-out);
}

/* Subtle noise overlay on body for texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  background-repeat: repeat;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

a {
  color: var(--c-accent-violet);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover {
  color: var(--c-accent-purple);
  text-decoration: underline;
}

::selection {
  background: rgba(123, 47, 247, 0.35);
  color: #fff;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(123, 47, 247, 0.25);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 47, 247, 0.45);
}

/* ================================================================
    5. LAYOUT — Independent scrolling panels
    ================================================================ */
.layout {
  display: flex;
  height: calc(100vh - var(--nav-h) - var(--footer-h));
  overflow: hidden;
}

.content {
  flex: 1;
  min-width: 0;
  padding: var(--sp-lg);
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Background body class (from base.html) */
.bg-dark  { background: var(--c-bg-deep); }
.text-light { color: var(--c-text-primary); }

/* ================================================================
    6. NAVIGATION
    ================================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: linear-gradient(135deg, var(--c-nav-from), var(--c-nav-to));
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 0 rgba(123, 47, 247, 0.08), 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Purple accent line under nav */
.nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--c-accent-purple) 20%,
    var(--c-accent-blue) 50%,
    var(--c-accent-purple) 80%,
    transparent
  );
  opacity: 0.6;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
  height: 100%;
  gap: var(--sp-lg);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  color: var(--c-text-primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  text-transform: uppercase;
}
.nav__brand:hover {
  text-decoration: none;
  color: var(--c-accent-purple);
}
.nav__brand img {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 12px rgba(123, 47, 247, 0.6))
          drop-shadow(0 0 24px rgba(67, 97, 238, 0.3))
          drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  animation: ball-glow 3s ease-in-out infinite;
}

@keyframes ball-glow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(123, 47, 247, 0.6)) drop-shadow(0 0 24px rgba(67, 97, 238, 0.3)); }
  50%      { filter: drop-shadow(0 0 18px rgba(123, 47, 247, 0.8)) drop-shadow(0 0 32px rgba(67, 97, 238, 0.5)); }
}

/* --- Hamburger toggle (mobile) --- */
.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-xs);
  z-index: 10;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}
@media (min-width: 768px) {
  .nav__toggle { display: none; }
}

/* --- Nav tabs (pill buttons) --- */
.nav__tabs {
  display: none;
  gap: var(--sp-xs);
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-full);
  padding: var(--sp-xs);
}
@media (min-width: 768px) {
  .nav__tabs { display: flex; }
}

.nav__tab {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--r-full);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.nav__tab:hover {
  color: var(--c-text-primary);
  background: var(--c-bg-hover);
  text-decoration: none;
}
.nav__tab--active {
  color: #fff;
  background: linear-gradient(135deg, var(--c-accent-purple), var(--c-accent-blue));
  box-shadow: 0 2px 10px rgba(123, 47, 247, 0.35);
}
.nav__tab--active:hover {
  box-shadow: 0 4px 16px rgba(123, 47, 247, 0.5);
}
.nav__tab-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* WC2026 dropdown */
.nav__tab-wrapper {
  position: relative;
}
.nav__tab-wrapper .dropdown-arrow {
  font-size: 0.55rem;
  margin-left: 2px;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav__tab-wrapper .dropdown-arrow--open {
  transform: rotate(180deg);
}
.nav__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: var(--c-bg-elevated, #1e1e2e);
  border: 1px solid var(--c-border, #333);
  border-radius: var(--r-md, 8px);
  padding: var(--sp-xs, 4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 100;
}
.nav__dropdown-item {
  display: block;
  padding: 8px 16px;
  color: var(--c-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--r-sm, 4px);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav__dropdown-item:hover {
  background: var(--c-bg-hover);
  color: var(--c-text-primary);
  text-decoration: none;
}

/* Mobile nav dropdown */
.nav__links {
  display: none;
  gap: var(--sp-xs);
  align-items: center;
}
.nav__links.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, var(--c-nav-to), var(--c-bg-deep));
  padding: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  gap: var(--sp-xs);
  animation: slideDown var(--dur-norm) var(--ease-out);
}
.nav__mobile-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding-top: var(--sp-xs);
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: var(--sp-xs);
}
.nav__mobile-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  padding: 4px 12px;
}
.nav__tab--sub {
  padding-left: 24px;
  font-size: 0.8rem;
}

/* --- Nav right section (search + theme) --- */
.nav__right {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-shrink: 0;
  margin-left: auto;
}

/* Legacy nav__link for auth button */
.nav__link {
  color: var(--c-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  transition:
    color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav__link:hover {
  color: var(--c-text-primary);
  background: var(--c-bg-hover);
  text-decoration: none;
}

.nav__link--auth {
  background: linear-gradient(135deg, var(--c-accent-purple), var(--c-accent-blue));
  color: #fff !important;
  padding: 6px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(123, 47, 247, 0.3);
  transition: box-shadow var(--dur-fast), transform var(--dur-fast);
}
.nav__link--auth:hover {
  box-shadow: 0 4px 16px rgba(123, 47, 247, 0.45);
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--c-accent-violet), var(--c-accent-indigo));
}

/* ================================================================
   6a. THEME TOGGLE
   ================================================================ */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1rem;
  transition:
    background var(--dur-fast),
    border-color var(--dur-fast),
    color var(--dur-fast),
    transform var(--dur-fast);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: rotate(15deg);
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { pointer-events: none; }
/* Default dark: show sun (click to go light) */
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }
:root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: inline; }
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }

/* ================================================================
   6b. SEARCH BAR
   ================================================================ */
.search-bar {
  position: relative;
  display: none;
  flex: 0 1 260px;
}
@media (min-width: 768px) {
  .search-bar { display: block; }
}
.search-bar__input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 0.825rem;
  outline: none;
  transition:
    border-color var(--dur-fast),
    background var(--dur-fast),
    box-shadow var(--dur-fast);
}
.search-bar__input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.search-bar__input:focus {
  border-color: var(--c-accent-purple);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.15);
}
.search-bar__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Light theme search bar */
[data-theme="light"] .search-bar__input {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  color: var(--c-text-primary);
}
[data-theme="light"] .search-bar__input::placeholder {
  color: rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .search-bar__input:focus {
  border-color: var(--c-accent-purple);
  background: rgba(0, 0, 0, 0.02);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}
[data-theme="light"] .search-bar__icon {
  color: rgba(0, 0, 0, 0.35);
}

/* ================================================================
    7. SIDEBAR (right-only, independently scrollable)
    ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--c-bg-surface);
  border-left: 1px solid var(--c-border);
  padding: var(--sp-md);
  display: none;
  overflow-y: auto;
  height: calc(100vh - var(--nav-h) - var(--footer-h));
  position: sticky;
  top: 0;
  transition: background var(--dur-norm) var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 47, 247, 0.15) transparent;
}
@media (min-width: 768px) {
  .sidebar { display: block; }
}

.sidebar__section {
  margin-bottom: var(--sp-lg);
}

.sidebar__title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-xs);
  border-bottom: 1px solid var(--c-border);
}

.sidebar__links {
  list-style: none;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px var(--sp-sm);
  color: var(--c-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition:
    color var(--dur-fast),
    background var(--dur-fast);
}
.sidebar__link:hover {
  color: var(--c-text-primary);
  background: var(--c-bg-hover);
  text-decoration: none;
}

.sidebar__empty {
  color: var(--c-text-muted);
  font-size: 0.8rem;
  padding: var(--sp-sm);
}

.sidebar__date {
  color: var(--c-text-muted);
  font-weight: 400;
  font-size: 0.6rem;
  margin-left: var(--sp-xs);
}

/* Scoreboard in sidebar */
.sidebar__scoreboard {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.sidebar__score-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm);
  border-radius: var(--r-sm);
  background: var(--c-bg-raised);
  border: 1px solid var(--c-border);
  font-size: 0.78rem;
  transition: border-color var(--dur-fast);
}
.sidebar__score-item:hover {
  border-color: var(--c-border-hover);
}

.sidebar__score-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
.sidebar__score-team {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.sidebar__score-team--home { color: var(--c-text-primary); }
.sidebar__score-team--away { color: var(--c-text-secondary); font-size: 0.72rem; }

.sidebar__score-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--c-score);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__score-comp {
  font-size: 0.6rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--sp-2xs);
}

/* ================================================================
   9. DATE SECTION (sidebar match groupings)
   ================================================================ */
.date-section {
  margin-bottom: var(--sp-md);
}

.date-section__label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-text-muted);
  padding: var(--sp-xs) var(--sp-sm);
  margin-bottom: var(--sp-xs);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}
.date-section__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}
.date-section--today .date-section__label {
  color: var(--c-accent-purple);
}
.date-section--today .date-section__label::after {
  background: linear-gradient(90deg, var(--c-accent-purple), transparent);
}

/* ================================================================
   10. COMPACT MATCH (sidebar rows)
   ================================================================ */
.compact-match {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-sm);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--c-text-secondary);
  transition:
    background var(--dur-fast),
    color var(--dur-fast);
  cursor: pointer;
  text-decoration: none;
}
.compact-match:hover {
  background: var(--c-bg-hover);
  color: var(--c-text-primary);
  text-decoration: none;
}

.compact-match__teams {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}
.compact-match__team {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.compact-match__team--home { color: var(--c-text-primary); }
.compact-match__team--away { color: var(--c-text-secondary); font-size: 0.75rem; }

.compact-match__score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--c-score);
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.compact-match__score--live {
  color: var(--c-live);
  text-shadow: 0 0 8px var(--c-live-glow);
}
.compact-match__score--scheduled {
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.compact-match__time {
  font-size: 0.65rem;
  color: var(--c-text-muted);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.compact-match__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-live);
  animation: pulse-live 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ================================================================
   11. FOOTER
   ================================================================ */
.footer {
  background: var(--c-bg-surface);
  border-top: 1px solid var(--c-border);
  padding: 0 var(--sp-md);
  text-align: center;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-norm) var(--ease-out);
}
.footer__inner {
  max-width: var(--content-max);
  width: 100%;
}

/* ================================================================
   12. HERO BANNER
   ================================================================ */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(123, 47, 247, 0.12), transparent),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(67, 97, 238, 0.08), transparent),
    linear-gradient(160deg, var(--c-bg-surface), var(--c-bg-base));
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl) var(--sp-xl);
  margin-bottom: var(--sp-xl);
  overflow: hidden;
}
/* Diagonal accent stripe */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 200%;
  background: linear-gradient(
    165deg,
    transparent 40%,
    rgba(123, 47, 247, 0.04) 45%,
    rgba(123, 47, 247, 0.08) 50%,
    rgba(123, 47, 247, 0.04) 55%,
    transparent 60%
  );
  pointer-events: none;
}
/* Subtle grid pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--c-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
}

.hero__content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--sp-sm);
  background: linear-gradient(135deg, var(--c-text-primary), var(--c-accent-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  color: var(--c-text-secondary);
  font-size: 1rem;
  max-width: 520px;
  line-height: 1.6;
}

/* ================================================================
   13. MATCH HERO (detail page)
   ================================================================ */
.match-hero {
  position: relative;
  background:
    radial-gradient(ellipse 50% 80% at 80% 20%, rgba(123, 47, 247, 0.15), transparent),
    radial-gradient(ellipse 50% 80% at 20% 80%, rgba(67, 97, 238, 0.10), transparent),
    linear-gradient(135deg, var(--c-bg-surface), var(--c-bg-raised));
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-xl) var(--sp-lg);
  text-align: center;
  margin-bottom: var(--sp-lg);
  overflow: hidden;
}
/* Pitch line accent */
.match-hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 1px solid rgba(123, 47, 247, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.match-hero__teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xl);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.match-hero__score {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--c-score);
  text-shadow: var(--shadow-score);
  padding: 0 var(--sp-sm);
}

.match-hero__meta {
  margin-top: var(--sp-md);
  color: var(--c-text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ================================================================
   14. PAGE HEADER
   ================================================================ */
.page-header {
  margin-bottom: var(--sp-lg);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-2xs);
  line-height: 1.2;
}
.page-header .subtitle {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ================================================================
   14-A. TEAM HISTORY CARD
   ================================================================ */
.team-history-card {
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  box-shadow: var(--shadow-md);
}

.team-nickname-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--c-accent-indigo);
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.20);
  border-radius: var(--r-full);
  padding: 2px 10px;
  margin-left: var(--sp-sm);
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.history-section {
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
}

.history-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.history-section--links {
  border-bottom-color: transparent;
}

.section-icon {
  font-size: 1rem;
  margin-right: var(--sp-xs);
}

.history-qual {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-accent-blue);
  margin-bottom: var(--sp-xs);
}

.history-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--c-text-secondary);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-list li {
  position: relative;
  padding: var(--sp-xs) 0 var(--sp-xs) var(--sp-lg);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--c-text-secondary);
}

.history-list li::before {
  content: "•";
  position: absolute;
  left: var(--sp-sm);
  color: var(--c-accent-purple);
  font-weight: 700;
}

.team-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.stat-box {
  flex: 1 0 calc(33.33% - var(--sp-sm));
  min-width: 100px;
  background: var(--c-bg-raised);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  text-align: center;
  border: 1px solid var(--c-border);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.stat-box:hover {
  border-color: var(--c-border-hover);
}

.stat-box--accent {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.20);
}

.stat-box--wide {
  flex: 2 0 100%;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-2xs);
}

.stat-box--accent .stat-value {
  color: var(--c-accent-indigo);
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
}

.player-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-primary);
  background: var(--c-bg-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 4px 12px;
  transition: all var(--dur-fast) var(--ease-out);
}

.player-tag:hover {
  border-color: var(--c-accent-purple);
  background: rgba(99, 102, 241, 0.10);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-text-secondary);
  background: var(--c-bg-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 8px 14px;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
}

.quick-link:hover {
  color: var(--c-accent-purple);
  border-color: var(--c-accent-purple);
  background: rgba(99, 102, 241, 0.08);
  text-decoration: none;
}

.history-placeholder {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  font-style: italic;
  padding: var(--sp-sm) 0;
}

@media (max-width: 600px) {
  .stat-box {
    flex: 1 0 calc(50% - var(--sp-sm));
    min-width: 80px;
  }
  .team-history-card {
    padding: var(--sp-md);
  }
}

/* ================================================================
   15. SECTION TITLE
   ================================================================ */
.section-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.section-date {
  font-weight: 400;
  color: var(--c-text-secondary);
  font-size: 0.8rem;
}

/* ================================================================
   16. MATCH CARD
   ================================================================ */
.match-card {
  position: relative;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  transition:
    border-color var(--dur-norm) var(--ease-out),
    transform var(--dur-norm) var(--ease-out),
    box-shadow var(--dur-norm) var(--ease-out);
  overflow: hidden;
}

/* Gradient hover glow */
.match-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(123, 47, 247, 0.03),
    rgba(67, 97, 238, 0.02)
  );
  opacity: 0;
  transition: opacity var(--dur-norm) var(--ease-out);
  pointer-events: none;
}

.match-card:hover {
  border-color: var(--c-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.match-card:hover::before {
  opacity: 1;
}

/* Live match card accent */
.match-card[data-status="live"] {
  border-color: rgba(233, 69, 96, 0.25);
  box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.08), inset 0 0 30px rgba(233, 69, 96, 0.03);
}
.match-card[data-status="live"]:hover {
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.12);
}

.match-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-sm);
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
}

.match-card__competition {
  color: var(--c-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.match-card__date {
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.match-card__teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-sm);
  position: relative;
  z-index: 1;
}

.team {
  flex: 1;
  min-width: 0;
}
.team--home { text-align: right; }
.team--away { text-align: left; }

.team__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.925rem;
  letter-spacing: -0.01em;
  color: var(--c-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.match-card__score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.score__home,
.score__away {
  color: var(--c-score);
  min-width: 1ch;
  text-align: center;
}
.score__separator {
  color: var(--c-text-muted);
  font-weight: 400;
}
.score__vs {
  color: var(--c-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
}

.match-card__footer {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.match-card__status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.status--finished {
  color: var(--c-finished);
  background: rgba(100, 116, 139, 0.1);
}
.status--live {
  color: var(--c-live);
  background: rgba(233, 69, 96, 0.1);
  animation: glow-pulse 2s ease-in-out infinite;
}
.status--scheduled {
  color: var(--c-scheduled);
  background: rgba(56, 189, 248, 0.1);
}

/* ================================================================
    MATCH CARD — Badges & Highlights
    ================================================================ */
.match-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--c-border);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--mvp {
  background: linear-gradient(135deg, var(--c-accent-purple), var(--c-accent-blue));
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.badge--mvj {
  background: var(--c-bg-raised);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

.badge__icon {
  font-size: 0.875rem;
}

.badge__label {
  font-weight: 700;
}

.badge__player {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.match-card__highlights-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--c-accent-purple);
  color: white;
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
}

.match-card__highlights-btn:hover {
  background: var(--c-accent-blue);
  transform: scale(1.05);
}

/* ================================================================
    17. MATCH TYPE BADGE (team profile)
    ================================================================ */
.match-type-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--r-full, 9999px);
  margin-top: var(--sp-xs, 4px);
  white-space: nowrap;
}

.match-type--friendly {
  color: #86efac;
  background: rgba(134, 239, 172, 0.12);
  border: 1px solid rgba(134, 239, 172, 0.25);
}

.match-type--worldcup {
  color: #fde68a;
  background: rgba(253, 230, 138, 0.12);
  border: 1px solid rgba(253, 230, 138, 0.25);
}

.match-type--qualifier {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.25);
}

.match-type--cup {
  color: #c4b5fd;
  background: rgba(196, 181, 253, 0.12);
  border: 1px solid rgba(196, 181, 253, 0.25);
}

.match-type--tournament {
  color: #f9a8d4;
  background: rgba(249, 168, 212, 0.12);
  border: 1px solid rgba(249, 168, 212, 0.25);
}

/* ================================================================
    17a. MATCH GRID
    ================================================================ */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-md);
}

/* ================================================================
    17a. COMPETITION CARD
    ================================================================ */
.competition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-md);
}

.competition-card {
  position: relative;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--dur-norm) var(--ease-out),
    transform var(--dur-norm) var(--ease-out),
    box-shadow var(--dur-norm) var(--ease-out);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.competition-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(123, 47, 247, 0.03),
    rgba(67, 97, 238, 0.02)
  );
  opacity: 0;
  transition: opacity var(--dur-norm) var(--ease-out);
  pointer-events: none;
}
.competition-card:hover {
  border-color: var(--c-border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  color: inherit;
}
.competition-card:hover::before { opacity: 1; }

.competition-card__icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

.competition-card__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-text-primary);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.competition-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.competition-card__badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: rgba(123, 47, 247, 0.1);
  color: var(--c-accent-violet);
  border: 1px solid rgba(123, 47, 247, 0.15);
}

.competition-card__count {
  font-size: 0.78rem;
  color: var(--c-text-secondary);
  font-weight: 500;
}
.competition-card__count strong {
  color: var(--c-text-primary);
  font-weight: 700;
  font-family: var(--font-display);
}

.competition-card__season {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  position: relative;
  z-index: 1;
}

/* Staggered entrance for competition cards */
.competition-grid .competition-card {
  animation: fadeInUp var(--dur-slow) var(--ease-out) both;
}
.competition-grid > a:nth-child(1) .competition-card,
.competition-grid > .competition-card:nth-child(1) { animation-delay: 0ms; }
.competition-grid > a:nth-child(2) .competition-card,
.competition-grid > .competition-card:nth-child(2) { animation-delay: 60ms; }
.competition-grid > a:nth-child(3) .competition-card,
.competition-grid > .competition-card:nth-child(3) { animation-delay: 120ms; }
.competition-grid > a:nth-child(4) .competition-card,
.competition-grid > .competition-card:nth-child(4) { animation-delay: 180ms; }
.competition-grid > a:nth-child(5) .competition-card,
.competition-grid > .competition-card:nth-child(5) { animation-delay: 240ms; }
.competition-grid > a:nth-child(6) .competition-card,
.competition-grid > .competition-card:nth-child(6) { animation-delay: 300ms; }

/* ================================================================
   18. TABS
   ================================================================ */
.tabs {
  display: flex;
  gap: var(--sp-2xs);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  color: var(--c-text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--sp-sm) var(--sp-md);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition:
    color var(--dur-fast),
    border-color var(--dur-fast),
    background var(--dur-fast);
  white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.tab-btn:hover {
  color: var(--c-text-primary);
  background: var(--c-bg-hover);
}
.tab-btn.active {
  color: var(--c-accent-purple);
  border-bottom-color: var(--c-accent-purple);
}

/* ================================================================
   19. STATS TABLE
   ================================================================ */
.stats-table {
  width: 100%;
  border-collapse: collapse;
}
.stats-table th,
.stats-table td {
  padding: var(--sp-sm) var(--sp-md);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.875rem;
}
.stats-table th {
  font-family: var(--font-display);
  color: var(--c-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stats-table .val-home {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats-table .val-away {
  text-align: left;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats-table tbody tr {
  transition: background var(--dur-fast);
}
.stats-table tbody tr:hover {
  background: var(--c-bg-hover);
}

/* ================================================================
   20. STANDINGS TABLE
   ================================================================ */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.standings-table th,
.standings-table td {
  padding: var(--sp-sm) var(--sp-md);
  text-align: center;
  border-bottom: 1px solid var(--c-border);
}
.standings-table th {
  font-family: var(--font-display);
  color: var(--c-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.standings-table td:first-child,
.standings-table th:first-child {
  text-align: left;
}
.standings-table tbody tr {
  transition: background var(--dur-fast);
}
.standings-table tbody tr:hover {
  background: var(--c-bg-hover);
}
/* Top positions highlight */
.standings-table tbody tr:nth-child(-n+4) td:first-child {
  border-left: 2px solid var(--c-accent-purple);
}

/* Standings grid layout (side-by-side groups) */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.standing-group {
  background: var(--c-bg-card, #1e1e1e);
  border-radius: var(--r-md, 8px);
  padding: var(--sp-lg, 16px);
  border: 1px solid var(--c-border, #333);
}

.standings-section {
  margin-bottom: 32px;
}

/* ================================================================
   21. EVENT TIMELINE
   ================================================================ */
.event-timeline {
  padding: var(--sp-md) 0;
}

.event-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--dur-fast);
  border-radius: var(--r-sm);
}
.event-item:hover {
  background: var(--c-bg-hover);
}
.event-item:last-child {
  border-bottom: none;
}

.event-item .minute {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 40px;
  color: var(--c-accent-purple);
  font-variant-numeric: tabular-nums;
}

.event-item .type {
  font-size: 0.8rem;
  color: var(--c-text-secondary);
  min-width: 80px;
  text-transform: capitalize;
}

.event-item .player {
  font-weight: 600;
  color: var(--c-text-primary);
}

/* Live event-timeline (Alpine.js rendered, used in live overview) */
.event-timeline { max-height: 500px; overflow-y: auto; scrollbar-width: thin; }
.event-timeline__item { display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md); border-left: 3px solid transparent; border-bottom: 1px solid var(--c-border); transition: background var(--dur-fast); animation: eventSlideIn 0.4s ease-out; }
.event-timeline__item:last-child { border-bottom: none; }
.event-timeline__item:hover { background: var(--c-bg-hover); }
.event-timeline__item--Goal { animation: eventSlideIn 0.4s ease-out, goalFlash 1s ease-out; }
.event-timeline__item--RedCard { animation: eventSlideIn 0.4s ease-out, redPulse 0.6s ease-out 3; }
.event-timeline__item--YellowCard { animation: eventSlideIn 0.4s ease-out, yellowCardFlash 0.6s ease-out 3; }
.event-timeline__minute { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; min-width: 36px; color: var(--c-accent-purple); font-variant-numeric: tabular-nums; }
.event-timeline__icon { font-size: 1rem; min-width: 24px; text-align: center; }
.event-timeline__desc { flex: 1; font-size: 0.85rem; color: var(--c-text-primary); }
.event-timeline__desc .event-sub-detail { color: var(--c-text-secondary); font-size: 0.8rem; }
.event-timeline__team { font-size: 0.7rem; color: var(--c-text-muted); text-align: right; min-width: 80px; }
.event-timeline__team.team--home { color: var(--c-accent-blue); }
.event-timeline__team.team--away { color: #e63946; }
.event-timeline--empty { text-align: center; padding: var(--sp-xl); color: var(--c-text-muted); font-size: 0.85rem; }

@keyframes eventSlideIn {
  from { opacity: 0; transform: translateX(-20px); max-height: 0; padding-top: 0; padding-bottom: 0; }
  to   { opacity: 1; transform: translateX(0); max-height: 60px; }
}
@keyframes goalFlash {
  0%   { background: rgba(244, 162, 97, 0.4); }
  100% { background: transparent; }
}
@keyframes redPulse {
  0%, 100% { border-left-color: #ef4444; }
  50%      { border-left-color: transparent; }
}
@keyframes yellowCardFlash {
  0%, 100% { background: rgba(251, 191, 36, 0.15); }
  50%      { background: transparent; }
}

/* ================================================================
   22. LINEUP VIEW
   ================================================================ */
.lineup-view {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
}

.starting-xi,
.substitutes {
  flex: 1;
  min-width: 280px;
}

.starting-xi ul,
.substitutes ul {
  list-style: none;
}

.starting-xi li,
.substitutes li {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--dur-fast);
  border-radius: var(--r-sm);
}
.starting-xi li:hover,
.substitutes li:hover {
  background: var(--c-bg-hover);
}

.starting-xi .number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-inverse);
  background: var(--c-accent-purple);
  border-radius: var(--r-xs);
}

.starting-xi .pos {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  margin-left: auto;
  padding: 2px 6px;
  background: var(--c-bg-raised);
  border-radius: var(--r-xs);
}

/* ================================================================
   23. LIVE DOT
   ================================================================ */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-live);
  animation: pulse-live 1.4s ease-in-out infinite;
  margin-right: var(--sp-xs);
  box-shadow: 0 0 6px var(--c-live-glow);
}

/* ================================================================
   25. VISUALIZATION
   ================================================================ */
.viz-image {
  max-width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
}

/* ================================================================
   26. LOGIN
   ================================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: var(--sp-lg);
}

.login-card {
  position: relative;
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl) var(--sp-xl);
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
/* Decorative gradient blob */
.login-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(123, 47, 247, 0.12), transparent 70%);
  pointer-events: none;
}
.login-card::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(67, 97, 238, 0.08), transparent 70%);
  pointer-events: none;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-sm);
  position: relative;
  z-index: 1;
}

.login-card p {
  color: var(--c-text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--sp-lg);
  position: relative;
  z-index: 1;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: #fff;
  color: #1a1a2e;
  border: none;
  border-radius: var(--r-md);
  padding: 10px var(--sp-lg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--dur-fast),
    transform var(--dur-fast);
  position: relative;
  z-index: 1;
}
.google-btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

/* ================================================================
   27. EMPTY STATE
   ================================================================ */
.empty-state {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  color: var(--c-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ================================================================
   28. SECTION (generic wrapper used in templates)
   ================================================================ */
.section {
  margin-bottom: var(--sp-xl);
}

/* ================================================================
    29. STATS PANEL
    ================================================================ */
.stats-panel {
  padding: var(--sp-md) 0;
}

/* ================================================================
    29a. HOME LAYOUT (home page two-column)
    ================================================================ */
.home-layout {
  display: flex;
  gap: var(--sp-lg);
}
.home-main {
  flex: 1;
  min-width: 0;
}

/* ================================================================
    29b. SCHEDULE COLUMNS (Yesterday/Today/Tomorrow grid)
    ================================================================ */
.match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.match-column {
  border: 1px solid var(--c-border, #ddd);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--c-bg-card, var(--c-bg-surface, #fff));
}

.match-column__title {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--c-accent, #e63946);
  color: var(--c-text-secondary, #666);
}

.match-column__date {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-left: 0.25rem;
}

@media (max-width: 768px) {
  .match-columns {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   30. ANIMATIONS
   ================================================================ */
@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.85); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0); }
  50%      { box-shadow: 0 0 8px 2px rgba(233, 69, 96, 0.15); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered entrance for match cards */
.match-grid .match-card {
  animation: fadeInUp var(--dur-slow) var(--ease-out) both;
}
.match-grid > a:nth-child(1)  .match-card,
.match-grid > .match-card:nth-child(1)  { animation-delay: 0ms; }
.match-grid > a:nth-child(2)  .match-card,
.match-grid > .match-card:nth-child(2)  { animation-delay: 50ms; }
.match-grid > a:nth-child(3)  .match-card,
.match-grid > .match-card:nth-child(3)  { animation-delay: 100ms; }
.match-grid > a:nth-child(4)  .match-card,
.match-grid > .match-card:nth-child(4)  { animation-delay: 150ms; }
.match-grid > a:nth-child(5)  .match-card,
.match-grid > .match-card:nth-child(5)  { animation-delay: 200ms; }
.match-grid > a:nth-child(6)  .match-card,
.match-grid > .match-card:nth-child(6)  { animation-delay: 250ms; }
.match-grid > a:nth-child(7)  .match-card,
.match-grid > .match-card:nth-child(7)  { animation-delay: 300ms; }
.match-grid > a:nth-child(8)  .match-card,
.match-grid > .match-card:nth-child(8)  { animation-delay: 350ms; }
.match-grid > a:nth-child(9)  .match-card,
.match-grid > .match-card:nth-child(9)  { animation-delay: 400ms; }

/* ================================================================
   HOME PAGE — 3-Column Grid Dashboard
   ================================================================ */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-lg);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-lg);
}

.home-column {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.column-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-text-primary);
  margin: 0 0 var(--sp-xs) 0;
  padding-bottom: var(--sp-xs);
  border-bottom: 1px solid var(--c-border);
}

.column-date {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--c-text-muted);
  font-weight: 400;
  display: block;
  margin-bottom: var(--sp-sm);
}

.match-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.match-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform var(--dur-fast) var(--ease-out);
}

.match-card-link:hover {
  transform: translateY(-2px);
}

/* Responsive: stack on mobile */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-xl);
  }
}

/* ================================================================
   MATCH DETAIL — Deep Dive & Lineups
   ================================================================ */
.deep-dive {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

.viz-card {
  background: var(--c-bg-surface);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  border: 1px solid var(--c-border);
}

.viz-card--large {
  grid-column: 1 / -1;
}

.viz-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 var(--sp-md) 0;
  color: var(--c-text-primary);
}

.viz-card img {
  width: 100%;
  border-radius: var(--r-sm);
}

.stats-controls {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.stat-field.hidden {
  display: none;
}

.stats-table-wrapper {
  overflow-x: auto;
}

.lineups-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xl);
}

.lineups-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

.lineup-card {
  background: var(--c-bg-surface);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  border: 1px solid var(--c-border);
}

.lineup-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 var(--sp-md) 0;
  color: var(--c-text-primary);
}

.formation-diagram {
  margin-bottom: var(--sp-md);
}

.formation-diagram img {
  width: 100%;
  border-radius: var(--r-sm);
}

.progression-section {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--c-border);
}

.progression-content {
  margin-top: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.progression-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.timeline-event {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-sm);
  background: var(--c-bg-raised);
  border-radius: var(--r-sm);
}

.timeline-minute {
  font-weight: 700;
  color: var(--c-accent-purple);
  min-width: 40px;
}

.heatmap-controls {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.heatmap-controls .btn.active {
  background: var(--c-accent-purple);
  color: white;
}

#heatmap-container img {
  width: 100%;
  border-radius: var(--r-sm);
}

@media (max-width: 768px) {
  .viz-grid, .lineups-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
    31. RESPONSIVE
    ================================================================ */
@media (max-width: 767px) {
  .content {
    padding: var(--sp-md);
  }

  .match-hero__teams {
    font-size: 1.1rem;
    gap: var(--sp-md);
    flex-wrap: wrap;
  }
  .match-hero__score {
    font-size: 1.8rem;
  }
  .match-hero {
    padding: var(--sp-lg) var(--sp-md);
  }

  .match-grid,
  .competition-grid {
    grid-template-columns: 1fr;
  }

  .lineup-view {
    flex-direction: column;
  }

  .hero {
    padding: var(--sp-xl) var(--sp-md);
    border-radius: var(--r-lg);
  }

  .tabs {
    gap: 0;
  }
  .tab-btn {
    padding: var(--sp-sm) var(--sp-sm);
    font-size: 0.8rem;
  }

  .home-layout {
    flex-direction: column;
  }
}

/* ================================================================
   31a. SOURCE SELECTOR
   ================================================================ */
.source-selector {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  padding: var(--sp-md);
  background: var(--c-bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}

.source-selector__label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--c-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
}

.source-selector__modes {
  display: flex;
  gap: var(--sp-xs);
}

.source-selector__mode {
  padding: var(--sp-xs) var(--sp-sm);
  border: 1px solid var(--c-border);
  background: var(--c-bg-raised);
  color: var(--c-text-primary);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--dur-fast) var(--ease-out);
}

.source-selector__mode:hover {
  background: var(--c-bg-hover);
}

.source-selector__mode.active {
  background: var(--c-accent-purple);
  color: white;
  border-color: var(--c-accent-purple);
}

.viz-card__source {
  display: none;
  margin-bottom: var(--sp-sm);
}

.viz-card__source.visible {
  display: block;
}

.viz-card__source select {
  width: 100%;
  padding: var(--sp-xs) var(--sp-sm);
  border: 1px solid var(--c-border);
  background: var(--c-bg-raised);
  color: var(--c-text-primary);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 480px) {
  .match-card__teams {
    gap: var(--sp-sm);
  }
  .team__name {
    font-size: 0.8rem;
  }
  .match-card__score {
    font-size: 1.1rem;
  }
  .page-header h1 {
    font-size: 1.3rem;
  }
}

/* ================================================================
    32. LIGHT THEME OVERRIDES (component-specific)
    ================================================================ */
[data-theme="light"] .nav {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .nav__brand {
  color: var(--c-text-primary);
}
[data-theme="light"] .nav__brand:hover {
  color: var(--c-accent-purple);
}
[data-theme="light"] .nav__brand img {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: none;
}
[data-theme="light"] .nav__tab {
  color: var(--c-text-secondary);
}
[data-theme="light"] .nav__tab:hover {
  color: var(--c-text-primary);
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .nav__tab--active {
  color: var(--c-accent-purple);
}
[data-theme="light"] .nav__dropdown {
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
}
[data-theme="light"] .nav__dropdown-item {
  color: var(--c-text-secondary);
}
[data-theme="light"] .nav__dropdown-item:hover {
  background: var(--c-bg-hover);
  color: var(--c-text-primary);
}

[data-theme="light"] .match-card {
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .match-card:hover {
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .login-card {
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .hero {
  box-shadow: var(--shadow-sm);
}

/* ================================================================
    32a. LIVE OVERVIEW — Animations
    ================================================================ */

/* Event slide-in (new events arriving via WebSocket) */
.event-slide-in {
  animation: liveEventSlideIn 0.4s ease-out !important;
}

@keyframes liveEventSlideIn {
  from { opacity: 0; transform: translateX(-20px); max-height: 0; padding-top: 0; padding-bottom: 0; }
  to   { opacity: 1; transform: translateX(0); max-height: 60px; }
}

/* Goal event — score background flash + slide-in */
.goal-flash {
  animation: liveGoalFlash 1s ease-out !important;
}

@keyframes liveGoalFlash {
  0%   { background: rgba(244, 162, 97, 0.4); }
  100% { background: transparent; }
}

/* Red card — pulse red border */
.red-card-pulse {
  animation: liveRedPulse 0.6s ease-out 3 !important;
}

@keyframes liveRedPulse {
  0%, 100% { border-left-color: #ef4444; }
  50%      { border-left-color: transparent; }
}

/* Yellow card — flash yellow background */
.yellow-card-flash {
  animation: liveYellowFlash 0.6s ease-out 3 !important;
}

@keyframes liveYellowFlash {
  0%, 100% { background: rgba(251, 191, 36, 0.15); }
  50%      { background: transparent; }
}

/* Score bump animation */
.live-score.score-bump {
  animation: liveScoreBump 0.5s ease-out !important;
}

@keyframes liveScoreBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); color: var(--c-gold, #fbbf24); }
  100% { transform: scale(1); }
}

/* Source health dot colors */
.source-health-dot { width: 8px; height: 8px; border-radius: 50%; }
.source-health--connected .source-health-dot { background: #4ade80; }
.source-health--disconnected .source-health-dot { background: #ef4444; }
.source-health--stale .source-health-dot { background: #facc15; }

/* ================================================================
    33. TABLE WRAPPER UTILITY
    Horizontal scrolling wrapper for data tables on all screen sizes
    ================================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--sp-md));
  padding: 0 var(--sp-md);
}

.table-wrapper table {
  min-width: 500px;
}

/* ================================================================
    34. MOBILE RESPONSIVE — Complete Mobile Experience
    Breakpoints: mobile <768px, tablet 768-1024px, desktop >1024px
    ================================================================ */

/* --- 34.1 Mobile Layout Fix --- */
/* Remove fixed height, allow natural flow, stack content + sidebar */
@media (max-width: 767px) {
  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .content {
    padding: var(--sp-md);
    overflow-y: visible;
    width: 100%;
  }
}

/* --- 34.2 Mobile Navigation --- */
@media (max-width: 767px) {
  .nav {
    height: 56px;
  }

  .nav__inner {
    padding: 0 var(--sp-md);
    gap: var(--sp-sm);
  }

  .nav__brand {
    font-size: 1.1rem;
    gap: var(--sp-sm);
  }

  .nav__brand img {
    width: 36px;
    height: 36px;
  }

  /* Hamburger: larger touch target (44px minimum) */
  .nav__toggle {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: var(--sp-sm);
  }

  /* Mobile dropdown: full-width, touch-friendly */
  .nav__links.is-open {
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: var(--sp-md);
    z-index: 99;
    box-shadow: var(--shadow-lg);
  }

  .nav__links.is-open .nav__tab {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
    font-size: 0.9rem;
    width: 100%;
  }

  .nav__links.is-open .nav__tab--sub {
    padding-left: var(--sp-xl);
  }

  .nav__mobile-section {
    padding-top: var(--sp-sm);
    margin-top: var(--sp-sm);
  }

  .nav__mobile-section-title {
    padding: var(--sp-xs) var(--sp-md);
  }

  /* Hide login button on mobile (use hamburger menu instead) */
  .nav__link--auth {
    display: none;
  }
}

/* Light theme hamburger bars */
[data-theme="light"] .nav__toggle span {
  background: rgba(0, 0, 0, 0.7);
}

/* --- 34.3 Bottom Tab Bar (Mobile Only) --- */
/* CSS-only implementation — add HTML to base.html later */
.mobile-nav {
  display: none;
}

@media (max-width: 767px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(31, 26, 40, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--c-border);
    z-index: 98;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
  }

  [data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  }

  .mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: var(--sp-xs) var(--sp-sm);
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    transition: color var(--dur-fast) var(--ease-out);
    border-radius: var(--r-sm);
    flex: 1;
  }

  .mobile-nav__item:hover {
    color: var(--c-text-primary);
    text-decoration: none;
  }

  .mobile-nav__item--active {
    color: var(--c-accent-purple);
  }

  .mobile-nav__icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .mobile-nav__label {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
  }

  /* Body padding for bottom nav */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

/* --- 34.4 Footer on Mobile --- */
@media (max-width: 767px) {
  .footer {
    margin-bottom: 56px;
    padding: var(--sp-md);
    height: auto;
    min-height: var(--footer-h);
  }
}

/* --- 34.5 Tables & Data on Mobile --- */
@media (max-width: 767px) {
  .stats-table,
  .standings-table {
    font-size: 0.8rem;
  }

  .stats-table th,
  .stats-table td,
  .standings-table th,
  .standings-table td {
    padding: var(--sp-xs) var(--sp-sm);
    white-space: nowrap;
  }

  /* WC2026 standings grid inline override */
  .standings-section > div[style*="grid"] {
    grid-template-columns: 1fr !important;
    gap: var(--sp-md) !important;
  }

  .standing-group {
    padding: var(--sp-md);
  }

  .standing-group h3 {
    font-size: 0.9rem;
    flex-wrap: wrap;
  }
}

/* --- 34.7 Touch-Friendly Targets --- */
@media (max-width: 767px) {
  .tab-btn {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
  }

  .sidebar__link {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
  }

  .source-selector__mode {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: var(--sp-sm) var(--sp-md);
  }

  .google-btn {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-lg);
  }

  .btn {
    min-height: 44px;
    padding: var(--sp-sm) var(--sp-md);
  }

  /* Form inputs: 44px height, 16px font (prevents iOS zoom) */
  select,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"] {
    min-height: 44px;
    font-size: 16px;
  }
}

/* --- 34.8 Typography on Mobile --- */
@media (max-width: 767px) {
  .page-header h1 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .hero h1 {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }

  .column-title {
    font-size: 1rem;
  }

  .section-title {
    font-size: 0.8rem;
  }

  .match-card__competition {
    font-size: 0.65rem;
  }

  .match-card__date {
    font-size: 0.65rem;
  }
}

/* --- 34.9 Grid Layouts on Mobile --- */
@media (max-width: 767px) {
  .standings-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-box {
    flex: 1 0 calc(50% - var(--sp-sm));
    min-width: 80px;
  }

  .match-card__teams {
    gap: var(--sp-sm);
  }

  .team__name {
    font-size: 0.8rem;
  }

  .match-hero__teams {
    gap: var(--sp-md);
    flex-wrap: wrap;
    font-size: 1.1rem;
  }

  .match-hero {
    padding: var(--sp-lg) var(--sp-md);
    border-radius: var(--r-lg);
  }

  .hero {
    padding: var(--sp-lg) var(--sp-md);
    border-radius: var(--r-lg);
  }

  .login-card {
    padding: var(--sp-xl) var(--sp-md);
    border-radius: var(--r-lg);
  }

  .team-history-card {
    padding: var(--sp-md);
  }
}

/* --- 34.10 WC2026 Hero Inline Style Override --- */
@media (max-width: 767px) {
  .wc2026-hero {
    padding: var(--sp-md) !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--sp-sm) !important;
  }

  .wc2026-hero h2 {
    font-size: 1.1rem !important;
  }

  .wc2026-hero p {
    font-size: 0.85rem !important;
  }

  .wc2026-hero a {
    width: 100%;
    justify-content: center;
    padding: var(--sp-sm) var(--sp-md) !important;
  }

  .wc2026-hero span[style*="font-size:2rem"] {
    font-size: 1.5rem !important;
  }
}

/* --- 34.11 Player Profile Mobile Enhancements --- */
@media (max-width: 767px) {
  .player-photo-img,
  .initials-avatar {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
  }

  .player-header__name {
    font-size: 1.4rem;
  }

  .player-header {
    padding: var(--sp-md);
    gap: var(--sp-md);
  }

  .player-header__meta {
    font-size: 0.85rem;
  }

  .player-awards {
    padding: var(--sp-md);
  }

  .awards-grid {
    gap: var(--sp-sm);
  }

  .award-competition {
    min-width: auto;
    font-size: 0.8rem;
  }

  .award-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
}

/* --- 34.12 Match Card Mobile Enhancements --- */
@media (max-width: 767px) {
  .match-card {
    padding: var(--sp-sm);
  }

  .match-card__header {
    font-size: 0.7rem;
    margin-bottom: var(--sp-xs);
  }

  .match-card__score {
    font-size: 1.1rem;
  }

  .match-card__status {
    font-size: 0.6rem;
    padding: 2px 8px;
  }

  .match-card__badges {
    padding: var(--sp-xs) var(--sp-sm);
  }

  .badge {
    font-size: 0.7rem;
    padding: var(--sp-2xs) var(--sp-xs);
  }
}

/* --- 34.13 Competition Card Mobile --- */
@media (max-width: 767px) {
  .competition-card {
    padding: var(--sp-md);
  }

  .competition-card__icon {
    font-size: 1.5rem;
  }

  .competition-card__name {
    font-size: 0.9rem;
  }

  .competition-card__meta {
    gap: var(--sp-xs);
  }
}

/* --- 34.14 Event Timeline Mobile --- */
@media (max-width: 767px) {
  .event-item {
    padding: var(--sp-xs) var(--sp-sm);
    gap: var(--sp-sm);
  }

  .event-item .minute {
    font-size: 0.8rem;
    min-width: 36px;
  }

  .event-item .type {
    font-size: 0.75rem;
    min-width: 70px;
  }

  .event-item .player {
    font-size: 0.85rem;
  }
}

/* --- 34.15 Lineup View Mobile --- */
@media (max-width: 767px) {
  .lineup-view {
    gap: var(--sp-md);
  }

  .starting-xi li,
  .substitutes li {
    padding: var(--sp-xs);
    gap: var(--sp-xs);
  }

  .starting-xi .number {
    font-size: 0.8rem;
    min-width: 24px;
    height: 24px;
  }

  .starting-xi .pos {
    font-size: 0.65rem;
    padding: 1px 4px;
  }
}

/* --- 34.16 Source Selector Mobile --- */
@media (max-width: 767px) {
  .source-selector {
    flex-direction: column;
    gap: var(--sp-sm);
    padding: var(--sp-sm);
  }

  .source-selector__modes {
    flex-wrap: wrap;
  }
}

/* --- 34.17 Empty State Mobile --- */
@media (max-width: 767px) {
  .empty-state {
    padding: var(--sp-xl) var(--sp-md);
    font-size: 0.85rem;
  }
}

/* --- 34.18 Smooth Scrolling --- */
@media (max-width: 767px) {
  html {
    scroll-behavior: smooth;
  }

  .content {
    scroll-behavior: smooth;
  }
}

/* --- 34.19 WC2026 Schedule Mobile --- */
@media (max-width: 767px) {
  .page-header nav {
    gap: var(--sp-sm);
  }

  .page-header nav .btn {
    font-size: 0.8rem;
    padding: var(--sp-xs) var(--sp-sm);
  }

  /* Filter buttons in schedule */
  .page-header + div[style*="margin-bottom: 24px"] {
    margin-bottom: var(--sp-md) !important;
  }

  .page-header + div button {
    font-size: 0.75rem;
    padding: var(--sp-xs) var(--sp-sm);
  }
}

/* --- 34.20 Viz Grid Mobile Enhancements --- */
@media (max-width: 767px) {
  .viz-card {
    padding: var(--sp-sm);
  }

  .viz-card h3 {
    font-size: 0.95rem;
    margin-bottom: var(--sp-sm);
  }

  .lineup-card {
    padding: var(--sp-sm);
  }

  .lineup-card h3 {
    font-size: 1rem;
    margin-bottom: var(--sp-sm);
  }
}

/* --- 34.21 Deep Dive Mobile --- */
@media (max-width: 767px) {
  .deep-dive {
    gap: var(--sp-md);
  }

  .progression-section {
    margin-top: var(--sp-md);
    padding-top: var(--sp-md);
  }

  .progression-content {
    gap: var(--sp-sm);
  }

  .timeline-event {
    padding: var(--sp-xs);
    gap: var(--sp-sm);
  }

  .timeline-minute {
    min-width: 36px;
    font-size: 0.85rem;
  }
}

/* --- 34.22 Stats Controls Mobile --- */
@media (max-width: 767px) {
  .stats-controls,
  .heatmap-controls {
    flex-wrap: wrap;
    gap: var(--sp-xs);
  }

  .stats-controls .btn,
  .heatmap-controls .btn {
    font-size: 0.75rem;
    padding: var(--sp-xs) var(--sp-sm);
  }
}

/* ================================================================
    33. PRINT STYLES
    ================================================================ */
@media print {
  .nav, .sidebar, .footer, .theme-toggle, .search-bar,
  .mobile-nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    padding-bottom: 0;
  }
  body::before {
    display: none;
  }
  .match-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* ================================================================
   PLAYER PROFILE
   ================================================================ */

/* --- Player Header --- */
.player-header {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}

.player-header__photo {
  flex-shrink: 0;
}

.player-photo-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--r-full);
  border: 3px solid var(--c-accent-purple);
  box-shadow: var(--shadow-glow);
}

.initials-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-accent-purple), var(--c-accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  border: 3px solid var(--c-accent-indigo);
  box-shadow: var(--shadow-glow);
}

.player-header__info {
  flex: 1;
  min-width: 0;
}

.player-header__name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text-primary);
  margin-bottom: var(--sp-sm);
  line-height: 1.2;
}

.player-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--c-text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--sp-sm);
}

.player-header__meta .flag-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.meta-sep {
  color: var(--c-text-muted);
  font-weight: 300;
}

.position-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--c-accent-violet);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jersey-badge {
  display: inline-block;
  background: var(--c-bg-raised);
  color: var(--c-text-primary);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.player-header__team {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-sm);
}

.player-header__team .flag-emoji {
  font-size: 1.2rem;
  line-height: 1;
}

.team-link {
  font-weight: 500;
  color: var(--c-accent-violet);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.team-link:hover {
  color: var(--c-accent-purple);
  text-decoration: underline;
}

/* --- Awards Banner --- */
.player-awards {
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}

.awards-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.award-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--c-border);
}

.award-row:last-child {
  border-bottom: none;
}

.award-competition {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--c-text-primary);
  min-width: 120px;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.award-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.award-mvp {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.award-hero {
  background: rgba(99, 102, 241, 0.15);
  color: var(--c-accent-violet);
}

.award-mvj {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.award-ghost {
  background: rgba(100, 116, 139, 0.15);
  color: var(--c-text-muted);
}

/* --- Tournament Stats Cards --- */
.tournament-stats-section {
  margin-bottom: var(--sp-lg);
}

.tournament-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-md);
}

.tournament-stat-card {
  background: var(--c-bg-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.tournament-stat-card:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-accent-violet);
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
}

.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-sm) var(--sp-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* --- Match Stats Table Enhancements --- */
.match-stats-section {
  margin-bottom: var(--sp-lg);
}

.match-stats-table td:nth-child(1),
.match-stats-table th:nth-child(1) {
  white-space: nowrap;
  min-width: 90px;
}

.match-stats-table td:nth-child(2),
.match-stats-table th:nth-child(2) {
  text-align: left;
}

.match-stats-table td:nth-child(3),
.match-stats-table th:nth-child(3) {
  text-align: left;
  min-width: 160px;
}

.comp-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-xs);
  background: rgba(99, 102, 241, 0.1);
  color: var(--c-accent-indigo);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.match-link {
  color: var(--c-text-primary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.match-link:hover {
  color: var(--c-accent-violet);
  text-decoration: underline;
}

.stat-highlight {
  font-weight: 700;
  color: var(--c-text-primary);
  font-variant-numeric: tabular-nums;
}

.rating-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-xs);
  background: rgba(99, 102, 241, 0.12);
  color: var(--c-accent-violet);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rating-na {
  color: var(--c-text-muted);
}

.empty-state {
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  color: var(--c-text-muted);
  font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .player-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-md);
  }

  .player-header__meta {
    justify-content: center;
  }

  .player-header__team {
    justify-content: center;
  }

  .player-header__name {
    font-size: 1.5rem;
  }

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

  .stat-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .award-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-xs);
  }
}

/* ================================================================
   THEME TOGGLE — JS REFERENCE (actual logic in app.js)
   ================================================================
   Inline script to prevent FOUC — place in <head> of base.html:

   <script>
     (function() {
       var t = localStorage.getItem('mm-theme');
       if (t) document.documentElement.setAttribute('data-theme', t);
     })();
   </script>

   Toggle logic (for app.js):

   function toggleTheme() {
     var el = document.documentElement;
     var current = el.getAttribute('data-theme');
     var next = current === 'light' ? 'dark' : 'light';
     if (next === 'dark') {
       el.removeAttribute('data-theme');
     } else {
       el.setAttribute('data-theme', next);
     }
     localStorage.setItem('mm-theme', next);
   }
   ================================================================ */
