:root {
  color-scheme: light;
  --ink: #10202a;
  --muted: #60717a;
  --line: #d8e2de;
  --paper: #f4f5f0;
  --panel: #ffffff;
  --green: #126a57;
  --red: #b93c43;
  --gold: #c58f23;
  --blue: #245c94;
  --shadow: 0 18px 45px rgba(24, 38, 41, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(36, 92, 148, 0.14), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(198, 143, 35, 0.12), transparent 18%),
    linear-gradient(120deg, rgba(18, 106, 87, 0.1), rgba(201, 161, 49, 0.11)),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar,
.summary-grid,
.controls,
.content-grid {
  margin-bottom: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

h2 {
  font-size: 1.05rem;
}

.source-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  padding: 10px 12px;
  white-space: nowrap;
}

.now-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.now-strip strong {
  display: block;
  margin-top: 2px;
}

.now-strip button,
.calendar-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.now-strip button {
  min-height: 38px;
  padding: 0 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 170px 170px 280px;
  gap: 12px;
}

.summary-panel,
.controls,
.side-panel,
.schedule-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.summary-panel {
  min-height: 136px;
  padding: 18px;
}

.feature-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 20px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.7)),
    linear-gradient(135deg, rgba(18, 106, 87, 0.15), rgba(36, 92, 148, 0.12)),
    url("https://images.unsplash.com/photo-1518091043644-c1d4457512c6?auto=format&fit=crop&w=1400&q=80") center / cover;
}

.feature-copy h2 {
  max-width: 430px;
  font-size: clamp(1.4rem, 3vw, 2.45rem);
  line-height: 1.05;
}

.host-map {
  position: relative;
  min-height: 160px;
  border: 1px solid rgba(23, 33, 38, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(36, 92, 148, 0.16), rgba(18, 106, 87, 0.18)),
    radial-gradient(circle at 18% 72%, rgba(18, 106, 87, 0.34) 0 7px, transparent 8px),
    radial-gradient(circle at 42% 42%, rgba(198, 143, 35, 0.32) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 35%, rgba(185, 60, 67, 0.28) 0 7px, transparent 8px),
    rgba(255, 255, 255, 0.64);
}

.pin {
  position: absolute;
  width: max-content;
  max-width: 170px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 0.74rem;
  font-weight: 750;
  padding: 7px 9px;
  box-shadow: 0 8px 18px rgba(16, 32, 42, 0.16);
}

.pin-mexico {
  left: 8%;
  bottom: 18%;
}

.pin-canada {
  left: 34%;
  top: 20%;
}

.pin-usa {
  right: 8%;
  top: 32%;
}

.stat-panel,
.next-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.stat-value {
  font-size: 3rem;
  font-weight: 850;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-panel strong {
  line-height: 1.25;
}

.controls {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(130px, 0.56fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

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

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f0;
  padding: 4px;
}

.segmented button,
.icon-button,
#clear-filters,
.calendar-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 750;
}

.segmented button.active {
  background: white;
  color: var(--green);
  box-shadow: 0 3px 10px rgba(20, 40, 38, 0.12);
}

.side-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.muted-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.schedule-panel {
  padding: 16px;
}

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

#timezone-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.group-list {
  display: grid;
  gap: 10px;
}

.group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  box-shadow: 0 12px 24px rgba(19, 34, 39, 0.04);
}

.group-card h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

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

.team-pill,
.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--ink);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 720;
}

.team-pill {
  border: 1px solid rgba(95, 113, 122, 0.18);
  cursor: pointer;
}

.team-pill:hover,
.team-pill:focus-visible {
  border-color: rgba(18, 106, 87, 0.36);
  outline: none;
}

.team-pill.active {
  border-color: rgba(18, 106, 87, 0.28);
  background: rgba(18, 106, 87, 0.08);
}

.team-pill img,
.team-flag {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border: 1px solid rgba(23, 33, 38, 0.16);
  margin-right: 6px;
}

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

.day-section {
  display: grid;
  gap: 10px;
}

.day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.day-heading h3 {
  margin: 0;
  font-size: 1.12rem;
}

.day-heading span {
  color: var(--muted);
  font-weight: 750;
}

.match-card {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(220px, 0.34fr) 76px;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 251, 0.98));
  padding: 14px 14px 14px 16px;
  box-shadow: 0 10px 24px rgba(17, 31, 35, 0.05);
  animation: rise 180ms ease-out;
}

.match-card.knockout {
  border-left-color: var(--red);
}

.match-card.favorite-match {
  border-color: rgba(18, 106, 87, 0.28);
}

.match-actions {
  display: flex;
  gap: 6px;
  justify-content: end;
}

.icon-button.favorite-button,
.icon-button.calendar-button {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  line-height: 1;
}

.icon-button.favorite-button.active {
  color: var(--gold);
  border-color: rgba(197, 143, 35, 0.3);
  background: rgba(197, 143, 35, 0.08);
}

.match-time {
  display: grid;
  gap: 3px;
}

.match-time strong {
  font-size: 1.08rem;
}

.match-time span,
.match-meta,
.venue {
  color: var(--muted);
  font-size: 0.86rem;
}

.teams {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.team-row {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 1rem;
  font-weight: 780;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-detail {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.stage-pill {
  background: rgba(198, 154, 49, 0.18);
  color: #7a5b11;
}

.calendar-button {
  background: rgba(18, 106, 87, 0.07);
  color: var(--green);
  border-color: rgba(18, 106, 87, 0.18);
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .summary-grid,
  .content-grid,
  .controls,
  .now-strip {
    grid-template-columns: 1fr;
  }

  .feature-panel {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .segmented {
    grid-template-columns: repeat(5, 1fr);
  }

  .now-strip {
    display: grid;
  }

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

  .match-detail {
    justify-items: start;
    text-align: left;
  }

  .match-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100vw - 20px, 1480px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-status {
    width: 100%;
    white-space: normal;
  }

  .summary-panel {
    min-height: 110px;
  }

  .host-map {
    min-height: 128px;
  }

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

  .match-detail {
    justify-items: start;
    text-align: left;
  }

  .team-name {
    white-space: normal;
  }

  .now-strip {
    padding: 12px;
  }
}
