:root {
  color-scheme: dark;
  --bg: #090b0c;
  --surface: #101315;
  --surface-2: #15191c;
  --text: #f5f3ef;
  --muted: #96999c;
  --dim: #666a6e;
  --line: #2a2e32;
  --line-soft: #1e2225;
  --red: #ef3326;
  --red-dark: #b92018;
  --green: #57c57a;
  --max: 1240px;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 45% -10%, #15191c 0, var(--bg) 38%); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid #ff655a; outline-offset: 3px; }

.site-header { max-width: var(--max); margin: 0 auto; padding: 34px 28px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 16px; color: var(--text); text-decoration: none; text-transform: uppercase; font-size: clamp(23px, 3vw, 34px); line-height: 1; font-weight: 850; letter-spacing: -.035em; }
.brand span { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 3px; background: var(--red); box-shadow: 0 0 25px rgba(239,51,38,.15); }
.federation-switch { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0c0f10; }
.federation-switch button { min-height: 52px; padding: 0 24px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 700; }
.federation-switch button:last-child { border-right: 0; }
.federation-switch button.is-active { background: var(--red); color: #fff; border-color: var(--red); }

main { max-width: var(--max); margin: 0 auto; padding: 0 28px 70px; }
.search-panel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(15,18,20,.78); box-shadow: 0 28px 80px rgba(0,0,0,.18); }
.primary-fields { display: grid; grid-template-columns: minmax(420px, 1.45fr) minmax(220px, .72fr) minmax(250px, .83fr); }
.field { min-width: 0; padding: 22px; border-right: 1px solid var(--line); }
.field:last-child { border-right: 0; }
.field-label, .eyebrow { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.compact-field select { width: 100%; height: 45px; border: 0; background: transparent; color: var(--text); font-size: 17px; font-weight: 720; }
.location-control { min-height: 45px; display: flex; align-items: center; gap: 11px; }
.location-button { display: inline-flex; min-width: 0; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); font-weight: 650; }
.location-button:hover { border-color: #494e53; }
.location-button svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.location-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or { color: var(--dim); }
.zip-wrap input { width: 84px; padding: 9px 8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); }
.zip-wrap input::placeholder { color: var(--dim); }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: var(--text); }
.field-note { margin: 9px 0 0; color: var(--dim); font-size: 12px; line-height: 1.45; }

.readiness-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; align-items: center; gap: 26px; padding: 24px 22px; border-top: 1px solid var(--line); }
.readiness-title { display: block; font-size: 16px; color: #c4c5c5; }
.week-controls { display: flex; align-items: center; gap: 16px; }
.stepper { height: 52px; display: grid; grid-template-columns: 48px 104px 48px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stepper button { border: 0; background: var(--surface); color: var(--muted); font-size: 25px; }
.stepper button:hover { color: var(--text); background: var(--surface-2); }
.stepper output { display: flex; align-items: center; justify-content: center; gap: 5px; border-inline: 1px solid var(--line); font-size: 21px; font-weight: 780; }
.stepper small { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.quick-weeks { display: flex; gap: 7px; }
.quick-weeks button { min-width: 44px; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: #b1b3b4; }
.quick-weeks button:first-child { padding-inline: 17px; }
.quick-weeks button.is-active { background: var(--text); color: #111; border-color: var(--text); font-weight: 750; }
.primary-button { min-height: 52px; padding: 0 27px; border: 1px solid #ff4b40; border-radius: var(--radius); background: linear-gradient(#f23a2e, #de291e); color: #fff; font-weight: 760; box-shadow: inset 0 1px rgba(255,255,255,.17); }
.primary-button:hover { background: #ff4135; }

.results-section { padding-top: 52px; }
.results-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.results-header .eyebrow { margin-bottom: 8px; color: var(--dim); }
.results-header h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.025em; }
.sort-controls { display: flex; gap: 6px; }
.sort-controls button { padding: 10px 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.sort-controls button.is-active { color: var(--text); border-color: var(--red); }
.active-summary { min-height: 34px; padding: 12px 0 0; color: var(--muted); font-size: 13px; }
.active-summary strong { color: var(--text); }
.results-list { border-bottom: 1px solid var(--line); }

.show-row { display: grid; grid-template-columns: 92px minmax(0,1fr) 110px; gap: 28px; align-items: stretch; padding: 34px 12px 34px 18px; border-top: 1px solid var(--line); animation: enter .35s ease both; }
.show-row:first-child { border-top: 0; }
.date-block { display: flex; flex-direction: column; justify-content: center; padding-right: 22px; border-right: 1px solid var(--line); font-style: normal; text-transform: uppercase; }
.date-block .month { color: var(--red); font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.date-block strong { margin: 1px 0; font-size: 43px; line-height: 1; letter-spacing: -.04em; }
.date-block small { color: var(--muted); font-size: 13px; }
.show-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.show-title-line h3 { margin: 0; font-size: clamp(20px, 2vw, 27px); line-height: 1.12; letter-spacing: -.02em; text-transform: uppercase; }
.badges { display: flex; gap: 7px; flex-wrap: wrap; }
.badge { padding: 4px 8px; border: 1px solid var(--red); border-radius: 4px; color: #ff6157; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.badge.green { color: var(--green); border-color: #317a48; }
.show-location { margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.show-divisions { margin: 13px 0 16px; color: #b4b6b7; font-size: 14px; }
.show-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.show-actions a, .show-actions button { min-height: 36px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: #c3c5c6; text-decoration: none; font-size: 13px; font-weight: 650; }
.show-actions a.registration { border-color: var(--red); background: var(--red); color: #fff; }
.show-actions a:hover, .show-actions button:hover { border-color: #565b60; color: #fff; }
.distance-block { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; }
.distance-block strong { font-size: 39px; line-height: 1; letter-spacing: -.05em; }
.distance-block span { margin-left: 4px; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.distance-block small { margin-top: 9px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }

.path-card { display: grid; grid-template-columns: 170px 1fr; gap: 22px; padding: 28px 0; border-top: 1px solid var(--line); }
.path-card:first-child { border-top: 0; }
.path-summary { display: flex; gap: 14px; align-items: flex-start; }
.path-number { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--red); font-weight: 800; }
.path-summary strong, .path-summary small { display: block; }
.path-summary strong { font-size: 16px; }
.path-summary small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.path-shows { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 15px; align-items: center; }
.path-show { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.path-show .step-label { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.path-show h3 { margin: 8px 0 7px; font-size: 17px; line-height: 1.2; text-transform: uppercase; }
.path-show p { margin: 0; color: var(--muted); font-size: 13px; }
.path-show a { display: inline-block; margin-top: 12px; color: var(--text); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.path-arrow { color: var(--dim); text-align: center; font-size: 24px; }

.empty-state, .loading-state, .error-state { padding: 74px 20px; text-align: center; }
.empty-state h3, .error-state h3 { margin: 0 0 10px; font-size: 24px; }
.empty-state p, .error-state p { max-width: 570px; margin: 0 auto; color: var(--muted); line-height: 1.6; }
.loading-state { color: var(--muted); }
.loading-state::before { content: ""; display: block; width: 28px; height: 28px; margin: 0 auto 15px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }

footer { max-width: var(--max); margin: 0 auto; padding: 0 28px 42px; }
footer p { max-width: 780px; margin: 0; color: var(--dim); font-size: 12px; line-height: 1.65; }
footer a { color: var(--muted); }

dialog { width: min(620px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #111416; color: var(--text); box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(0,0,0,.75); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 24px; }
#dialog-content { padding: 32px; }
#dialog-content .eyebrow { color: var(--red); }
#dialog-content h2 { max-width: 520px; margin: 0 40px 13px 0; font-size: 28px; text-transform: uppercase; }
#dialog-content .dialog-meta { color: var(--muted); line-height: 1.6; }
#dialog-content .dialog-note { margin: 22px 0; padding: 14px; border-left: 2px solid var(--red); background: #171a1c; color: #b9bbbc; font-size: 13px; line-height: 1.55; }
#dialog-content .show-actions { margin-top: 23px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1050px) {
  .primary-fields { grid-template-columns: 1fr 1fr; }
  .location-field { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .readiness-row { grid-template-columns: 1fr auto; }
  .readiness-copy { grid-column: 1 / -1; }
  .quick-weeks { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .site-header { padding: 20px 16px 16px; align-items: stretch; flex-direction: column; }
  .brand { font-size: 25px; }
  .brand span { width: 22px; height: 22px; }
  .federation-switch { width: 100%; }
  .federation-switch button { flex: 1; min-height: 45px; padding: 0 12px; font-size: 13px; }
  main { padding: 0 16px 50px; }
  .primary-fields { grid-template-columns: 1fr 1fr; }
  .field { padding: 17px 16px; }
  .location-control { flex-wrap: wrap; }
  .location-button { flex: 1 1 100%; justify-content: center; }
  .compact-field select { height: 39px; font-size: 15px; }
  .readiness-row { display: block; padding: 18px 16px; }
  .readiness-title { font-size: 15px; line-height: 1.4; }
  .week-controls { display: block; margin-top: 17px; }
  .stepper { width: 100%; grid-template-columns: 52px 1fr 52px; }
  .quick-weeks { display: grid; grid-template-columns: repeat(6,1fr); gap: 6px; margin-top: 11px; }
  .quick-weeks button, .quick-weeks button:first-child { min-width: 0; height: 39px; padding: 0 4px; }
  .quick-weeks button:first-child { grid-column: span 2; }
  .primary-button { width: 100%; margin-top: 15px; }
  .results-section { padding-top: 36px; }
  .results-header { display: block; padding-bottom: 12px; }
  .sort-controls { margin-top: 15px; overflow-x: auto; }
  .sort-controls button { flex: 0 0 auto; padding-inline: 10px; font-size: 13px; }
  .show-row { grid-template-columns: 66px minmax(0,1fr); gap: 16px; padding: 25px 0; }
  .date-block { padding-right: 14px; }
  .date-block strong { font-size: 34px; }
  .show-title-line h3 { font-size: 19px; }
  .distance-block { grid-column: 2; grid-row: 2; flex-direction: row; justify-content: flex-start; align-items: baseline; text-align: left; margin-top: -5px; }
  .distance-block strong { font-size: 22px; }
  .distance-block small { margin: 0 0 0 10px; }
  .show-actions a, .show-actions button { min-height: 34px; padding-inline: 10px; font-size: 12px; }
  .path-card { grid-template-columns: 1fr; }
  .path-shows { grid-template-columns: 1fr; }
  .path-arrow { transform: rotate(90deg); }
  #dialog-content { padding: 26px 20px; }
}

@media (max-width: 430px) {
  .field-label { font-size: 10px; }
  .or { display: none; }
  .zip-wrap { flex: 1; }
  .zip-wrap input { width: 100%; }
  .show-divisions { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .show-actions a.secondary-link:nth-of-type(n+3) { display: none; }
}

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