:root {
  color-scheme: dark;
  --canvas: #0b111c;
  --surface: #141f30;
  --surface-alternate: #182538;
  --raised: #1c2a40;
  --line: #304158;
  --ink: #f5f7fc;
  --muted: #aebbd0;
  --accent: #c8fa54;
  --icon-gap: 0.5rem;
  --text: "Roboto", system-ui, sans-serif;
  --heading: "Barlow Condensed", var(--text);
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 1rem/1.5 var(--text);
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tipoff-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.tipoff-header-inner,
.tipoff-guide {
  width: min(100%, 66rem);
  margin-inline: auto;
  padding-inline: clamp(0.875rem, 4vw, 2rem);
}

.tipoff-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.75rem;
  gap: 1rem;
}

.tipoff-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  color: var(--accent);
  font: italic 800 2.15rem/1 var(--heading);
  text-decoration: none;
  text-transform: uppercase;
}

.tipoff-brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
}

.tipoff-header nav {
  min-width: 0;
}
.tipoff-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
}

.tipoff-home-mark {
  display: block;
  width: auto;
  height: 2rem;
}
.tipoff-back:hover {
  opacity: 0.8;
}

.tipoff-guide {
  flex: 1 0 auto;
  padding-block: clamp(1.3rem, 4vw, 2.5rem) 3rem;
}

.tipoff-header,
.tipoff-footer {
  flex-shrink: 0;
}

.tipoff-date {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* Keep this breakpoint in sync with placeDateControls in guide.js. */
.tipoff-header-date {
  display: none;
}

@media (min-width: 64rem) {
  .tipoff-header-date {
    display: flex;
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .tipoff-header-date .tipoff-date {
    max-width: 24rem;
    padding-bottom: 0;
    border-bottom: 0;
  }
}

.tipoff-date-choice {
  position: relative;
  min-width: 0;
}

.tipoff-date #date {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.25rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  margin: 0;
  font: 500 1rem/1.25 var(--text);
  text-align: center;
}

#date:hover {
  background: var(--surface);
}

.tipoff-calendar {
  position: fixed;
  inset: auto;
  width: 21rem;
  max-width: calc(100vw - 1rem);
  max-height: calc(100dvh - 1rem);
  overflow-y: auto;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 35%);
  font: 500 0.875rem/1.3 var(--text);
}

.tipoff-calendar::backdrop {
  background: transparent;
}

.tipoff-calendar-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  margin-bottom: 0.375rem;
}

.tipoff-calendar-header h3 {
  margin: 0;
  font: 700 1rem/1.3 var(--text);
  text-align: center;
}

.tipoff-calendar button {
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.tipoff-calendar button:hover {
  background: var(--raised);
}
.tipoff-calendar-nav {
  display: grid;
  place-items: center;
  min-height: 44px;
}

.tipoff-calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.125rem;
}

#calendar-weekdays {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.6875rem;
  text-align: center;
}

#calendar-weekdays span {
  padding-block: 0.375rem;
}
.tipoff-calendar-day {
  min-width: 0;
  min-height: 44px;
  font-variant-numeric: tabular-nums;
}
.tipoff-calendar-day[data-outside] {
  color: var(--muted);
  opacity: 0.65;
}
.tipoff-calendar-day[aria-current="date"] {
  border-color: var(--accent);
  color: var(--accent);
}
.tipoff-calendar .tipoff-calendar-day[aria-selected="true"] {
  background: var(--accent);
  color: var(--canvas);
  font-weight: 800;
  opacity: 1;
}

.tipoff-calendar #calendar-today {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--accent);
  font-weight: 700;
}

.button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.375rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  background: var(--surface);
  color: var(--ink);
  font: 700 0.875rem/1 var(--text);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--raised);
}

#previous,
#next,
#today {
  background: transparent;
  font-weight: 500;
}

#previous,
#next {
  border-color: transparent;
  color: var(--muted);
}

#today {
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  color: var(--ink);
}

#previous:hover,
#next:hover,
#today:hover {
  background: var(--surface);
  color: var(--ink);
}

.tipoff-date svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tipoff-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.375rem;
  max-width: 34rem;
  margin-top: 0.75rem;
}

.tipoff-filters .button {
  position: relative;
  min-height: 3rem;
  padding-inline: 0.2rem;
  border: 0;
  background: transparent;
  font: 700 1.1rem/1 var(--heading);
  text-transform: uppercase;
}

.tipoff-filters .button:hover {
  background: var(--raised);
}

.tipoff-filters [aria-pressed="true"] {
  box-shadow: inset 0 -2px var(--accent);
  color: var(--accent);
}

.tipoff-league-logo {
  width: 2.1rem;
  height: 2.1rem;
  object-fit: contain;
}

.tipoff-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin: 0.65rem 0 1.25rem;
  color: var(--muted);
  font: 500 0.75rem/1.4 var(--text);
}

.tipoff-zone-label {
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tipoff-meta,
.tipoff-league-status {
  color: var(--muted);
  font-size: 0.8125rem;
}

.tipoff-league {
  margin-top: 0.875rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.tipoff-league .tipoff-league-header {
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-left: 4px solid var(--accent);
  border-radius: 0.4375rem 0.4375rem 0 0;
  box-shadow: inset 0 -1px 0 rgb(174 187 208 / 16%);
  background: var(--raised);
  font: 700 1.55rem/1 var(--heading);
  letter-spacing: 0.025em;
}

.tipoff-league-status,
.tipoff-league > div > .tipoff-meta {
  margin: 0.55rem 0.75rem;
}

.tipoff-games {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tipoff-game,
.tipoff-game-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.22rem 0.65rem;
  align-items: center;
}

.tipoff-game {
  padding: 0.7rem 0.75rem;
}

.tipoff-game:nth-child(odd) {
  background: var(--surface-alternate);
}

.tipoff-game:last-child:not(.tipoff-game-national, .tipoff-game-followed) {
  border-radius: 0 0 0.4375rem 0.4375rem;
}

.tipoff-game p {
  margin: 0;
}

.tipoff-start {
  color: var(--accent);
  font: 700 1.1rem/1.2 var(--heading);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tipoff-broadcasts,
.tipoff-game-notice,
.tipoff-altitude {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.875rem;
}

.tipoff-altitude summary {
  width: fit-content;
  padding-block: 0.4rem;
  color: var(--accent);
  cursor: pointer;
}

@media (max-width: 22rem) {
  .tipoff-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tipoff-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.tipoff-matchup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--icon-gap);
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.tipoff-matchup-home {
  display: flex;
  align-items: center;
  gap: var(--icon-gap);
  min-width: 0;
}

.tipoff-matchup-separator {
  flex-shrink: 0;
  color: var(--muted);
}

.tipoff-team {
  display: flex;
  align-items: center;
  gap: var(--icon-gap);
  min-width: 0;
}

.tipoff-team-name {
  position: relative;
}

.tipoff-team-full {
  display: inline-block;
  white-space: nowrap;
}
.tipoff-team-short {
  display: inline-block;
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
}

/* Keep the full label measurable while the shorter name is visible. */
.tipoff-matchup-short .tipoff-team-full {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.tipoff-matchup-short .tipoff-team-short {
  position: static;
  visibility: visible;
}

/* Keep both name variants measurable when only the artwork fits. */
.tipoff-matchup-logos .tipoff-team-name {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tipoff-matchup-logos .tipoff-team {
  flex-shrink: 0;
}
.tipoff-matchup-logos .tipoff-team-logo {
  width: 1.8rem;
  height: 1.8rem;
}

.tipoff-team-logo {
  width: 1.4rem;
  height: 1.4rem;
  object-fit: contain;
  flex-shrink: 0;
}

ul.tipoff-broadcasts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--icon-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tipoff-broadcast {
  display: inline-flex;
  align-items: center;
  gap: var(--icon-gap);
  min-width: 0;
  max-width: 100%;
  padding: 0.2rem 0;
}

.tipoff-network-logo {
  width: min(
    var(--network-max-width, 3rem),
    calc(var(--network-height, 1.4rem) * var(--network-ratio, 2))
  );
  height: auto;
  aspect-ratio: var(--network-ratio, 2);
  object-fit: contain;
  flex-shrink: 0;
}

.tipoff-network-logo-light {
  filter: brightness(0) invert(1);
}

.tipoff-station-tag {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.tipoff-pass .tipoff-station-tag {
  padding-inline: 0.25rem;
  border-radius: 0.15rem;
  background: var(--accent);
  color: var(--canvas);
}

.tipoff-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tipoff-summary {
  margin-bottom: 1.25rem;
}

.tipoff-summary h2,
.tipoff-highlights-title {
  margin: 0;
  font: 700 1.65rem/1.1 var(--heading);
}

.tipoff-summary-groups {
  display: grid;
  gap: 0.75rem;
}

.tipoff-summary-groups .tipoff-league {
  margin: 0;
}

.tipoff-summary .tipoff-game,
.tipoff-summary .tipoff-game-toggle {
  gap: 0.35rem 0.6rem;
}

.tipoff-game.tipoff-game-national,
.tipoff-game.tipoff-game-followed {
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  margin: 0.4rem;
}

.tipoff-game.tipoff-game-followed {
  border-color: #72bdff;
}

@media (min-width: 44rem) {
  .tipoff-summary-groups {
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    align-items: start;
  }
}

.tipoff-game-details,
.tipoff-followed-details {
  grid-column: 1 / -1;
}

.tipoff-game-toggle {
  cursor: pointer;
  list-style: none;
}

.tipoff-game-toggle::-webkit-details-marker {
  display: none;
}

.tipoff-game-toggle .tipoff-start::after {
  content: "▸" / "";
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--muted);
}

.tipoff-game-details[open] .tipoff-start::after,
.tipoff-followed-details[open] > summary .tipoff-start::after {
  transform: rotate(90deg);
}

.tipoff-game-details[open] > .tipoff-broadcasts {
  margin-top: 0.35rem;
}

.tipoff-game:has(> .tipoff-game-details:not([open])) {
  filter: brightness(50%);
}

.tipoff-inactive-league:not([open]) {
  filter: brightness(50%);
}

.tipoff-inactive-league summary {
  cursor: pointer;
  list-style: none;
}

.tipoff-inactive-league summary::-webkit-details-marker {
  display: none;
}

.tipoff-inactive-league h2::after {
  content: "▸" / "";
  flex-shrink: 0;
  color: var(--muted);
}

.tipoff-inactive-league[open] h2::after {
  transform: rotate(90deg);
}

.tipoff-inactive-league:not([open]) h2 {
  border-radius: 0.4375rem;
}

.tipoff-league-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tipoff-header-meta {
  display: inline-flex;
  align-items: center;
  margin-inline-start: auto;
  gap: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.tipoff-league-count,
.tipoff-national-marker {
  color: var(--muted);
  font: 800 0.65rem/1.2 var(--text);
  text-transform: uppercase;
  white-space: nowrap;
}

.tipoff-league-count,
.tipoff-altitude-times {
  color: #8794a7;
  font: 500 0.5625rem/1.2 var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tipoff-national-marker {
  margin-inline-start: 0;
  color: var(--accent);
}

.tipoff-all-games {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.tipoff-all-games > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding-block: 0.5rem;
  font: 700 1.65rem/1.1 var(--heading);
  cursor: pointer;
  list-style: none;
}

.tipoff-all-games > summary::-webkit-details-marker {
  display: none;
}

.tipoff-all-games > summary::after {
  content: "＋" / "";
  color: var(--accent);
}

.tipoff-all-games[open] > summary::after {
  content: "−" / "";
}

.tipoff-meta:empty {
  display: none;
}

.tipoff-summary-groups {
  margin-top: 0.75rem;
}

.tipoff-highlights-title {
  margin-top: 1rem;
}

.tipoff-game-inline {
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
}

ul.tipoff-inline-broadcasts {
  grid-column: auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: var(--icon-gap);
  width: 100%;
}

.tipoff-inline-broadcasts .tipoff-broadcast {
  flex: 0 1 auto;
  padding: 0;
  font-size: 0.7rem;
}

.tipoff-inline-broadcasts .tipoff-network-logo {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 32rem) {
  .tipoff-game-inline {
    grid-template-columns: 4.2rem minmax(0, 1fr) auto;
  }
}

.tipoff-game-inline .tipoff-matchup {
  flex-wrap: nowrap;
}

.tipoff-game-inline .tipoff-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flat-surface pass. Remove tipoff-flat from <body> to restore the prior look. */
.tipoff-flat .tipoff-league-header,
.tipoff-flat .tipoff-game {
  background: var(--surface);
}

.tipoff-flat .tipoff-game:has(> .tipoff-game-details:not([open])),
.tipoff-flat .tipoff-inactive-league:not([open]) {
  filter: none;
  color: var(--muted);
}

.tipoff-followed-body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.tipoff-followed-body h4 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  color: var(--accent);
  font: 700 0.625rem/1.4 var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tipoff-followed-body h4::after {
  content: "";
  flex: 1;
  min-width: 1.5rem;
  height: 1px;
  background: rgb(200 250 84 / 18%);
}

.tipoff-followed-body > h4 {
  margin-bottom: -0.5rem;
}
.tipoff-altitude {
  font-size: 0.75rem;
  line-height: 1.45;
}
.tipoff-altitude p {
  margin: 0.3rem 0;
}
.tipoff-altitude .tipoff-meta {
  font-size: 0.625rem;
}
.tipoff-altitude-times {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  font-variant-numeric: tabular-nums;
}
.tipoff-altitude-times > span {
  white-space: nowrap;
}
.tipoff-followed-body .tipoff-altitude-times {
  margin: 0;
}

/* Source/freshness details open upward from the footer. */
.tipoff-schedule-status {
  position: relative;
  min-width: 0;
  max-width: calc(100% - 60px);
  margin-left: auto;
  border: 0;
  color: var(--muted);
  font: 400 0.75rem/1.5 var(--text);
}

.tipoff-schedule-status > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0 0.5rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

.tipoff-schedule-status > summary::-webkit-details-marker {
  display: none;
}
.tipoff-schedule-status > summary::after {
  content: "+" / "";
  margin-left: auto;
}
.tipoff-schedule-status[open] > summary::after {
  content: "−" / "";
}
#schedule-status-summary {
  flex: 1;
  min-width: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}
.tipoff-schedule-status > summary {
  flex-wrap: nowrap;
}
.tipoff-schedule-status > summary::after {
  flex-shrink: 0;
}
#national-status {
  color: #727f91;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tipoff-date-label {
  white-space: nowrap;
}
.tipoff-date-today::after {
  content: " · ";
}
@media (max-width: 24rem) {
  .tipoff-date-today {
    display: block;
  }
  .tipoff-date-today::after {
    content: none;
  }
  .tipoff-date #date {
    font-size: 0.9375rem;
  }
}
.tipoff-schedule-status dl {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  z-index: 20;
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(24rem, calc(100dvh - 6rem));
  overflow-y: auto;
  margin: 0;
  padding: 0.875rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--raised);
  box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 25%);
}
.tipoff-schedule-status dl > div {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.5rem;
  padding-block: 0.25rem;
}
.tipoff-schedule-status dt {
  font-weight: 600;
}
.tipoff-schedule-status dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Keep the empty national message close to the full schedule. */
#national-leagues:not(:has(> section:not([hidden]))) {
  display: none;
}
.tipoff-summary:has(> #national-status:not(:empty)) {
  margin-bottom: 0;
}
.tipoff-guide:has(#national-status:not(:empty)) > .tipoff-all-games {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
}

.tipoff-status-loaded-label,
.tipoff-status-loaded-time {
  display: block;
  white-space: nowrap;
}

.tipoff-status-loaded-time {
  font-size: 0.9em;
  font-weight: 500;
  color: #8794a7;
}
