:root {
  color-scheme: dark;
  --bg-deep: #1a0b3d;
  --bg-mid: #2d1361;
  --panel: #2a1a4d;
  --panel-glass: rgba(58, 32, 110, 0.6);
  --accent: #ffd23f;
  --accent-2: #00e0d3;
  --pink: #ff3ea5;
  --live: #ff4f70;
  --text: #f6f0ff;
  --text-dim: #c3b3ea;

  --show-lilo-and-stitch: #00c2c7;
  --show-emperors-new-school: #ff9d1f;
  --show-recess: #ff3ea5;
  --show-kim-possible: #7ed321;
  --show-the-proud-family: #ff5c5c;
  --show-american-dragon-jake-long: #2ecc71;
  --show-thats-so-raven: #9b59ff;
  --show-even-stevens: #4fc3f7;
  --show-lizzie-mcguire: #ff8fd6;
  --show-phineas-and-ferb: #1de9b6;
  --show-ducktales: #ffd23f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(ellipse at top, var(--bg-mid), var(--bg-deep) 60%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* Only a cheap color-matrix filter here — saturate() is nearly free to
     recompute every frame. The expensive feTurbulence/feDisplacementMap warp
     lives on .crt-overlay instead, so it re-rasterizes one small fixed
     layer per frame rather than the whole animating page (that was what
     made hover/pulse animations janky). */
  filter: saturate(1.35);
  cursor: url("cursors/normal.png") 0 0, auto;
  /* Avoids the gray tap-flash rectangle Chrome/Safari draw on touch, since
     buttons/segments already have their own :active feedback. */
  -webkit-tap-highlight-color: transparent;
}

/* Y2K starfield backdrop */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 22% 42%, rgba(255, 255, 255, 0.5) 0, transparent 50%),
    radial-gradient(2px 2px at 80% 10%, rgba(255, 255, 255, 0.4) 0, transparent 50%),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255, 255, 255, 0.35) 0, transparent 50%),
    radial-gradient(1.5px 1.5px at 30% 85%, rgba(255, 255, 255, 0.4) 0, transparent 50%),
    radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.3) 0, transparent 50%);
}

/* CRT scanline + vignette overlay, sits above every element so the lines
   read across the whole screen instead of hiding behind opaque UI panels. */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  mix-blend-mode: multiply;
  animation: crt-flicker 6s ease-in-out infinite;
  filter: url(#crt-warp);
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.95;
  }
  50% {
    opacity: 1;
  }
  52% {
    opacity: 0.92;
  }
  54% {
    opacity: 1;
  }
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #3a1f6e, #1f1049);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-wrap: wrap;
  overflow: hidden;
}

/* Frutiger Aero light-sweep: a soft diagonal shine periodically glides
   across the header, like light catching a glossy Web 2.0 surface. */
.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.22) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: header-shine 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes header-shine {
  0%,
  25% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(120%);
  }
}

.wordmark-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tagline {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.lineup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.lineup-badge::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
}

.lineup-badge--default {
  color: var(--accent-2);
  background: rgba(0, 224, 211, 0.12);
  border: 1px solid rgba(0, 224, 211, 0.4);
}

.lineup-badge--default::before {
  background: var(--accent-2);
  box-shadow: 0 0 6px var(--accent-2);
}

.lineup-badge--custom {
  color: var(--pink);
  background: rgba(255, 62, 165, 0.12);
  border: 1px solid rgba(255, 62, 165, 0.45);
  /* The whole pill cancels the custom lineup (see main.js), not just the
     small × — cursor reflects that it's clickable anywhere. */
  cursor: url("cursors/link.png") 8 0, pointer;
}

.lineup-badge--custom::before {
  background: var(--pink);
  box-shadow: 0 0 6px var(--pink);
}

.wordmark {
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  display: flex;
  gap: 0.4rem;
  white-space: nowrap;
  position: relative;
  z-index: 0;
  /* Easter egg: click it to replay the bounce-in (see main.js). */
  cursor: url("cursors/link.png") 8 0, pointer;
  /* Without this, the column-flex parent's default align-items: stretch
     widens this box to match the longer tagline below it, so the glow
     (centered on this box) skews right into that empty space. */
  align-self: flex-start;
}

/* Soft bloom sitting behind the wordmark, like light glowing off glass.
   An ellipse (not a circle) stretched wider than tall so it hugs the
   shape of the two words instead of reading as a separate round blob. */
.wordmark::before {
  content: '';
  position: absolute;
  inset: -6px -26px;
  background: radial-gradient(ellipse at center, rgba(255, 210, 63, 0.45), transparent 72%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.wordmark-disney,
.wordmark-channel {
  color: #fffbea;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 0 2px rgba(255, 255, 255, 0.9),
    0 0 5px rgba(255, 210, 63, 0.9),
    0 0 10px rgba(255, 62, 165, 0.45);
  animation: bounce-in 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.wordmark-channel {
  animation-delay: 120ms;
}

@keyframes bounce-in {
  0% {
    transform: scale(0.4) translateY(-10px);
    opacity: 0;
  }
  70% {
    transform: scale(1.08) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* Easter egg replay (see main.js) — a quick hop with the same bouncy
   easing as bounce-in above, but never touching opacity/starting from a
   tiny scale, so replaying it doesn't make the letters flicker out and
   back in — they just stay visible and bounce in place. */
.wordmark--replay .wordmark-disney,
.wordmark--replay .wordmark-channel {
  animation: wordmark-bounce 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wordmark--replay .wordmark-channel {
  animation-delay: 120ms;
}

@keyframes wordmark-bounce {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.08) translateY(-8px);
  }
}

.ticker {
  flex: 1 1 auto;
  min-width: 8rem;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  order: 3;
  flex-basis: 100%;
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-scroll 30s linear infinite;
}

.ticker-msg--cyan {
  color: var(--accent-2);
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    /* -100% alone only brings the track's trailing edge exactly to the
       left boundary, not past it, so the loop reset happens while the
       last bit of text is still visible — hence the sudden "pop". The
       extra fixed offset pushes it genuinely off-screen first. */
    transform: translateX(calc(-100% - 60px));
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customize-btn {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #2a1a4d;
  background: linear-gradient(180deg, #ffe08a, var(--accent));
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: url("cursors/link.png") 8 0, pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 150ms ease;
}

.customize-btn:hover {
  transform: translateY(-1px);
}

.customize-btn:active {
  transform: translateY(0);
}

.clock {
  font-family: 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  background: #0b0620;
  border: 1px solid rgba(0, 224, 211, 0.4);
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  text-shadow: 0 0 8px rgba(0, 224, 211, 0.8);
  box-shadow: inset 0 0 8px rgba(0, 224, 211, 0.2);
}

.lineup-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 2.15rem 1.5rem 0;
}

/* Integrated close "×" inside the badge pill itself, rather than a second
   same-coloured pill sitting next to it. */
.lineup-badge-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.05rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: url("cursors/link.png") 8 0, pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.lineup-badge-close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.12);
}

.lineup-badge-close[hidden] {
  display: none;
}

.guide {
  max-width: 100%;
  margin: 0 auto;
  padding: 0.25rem 1.5rem 1.75rem;
}

.timeline-scroll {
  /* overflow-x: auto silently forces overflow-y to 'auto' too (CSS spec
     quirk — you can't mix scroll-x with truly-visible-y), so the marker's
     negative top offset plus its hover lift needs real padding here to
     avoid being clipped, not just visual breathing room. */
  overflow-x: auto;
  padding: 2rem 0.5rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.08);
}

/* Native scrollbar re-skinned to match the gold/pink Y2K palette, for
   browsers that support styling it (desktop Chrome/Edge, Android Chrome). */
.timeline-scroll::-webkit-scrollbar {
  height: 0.5rem;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 999px;
}

/* Custom, always-on scroll indicator — iOS Safari can't restyle (or
   reliably keep visible) the native scrollbar at all, so this is what
   actually tells touch users the timeline scrolls sideways. Purely
   decorative: real scrolling still happens by dragging the track itself. */
.timeline-scrollbar-track {
  display: none;
  position: relative;
  height: 0.35rem;
  margin: 0.5rem 0.75rem 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}

.timeline-scrollbar-track[hidden] {
  display: none;
}

.timeline-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  box-shadow: 0 0 6px rgba(255, 210, 63, 0.6);
}

@media (max-width: 640px), (pointer: coarse) {
  .timeline-scrollbar-track {
    display: block;
  }

  /* The custom indicator above is the only one that should show here —
     without this, Android Chrome (which, unlike iOS Safari, does support
     ::-webkit-scrollbar styling) would render both at once. */
  .timeline-scroll {
    scrollbar-width: none;
  }

  .timeline-scroll::-webkit-scrollbar {
    display: none;
  }
}

.timeline-track {
  position: relative;
  display: flex;
  /* Natural (fit-content) width matches the segments' fixed-pixel minimum
     sizes, so on a narrow screen it's exactly as wide as it needs to be
     (triggering horizontal scroll on .timeline-scroll) — but min-width:
     100% forces it no narrower than the available space, so on a wide
     screen the segments' flex-grow has real room to stretch into instead
     of leaving the rest of the screen blank. */
  width: fit-content;
  min-width: 100%;
  height: 7rem;
  background: var(--panel-glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.timeline-segment {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  text-align: left;
  padding: 0.65rem 0.85rem;
  overflow: hidden;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--show-color, var(--panel)) 30%, transparent) 0%,
    transparent 60%
  );
  color: inherit;
  font: inherit;
  cursor: url("cursors/link.png") 8 0, pointer;
  position: relative;
  transition: transform 150ms ease, background 150ms ease;
}

.timeline-segment[data-show='lilo-and-stitch'] {
  --show-color: var(--show-lilo-and-stitch);
}
.timeline-segment[data-show='emperors-new-school'] {
  --show-color: var(--show-emperors-new-school);
}
.timeline-segment[data-show='recess'] {
  --show-color: var(--show-recess);
}
.timeline-segment[data-show='kim-possible'] {
  --show-color: var(--show-kim-possible);
}
.timeline-segment[data-show='the-proud-family'] {
  --show-color: var(--show-the-proud-family);
}
.timeline-segment[data-show='american-dragon-jake-long'] {
  --show-color: var(--show-american-dragon-jake-long);
}
.timeline-segment[data-show='thats-so-raven'] {
  --show-color: var(--show-thats-so-raven);
}
.timeline-segment[data-show='even-stevens'] {
  --show-color: var(--show-even-stevens);
}
.timeline-segment[data-show='lizzie-mcguire'] {
  --show-color: var(--show-lizzie-mcguire);
}
.timeline-segment[data-show='phineas-and-ferb'] {
  --show-color: var(--show-phineas-and-ferb);
}
.timeline-segment[data-show='ducktales'] {
  --show-color: var(--show-ducktales);
}

/* Frutiger Aero "wet glass" bevel: a bright specular highlight riding the
   top edge, tapering into a soft inner shadow at the bottom for thickness. */
.timeline-segment::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 255, 255, 0.4), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 35%, rgba(0, 0, 0, 0.18) 100%);
  box-shadow: inset 0 -6px 10px -4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* :first-of-type/:last-of-type (not :first-child/:last-child) because the
   marker div is the track's actual first child — matching by type finds the
   first/last <button> segment regardless of where the marker sits. */
.timeline-segment:first-of-type {
  border-top-left-radius: calc(1rem - 2px);
  border-bottom-left-radius: calc(1rem - 2px);
}

.timeline-segment:last-of-type {
  border-right: none;
  border-top-right-radius: calc(1rem - 2px);
  border-bottom-right-radius: calc(1rem - 2px);
}

.timeline-segment.episode-info-revealed:hover,
.timeline-segment.episode-info-revealed:active,
.timeline-segment.episode-info-revealed:focus-visible {
  transform: translateY(-4px);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--show-color, var(--panel)) 45%, transparent) 0%,
    transparent 65%
  );
}

/* Episode segments stay real (non-disabled) buttons even when locked, so
   :hover still registers on them — disabled buttons never match :hover in
   Chrome, which would otherwise break the "hover a mystery show" hint
   below. Clicking is instead gated in JS by checking for
   .episode-info-revealed. */
.timeline-segment:disabled,
.timeline-segment:not(.timeline-break):not(.episode-info-revealed) {
  cursor: url("cursors/unavailable.png") 10 10, default;
  opacity: 0.8;
}

.timeline-segment.live {
  animation: live-pulse 1.8s ease-in-out infinite;
  opacity: 1;
}

.timeline-segment.timeline-break {
  flex-direction: row;
  padding: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 210, 63, 0.25) 0 6px,
    rgba(0, 0, 0, 0.25) 6px 12px
  );
  cursor: url("cursors/unavailable.png") 10 10, default;
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 2px var(--live);
  }
  50% {
    box-shadow: inset 0 0 0 2px var(--live), inset 0 0 24px rgba(255, 79, 112, 0.5);
  }
}

.segment-dot {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--show-color, var(--accent));
  box-shadow: 0 0 6px var(--show-color, var(--accent));
  opacity: 0;
  transition: opacity 150ms ease;
}

.timeline-segment.live .segment-dot {
  opacity: 1;
}

.segment-show {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  min-width: 0;
}

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

/* Placeholder shown for a not-yet-revealed upcoming show — softer than the
   real name so it reads as a deliberate "to be revealed" tease. */
.segment-show-text--mystery {
  font-style: italic;
  opacity: 0.7;
  /* "Mystery Show" is a short, fixed string (unlike real show names, which
     do need the inherited overflow/ellipsis truncation) — the italic
     slant on the trailing "w" was getting clipped by that overflow, so
     it's turned off here and given a little breathing room instead. */
  overflow: visible;
  padding-right: 0.2em;
}

.segment-episode {
  min-width: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Episode identity only ever shows in a fixed window around the show
   itself (2 minutes before start through to its end — see
   EPISODE_INFO_REVEAL_LEAD_MS in guide.js) — no peeking ahead, and no
   checking back once it's over. */
.segment-episode-reveal {
  display: none;
}

.timeline-segment.episode-info-revealed .segment-episode-reveal {
  display: inline;
}

.segment-time {
  min-width: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Outer shell — position only, via a CSS var + transform (not `left`), so
   the whole marker moves as a single compositor-driven unit every frame —
   a parent's transform always carries its whole subtree (stick + diamond
   head below) along atomically, so they can never visibly fall out of
   sync with each other. */
.timeline-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  transform: translateX(var(--marker-x, 0px));
  transition: transform 1s linear;
  pointer-events: none;
}

/* Inner — the actual visible stick + diamond head, plus the quick
   hover-lift, split onto its own transform/transition so the lift's snappy
   150ms doesn't have to share a duration with the 1s positional glide
   above. */
.timeline-marker-stick {
  position: absolute;
  top: -0.5rem;
  bottom: -0.5rem;
  left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--live));
  box-shadow: 0 0 10px var(--live), 0 0 20px rgba(255, 79, 112, 0.6);
  border-radius: 999px;
  transition: transform 150ms ease;
}

/* Diamond "head" capping the top of the stick — purely decorative. */
.timeline-marker-stick::before {
  content: '';
  position: absolute;
  top: -0.65rem;
  left: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin-left: -0.45rem;
  background: var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--accent);
}

/* Marker rises together with the live segment when it's hovered (or
   tapped, on touch), instead of staying planted while the segment lifts
   out from under it. */
.timeline-track:has(.timeline-segment.live:hover) .timeline-marker-stick,
.timeline-track:has(.timeline-segment.live:active) .timeline-marker-stick {
  transform: translateY(-4px);
}

.timeline-elapsed {
  margin: 1rem 0 0;
  padding: 0.65rem 1rem;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  background: rgba(11, 6, 32, 0.55);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid rgba(0, 224, 211, 0.35);
  border-radius: 0.6rem;
  box-shadow: inset 0 0 10px rgba(0, 224, 211, 0.12);
}

.elapsed-hover-hint,
.elapsed-mystery-hint {
  display: none;
}

/* While hovering any clickable segment — live, or in its 2-minute
   pre-reveal window (see episode-info-revealed) — swap the detailed
   elapsed message for a short call to action — same trick as the marker:
   :has() lets a sibling react to the segment's hover state without any
   JS. */
.guide:has(.timeline-segment.episode-info-revealed:hover) .elapsed-default,
.guide:has(.timeline-segment.episode-info-revealed:active) .elapsed-default {
  display: none;
}

.guide:has(.timeline-segment.episode-info-revealed:hover) .elapsed-hover-hint,
.guide:has(.timeline-segment.episode-info-revealed:active) .elapsed-hover-hint {
  display: inline;
}

/* Hovering (or tapping) a not-yet-revealed upcoming show swaps the elapsed
   box to explain why it's still a mystery, whatever the box would
   otherwise be showing (live countdown, ad break, "next up at", etc). */
.guide:has(.timeline-segment:hover .segment-show-text--mystery) .elapsed-default,
.guide:has(.timeline-segment:active .segment-show-text--mystery) .elapsed-default,
.guide:has(.timeline-segment:focus-visible .segment-show-text--mystery) .elapsed-default,
.guide:has(.timeline-segment:hover .segment-show-text--mystery) .elapsed-hover-hint,
.guide:has(.timeline-segment:active .segment-show-text--mystery) .elapsed-hover-hint,
.guide:has(.timeline-segment:focus-visible .segment-show-text--mystery) .elapsed-hover-hint {
  display: none;
}

.guide:has(.timeline-segment:hover .segment-show-text--mystery) .elapsed-mystery-hint,
.guide:has(.timeline-segment:active .segment-show-text--mystery) .elapsed-mystery-hint,
.guide:has(.timeline-segment:focus-visible .segment-show-text--mystery) .elapsed-mystery-hint {
  display: inline;
}

.footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  opacity: 0.7;
}

.footer p {
  margin: 0.25rem 0 0;
}

.footer p:first-child {
  margin-top: 0;
}

.footer a {
  color: inherit;
  text-decoration: underline;
  cursor: url("cursors/link.png") 8 0, pointer;
}

.footer a:hover {
  color: var(--accent-2);
}

.header-schedule {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.7rem;
  white-space: nowrap;
}

.header-schedule-title {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lineup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 2, 20, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lineup-overlay[hidden] {
  display: none;
}

.lineup-modal {
  width: 100%;
  max-width: 30rem;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #3a1f6e, #1a0b3d);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.6);
  color: var(--text);
}

.lineup-modal h2 {
  margin: 0 0 0.4rem;
  font-family: 'Baloo 2', sans-serif;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.7);
}

.lineup-modal-hint {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.lineup-modal-notice {
  margin: -0.5rem 0 1.25rem;
  padding: 0.6rem 0.85rem;
  color: var(--accent);
  font-size: 0.8rem;
  background: rgba(255, 210, 63, 0.1);
  border: 1px solid rgba(255, 210, 63, 0.35);
  border-radius: 0.5rem;
}

.lineup-modal-notice[hidden] {
  display: none;
}

.lineup-pool-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 16rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.lineup-pool-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(11, 6, 32, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: url("cursors/link.png") 8 0, pointer;
}

.lineup-pool-item input {
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
  cursor: url("cursors/link.png") 8 0, pointer;
}

.lineup-pool-warning {
  margin: 0.6rem 0 0;
  color: var(--pink);
  font-size: 0.8rem;
}

.lineup-pool-warning[hidden] {
  display: none;
}

.lineup-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.lineup-modal-actions button {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: url("cursors/link.png") 8 0, pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Longer labels (e.g. "Help cover website costs") would otherwise wrap
     to two lines on a narrow modal while shorter ones like "Close" stay
     on one — keeping every action-row button a single line guarantees
     they're all the same height regardless of width. */
  white-space: nowrap;
}

.lineup-cancel {
  background: transparent;
  color: var(--text-dim);
}

.lineup-apply {
  background: linear-gradient(180deg, #ffe08a, var(--accent));
  color: #2a1a4d;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.lineup-apply:disabled {
  opacity: 0.4;
  cursor: url("cursors/unavailable.png") 10 10, not-allowed;
}

.lineup-reset {
  margin-right: auto;
  background: transparent;
  color: var(--pink);
  border-color: rgba(255, 62, 165, 0.4);
}

.lineup-reset[hidden] {
  display: none;
}

.about-modal p {
  margin: 0 0 0.85rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}

.about-modal p:last-of-type {
  margin-bottom: 0;
}

/* Same title treatment as .about-modal-schedule-title below. */
.about-modal .about-modal-lead {
  text-align: center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  color: var(--text);
}

/* Groups the "Schedule" title with its two detail lines into one visual
   unit, centered, with the lines packed tight against each other — the
   normal paragraph gap only applies before/after the group as a whole. */
.about-modal-schedule {
  margin: 0 0 0.85rem;
  text-align: center;
}

.about-modal .about-modal-schedule-title {
  margin: 0 0 0.35rem;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  color: var(--text);
}

.about-modal .about-modal-schedule-line {
  margin: 0;
}

.about-close {
  margin-left: auto;
  background: linear-gradient(180deg, #ffe08a, var(--accent));
  color: #2a1a4d;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Sits at the opposite end of the action row from Close — .about-close's
   own margin-left: auto already pushes it there, so this just needs its
   own look, not its own positioning rule. */
.about-support {
  background: transparent;
  color: var(--accent-2);
  border-color: rgba(0, 224, 211, 0.4);
  transition: background 150ms ease, color 150ms ease;
}

.about-support:hover {
  background: var(--accent-2);
  color: #0b0620;
}

/* ---------- Small screens (phones) ---------- */
@media (max-width: 640px) {
  .header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .wordmark {
    font-size: 1.35rem;
  }

  .tagline {
    font-size: 0.62rem;
    white-space: normal;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .customize-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.85rem;
  }

  .clock {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  .lineup-badge-row {
    padding: 1.25rem 1rem 0;
  }

  .guide {
    padding: 0.25rem 0.75rem 1.5rem;
  }

  .timeline-track {
    height: 6.5rem;
  }

  .timeline-segment {
    padding: 0.55rem 0.7rem;
  }

  .footer {
    font-size: 0.75rem;
    padding: 1.5rem 1rem 1.25rem;
  }

  .header-schedule {
    font-size: 0.65rem;
    white-space: normal;
  }

  .lineup-overlay {
    padding: 0.75rem;
  }

  .lineup-modal {
    padding: 1.1rem;
    max-height: 90vh;
  }

  .lineup-modal h2 {
    font-size: 1.15rem;
  }
}

/* ---------- Touch screens: bigger hit targets, no hover reliance ----------
   Uses (pointer: coarse) rather than a width breakpoint since a touch
   laptop/tablet at desktop width needs the same treatment. */
@media (pointer: coarse) {
  .lineup-badge-close {
    width: 1.7rem;
    height: 1.7rem;
    margin-left: 0.1rem;
  }

  .customize-btn {
    min-height: 2.75rem;
    padding: 0.6rem 1.1rem;
  }

  .lineup-modal-actions button {
    min-height: 2.75rem;
    padding: 0.6rem 1.1rem;
  }

  .lineup-pool-item {
    min-height: 2.75rem;
    padding: 0.7rem 0.85rem;
  }

  .lineup-pool-item input {
    width: 1.3rem;
    height: 1.3rem;
  }

  .timeline-segment,
  .customize-btn,
  .lineup-badge-close,
  .lineup-pool-item,
  .lineup-modal-actions button {
    touch-action: manipulation;
  }
}

/* ---------- Snake easter egg ---------- */
.snake-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(5, 2, 20, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.snake-modal {
  background: linear-gradient(160deg, #3a1f6e, #1a0b3d);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.6);
  color: var(--text);
}

.snake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  gap: 1rem;
  margin: 0 0 0.75rem;
  font-family: 'Fredoka', sans-serif;
}

.snake-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.7);
}

.snake-scores {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.snake-score {
  color: var(--accent-2);
}

.snake-best {
  color: var(--pink);
}

.snake-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: url("cursors/link.png") 8 0, pointer;
  transition: background 150ms ease;
}

.snake-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.snake-canvas {
  display: block;
  border-radius: 0.5rem;
  border: 2px solid rgba(255, 210, 63, 0.4);
  box-shadow: 0 0 20px rgba(255, 210, 63, 0.15);
}

.snake-hint {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}
