/* ═══════════════════════════════════════════════════════════════════════════
   historicalsoccer.com — Main Design System
   DM Sans + DM Mono | Dark gold theme | Performance: <25KB gzipped
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-deep:       #080c14;
  --bg-card:       #0f1623;
  --bg-elevated:   #18202e;
  --bg-input:      #1e2a3a;
  --bg-glass:      rgba(15, 22, 35, 0.8);

  /* Brand */
  --gold:          #f5a623;
  --gold-dim:      #b87a1a;
  --gold-glow:     rgba(245, 166, 35, 0.15);
  --gold-glow-md:  rgba(245, 166, 35, 0.25);

  /* Text */
  --text-primary:   #eef2f7;
  --text-secondary: #8fa3bf;
  --text-muted:     #4d657e;

  /* Semantic */
  --win:      #22c55e;
  --win-bg:   rgba(34, 197, 94, 0.12);
  --draw:     #818cf8;
  --draw-bg:  rgba(129, 140, 248, 0.12);
  --loss:     #f43f5e;
  --loss-bg:  rgba(244, 63, 94, 0.12);
  --og:       #f97316;
  --pen:      #a78bfa;

  /* Structure */
  --border:     rgba(30, 45, 61, 0.8);
  --border-md:  rgba(50, 72, 95, 0.6);
  --radius:     8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold:0 0 24px rgba(245,166,35,0.25);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Typography */
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --duration:  200ms;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245,166,35,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(129,140,248,0.04) 0%, transparent 50%);
}

img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: #ffc553; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-sans); }
input, select, textarea { font-family: var(--font-sans); }

/* Selection */
::selection { background: var(--gold-glow-md); color: var(--gold); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--wide  { max-width: 1400px; }
.container--narrow{ max-width: 800px; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  height: 60px;
  gap: var(--space-lg);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav__logo:hover { color: var(--gold); }

.nav__logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-gold);
}

.nav__links {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
}

.nav__link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.nav__link:hover,
.nav__link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.nav__link.active { color: var(--gold); }

.nav__search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: text;
  transition: border-color var(--duration) var(--ease);
}
.nav__search:hover { border-color: var(--border-md); }
.nav__search-icon { flex-shrink: 0; }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius);
  margin-left: auto;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.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); }

/* Mobile Menu */
.nav__mobile {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md);
  flex-direction: column;
  gap: var(--space-xs);
}
.nav__mobile.open { display: flex; }
.nav__mobile .nav__link { display: block; font-size: 1rem; padding: 10px 12px; }

/* ── Hero Section ───────────────────────────────────────────────────────── */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(245,166,35,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--gold-glow);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero__title span {
  background: linear-gradient(135deg, var(--gold) 0%, #ffd166 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

/* ── Stat Counter Row ───────────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}

.stat-item {
  text-align: center;
}

.stat-item__value {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-item__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── World Cup Grid ─────────────────────────────────────────────────────── */
.wc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.wc-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition:
    transform var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
  overflow: hidden;
}
.wc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.wc-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245,166,35,0.4);
  box-shadow: var(--shadow-gold), var(--shadow-md);
  color: var(--text-primary);
}
.wc-card:hover::before { opacity: 1; }

.wc-card__year {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.wc-card__host {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wc-card__champion {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
}

.wc-card__stats {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wc-card__stats span { display: flex; align-items: center; gap: 4px; }

/* ── Section Headers ────────────────────────────────────────────────────── */
.section {
  padding: var(--space-2xl) 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section__title span {
  color: var(--gold);
}

.section__link {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.section__link:hover { color: var(--gold); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.card--hoverable {
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.card--hoverable:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
}

/* ── Match Scoreboard ───────────────────────────────────────────────────── */
.scoreboard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.scoreboard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.scoreboard__stage {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.scoreboard__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
}

.scoreboard__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.scoreboard__team-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scoreboard__score {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  padding: 0 var(--space-md);
}

.scoreboard__divider {
  font-size: 2rem;
  color: var(--text-muted);
}

.scoreboard__meta {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Goal Timeline ──────────────────────────────────────────────────────── */
.goal-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.goal-event {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  padding: 6px 0;
}

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

.goal-event__minute {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 48px;
  flex-shrink: 0;
}

.goal-event__player { color: var(--text-primary); }

.goal-event__icon {
  font-size: 0.75rem;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.goal-event__icon--ball::before { content: '⚽'; }

/* ── Player Avatar ──────────────────────────────────────────────────────── */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.avatar--lg { width: 80px; height: 80px; font-size: 1.5rem; }
.avatar--sm { width: 32px; height: 32px; font-size: 0.75rem; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-elevated);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}

.data-table th[data-sortable] {
  cursor: pointer;
  user-select: none;
}
.data-table th[data-sortable]:hover { color: var(--text-primary); }
.data-table th.sorted-asc::after  { content: ' ↑'; color: var(--gold); }
.data-table th.sorted-desc::after { content: ' ↓'; color: var(--gold); }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background var(--duration) var(--ease);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.data-table .rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 40px;
}

/* Group table rank colors */
.rank-1 { color: var(--gold) !important; font-weight: 700; }
.rank-2 { color: var(--win) !important; }

/* ── Stat Bars ──────────────────────────────────────────────────────────── */
.stat-bar-group {
  display: flex;
  gap: 0;
  height: 8px;
  border-radius: 100px;
  overflow: hidden;
  margin: var(--space-sm) 0;
}

.stat-bar {
  height: 100%;
  transition: width 600ms var(--ease);
}
.stat-bar--win  { background: var(--win); }
.stat-bar--draw { background: var(--draw); }
.stat-bar--loss { background: var(--loss); }

/* ── Flags ──────────────────────────────────────────────────────────────── */
.flag {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.flag svg { display: block; }
.flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ── Badges / Tags ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge--gold    { background: var(--gold-glow); color: var(--gold); border: 1px solid rgba(245,166,35,0.3); }
.badge--win     { background: var(--win-bg);    color: var(--win);  border: 1px solid rgba(34,197,94,0.3); }
.badge--draw    { background: var(--draw-bg);   color: var(--draw); border: 1px solid rgba(129,140,248,0.3); }
.badge--loss    { background: var(--loss-bg);   color: var(--loss); border: 1px solid rgba(244,63,94,0.3); }
.badge--muted   { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Goal type labels ───────────────────────────────────────────────────── */
.goal-type {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-left: 4px;
}
.goal-type.og  { background: rgba(249,115,22,0.2); color: var(--og); }
.goal-type.pen { background: rgba(167,139,250,0.2); color: var(--pen); }

/* ── Cards (booking) ────────────────────────────────────────────────────── */
.card.yellow-card,
.card.second-yellow,
.card.red-card { font-size: 0.85rem; }

/* ── Result badges ──────────────────────────────────────────────────────── */
.result-win  { color: var(--win); }
.result-draw { color: var(--draw); }
.result-loss { color: var(--loss); }

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}
.breadcrumb a      { color: var(--text-muted); }
.breadcrumb a:hover{ color: var(--text-secondary); }
.breadcrumb__sep   { color: var(--text-muted); opacity: 0.4; }
.breadcrumb__current { color: var(--text-secondary); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  box-shadow: inset 0 -2px 0 var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
.tabs::-webkit-scrollbar {
  display: none !important; /* Chrome, Safari, Edge */
  width: 0 !important;
  height: 0 !important;
  -webkit-appearance: none;
}

.tab {
  padding: 10px var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.tab:hover          { color: var(--text-primary); }
.tab.active         { color: var(--gold); border-bottom-color: var(--gold); }

/* ── Search ─────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px var(--space-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--duration) var(--ease);
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--gold); }

.search-btn {
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px var(--space-lg);
  border-radius: var(--radius);
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.search-btn:hover { background: #ffc553; transform: translateY(-1px); }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0 var(--space-sm);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.page-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.page-btn.active {
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 700;
}
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-xl);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.footer-col__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.footer-col p { line-height: 1.7; margin-bottom: var(--space-sm); }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.footer-links a {
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}
.footer-links a:hover { color: var(--text-secondary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-win     { color: var(--win); }
.text-loss    { color: var(--loss); }
.text-draw    { color: var(--draw); }
.text-mono    { font-family: var(--font-mono); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* ── Bracket ────────────────────────────────────────────────────────────── */
.bracket {
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.bracket-match {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 200px;
  margin: 8px 0;
}

.bracket-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.8rem;
  gap: var(--space-sm);
}
.bracket-team + .bracket-team { border-top: 1px solid var(--border); }
.bracket-team.winner { color: var(--gold); font-weight: 600; }

.bracket-score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state__icon { font-size: 3rem; margin-bottom: var(--space-md); }
.empty-state__title { font-size: 1.125rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* ── Loading shimmer ────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

/* ── Page Fade-in ────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 400ms var(--ease) both; }
.fade-in--delay-1 { animation-delay: 80ms; }
.fade-in--delay-2 { animation-delay: 160ms; }
.fade-in--delay-3 { animation-delay: 240ms; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
  }

  .nav__links   { display: none; }
  .nav__search  { display: none; }
  .nav__hamburger { display: flex; }

  .hero { padding: var(--space-2xl) 0 var(--space-xl); }

  .stat-row { gap: var(--space-lg); }
  .stat-item__value { font-size: 1.75rem; }

  .scoreboard__teams { grid-template-columns: 1fr auto 1fr; gap: var(--space-md); }
  .scoreboard__score { font-size: 2.5rem; }

  .footer-grid  { grid-template-columns: 1fr; gap: var(--space-xl); }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .wc-grid { grid-template-columns: 1fr 1fr; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ── Markdown Content Styling (Globally Reusable) ─────────────────────────── */
.markdown-content {
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.markdown-content h2 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}
.markdown-content h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.markdown-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}
.markdown-content a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}
.markdown-content a:hover {
  color: var(--gold-dim);
}
.markdown-content ul {
  list-style: none;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}
.markdown-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}
.markdown-content ul li::before {
  content: "⚽";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 0.9em;
}
.markdown-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  color: var(--text-secondary);
}
.markdown-content ol li {
  margin-bottom: 0.5rem;
}
.markdown-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.markdown-content th, .markdown-content td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.markdown-content th {
  background: var(--bg-elevated);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.markdown-content tr:last-child td {
  border-bottom: none;
}
.markdown-content tr:hover td {
  background: rgba(255,255,255,0.02);
}
.markdown-content td:first-child {
  color: var(--text-secondary);
  font-weight: 600;
  background: rgba(255,255,255,0.01);
}
@media (max-width: 768px) {
  .markdown-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.markdown-content blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 1.5rem;
  margin-left: 0;
  margin-right: 0;
  font-style: italic;
  color: var(--text-muted);
}
.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 2rem auto;
}
.markdown-content iframe {
  max-width: 100%;
  border-radius: var(--radius);
  border: none;
  margin: 1.5rem 0;
}

/* Tournament Cards (Team Profile) */
.t-cards-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.t-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.t-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.t-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 16px;
}

.t-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.t-card-year {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'DM Sans', sans-serif;
}

.t-card-host {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.t-card-result {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Dynamic Result Colors */
.t-card-result.champion { background: rgba(255, 215, 0, 0.15); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.3); }
.t-card-result.runner-up { background: rgba(192, 192, 192, 0.15); color: #e0e0e0; border: 1px solid rgba(192, 192, 192, 0.3); }
.t-card-result.third-place { background: rgba(205, 127, 50, 0.15); color: #cd7f32; border: 1px solid rgba(205, 127, 50, 0.3); }

.t-card-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    text-align: center;
}

.t-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 8px;
    border-radius: var(--radius-md);
}

.t-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.t-stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
}

.t-matches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.t-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.t-match-teams {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
}

.t-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

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

.t-match-score {
    font-weight: 700;
    font-family: 'DM Sans', sans-serif;
    color: var(--gold);
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    min-width: 60px;
    text-align: center;
}

.t-match-stage {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    width: 100px;
    text-align: right;
}

@media (max-width: 768px) {
    .t-card-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .t-match {
        flex-direction: column;
        gap: 12px;
    }
    .t-match-stage {
        width: auto;
        text-align: center;
    }
}
