/* 2026 FIFA World Cup Portal — Premium Redesign v2 (TasteSkill) */

/* ========== Reset & Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ========== Design Tokens — Light Mode ========== */
:root {
  /* Backgrounds */
  --bg:          #f5f4f1;        /* warm off-white, main page */
  --surface:     #ffffff;        /* card surface */
  --surface-2:   #f0eeeb;        /* secondary surface / hover */
  --surface-3:   #e8e6e1;        /* tertiary / pressed */

  /* Borders */
  --border:      rgba(15, 17, 23, 0.08);
  --border-med:  rgba(15, 17, 23, 0.14);

  /* Accent — single sport-orange */
  --accent:      #e8622c;
  --accent-soft: rgba(232, 98, 44, 0.10);
  --accent-med:  rgba(232, 98, 44, 0.20);

  /* Text hierarchy */
  --text-1:      #0f1117;
  --text-2:      #5a5c63;
  --text-3:      #9b9da4;

  /* Status colors (functional only) */
  --live:        #dc2626;
  --live-soft:   rgba(220, 38, 38, 0.09);
  --win:         #16a34a;
  --win-soft:    rgba(22, 163, 74, 0.09);
  --scheduled:   rgba(15, 17, 23, 0.45);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(15,17,23,0.07), 0 1px 2px rgba(15,17,23,0.04);
  --shadow-md:   0 4px 12px rgba(15,17,23,0.08), 0 2px 4px rgba(15,17,23,0.04);
  --shadow-lg:   0 8px 24px rgba(15,17,23,0.10), 0 4px 8px rgba(15,17,23,0.05);

  /* Motion */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== Auto Dark Mode ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0d1117;
    --surface:     #161b26;
    --surface-2:   #1e2535;
    --surface-3:   #273044;

    --border:      rgba(255, 255, 255, 0.07);
    --border-med:  rgba(255, 255, 255, 0.12);

    --accent:      #f07340;
    --accent-soft: rgba(240, 115, 64, 0.12);
    --accent-med:  rgba(240, 115, 64, 0.22);

    --text-1:      #e8e9ec;
    --text-2:      rgba(232, 233, 236, 0.58);
    --text-3:      rgba(232, 233, 236, 0.34);

    --live:        #f87171;
    --live-soft:   rgba(248, 113, 113, 0.12);
    --win:         #4ade80;
    --win-soft:    rgba(74, 222, 128, 0.10);
    --scheduled:   rgba(232, 233, 236, 0.42);

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.25);
    --shadow-md:   0 4px 12px rgba(0,0,0,0.30);
    --shadow-lg:   0 8px 24px rgba(0,0,0,0.40);
  }
}

/* ========== Base ========== */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-med); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ========== App Shell ========== */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#app-root {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

/* ========== Navigation ========== */
#main-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-shell {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 60px;
}

/* Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.brand-text sup {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--accent);
  vertical-align: super;
  letter-spacing: 0;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 6px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  position: relative;
}
.nav-link:hover {
  color: var(--text-1);
  background: var(--surface-2);
}
.nav-link.active {
  color: var(--accent);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.nav-link svg { width: 15px; height: 15px; stroke-width: 1.75; flex-shrink: 0; }

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lang-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.15s var(--ease);
  letter-spacing: 0.02em;
}
.lang-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--border);
}
.icon-btn svg { width: 16px; height: 16px; stroke-width: 1.75; }

/* Mobile toggle */
.mobile-toggle { display: none; }

/* ========== Section Headers ========== */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-bar-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-bar-left svg { color: var(--accent); width: 15px; height: 15px; stroke-width: 2; }

.section-bar-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: 0.01em;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.15s var(--ease);
}
.view-all-link:hover { color: var(--accent); }
.view-all-link svg { width: 12px; height: 12px; transition: transform 0.15s var(--ease); }
.view-all-link:hover svg { transform: translateX(2px); }

/* ========== Page Title ========== */
.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-title .accent { color: var(--accent); }

/* ========== Cards ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-pad { padding: 1.25rem; }

/* ========== Dashboard Two-Column Layout ========== */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.dash-left { display: flex; flex-direction: column; gap: 1.25rem; }
.dash-right { display: flex; flex-direction: column; gap: 1.25rem; }

/* ========== Next Match Hero Card ========== */
.next-match-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.next-match-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.next-match-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    170deg,
    rgba(10, 12, 20, 0.55) 0%,
    rgba(10, 12, 20, 0.75) 55%,
    rgba(10, 12, 20, 0.92) 100%
  );
}

.next-match-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 300px;
  padding: 1.5rem;
  justify-content: space-between;
  color: #fff;
}

.next-match-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.70);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  align-self: flex-start;
}

.next-match-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.next-match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex: 1;
  padding: 1rem 0;
}

.next-match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  text-align: center;
}

.next-match-flag {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.next-match-team-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.next-match-vs {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.next-match-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.countdown-area {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.countdown-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.50);
}

.countdown-digits {
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.countdown-colon {
  opacity: 0.45;
  font-size: 1.1rem;
  margin: 0 1px;
  animation: blink-colon 1s step-end infinite;
}

@keyframes blink-colon { 50% { opacity: 0; } }

.countdown-go-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.countdown-go-btn:hover {
  background: #d4561f;
  transform: translateX(2px);
}
.countdown-go-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* No match fallback */
.next-match-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  text-align: center;
  color: rgba(255,255,255,0.55);
}
.next-match-empty p:first-child { font-size: 1.2rem; font-weight: 600; }
.next-match-empty p:last-child { font-size: 0.8rem; }

/* ========== Today's Matches List (right sidebar) ========== */
.match-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  border-radius: 6px;
  cursor: pointer;
}
.match-list-item:last-child { border-bottom: none; }
.match-list-item:hover { background: var(--surface-2); padding-left: 0.5rem; padding-right: 0.5rem; margin: 0 -0.5rem; }

.match-list-teams {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.match-list-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.match-list-team-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-1);
  min-width: 0;
  flex: 1;
}

.match-list-team-name.winner { font-weight: 700; }

.match-list-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  min-width: 14px;
  text-align: right;
}
.match-list-score.winner { color: var(--accent); }
.match-list-score.null-score { color: var(--text-3); }

.match-list-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-badge.live {
  background: var(--live-soft);
  color: var(--live);
}
.status-badge.finished {
  background: var(--surface-2);
  color: var(--text-3);
}
.status-badge.scheduled {
  background: var(--surface-2);
  color: var(--text-2);
}

.live-pulse {
  display: inline-flex;
  position: relative;
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}
.live-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--live);
  opacity: 0.6;
  animation: live-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.live-pulse::after {
  content: '';
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
}

@keyframes live-ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.match-list-time {
  font-size: 0.68rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ========== Match Card (Full Grid) ========== */
.match-card {
  padding: 1.1rem;
  transition: all 0.2s var(--ease);
}
.match-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-med);
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-3);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
  font-weight: 500;
}

.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
}

.match-team-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.flag-sm {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-2);
}

.flag-md {
  width: 40px;
  height: 27px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.team-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.team-name.winner { font-weight: 700; }

.team-score {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 24px;
  text-align: right;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.team-score.winner { color: var(--accent); }
.team-score.null-score { color: var(--text-3); font-weight: 400; font-size: 0.9rem; }

.match-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-3);
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  margin-top: 0.65rem;
}

.detail-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.7rem;
  transition: all 0.15s var(--ease);
}
.detail-link:hover { opacity: 0.75; }

/* ========== News Row (sidebar) ========== */
.news-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.news-row:last-child { border-bottom: none; }
.news-row:hover { opacity: 0.75; }

.news-thumb {
  width: 72px;
  height: 50px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.news-row-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.2rem;
}

.news-row-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-row:hover .news-row-title { color: var(--accent); }

.news-row-meta {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ========== News Card (full page) ========== */
.news-card-full {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.news-card-img-wrap {
  width: 100%;
  height: 175px;
  overflow: hidden;
  background: var(--surface-2);
}

.news-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.news-card-full:hover .news-card-img { transform: scale(1.04); }

.news-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
}

.news-card-source {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.news-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-desc {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.68rem;
  color: var(--text-3);
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-med);
  transition: all 0.15s var(--ease);
}
.read-more-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.read-more-btn svg { width: 11px; height: 11px; }

/* ========== Scorer Row ========== */
.scorer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s var(--ease);
}
.scorer-row:last-child { border-bottom: none; }
.scorer-row:hover { background: var(--surface-2); border-radius: 6px; padding-left: 0.5rem; padding-right: 0.5rem; margin: 0 -0.5rem; }

.scorer-rank {
  width: 18px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.scorer-rank.top3 { color: var(--accent); }

.scorer-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.scorer-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.scorer-team-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  color: var(--text-3);
  min-width: 0;
  flex-shrink: 0;
  max-width: 70px;
  overflow: hidden;
}
.scorer-team-badge img { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.scorer-team-badge span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scorer-goals {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.scorer-row:hover .scorer-goals { color: var(--accent); }

/* ========== Standings Grid ========== */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.group-header-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 26px 26px 26px 26px 34px;
  align-items: center;
  padding: 0.6rem 1rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.group-header-row:first-child span:first-child {
  color: var(--accent);
  font-size: 0.72rem;
}

.group-team-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 26px 26px 26px 26px 34px;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  transition: background 0.12s;
  border-top: 1px solid rgba(15,17,23,0.04);
}

@media (prefers-color-scheme: dark) {
  .group-team-row { border-top-color: rgba(255,255,255,0.04); }
}

.group-team-row:hover { background: var(--surface-2); }
.group-team-row.qualified-row { background: var(--accent-soft); }
.group-team-row.qualified-row:hover { background: var(--accent-med); }

.group-team-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.group-team-pos {
  width: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.group-team-pos.qualified { color: var(--accent); }

.group-team-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
}
.group-team-row:hover .group-team-name { color: var(--accent); }

.group-stat {
  font-variant-numeric: tabular-nums;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-2);
}

.group-pts {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-1);
}
.qualified-row .group-pts { color: var(--accent); }

/* ========== Tabs ========== */
.tabs-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  padding-bottom: 0;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s var(--ease);
  border-radius: 0;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-1); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ========== Match Date Group ========== */
.date-group { margin-bottom: 2rem; }

.date-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.85rem;
}
.date-group-title::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ========== Team Grid ========== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.75rem;
  gap: 0.6rem;
  transition: all 0.2s var(--ease);
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-med); }

.team-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.team-card-group {
  font-size: 0.6rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ========== Team Detail ========== */
.team-detail-header {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.team-detail-flag {
  width: 90px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.team-detail-name {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: -0.03em;
}

.team-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.pill {
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* ========== Match Detail Hero ========== */
.match-hero {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
}

.match-hero-stage {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.match-hero-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 580px;
  margin-bottom: 1.5rem;
}

.match-hero-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.match-hero-flag {
  width: 72px;
  height: 50px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.match-hero-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.match-hero-score {
  font-family: 'Outfit', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.score-dash { color: var(--text-3); font-weight: 300; }

.match-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-2);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 360px;
}

/* ========== Data Table ========== */
.data-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  color: var(--text-3);
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .num-col { font-variant-numeric: tabular-nums; }

/* ========== Chart Canvas ========== */
.chart-canvas { width: 100%; max-height: 300px; margin-top: 0.75rem; }

/* ========== Grids ========== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

.grid-2-fixed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-med);
  border-radius: 14px;
  width: 90%;
  max-width: 460px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(-16px) scale(0.98);
  transition: transform 0.3s var(--ease-out);
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-1); }

.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.6rem 0.85rem;
  color: var(--text-1);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s var(--ease);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.82rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  transition: all 0.15s var(--ease);
}
.btn-primary:hover { background: #d4561f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(232,98,44,0.3); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.82rem;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.15s var(--ease);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text-1); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text-1);
  color: var(--surface);
  border-radius: 9px;
  padding: 0.75rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
}
.toast.active { transform: translateY(0); opacity: 1; }

/* ========== Footer ========== */
#main-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-3);
}

.footer-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

/* ========== Loading Spinner ========== */
.initial-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 1rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border-med);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Skeleton Loader ========== */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 5px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========== Tournament Status Strip ========== */
.tournament-strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 1rem;
  background: var(--accent);
  border-radius: 8px;
  margin-bottom: 1.25rem;
  color: #fff;
  overflow: hidden;
}

.tournament-strip-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.tournament-strip-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tournament-strip-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin-top: 1px;
}

.tournament-strip-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}

.tournament-strip-title {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

/* Progress bar in the strip */
.strip-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.strip-progress-label { font-size: 0.6rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; }
.strip-progress-bar { height: 4px; background: rgba(255,255,255,0.25); border-radius: 2px; overflow: hidden; }
.strip-progress-fill { height: 100%; background: #fff; border-radius: 2px; transition: width 0.6s var(--ease); }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
  .nav-menu { display: none; }
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0.75rem;
    right: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-med);
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .nav-menu.active .nav-link.active::after { display: none; }
  .mobile-toggle { display: flex; }
}

@media (max-width: 768px) {
  #app-root { padding: 1rem 1rem 2.5rem; }
  .nav-shell { padding: 0 1rem; }
  .page-title { font-size: 1.45rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-fixed { grid-template-columns: 1fr; }
  .match-hero-score { font-size: 2.75rem; }
  .match-hero-board { gap: 1.25rem; }
  .match-hero-name { font-size: 1rem; }
  .team-detail-header { padding: 1.5rem; gap: 1.25rem; }
  .team-detail-name { font-size: 1.75rem; }
  .tournament-strip { gap: 1rem; }
  .tournament-strip-title { display: none; }
}
