:root {
  color-scheme: light;
  --navy: #123f82;
  --navy-dark: #082c60;
  --blue: #1f69c5;
  --sky: #eaf3ff;
  --gold: #f2b629;
  --ink: #152438;
  --muted: #64748b;
  --line: #d9e2ef;
  --surface: #ffffff;
  --background: #f4f7fb;
  --danger: #a93030;
  --shadow: 0 14px 35px rgba(14, 45, 85, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(43, 112, 198, 0.12), transparent 32rem),
    var(--background);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="date"],
input[type="checkbox"] {
  cursor: pointer;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 28px;
}

.hero {
  margin-bottom: 26px;
}

.season-label {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  color: var(--navy-dark);
  font-size: clamp(31px, 5vw, 48px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.finder {
  padding: 24px;
  border: 1px solid rgba(217, 226, 239, 0.85);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.primary-filters,
.secondary-filters {
  display: grid;
  gap: 16px;
}

.primary-filters {
  grid-template-columns: minmax(0, 1.75fr) minmax(220px, 0.75fr);
}

.secondary-filters {
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(150px, 0.7fr) auto auto;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #40536c;
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c7d4e4;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 150ms, box-shadow 150ms;
}

.field input {
  padding: 0 14px;
}

.field select {
  padding: 0 38px 0 14px;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 105, 197, 0.15);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-left: 43px;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 15px;
  left: 16px;
  width: 15px;
  height: 15px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 4px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
}

.check-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  color: #40536c;
  font-size: 14px;
  font-weight: 700;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.clear-button,
.error-card button {
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 11px;
  color: var(--navy);
  background: var(--sky);
  font-weight: 800;
}

.clear-button:hover,
.error-card button:hover {
  background: #dcecff;
}

.results-section {
  margin-top: 34px;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 4px 14px;
}

.results-heading h2 {
  margin-bottom: 0;
  color: var(--navy-dark);
  font-size: 25px;
  letter-spacing: -0.025em;
}

.result-count {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.games {
  display: grid;
  gap: 12px;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 210px;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 5px 17px rgba(16, 43, 79, 0.045);
}

.game-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
  content: "";
}

.date-block {
  display: grid;
  min-height: 67px;
  place-content: center;
  border-radius: 13px;
  color: var(--navy);
  background: var(--sky);
  text-align: center;
}

.date-block .weekday {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.date-block .day {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.05;
}

.date-block .month {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.game-main {
  min-width: 0;
}

.division {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #695011;
  background: #fff4d1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.matchup {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 18px;
  font-weight: 820;
  line-height: 1.3;
}

.matchup .versus {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-club {
  color: var(--navy);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 17px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.location {
  justify-self: end;
  min-width: 0;
  text-align: right;
}

.location-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.location a,
.location .plain-location {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.location a:hover {
  text-decoration: underline;
}

.location a::after {
  margin-left: 5px;
  content: "↗";
}

.game-card.cancelled {
  opacity: 0.67;
}

.game-card.cancelled::before {
  background: var(--danger);
}

.cancelled-label {
  color: var(--danger);
  font-weight: 850;
}

.status-card {
  display: grid;
  min-height: 180px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 1px dashed #bfd0e4;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.status-card strong {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 18px;
}

.status-card p {
  margin-bottom: 0;
}

.error-card button {
  margin-top: 14px;
}

.loader {
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border: 3px solid #d7e4f3;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

footer p {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding-top: 24px;
  }

  .hero {
    align-items: flex-start;
  }

  .intro {
    font-size: 15px;
  }

  .finder {
    padding: 17px;
    border-radius: 17px;
  }

  .primary-filters,
  .secondary-filters {
    grid-template-columns: 1fr;
  }

  .secondary-filters {
    gap: 12px;
  }

  .check-field {
    min-height: 32px;
  }

  .clear-button {
    width: 100%;
  }

  .game-card {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .location {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .location-label {
    display: none;
  }

  .results-heading {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
