:root {
  --bg: #080d18;
  --bg-soft: #0d1424;
  --card: rgba(20, 29, 48, 0.78);
  --card-solid: #141d30;
  --border: rgba(148, 163, 184, 0.14);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --live: #f87171;
  --warn: #fbbf24;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(52, 211, 153, 0.13), transparent 65%),
    radial-gradient(700px 420px at 88% 4%, rgba(96, 165, 250, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(13, 20, 36, 0.6), transparent 45%);
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 13, 24, 0.82);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  font-size: 19px;
}

.brand-accent { color: var(--accent); }

.nav { display: flex; gap: 26px; margin-left: auto; }

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 21px 0 19px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav-link:hover, .nav-link.active { color: var(--text); border-color: var(--accent); }

.live-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
}

/* Hero */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 56px 0 34px;
}

.eyebrow, .card-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
  color: var(--accent);
}

.hero h1 {
  margin: 12px 0 10px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -2px;
  font-weight: 800;
}

.hero h1 span { color: var(--accent); }

.hero-copy p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
}

.hero-card {
  flex: 0 0 235px;
  padding: 18px 20px 20px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.14), rgba(20, 29, 48, 0.9));
  border: 1px solid rgba(52, 211, 153, 0.25);
  box-shadow: var(--shadow);
}

.hero-card-top { display: flex; align-items: center; gap: 10px; }
.hero-flag { font-size: 24px; line-height: 1; }
.hero-card-label { font-size: 10px; letter-spacing: 1.5px; font-weight: 800; color: var(--accent); }
.hero-round { font-size: 38px; font-weight: 800; letter-spacing: -1.5px; margin: 8px 0 2px; }
.hero-card-bottom { color: var(--muted); font-size: 13px; }

/* Section titles */
.section-title, .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.section-title h2, .section-heading h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.section-title span, .section-heading span { color: var(--dim); font-size: 12px; }

/* Tournament tabs */
.tournament-section { margin-bottom: 26px; }

.tournament-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tournament-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-align: left;
  transition: transform .18s, border-color .18s, background .18s;
}

.tournament-tab:hover { transform: translateY(-2px); border-color: rgba(148, 163, 184, 0.35); }

.tournament-tab.active {
  border-color: var(--tab-accent, var(--accent));
  background: color-mix(in srgb, var(--tab-accent, var(--accent)) 12%, var(--card-solid));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tab-accent, var(--accent)) 25%, transparent);
}

.tab-flag {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: rgba(255, 255, 255, 0.05);
}

.tab-text { min-width: 0; }
.tab-name { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-country { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.round-control, .toolbar-right, .filters { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .18s, border-color .18s;
}

.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.round-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.round-select-label { font-size: 12px; color: var(--muted); }

select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

select option { background: var(--card-solid); color: var(--text); }

.ghost-btn, .text-btn, .wide-btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 9px 13px;
  transition: color .18s, border-color .18s, background .18s;
}

.ghost-btn:hover, .text-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.ghost-btn.is-current { color: var(--accent); border-color: rgba(52, 211, 153, 0.4); }

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
}

.search-box:focus-within { border-color: var(--accent); }
.search-box input { width: 190px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: var(--dim); }

.filter-btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: all .18s;
}

.filter-btn:hover { color: var(--text); }
.filter-btn.active { background: var(--accent-soft); border-color: rgba(52, 211, 153, 0.3); color: var(--accent); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; padding-bottom: 60px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }

/* Round summary */
.round-summary { padding: 16px 18px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.summary-title strong { display: block; font-size: 16px; }
.summary-title span { color: var(--muted); font-size: 12px; }
.summary-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font-size: 19px; letter-spacing: -0.5px; }
.stat span { font-size: 11px; color: var(--muted); }
.stat.live b { color: var(--live); }
.stat.goals b { color: var(--accent); }

/* Match cards */
.matches { display: grid; gap: 10px; }

.match {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 13px 16px 15px;
  transition: border-color .18s, transform .18s;
}

.match:hover { border-color: rgba(148, 163, 184, 0.32); transform: translateY(-1px); }
.match.live { border-color: rgba(248, 113, 113, 0.38); background: linear-gradient(90deg, rgba(248, 113, 113, 0.07), var(--card) 45%); }

.match-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.status {
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
}

.status.finished { background: rgba(148, 163, 184, 0.13); color: #cbd5e1; }
.status.live { background: rgba(248, 113, 113, 0.16); color: var(--live); }
.status.upcoming { background: rgba(251, 191, 36, 0.13); color: var(--warn); }
.venue { margin-left: auto; }

.match-body {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: center;
  gap: 10px;
}

.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team.away { flex-direction: row-reverse; text-align: right; }

.crest {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--team-color) 85%, white), color-mix(in srgb, var(--team-color) 65%, black));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 5px 14px rgba(0, 0, 0, 0.25);
}

.team-name { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-city { display: block; font-size: 11px; color: var(--dim); font-weight: 400; }
.winner .team-name { color: var(--text); font-weight: 800; }
.loser .team-name { color: var(--muted); }

.score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.score .dash { color: var(--dim); font-size: 17px; font-weight: 400; }
.match.live .score { color: var(--live); }
.score .time { color: var(--dim); }

.kickoff {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 46px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--text); margin-bottom: 5px; }

/* Sidebar */
.sidebar { display: grid; gap: 20px; position: sticky; top: 86px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 12px; }
.card-head h3 { margin: 4px 0 0; font-size: 16px; }
.card-kicker { display: block; }
.text-btn { padding: 5px 9px; font-size: 11px; }

.table-scroll { overflow-x: auto; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.standings-table th { text-align: left; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.standings-table th:not(:nth-child(2)), .standings-table td:not(:nth-child(2)) { text-align: center; }
.standings-table td { padding: 8px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); font-variant-numeric: tabular-nums; }
.standings-table tr:last-child td { border-bottom: 0; }
.standings-table tr.champions td:first-child { box-shadow: inset 3px 0 0 var(--accent); color: var(--accent); font-weight: 800; }
.standings-table tr.relegation td:first-child { box-shadow: inset 3px 0 0 var(--live); }
.standings-table tr.current-team { background: rgba(255, 255, 255, 0.035); }
.table-team { display: flex; align-items: center; gap: 8px; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.points { font-weight: 800; }
.card-note { margin: 6px 18px 16px; font-size: 10.5px; color: var(--dim); }

.next-badge { font-size: 10px; font-weight: 800; color: var(--warn); background: rgba(251, 191, 36, 0.12); border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.next-matches { padding: 0 18px; display: grid; gap: 9px; }
.next-match { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.next-match .pair { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-match .when { color: var(--dim); font-size: 11px; white-space: nowrap; }
.wide-btn { display: block; width: calc(100% - 36px); margin: 16px 18px 18px; text-align: center; border-color: rgba(52, 211, 153, 0.3); color: var(--accent); }

/* Footer */
.footer { border-top: 1px solid var(--border); background: rgba(8, 13, 24, 0.75); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 0; color: var(--dim); font-size: 12px; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .tournament-tabs { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 24px, 1180px); }
  .nav { display: none; }
  .live-clock { margin-left: auto; }
  .hero { flex-direction: column; align-items: stretch; padding-top: 36px; }
  .hero-card { flex: auto; }
  .toolbar { align-items: stretch; }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .search-box input { width: 100%; }
  .filters { flex-wrap: wrap; }
  .sidebar { grid-template-columns: 1fr; }
  .match-body { grid-template-columns: 1fr 76px 1fr; gap: 5px; }
  .crest { width: 32px; height: 32px; flex-basis: 32px; font-size: 9px; border-radius: 9px; }
  .team { gap: 6px; }
  .team-name { font-size: 12px; }
  .team-city { display: none; }
  .score, .kickoff { font-size: 18px; }
  .venue { display: none; }
}

@media (max-width: 430px) {
  .tournament-tabs { grid-template-columns: 1fr; }
  .summary-stats { gap: 14px; }
  .round-control { flex-wrap: wrap; }
}
