:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #eef6fb;
  --text: #172033;
  --muted: #657083;
  --line: #dfe7ef;
  --blue: #0f75bc;
  --blue-dark: #07588e;
  --green: #16a085;
  --gold: #f2b84b;
  --shadow: 0 18px 45px rgba(19, 42, 74, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  min-height: 320px;
  background:
    linear-gradient(120deg, rgba(15, 117, 188, 0.94), rgba(22, 160, 133, 0.86)),
    url("https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: #fff;
}

.hero-compact {
  min-height: 280px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px clamp(18px, 4vw, 34px);
}

.brand,
.tabs {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.brand-text {
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.tabs {
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tabs a {
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 700;
}

.tabs a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.tabs a.is-active {
  background: rgba(255, 255, 255, 0.24);
}

.hero-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px clamp(18px, 4vw, 34px) 64px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #d9ffe9;
}

main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 42px clamp(18px, 4vw, 34px) 72px;
}

.section + .section {
  margin-top: 48px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: 0;
}

.filter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

select {
  min-width: 120px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.match-card {
  display: grid;
  gap: 18px;
  min-width: 0;
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.match-meta,
.teams,
.venue,
.team {
  display: flex;
  align-items: center;
  min-width: 0;
}

.match-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.match-meta time {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue-dark);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 9px;
  font-weight: 900;
  text-align: center;
}

.team.away {
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.team img,
.team-cell img,
.flag-placeholder {
  width: 38px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.09);
}

.flag-placeholder {
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.team-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.2;
  white-space: normal;
}

.versus {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: var(--gold);
  color: #2d2107;
  font-size: 12px;
  font-weight: 900;
}

.venue {
  min-height: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tables {
  display: grid;
  gap: 24px;
}

.standing-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.standing-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface-soft);
}

.standing-title h3 {
  margin: 0;
  font-size: 18px;
}

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

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

th,
td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td:first-child,
th:first-child {
  width: 72px;
}

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

.rank {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--blue-dark);
  font-weight: 900;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  font-weight: 900;
}

.points {
  color: var(--blue-dark);
  font-weight: 900;
}

.empty {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    justify-content: space-between;
  }

  .tabs a {
    flex: 1;
    text-align: center;
  }

  .hero {
    min-height: 350px;
  }

  .hero-content {
    padding-top: 46px;
  }

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

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

  .match-card {
    min-height: 230px;
  }

  .filter {
    justify-content: space-between;
  }

  select {
    flex: 1;
  }

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

  table {
    min-width: 0;
  }

  th,
  td {
    padding: 14px 10px;
  }

  th:nth-child(4),
  th:nth-child(5),
  th:nth-child(6),
  th:nth-child(7),
  th:nth-child(8),
  th:nth-child(9),
  td:nth-child(4),
  td:nth-child(5),
  td:nth-child(6),
  td:nth-child(7),
  td:nth-child(8),
  td:nth-child(9) {
    display: none;
  }

  td:first-child,
  th:first-child {
    width: 58px;
  }

  td:nth-child(3),
  th:nth-child(3),
  td:nth-child(10),
  th:nth-child(10) {
    width: 58px;
  }

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

  .team-cell img {
    width: 32px;
    height: 22px;
  }

  .rank {
    width: 34px;
    height: 34px;
  }
}
