/* Rev. J. Money UBN v2, rethemed to the live RotatoCAM palette (jmscnc.com/rotatocam/ site2.css). */

@font-face {
  font-family: Geist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
}

:root {
  --bg: #060709;
  --bg-footer: #080a0d;
  --surface: #0b0d10;
  --surface-2: #10141b;
  --ink: #f2f4f7;
  --text-2: #c4c9d1;
  --dim: #a3a9b3;
  --text-dim: #969da9;
  --accent: #9cc0ff;
  --accent-hover: #c6dcff;
  --numeral: #8fa4c5;
  --ok: #8bbf5a;
  --line: #262b34;
  --rule-soft: #1c2027;
  --panel: #0b0d10;
  --disp: Geist, Helvetica, Arial, sans-serif;
  --pixel: "Press Start 2P", "Geist Mono", ui-monospace, monospace;
  --lcd: "Geist Mono", ui-monospace, monospace;
  --sans: Geist, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --glow-a: 0 0 18px rgba(156, 192, 255, 0.28);
  --glow-c: 0 0 18px rgba(156, 192, 255, 0.18);
  --dock-h: 132px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: radial-gradient(ellipse 800px 420px at 50% 160px, rgba(90,140,255,.11), transparent 75%), var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; background: #060709;
}
.scanlines, .vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 8;
}
.scanlines {
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay; opacity: 0.5;
}
.vignette {
  z-index: 7;
  background:
    radial-gradient(ellipse 800px 420px at 50% 0%, rgba(90,140,255,.11), transparent 70%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(6,7,9,0.55) 100%);
}

/* App chrome */
.app {
  position: relative;
  z-index: 10;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.marquee {
  flex: 0 0 32px;
  background: var(--bg-footer);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.marquee-label {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(156,192,255,.12);
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 2;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: ticker 42s linear infinite;
  white-space: nowrap;
  font-family: var(--lcd);
  font-size: 22px;
  color: var(--accent);
  text-shadow: none;
  padding-left: 1.5em;
}
.marquee-track span { padding-right: 3.5em; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(6,7,9,.90);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand img {
  width: 44px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(156,192,255,0.22));
}
.brand-kicker {
  display: block;
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--accent);
}
.brand-name {
  display: block;
  font-family: var(--disp);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #f2f4f7;
  text-shadow: 0 0 12px rgba(156,192,255,0.5);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.nav a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
  border: 1px solid transparent;
  padding: 8px 12px;
  border-radius: 7px;
}
.nav a:hover, .nav a:focus-visible {
  color: var(--ink);
  background: rgba(255,255,255,.04);
  outline: none;
}
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nav a[aria-current="page"] {
  color: var(--ink);
  background: rgba(255,255,255,.10);
  border-color: transparent;
}

/* Panels */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: transparent;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
  outline: none;
}
.panel.active {
  transform: translateX(0);
  visibility: visible;
  z-index: 2;
}
.panel.exit-left {
  transform: translateX(-28%);
  visibility: visible;
  z-index: 1;
}
.panel.exit-right {
  transform: translateX(100%);
  visibility: visible;
  z-index: 1;
}
.panel.pre-left {
  transform: translateX(-28%);
  visibility: hidden;
  transition: none;
}
.panel-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(6px, 1vh, 10px) 0 clamp(6px, 1.2vh, 14px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-head {
  margin: 0 0 clamp(6px, 1.2vh, 12px);
  flex: 0 0 auto;
}
.panel-head h2 {
  font-family: var(--disp);
  font-weight: 900;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(156,192,255,0.35);
}
.panel-head p {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
}
.back-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 10px;
}
.back-btn:hover, .back-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--glow-c);
  outline: none;
}

/* Blinkies (kept from v1, slightly tighter on the home strip) */
.blinkie-row {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  justify-content: center;
  gap: 7px;
  margin: 0 0 10px;
}
.blinkie {
  width: 140px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.25;
  letter-spacing: 0.4px;
  text-decoration: none;
  color: #fff;
  image-rendering: pixelated;
  border: 3px solid #fff;
  box-shadow: inset 0 0 0 2px #000, 2px 2px 0 #000;
  padding: 3px 5px;
  background: #000;
  text-shadow: 1px 1px 0 #000;
}
.blinkie > span { display: block; line-height: 1.3; }
.blinkie:hover { color: #fff; filter: brightness(1.15); }
.b-rev { background: #0b0d10; color: var(--accent-hover); border-color: var(--accent); animation: hueflash 1.4s steps(2) infinite; }
.b-air { background: #0b0d10; color: var(--ok); border-color: var(--ok); }
.b-air.on { animation: airblink 1.2s steps(2) infinite; background: rgba(139,191,90,.16); }
.b-3am { background: #0b0d10; color: var(--accent-hover); border-color: var(--accent); }
.b-spin { background: #0b0d10; color: var(--accent); border-color: var(--accent); }
.b-bbs { background: #0b0d10; color: var(--ok); border-color: var(--ok); }
.b-bbs .cur { animation: blink 0.7s steps(1) infinite; }
.b-tx { background: #0b0d10; color: var(--accent-hover); border-color: var(--accent); font-size: 7px; }
.b-yt { background: #0b0d10; color: var(--ink); border-color: #394353; }
.b-x { background: #0b0d10; color: var(--ink); border-color: #394353; }
.b-jms { background: #0b0d10; color: var(--accent); border-color: var(--accent); }
.b-pat { background: #0b0d10; color: var(--text-2); border-color: #394353; }
@keyframes hueflash {
  0% { color: var(--accent); border-color: var(--accent); }
  100% { color: var(--accent-hover); border-color: var(--accent-hover); }
}
@keyframes airblink {
  50% { color: var(--bg); background: var(--ok); text-shadow: none; }
}
@keyframes blink { 50% { opacity: 0; } }

/* Home hero + minis */
.now-inner { display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden; }
.hero-card {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  gap: 22px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  position: relative;
  flex: 0 0 auto;
}
.hero-card::before, .hero-card::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  pointer-events: none;
}
.hero-card::before { top: 8px; left: 8px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.hero-card::after { bottom: 8px; right: 8px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.hero-art {
  position: relative;
  aspect-ratio: 1;
  width: clamp(88px, 18vh, 230px);
  border: 2px solid var(--accent);
  box-shadow: var(--glow-a);
  background: #000;
  overflow: hidden;
  justify-self: center;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-card.is-current.playing .hero-art img {
  animation: slowzoom 16s ease-in-out infinite alternate;
}
@keyframes slowzoom { to { transform: scale(1.08); } }
.new-ribbon {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(156,192,255,.12);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  transform: none;
  box-shadow: none;
  z-index: 2;
  text-shadow: none;
}
.now-kicker {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--accent);
  letter-spacing: 2px;
  margin: 0 0 8px;
}
#hero-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(16px, 2.8vh, 40px);
  line-height: 1.15;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(156,192,255,0.35);
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
}
.hero-meta {
  font-family: var(--lcd);
  font-size: 22px;
  color: var(--dim);
  margin: 0 0 16px;
}
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-play-lg {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  background: #f2f4f7;
  color: #060709;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 11px 19px;
  border-radius: 999px;
}
.btn-play-lg svg { width: 22px; height: 22px; }
.btn-play-lg:hover { background: #fff; box-shadow: 0 5px 24px rgba(120,160,255,.16); }
.btn-play-lg:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.text-link { font-family: var(--mono); font-size: 12px; }

.row-label {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 12px 0 8px;
}
.mini-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.2vh, 12px);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-content: start;
}
.mini-card, .track-card, .genre-card {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.mini-card:hover, .track-card:hover, .genre-card:hover,
.mini-card:focus-visible, .track-card:focus-visible, .genre-card:focus-visible {
  border-color: var(--accent);
  box-shadow: none;
  transform: translateY(-1px);
  outline: none;
  color: var(--ink);
}
.mini-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #000;
  border-bottom: 1px solid var(--line);
  max-height: var(--mini-art-max, none);
}
.mini-card .body, .track-card .body { padding: 6px 10px 8px; min-width: 0; }
.mini-card .name, .track-card .name, .genre-card h3 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  line-height: 1.2;
}
.mini-card .meta, .track-card .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 3px;
}
.is-current {
  border-color: var(--accent) !important;
  box-shadow: var(--glow-a);
}
.is-current .name { color: var(--accent-hover); }

/* Genre + track grids */
.genre-grid, .track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}
@media (min-width: 1100px) {
  .genre-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Open genre track list: the only scrolling region. Chrome and dock stay fixed. */
#genre-tracks,
.track-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: min-content;
  gap: 8px;
  align-content: start;
  align-items: start;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 1600px) {
  #genre-tracks, .track-list { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 1100px) {
  #genre-tracks, .track-list { grid-template-columns: repeat(4, 1fr); }
}
.track-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  align-self: start;
  gap: 8px;
  padding: 6px 8px 6px 6px;
  min-width: 0;
  min-height: min-content;
  height: auto;
}
.track-card img {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  aspect-ratio: 1;
  object-fit: cover;
  background: #000;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}
.track-card .body { padding: 0 2px 0 0; min-width: 0; overflow: visible; }
.genre-card { padding: 0; }
.genre-card .mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 16/10;
  background: #000;
  border-bottom: 1px solid var(--line);
}
.genre-card .mosaic img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; }
.genre-card .body { padding: 10px 12px 12px; }
.genre-card h3 {
  font-size: 15px;
  margin: 0 0 2px;
  letter-spacing: 0.05em;
  color: var(--accent-hover);
}
.genre-card p { margin: 0; color: var(--dim); font-size: 13px; font-family: var(--mono); }

/* Workshop / logbook */
.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}
.log-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.log-card:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: none;
}
.log-card h3 {
  font-family: var(--disp);
  font-size: 18px;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}
.log-card p { margin: 0; color: var(--dim); font-size: 14px; }
.bio-bit {
  flex: 0 1 auto;
  margin: clamp(8px, 1.5vh, 18px) 0 0;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(12px, 1.6vh, 16px);
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.counter-box {
  flex: 0 0 auto;
  margin: clamp(8px, 1.5vh, 18px) auto 0;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-width: 280px;
}
.counter-digits {
  font-family: var(--lcd);
  font-size: 52px;
  line-height: 1;
  color: var(--numeral);
  text-shadow: none;
  letter-spacing: 0.08em;
}
.counter-caption {
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 1px;
  color: var(--dim);
  margin-top: 4px;
}
.counter-caption.dim { margin-top: 10px; }
.meter {
  display: flex; gap: 4px; justify-content: center;
  margin-top: 8px; height: 18px; align-items: flex-end;
}
.meter span {
  width: 8px; background: var(--accent);
  display: block; height: 100%;
  box-shadow: none;
  animation: meter 1.2s ease-in-out infinite;
  transform-origin: bottom;
}
.meter span:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.meter span:nth-child(3) { animation-delay: 0.2s; height: 90%; }
.meter span:nth-child(4) { animation-delay: 0.3s; height: 40%; }
.meter span:nth-child(5) { animation-delay: 0.15s; height: 75%; }
@keyframes meter {
  0%,100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}
body.is-paused .meter span { animation: none; transform: scaleY(0.35); opacity: 0.5; }

/* Docked player */
.dock {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: rgba(6,7,9,.90);
  backdrop-filter: blur(16px);
  padding: clamp(4px, 0.8vh, 8px) 16px 6px;
  z-index: 20;
}
.dock-main {
  display: grid;
  grid-template-columns: auto 1fr auto minmax(180px, 1.4fr) auto;
  gap: 12px;
  align-items: center;
}
.dock-art {
  width: 52px; height: 52px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #000;
}
.dock-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock-sub { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.dock-controls { display: flex; align-items: center; gap: 8px; }
.btn {
  appearance: none;
  border: 1px solid #394353;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}
.btn:hover { border-color: var(--accent); background: #141a24; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-round { width: 40px; height: 40px; border-radius: 50%; }
.btn-play {
  width: 52px; height: 52px; border-radius: 50%;
  background: #f2f4f7;
  color: #060709;
  border-color: transparent;
}
.btn-play:hover { background: #fff; color: #060709; box-shadow: 0 5px 24px rgba(120,160,255,.16); }
.btn-play svg, .btn-round svg { width: 22px; height: 22px; fill: currentColor; }
.dock-seek, .dock-vol { display: flex; align-items: center; gap: 8px; }
.dock-vol { width: 110px; color: var(--dim); }
.dock-vol svg { width: 16px; height: 16px; flex: 0 0 auto; }
.time {
  font-family: var(--lcd);
  font-size: 20px;
  color: var(--numeral);
  width: 3.1em;
  min-width: 3.1em;
}
.time.end { text-align: right; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: var(--glow-a); border: 0; cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 0; cursor: pointer;
}
.sc-slot {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  height: 20px;
}
#sc-widget { display: block; width: 100%; height: 20px; border: 0; }
.sc-attr {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
}
.sc-attr.fine { margin-top: 2px; font-size: 10px; }
.status-error { color: #c0392b; font-family: var(--mono); font-size: 12px; margin: 4px 0 0; }
.status-error[hidden] { display: none !important; }

/* Mobile */
@media (max-width: 860px) {
  .chrome { flex-direction: column; align-items: stretch; padding: 8px 12px 10px; gap: 8px; }
  .nav { justify-content: space-between; }
  .nav a { flex: 1; text-align: center; padding: 8px 6px; font-family: var(--sans); font-size: 12px; letter-spacing: 0; font-weight: 500; white-space: nowrap; }
  .panel-inner { width: min(1120px, calc(100% - 20px)); }
  #panel-now .blinkie-row { display: none; }
  .hero-card { grid-template-columns: auto 1fr; gap: 10px; }
  .hero-art { max-width: min(190px, 28vw); width: clamp(88px, 16vh, 190px); margin: 0; }
  #hero-title { font-size: clamp(16px, 3.4vh, 22px); }
  .mini-row, .genre-grid { grid-template-columns: 1fr 1fr; }
  #genre-tracks, .track-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .track-card {
    grid-template-columns: 60px 1fr;
    padding: 5px 8px 5px 5px;
  }
  .track-card img { width: 60px; height: 60px; min-width: 60px; min-height: 60px; border-radius: 6px; }
  .sc-attr { display: block; font-size: 10px; margin: 2px 0 0; line-height: 1.3; }
  .sc-attr.fine { font-size: 9px; white-space: normal; }
  .dock { padding-bottom: 18px; }
  .dock-main {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "art meta controls"
      "seek seek seek";
  }
  .dock-art { grid-area: art; width: 44px; height: 44px; }
  .dock-meta { grid-area: meta; min-width: 0; }
  .dock-controls { grid-area: controls; }
  .dock-seek { grid-area: seek; }
  .dock-vol { display: none; }
  .btn-play { width: 44px; height: 44px; }
  .btn-round { width: 36px; height: 36px; }
  .blinkie { width: 148px; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .blinkie, .b-rev, .b-air, .b-bbs .cur,
  .hero-card.is-current.playing .hero-art img, .meter span {
    animation: none !important;
  }
  .panel, .mini-card, .track-card, .genre-card, .log-card, .pager-track {
    transition: none !important;
  }
  .scanlines { opacity: 0.25; }
}

@media (max-height: 800px) {
  #panel-now .blinkie-row { display: none; }
  .panel-head h2 { font-size: clamp(18px, 3.6vh, 28px); }
  .hero-meta { font-size: clamp(14px, 2.4vh, 22px); margin: 0 0 8px; }
  .btn-play-lg { padding: 8px 16px; }
}


@media (max-width: 860px) and (min-height: 700px) and (orientation: portrait) {
  .hero-card { grid-template-columns: auto 1fr; align-items: center; }
  .hero-body { min-width: 0; }
  .hero-actions { position: relative; z-index: 1; }
}
/* Landscape phones / short wide viewports: keep chrome in a row, compact dock. */
@media (max-height: 500px), (max-width: 860px) and (orientation: landscape) {
  .chrome { flex-direction: row; align-items: center; padding: 4px 10px; gap: 10px; }
  .brand img { width: 32px; }
  .nav a { padding: 6px 8px; font-size: 12px; }
  .marquee { flex-basis: 24px; }
  .hero-card { grid-template-columns: auto 1fr; }
  .hero-art { width: clamp(72px, 22vh, 140px); }
  #panel-now .blinkie-row, .log-blinkies { display: none; }
  .dock-art { width: 36px; height: 36px; }
  .btn-play { width: 36px; height: 36px; }
  .btn-round { width: 30px; height: 30px; }
  .counter-digits { font-size: 28px; }
}

/* Pager + visualizer */
.hero-card { flex: 0 0 auto; min-height: 0; }
.hero-body { min-width: 0; }
.pager {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pager-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.pager-track {
  height: 100%;
  display: flex;
  will-change: transform;
}
.pager-page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}
.pager-page .genre-grid,
.pager-page .track-grid,
.pager-page .log-grid {
  height: 100%;
  overflow: hidden;
}
.pager-ui {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 2px;
}
.pager.is-single .pager-ui,
.pager-ui[hidden] { display: none; }
.pager-btn {
  appearance: none;
  background: transparent;
  border: 1px solid #394353;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1;
  width: 36px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); background: #141a24; }
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.pager-ind {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--numeral);
  min-width: 3.2em;
  text-align: center;
}

.viz {
  margin: clamp(2px, 0.5vh, 6px) 0 2px;
  height: clamp(22px, 4.2vh, 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0d10;
  overflow: hidden;
}
.viz-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  padding: 2px 5px;
  box-sizing: border-box;
}
.viz-bar {
  flex: 1 1 0;
  min-width: 0;
  background: #9cc0ff;
  border-radius: 1px 1px 0 0;
  height: 8%;
  position: relative;
  box-shadow: 0 0 6px rgba(156, 192, 255, 0.18);
}
.viz-bar i {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #c6dcff;
  bottom: 8%;
  pointer-events: none;
}
.viz.is-idle .viz-bar { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  .pager-track { transition: none !important; }
  .viz-bar, .viz-bar i { transition: none !important; }
}

@media (max-height: 500px) {
  .panel-head p { display: none; }
  .panel-head h2 { font-size: clamp(16px, 5vh, 22px); margin: 0 0 2px; }
  .back-btn { margin-bottom: 4px; padding: 4px 8px; }
  .track-card { min-height: 0; }
  .track-card .name { font-size: 12px; }
  .pager-viewport { min-height: 76px; }
  .pager { position: relative; }
  .pager-ui { position: absolute; right: 8px; bottom: 4px; z-index: 5; background: rgba(6,7,9,.92); border-radius: 999px; padding: 2px 8px; margin: 0; }

  .hero-actions { gap: 8px; }
  .btn-play-lg { padding: 7px 14px; }
  .hero-meta { margin: 0 0 6px; }
}
