:root {
  /* Neutral, shadcn-style zinc palette. The only non-neutral color in the
     app is the map's ridership heat scale (blue -> red), which encodes data,
     not theme -- see HEAT in app.js. */
  --accent: #e4e4e7;
  --bg: #09090b;
  --panel: rgba(24, 24, 27, 0.82);
  --panel-solid: #18181b;
  --text: #fafafa;
  --muted: #a1a1aa;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
/* Scoped to our own icon buttons only -- don't touch Plotly's internal SVGs. */
#playBtn svg,
#dataToggle svg,
#dataClose svg {
  width: 60%;
  height: 60%;
}

/* Full-bleed map */
#map {
  position: fixed;
  inset: 0;
}

/* Floating top bar */
#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(
    to bottom,
    rgba(9, 9, 11, 0.92),
    rgba(9, 9, 11, 0)
  );
  pointer-events: none;
}
#topbar > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
#eventSelect {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.stats {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat {
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  min-width: 108px;
  text-align: right;
}
.stat .num {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat .lbl {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

#dataToggle {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-self: center;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#dataToggle:hover {
  background: var(--panel-solid);
}

/* Expandable day-comparison panel */
#dataPanel {
  position: fixed;
  top: 4.4rem;
  right: 1rem;
  z-index: 15;
  width: min(420px, calc(100vw - 2rem));
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
  transform-origin: top right;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
#dataPanel.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
}
#dataClose {
  background: none;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#dataClose:hover {
  background: var(--border);
  color: var(--text);
}
.chart-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin: 0.3rem 0 0.1rem;
}
.chart {
  width: 100%;
  height: 190px;
}

/* Bottom timeline */
#timeline {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: linear-gradient(to top, rgba(9, 9, 11, 0.94), rgba(9, 9, 11, 0));
  padding: 0.5rem 1rem 0.8rem;
}
/* "Now showing" — the clear, prominent label of the current day */
#nowShowing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0 0.1rem 0.45rem;
}
#nowDate {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
#nowGame.chip {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
#nowGame.chip:empty {
  display: none;
}
.day-totals {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Day feed — snap-scrolling strip, active card auto-centered */
.days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 40vw 0.6rem 0;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}
.days::-webkit-scrollbar {
  display: none;
}
.day {
  flex: 0 0 auto;
  cursor: pointer;
  user-select: none;
  scroll-snap-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: 3px solid transparent;
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  text-align: center;
  min-width: 60px;
  transition:
    transform 0.12s,
    background 0.15s,
    box-shadow 0.15s;
}
.day:hover {
  transform: translateY(-3px);
}
.day .d-dow {
  font-size: 0.64rem;
  color: var(--muted);
  text-transform: uppercase;
}
.day .d-date {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}
.day.game {
  border-bottom-color: var(--accent);
}
.day.active {
  background: var(--panel-solid);
  transform: translateY(-4px) scale(1.08);
  box-shadow:
    0 0 0 2px var(--accent),
    0 6px 18px rgba(0, 0, 0, 0.5);
}
.day.nodata {
  opacity: 0.35;
  pointer-events: none;
}

.scrubber {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}
#playBtn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  padding: 9px;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hour {
  flex: 1;
  accent-color: var(--accent);
}
.hourLabel {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 56px;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  z-index: 20;
  font-size: 1.1rem;
}
#loading.hidden {
  display: none;
}

@media (max-width: 640px) {
  .stat {
    min-width: 84px;
    padding: 0.3rem 0.55rem;
  }
  .stat .num {
    font-size: 1.05rem;
  }
  #topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .stats {
    justify-content: space-between;
  }
  #dataPanel {
    top: auto;
    bottom: 12rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}
