:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #dfe5ea;
  --surface: #ffffff;
  --wash: #f5f7f2;
  --grass: #0e5b3d;
  --grass-2: #1f7a55;
  --red: #c83d32;
  --gold: #d9a441;
  --navy: #17223b;
  --sky: #dcebf3;
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(245, 247, 242, 0.92);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.status-strip span,
.source-copy p,
.footer,
.host-card span {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #263241;
}

.nav a:hover {
  background: #e8eee7;
}

main {
  overflow: hidden;
}

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 72px) 28px;
  background:
    radial-gradient(circle at 72% 25%, rgba(216, 164, 65, 0.18), transparent 34%),
    linear-gradient(132deg, #f6f2e8 0%, #f5f7f2 46%, #e7f0ec 100%);
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.55rem, 6vw, 5.85rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  margin-bottom: 28px;
  color: #334155;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.75;
}

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

.primary-action,
.ghost-action,
.icon-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.ghost-action,
.icon-button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.match-stage {
  position: relative;
  min-height: 540px;
}

.pitch {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, var(--grass), var(--grass-2));
  box-shadow: var(--shadow);
}

.pitch::before,
.pitch::after {
  content: "";
  position: absolute;
  border: 3px solid rgba(255, 255, 255, 0.68);
}

.pitch::before {
  inset: 32px;
  border-radius: 12px;
}

.pitch::after {
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-line {
  position: absolute;
  top: 50%;
  left: 32px;
  right: 32px;
  height: 3px;
  background: rgba(255, 255, 255, 0.68);
}

.pitch-circle {
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: 120px;
  height: 56px;
  border: 3px solid rgba(255, 255, 255, 0.68);
  border-bottom: 0;
  border-radius: 80px 80px 0 0;
  transform: translateX(-50%);
}

.country-pin {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.pin-mexico {
  left: 9%;
  bottom: 16%;
  border-left: 7px solid var(--red);
}

.pin-usa {
  right: 13%;
  top: 16%;
  border-left: 7px solid var(--gold);
}

.pin-canada {
  left: 18%;
  top: 18%;
  border-left: 7px solid #fff;
}

.stage-panel {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: min(260px, calc(100% - 52px));
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.stage-panel span,
.stage-panel small {
  display: block;
  color: var(--muted);
}

.stage-panel strong {
  display: block;
  margin: 4px 0;
  color: var(--red);
  font-size: 3rem;
  line-height: 1;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0 clamp(18px, 5vw, 72px) 28px;
  background: #e5ebe4;
}

.status-strip div {
  min-height: 92px;
  padding: 18px;
  background: var(--surface);
}

.status-strip span,
.status-strip strong {
  display: block;
}

.status-strip strong {
  margin-top: 8px;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.toolbar,
.groups-section,
.hosts-section,
.source-section,
.data-section,
.analysis-section,
.prediction-section {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 5vw, 72px) 0;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.toolbar h2,
.section-heading h2,
.source-copy h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.08;
}

.section-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.controls label {
  display: grid;
  gap: 6px;
}

.controls span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select {
  width: 180px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.search-box input {
  width: min(280px, 72vw);
}

.icon-button[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #241a05;
  font-weight: 900;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px) 0;
}

.day-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
}

.day-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.day-card.is-finished > header {
  cursor: pointer;
  background: #fbfcf8;
}

.day-card.is-collapsed .match-list {
  display: none;
}

.day-card.is-collapsed > header {
  border-bottom: 0;
}

.date-label {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 900;
}

.day-card h3 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

.match-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef3ed;
  color: var(--grass);
  font-weight: 800;
  font-size: 0.82rem;
}

.match-list {
  display: grid;
}

.match-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 64px 68px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0ef;
}

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

.finished-match {
  background: #fafafa;
}

.fav-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #8b95a1;
  cursor: pointer;
}

.fav-button.active {
  background: #fff7d7;
  border-color: var(--gold);
  color: #a56a00;
}

.teams {
  min-width: 0;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-pill {
  border-radius: 999px;
  padding: 5px 8px;
  background: #eff6ff;
  color: #214a7b;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.match-row time {
  text-align: right;
  color: var(--navy);
  font-weight: 900;
}

.group-grid,
.analysis-grid,
.prediction-grid,
.standings-grid,
.knockout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.group-card {
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.group-card h3 {
  margin-bottom: 12px;
  color: var(--grass);
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-list span {
  border-radius: 999px;
  padding: 6px 9px;
  background: #f0f2f5;
  font-size: 0.9rem;
}

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.accuracy-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.accuracy-board div {
  min-height: 96px;
  padding: 18px;
  background: #fff;
}

.accuracy-board span,
.accuracy-board strong {
  display: block;
}

.accuracy-board span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.accuracy-board strong {
  margin-top: 8px;
  color: var(--red);
  font-size: 1.85rem;
  line-height: 1;
}

.data-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
}

.table-wrap.compact .data-table {
  min-width: 640px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0ef;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f7faf7;
  color: #384354;
  font-size: 0.86rem;
  white-space: nowrap;
}

.data-table td {
  color: #263241;
  line-height: 1.55;
}

.analysis-card,
.prediction-card,
.standing-card,
.knockout-card,
.third-place-panel,
.rules-note {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.standings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.standing-card h3,
.knockout-card h3,
.third-place-panel h3,
.rules-note h3 {
  margin-bottom: 12px;
}

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

.mini-table th,
.mini-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #eef1ef;
  text-align: right;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
}

.qualified-row td:first-child {
  color: var(--grass);
  font-weight: 900;
}

.third-row td:first-child {
  color: #9b6b08;
  font-weight: 900;
}

.third-place-panel,
.rules-note {
  margin-top: 18px;
}

.third-place-panel p,
.rules-note p,
.knockout-card p {
  color: var(--muted);
  line-height: 1.65;
}

.rule-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.rule-strip div {
  min-height: 92px;
  padding: 18px;
  background: #fff;
}

.rule-strip span,
.rule-strip strong {
  display: block;
}

.rule-strip span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.rule-strip strong {
  margin-top: 8px;
}

.knockout-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.knockout-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--red);
}

.analysis-card h3,
.prediction-card h3 {
  margin-bottom: 8px;
}

.analysis-card p,
.analysis-note {
  color: var(--muted);
  line-height: 1.65;
}

.analysis-note {
  margin: 14px 0 0;
}

.prediction-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.prediction-card time {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.forecast-score {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0 14px;
  background: var(--navy);
  color: #fff;
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
}

.prediction-check {
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #263241;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.55;
}

.prediction-check.pending {
  background: #f1f5f9;
  color: #64748b;
}

.prediction-check.hit {
  background: #dcfce7;
  color: #166534;
}

.prediction-check.partial {
  background: #fef3c7;
  color: #8a5b05;
}

.prediction-check.miss {
  background: #fee2e2;
  color: #991b1b;
}

.prediction-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.prediction-card dl div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
}

.prediction-card dt {
  color: var(--muted);
  font-weight: 800;
}

.prediction-card dd {
  min-width: 0;
  margin: 0;
  color: #263241;
  line-height: 1.55;
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.host-card {
  min-height: 220px;
  border-radius: 8px;
  padding: 24px;
  color: #fff;
}

.host-card h3 {
  margin: 8px 0 14px;
  font-size: 2rem;
}

.host-card p,
.host-card span {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.host-card.mexico {
  background: linear-gradient(135deg, #7b211c, #c84a35);
}

.host-card.usa {
  background: linear-gradient(135deg, #18213c, #36557c);
}

.host-card.canada {
  background: linear-gradient(135deg, #0f5e43, #2a8d65);
}

.source-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.55fr);
  align-items: center;
  gap: 26px;
  padding-bottom: clamp(34px, 6vw, 72px);
}

.source-copy p {
  max-width: 680px;
  line-height: 1.75;
}

.source-image {
  display: block;
  max-height: 460px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.source-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 24px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c2bc;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

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

  .match-stage {
    min-height: 420px;
  }

  .status-strip,
  .accuracy-board,
  .rule-strip,
  .schedule-grid,
  .group-grid,
  .analysis-grid,
  .prediction-grid,
  .standings-grid,
  .knockout-grid,
  .host-grid,
  .source-section {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar {
    display: grid;
    align-items: start;
  }

  .controls {
    justify-content: start;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .hero {
    padding-top: 30px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.45rem);
  }

  .match-stage {
    min-height: 360px;
  }

  .status-strip,
  .accuracy-board,
  .rule-strip,
  .schedule-grid,
  .group-grid,
  .analysis-grid,
  .prediction-grid,
  .standings-grid,
  .knockout-grid,
  .host-grid,
  .source-section {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .controls label,
  input,
  select,
  .icon-button {
    width: 100%;
  }

  .match-row {
    grid-template-columns: 38px minmax(0, 1fr) 56px;
    grid-template-areas:
      "fav teams group"
      "fav time time";
    min-height: 74px;
  }

  .fav-button {
    grid-area: fav;
  }

  .teams {
    grid-area: teams;
    white-space: normal;
  }

  .group-pill {
    grid-area: group;
  }

  .match-row time {
    grid-area: time;
    text-align: left;
  }

  .footer {
    display: grid;
  }
}
