@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #08090b;
  --panel: #111318;
  --panel-2: #17191f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(34, 211, 255, 0.35);
  --text: #f1f1ee;
  --text-dim: #8b8f98;
  --text-dimmer: #52565f;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 255, 0.12);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Per-alias identity colors - used to color-code artist names on browse
     tiles, and reused as the basis for the Pryda/Cirez D bonus themes.
     Cirez D green and Pryda red sampled directly from official logo files
     (graphics-resources/cirezd.png, Pry039.jpg) - not a guess. */
  --alias-ericprydz: #22d3ee;
  --alias-cirezd: #28f002;
  --alias-pryda: #ff0101;

  /* Pryda's per-track vinyl catalog color rainbow (each track on a release
     gets its own ring color on the label) - sampled from the "PRYDA -
     Evouh" (PRY 012) label, graphics-resources/52f2195f-....webp. Not
     wired into anything yet - stored for future highlighting/theming use
     per user request. */
  --record-orange: #ff9b47;
  --record-yellow: #fff000;
  --record-green: #43a025;
  --record-blue: #0083d8;
  --record-purple: #7a2073;
  --record-pink: #e2006a;
}

/* Easter-egg bonus themes (Konami code, see js/easter-egg.js) - re-skin the
   whole site's accent to a specific alias's color rather than the default
   Eric Prydz cyan. Placeholder trigger for now, per user - a keyboard
   sequence isn't great on mobile and most visitors will need to be told
   about it anyway, so this'll get replaced with a tap-based trigger later. */
html[data-theme="pryda"] {
  --accent: var(--alias-pryda);
  --accent-dim: rgba(255, 1, 1, 0.12);
  --border-strong: rgba(255, 1, 1, 0.35);
}

html[data-theme="cirezd"] {
  --accent: var(--alias-cirezd);
  --accent-dim: rgba(40, 240, 2, 0.12);
  --border-strong: rgba(40, 240, 2, 0.35);
}

/* Hidden reward skins from the Cirez D mini-game (catch 3 ID orbs) - each
   one re-skins the accent to a color from Pryda's vinyl-label rainbow
   (--record-*). Unlike the base pryda/cirezd themes above, this choice IS
   persisted (sessionStorage, see js/easter-egg.js) - it's a reward, not a
   rediscover-each-visit easter egg, so it should survive a refresh, just
   not a closed tab. */
html[data-theme="pryda-orange"] { --accent: var(--record-orange); --accent-dim: rgba(255, 155, 71, 0.12); --border-strong: rgba(255, 155, 71, 0.35); }
html[data-theme="pryda-yellow"] { --accent: var(--record-yellow); --accent-dim: rgba(255, 240, 0, 0.12); --border-strong: rgba(255, 240, 0, 0.35); }
html[data-theme="pryda-green"] { --accent: var(--record-green); --accent-dim: rgba(67, 160, 37, 0.12); --border-strong: rgba(67, 160, 37, 0.35); }
html[data-theme="pryda-blue"] { --accent: var(--record-blue); --accent-dim: rgba(0, 131, 216, 0.12); --border-strong: rgba(0, 131, 216, 0.35); }
html[data-theme="pryda-purple"] { --accent: var(--record-purple); --accent-dim: rgba(122, 32, 115, 0.12); --border-strong: rgba(122, 32, 115, 0.35); }
html[data-theme="pryda-pink"] { --accent: var(--record-pink); --accent-dim: rgba(226, 0, 106, 0.12); --border-strong: rgba(226, 0, 106, 0.35); }

#mouse-egg {
  position: absolute;
  width: 18px;
  height: auto;
  opacity: 0.35;
  cursor: pointer;
  z-index: 500;
  filter: grayscale(1) brightness(1.1);
  transition: opacity 0.4s ease;
  pointer-events: auto;
}

#mouse-egg:hover {
  opacity: 0.6;
}

#mouse-egg.hidden {
  display: none;
}

.mouse-firework-particle {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: auto;
  z-index: 600;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Cirez D mini-game "ID" pickup circles (not wired up yet) - cosmetic
   pickups only, colored from the Pryda vinyl-label rainbow (--record-*
   above). currentColor drives both fill and glow so each variant is a
   one-line color swap. */
.id-circle {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px 3px currentColor;
  pointer-events: none;
}

.id-circle.color-orange { color: var(--record-orange); }
.id-circle.color-yellow { color: var(--record-yellow); }
.id-circle.color-green { color: var(--record-green); }
.id-circle.color-blue { color: var(--record-blue); }
.id-circle.color-purple { color: var(--record-purple); }
.id-circle.color-pink { color: var(--record-pink); }

/* Cirez D mini-game parallax strip - shown only while the Cirez D theme
   is active (see initMouseStrip() in js/easter-egg.js). Two looping
   background layers (rigging/hanging PA behind, speaker stacks in
   front) with the mouse run-cycle sprite animating between them, plus a
   tap-to-jump catch-3-ID-orbs mini-game (see js/easter-egg.js). */
#cirezd-mouse-strip {
  display: none;
  position: relative;
  max-width: 900px;
  width: 100%;
  height: 110px;
  margin: 0 auto;
  overflow: hidden;
  cursor: pointer;
}

html[data-theme="cirezd"] #cirezd-mouse-strip {
  display: block;
}

.strip-layer {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: auto 100%;
}

.strip-back {
  background-image: url("graphics-resources/riggingandstacks1.png");
  height: 90px;
  top: 6px;
  background-size: auto 90px;
  opacity: 0.7;
  animation: strip-scroll-back 60s linear infinite;
}

.strip-front {
  background-image: url("graphics-resources/speakerstack1.png");
  bottom: -14px;
  z-index: 2;
  animation: strip-scroll-front 10s linear infinite;
}

@keyframes strip-scroll-back {
  from { background-position-x: 0; }
  to { background-position-x: -270px; }
}

@keyframes strip-scroll-front {
  from { background-position-x: 0; }
  to { background-position-x: -176px; }
}

.strip-mouse {
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 56px;
  height: auto;
  transform: translateX(-50%);
}

/* Tap-anywhere-in-the-strip jump (see js/easter-egg.js) - no real jump
   sprite yet, so this is a plain vertical bounce on the existing run-cycle
   frame rather than a dedicated animation. */
@keyframes mouse-jump {
  0% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-30px); }
  100% { transform: translateX(-50%) translateY(0); }
}

.strip-mouse.jumping {
  animation: mouse-jump 0.5s ease-out;
}

/* ID-orb pickups - spawned/animated from JS (see js/easter-egg.js), which
   sets a duration then flips `right` to trigger this transition; a plain
   transition (rather than @keyframes) so its current position is always
   queryable via getBoundingClientRect for catch detection mid-flight. */
.id-circle {
  right: -24px;
  /* Above the mouse's resting reach (56px tall, sitting at bottom:19px -
     so its resting top edge is at ~75px) but within the jump's +30px
     reach - catching one requires actually jumping, not just standing
     under it. */
  bottom: 78px;
  transition-property: right;
  transition-timing-function: linear;
}

/* Pryda skin - unlocked (not chosen; there's one Pryda skin, not a color
   picker) by catching 3 ID orbs in the Cirez D mini-game. Three dim Y
   logos in a row behind the header text; the center one gets a
   flame/glowing version cross-fading on top at random intervals. */
.pryda-skin-bg {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

html[data-theme="pryda"] .pryda-skin-bg {
  display: flex;
}

.pryda-y {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.pryda-y-center {
  /* Slightly bigger than the side two so the glowing one reads as the
     focal point, not just a third identical logo. */
  width: 100px;
  height: 100px;
}

/* Its own leaf element (not a filter directly on .pryda-y) - CSS filter
   applies to an element's full rendered output INCLUDING children, so
   putting it on the shared .pryda-y container was also grayscaling the
   flame layer nested inside the center one. */
.pryda-y-layer {
  position: absolute;
  inset: 0;
  background-image: url("graphics-resources/M9Vz7EH-red.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: grayscale(1) brightness(3);
  opacity: 0.5;
}

.pryda-y-flame {
  position: absolute;
  inset: -18px;
  background-image: url("graphics-resources/fire-y.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(1.8) saturate(1.6) drop-shadow(0 0 10px #ff3b1f);
  opacity: 0;
  transition: opacity 1.4s ease;
}

.pryda-y-flame.glowing {
  opacity: 1;
}

#theme-switcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 900;
  display: flex;
  gap: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.3rem;
}

#theme-switcher.hidden {
  display: none;
}

#theme-switcher button {
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
}

#theme-switcher button:hover {
  color: var(--text);
}

#theme-switcher button.active {
  background: var(--accent-dim);
  border-color: var(--border-strong);
  color: var(--accent);
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(34, 211, 255, 0.08), transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  position: relative;
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}

/* Decorative grid, faded top-to-bottom - kept off the text elements
   entirely (previously the whole .topbar had this as a mask, which faded
   the tagline into near-illegibility along with the background). */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
  pointer-events: none;
  z-index: 0;
}

.topbar h1, .tagline, .topbar-links {
  position: relative;
  z-index: 1;
}

.topbar h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
}

.tagline {
  color: var(--text);
  margin: 0;
  font-size: 0.95rem;
}

.topbar-links {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-link {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.topbar-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
}

.panel h2, .panel h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 0;
}

.panel h2 {
  font-size: 1rem;
  color: var(--text-dim);
}

.panel h3 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.heading-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.heading-row h3 {
  margin-bottom: 0;
}

.inline-hint {
  font-size: 0.72rem;
  color: var(--text-dimmer);
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
}

.bucket-summary {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

#bucket-count {
  font-weight: 700;
  color: var(--accent);
}

.share-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-all-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.select-all-controls button {
  font-size: 0.8rem;
}

button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button.secondary {
  background: transparent;
}

#load-code-box {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

#load-code-box input {
  flex: 1;
}

.research-opt-in {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.research-opt-in button {
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  color: var(--text-dimmer);
  border-color: var(--border);
}

.research-opt-in button:hover {
  color: var(--text-dim);
  border-color: var(--border);
}

input[type="text"], select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.hidden {
  display: none !important;
}

.view-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.view-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0 0 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85rem;
}

.view-tab:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.view-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.chip-picker {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.chip-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.chip-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
}

.show-tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 2px solid transparent;
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color 0.15s ease, background 0.15s ease;
  /* Native <button> content is vertically-centered by default in most
     browsers - without this, shorter tiles (no show-name line) visibly
     float their text toward the middle instead of the top. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.show-tile:hover {
  border-color: var(--border-strong);
}

.show-tile.selected {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.show-tile:disabled {
  cursor: default;
  color: var(--text-dimmer);
  opacity: 0.6;
}

.show-tile .tile-date {
  display: block;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.show-tile .tile-artist {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.show-tile .tile-artist.alias-ericprydz {
  color: var(--alias-ericprydz);
}

.show-tile .tile-artist.alias-cirezd {
  color: var(--alias-cirezd);
}

.show-tile .tile-artist.alias-pryda {
  color: var(--alias-pryda);
}

.show-tile .tile-artist.tile-artist-long {
  font-size: 0.9rem;
}

.show-tile .tile-artist.tile-artist-longer {
  font-size: 0.78rem;
}

.show-tile .tile-show-name {
  display: block;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.show-tile .tile-venue {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text-dim);
}

.show-tile .tile-location {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.show-tile .tile-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.show-tile.selected .tile-category {
  color: var(--accent);
}

.note {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
  text-wrap: balance;
}

/* Full-width photo banner, one per skin (classic is the default/fallback,
   overridden per active theme below). Bottom-anchored + cover so the
   Prydz silhouette at the photo's bottom always stays visible regardless
   of viewport width - narrow phones just crop the sides evenly. Fades
   into the page background starting a third of the way up, via a mask
   rather than baked into the image, so the fade point/strength is easy
   to adjust later without a re-export. */
.skin-footer-photo {
  width: 100%;
  height: min(30vw, 420px);
  margin-top: 2rem;
  background-image: url("images/classicbackground.jpg");
  background-size: cover;
  background-position: bottom center;
  -webkit-mask-image: linear-gradient(to top, black 0%, black 66%, transparent 100%);
  mask-image: linear-gradient(to top, black 0%, black 66%, transparent 100%);
}

html[data-theme="cirezd"] .skin-footer-photo {
  background-image: url("images/cirezdbackground.jpg");
}

html[data-theme="pryda"] .skin-footer-photo {
  background-image: url("images/prydabackground.jpg");
}

.site-footer {
  max-width: 640px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  text-align: center;
}

.site-footer p {
  color: var(--text-dimmer);
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
}

.show-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.show-filters input {
  flex: 1;
  min-width: 200px;
}

.show-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 480px;
  overflow-y: auto;
}

.show-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  border-left: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.show-row.selected {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.show-row .show-date {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 90px;
  font-size: 0.9rem;
}

.show-row .show-title {
  flex: 1;
}

.show-row .not-attendable {
  min-width: 1rem;
  text-align: center;
  color: var(--text-dimmer);
}

.show-row .show-category {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
}

.radio-row {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}

.radio-row:hover {
  border-color: var(--border-strong);
}

#radio-tracklist-result {
  margin-top: 1rem;
}

.radio-source-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.radio-tracklist {
  list-style: decimal;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.radio-tracklist li {
  font-size: 0.9rem;
}

/* Special recurring show-groups (HOLO/EPIC/20 Years of Pryda) - a badge
   layered on top of the real venue category, not a category itself. HOLO
   and EPIC share one treatment since they're the same touring-spectacle
   concept across two eras (per user), not two different things. */
.show-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

.show-badge.badge-holo,
.show-badge.badge-epic {
  color: var(--accent);
  border-color: var(--border-strong);
}

.show-badge.badge-twentyyears {
  color: var(--alias-pryda);
  border-color: rgba(255, 1, 1, 0.35);
}

.show-tile .show-badge {
  display: inline-block;
  margin-bottom: 0.4rem;
}

.show-row a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s ease;
}

.show-row a:hover {
  color: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-tile {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-strong);
  border-radius: 3px;
  padding: 1rem 0.9rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}

/* Shareable stats card - designed to look good in a plain screenshot
   (no browser chrome cropped out for them), so no scrolling/collapsible
   bits inside it - everything visible at once. */
#stats-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.75);
}

#stats-card-overlay.hidden {
  display: none;
}

#stats-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 2rem 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#stats-card-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

.stats-card-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 1.3rem;
}

.stats-card-subtitle {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.stats-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.stats-card-stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-strong);
  border-radius: 3px;
  padding: 0.75rem 0.4rem;
}

.stats-card-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stats-card-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

.stats-card-highlight {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  text-align: left;
}

.stats-card-highlight:empty {
  display: none;
}

.stats-card-highlight strong {
  color: var(--accent);
}

.stats-card-footer {
  margin-top: 1rem;
  color: var(--text-dimmer);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

#category-breakdown, #timeline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.chip strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.chip-clickable {
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.chip-clickable:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip-clickable.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.chip-clickable.active strong {
  color: var(--accent);
}

#track-lookup-select {
  margin-bottom: 0.75rem;
  min-width: 260px;
}

#track-lookup-result {
  margin-top: 0.5rem;
}

.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.track-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.track-summary {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 0;
  text-align: left;
  color: var(--text);
  font-family: var(--font-body);
}

.track-card.open .track-summary {
  border-bottom: 1px solid var(--border);
}

.track-card.always-open .track-summary {
  cursor: default;
}

.track-card.always-open .track-summary:disabled {
  opacity: 1;
  color: var(--text);
}

/* JS-toggled class (not native <details> [open]) so the transition runs
   identically every time, not just on the first open - see app.js. */
.track-details-inner {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}

.track-card.open .track-details-inner {
  grid-template-rows: 1fr;
  opacity: 1;
}

.track-details-inner .track-shows-list {
  overflow: hidden;
  min-height: 0;
  padding: 0 0.85rem;
}

.track-card.open .track-details-inner .track-shows-list {
  padding: 0.5rem 0.85rem 0.75rem;
}

.track-rank {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 1.4rem;
}

.track-name {
  flex: 1;
  font-size: 0.95rem;
}

.track-badge {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.track-meta {
  margin: -0.35rem 0 0;
  padding: 0 0.85rem 0.6rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.track-shows-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.track-shows-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.occ-date {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 80px;
  flex-shrink: 0;
}

.occ-venue {
  flex: 1;
  color: var(--text);
}

.occ-location {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.map {
  height: 360px;
  border-radius: 3px;
  border: 1px solid var(--border);
  filter: grayscale(0.4) brightness(0.85) contrast(1.1);
}

/* Mobile - this site had zero responsive breakpoints before; the desktop
   flex-row layouts (show-row, track-shows-list li) don't shrink below their
   content's natural width, and a few explicit min-widths (the track-lookup
   select, the stat tiles' minmax floor) actively fight a narrow viewport
   instead of yielding to it. Found via real on-device testing, not guessed. */
@media (max-width: 640px) {
  main {
    padding: 0 1rem 2.5rem;
    gap: 1rem;
  }

  .panel {
    padding: 1rem;
  }

  /* Force 3-across always (rather than wrapping to 2+1, which nearly
     doubles this section's height on a phone) by shrinking the tiles
     instead of letting them wrap. */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .stat-tile {
    padding: 0.6rem 0.4rem;
  }

  .stat-value {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  #track-lookup-select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Both of these are flex rows sized for desktop - fully stack them
     (rather than trying to selectively wrap) so nothing can force
     horizontal overflow regardless of how long a venue/location string is.
     Checkbox ends up on its own line above everything else, per request. */
  .show-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .show-row .show-date {
    min-width: 0;
  }

  .track-shows-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }

  .occ-location {
    white-space: normal;
  }
}
