:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #9eabbf;
  --soft: #c6cfde;
  --bg: #071224;
  --panel: rgba(12, 25, 47, 0.78);
  --panel-strong: rgba(15, 32, 59, 0.95);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #63e6be;
  --accent-2: #7cc7ff;
  --warn: #ffd166;
  --danger: #ff7d7d;
  --ok: #8cf0a4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(99, 230, 190, 0.2), transparent 30rem),
    radial-gradient(circle at 80% 0%, rgba(124, 199, 255, 0.22), transparent 28rem),
    linear-gradient(145deg, #071224 0%, #0a1428 50%, #040814 100%);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%);
}

button,
select,
a {
  font: inherit;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  max-width: 100%;
}

.ambient {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.ambient-one {
  background: var(--accent);
  left: -8rem;
  top: 12rem;
}

.ambient-two {
  background: var(--accent-2);
  right: -8rem;
  bottom: 10rem;
}

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

.site-header {
  padding: 24px 0 18px;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 12, 24, 0.64);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding-left: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #041221;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 3px;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.filter-button,
.primary-button,
.secondary-button,
.dialog-close {
  border: 0;
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.nav-link,
.filter-button {
  color: var(--soft);
  background: transparent;
  padding: 10px 14px;
}

.nav-link:hover,
.filter-button:hover,
.secondary-button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.nav-link.is-active,
.filter-button.is-active {
  color: #041221;
  background: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  padding: 64px 0 28px;
}

.hero-copy,
.hero-panel,
.stat-card,
.owner-card,
.toolbar,
.group-card,
.team-owner-card,
.fixture-date-group,
.match-card,
.empty-state {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 420px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(150deg, rgba(99, 230, 190, 0.16), transparent 42%),
    linear-gradient(340deg, rgba(124, 199, 255, 0.18), transparent 38%),
    var(--panel);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.hero-text {
  max-width: 600px;
  color: var(--soft);
  font-size: 1.2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041221;
  font-weight: 900;
}

.primary-button:hover,
.secondary-button:hover,
.nav-link:hover,
.filter-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.status-dot {
  width: 18px;
  height: 18px;
  display: inline-block;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 8px rgba(255, 209, 102, 0.12);
  margin-bottom: auto;
}

.status-dot.live {
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(140, 240, 164, 0.12);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(255, 125, 125, 0.12);
}

.status-label {
  margin-top: 56px;
  margin-bottom: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.status-detail,
.status-note,
.muted {
  color: var(--muted);
}

.status-note {
  line-height: 1.55;
  margin-bottom: 0;
}

.layout {
  padding: 12px 0 80px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat-value {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.07em;
}

.stat-label {
  color: var(--muted);
  font-weight: 700;
}

.owner-board,
.view {
  margin-top: 28px;
}

.section-heading {
  margin-bottom: 16px;
}

.inline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

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

.owner-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.owner-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -60px;
  top: -60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 230, 190, 0.2), rgba(124, 199, 255, 0.14));
}

.owner-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.owner-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
}

.owner-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-weight: 900;
}

.owner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.owner-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.owner-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.owner-team-strip,
.team-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.team-chip,
.status-pill,
.owner-pill,
.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.team-chip {
  padding: 7px 9px;
}

.team-chip.eliminated {
  color: rgba(198, 207, 222, 0.54);
  text-decoration: line-through;
}

.team-chip.champion {
  color: #041221;
  background: linear-gradient(135deg, var(--warn), var(--accent));
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-top: 28px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
}

.select-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 42px 0 14px;
  color: var(--ink);
  background: #101d32;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.fixture-list {
  display: grid;
  gap: 16px;
}

.fixture-date-group {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.fixture-date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.fixture-date-heading h3 {
  margin: 0;
}

.fixture-date-heading span {
  color: var(--muted);
  font-weight: 800;
}

.fixture-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.match-card {
  display: grid;
  gap: 14px;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  width: 100%;
  color: inherit;
}

button.match-card {
  border: 1px solid var(--line);
}

.match-card:hover {
  border-color: var(--line-strong);
  background: var(--panel-strong);
  transform: translateY(-1px);
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  padding: 7px 9px;
  color: #041221;
  background: var(--warn);
  border-color: transparent;
}

.status-pill.live {
  background: var(--ok);
}

.status-pill.final {
  background: var(--ink);
}

.status-pill.eliminated {
  background: var(--danger);
}

.match-time {
  color: var(--muted);
  font-weight: 800;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.team-line {
  min-width: 0;
}

.team-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-pill {
  margin-top: 7px;
  padding: 6px 8px;
}

.score-box {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.3rem;
  font-weight: 900;
}

.match-venue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.group-badge {
  padding: 6px 8px;
  color: var(--ink);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.group-card {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 12px;
}

.group-card-header h3 {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 0.92rem;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr.qualified td:first-child::after,
tr.third-race td:first-child::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 7px;
  background: var(--ok);
}

tr.third-race td:first-child::after {
  background: var(--warn);
}

.team-owner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.team-owner-card {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.team-owner-card h3 {
  margin-bottom: 6px;
}

.team-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.team-list-row:last-child {
  border-bottom: 0;
}

.team-status {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.team-status.active {
  color: var(--ok);
}

.team-status.eliminated {
  color: var(--danger);
}

.team-status.champion {
  color: var(--warn);
}

.match-dialog {
  width: min(760px, calc(100% - 24px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  padding: 0;
  background: #09162a;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.match-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
}

.dialog-body {
  padding: 30px;
}

.dialog-scoreline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 26px 0;
}

.dialog-team {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.dialog-team:last-child {
  text-align: right;
}

.dialog-score {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.empty-state {
  border-radius: var(--radius-lg);
  padding: 34px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .group-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid,
  .owner-grid,
  .team-owner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fixture-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .layout {
    width: min(100% - 22px, 1180px);
  }

  .nav-shell,
  .toolbar,
  .inline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links,
  .filter-row {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .nav-link,
  .filter-button {
    white-space: nowrap;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-copy {
    min-height: 360px;
  }

  .hero-actions,
  .primary-button,
  .secondary-button,
  .select-label,
  select {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    justify-content: center;
  }

  .stat-grid,
  .owner-grid,
  .team-owner-grid {
    grid-template-columns: 1fr;
  }

  .dialog-scoreline {
    grid-template-columns: 1fr;
  }

  .dialog-team:last-child {
    text-align: left;
  }

  .dialog-score {
    text-align: center;
  }
}
