:root {
  --bg: #f5f0e8;
  --bg2: #ede7db;
  --surface: #faf7f2;
  --surface-bg: #f5f0e8;
  --border: #e9e4da;
  --border2: #c9bfad;
  --cream: #2a2218;
  --muted: #8a7f70;
  --muted2: #a89c8a;
  --rust: #c4622d;
  --rust-dim: rgba(196, 98, 45, 0.10);
  --amber: #b8780a;
  --text: #3a3020;
  --topbar-bg: rgba(245, 240, 232, 0.92);
  --overlay-bg: rgba(245, 240, 232, 0.85);
  --ambient-a: rgba(245, 240, 232, 0.4);
  --ambient-b: rgba(196, 98, 45, 0.05);
  --grain-blend: multiply;
  --grain-opacity: 0.025;
  --topbar-h: 80px;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --font-d: 'Bebas Neue', sans-serif;
  --font-s: 'Instrument Serif', serif;
  --font-m: 'Courier Prime', monospace;
}

html[data-theme="dark"] {
  --bg: #181411;
  --bg2: #201c18;
  --surface: #272119;
  --surface-bg: #181411;
  --border: #302820;
  --border2: #3f3428;
  --cream: #e0d4c0;
  --muted: #6e6558;
  --muted2: #7e7468;
  --rust: #d4703a;
  --rust-dim: rgba(212, 112, 58, 0.15);
  --amber: #d49820;
  --text: #b8ac98;
  --topbar-bg: rgba(20, 16, 13, 0.92);
  --overlay-bg: rgba(16, 13, 10, 0.88);
  --ambient-a: rgba(30, 22, 14, 0.6);
  --ambient-b: rgba(196, 98, 45, 0.08);
  --grain-blend: screen;
  --grain-opacity: 0.04;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Smooth theme transitions — only active during the switch (class added/removed by JS) */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

/* Global scrollbar — cream theme */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

* {
  scrollbar-color: var(--border2) var(--bg);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-m);
  min-height: 100dvh;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, var(--ambient-a) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 95%, var(--ambient-b) 0%, transparent 60%);
}

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
}

.logo {
  font-family: var(--font-d);
  font-size: 40px;
  letter-spacing: 0.12em;
  color: var(--cream);
  line-height: 1;
}

.logo em {
  color: var(--rust);
  font-style: normal;
}

.logo-handle {
  display: block;
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 300;
  text-decoration: none;
}

.logo-handle:hover {
  color: var(--cream);
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.vbtn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
}

.vbtn:hover {
  color: var(--text);
}

.vbtn.active {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.search-trigger:hover {
  border-color: var(--muted);
  color: var(--text);
}

.search-trigger kbd {
  font-family: var(--font-m);
  font-size: 9px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--muted);
}

/* ── SEARCH OVERLAY ── */
.soverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.soverlay.open {
  opacity: 1;
  pointer-events: all;
}

.sbox {
  width: min(720px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.18);
  max-height: calc(100dvh - 132px);
}

.srow {
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.srow>span {
  font-size: 24px !important;
}

.sinput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--cream);
  font-family: var(--font-m);
  font-size: 28px;
  padding: 24px 0;
  letter-spacing: 0.02em;
}

.sinput::placeholder {
  color: var(--muted);
}

.sclose {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.sclose:hover {
  color: var(--text);
}

.sresults {
  max-height: min(520px, calc(100dvh - 200px));
  overflow-y: auto;
}

.sresults::-webkit-scrollbar,
.lyrics-plain-wrap::-webkit-scrollbar,
.vinfo-similar::-webkit-scrollbar,
.vinfo-info::-webkit-scrollbar,
.vinfo-queue::-webkit-scrollbar {
  width: 2px;
}

.sresults::-webkit-scrollbar-thumb,
.lyrics-plain-wrap::-webkit-scrollbar-thumb,
.vinfo-similar::-webkit-scrollbar-thumb,
.vinfo-info::-webkit-scrollbar-thumb,
.vinfo-queue::-webkit-scrollbar-thumb {
  background: var(--border2);
}

.ritem {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid rgba(31, 31, 28, 0.6);
}

.ritem:hover {
  background: rgba(0, 0, 0, 0.04);
}

.ritem.active {
  background: var(--rust-dim);
}

.rnum {
  font-size: 10px;
  color: var(--muted2);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.ritem.active .rnum {
  color: var(--rust);
}

.rart {
  width: 40px;
  height: 40px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

.rname {
  font-family: var(--font-s);
  font-size: 16px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.rartist {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.rdur {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.queue-btn {
  flex-shrink: 0;
  width: 0;
  height: 26px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.15s, color 0.15s, border-color 0.15s;
}

.queue-btn:hover {
  color: var(--rust);
  border-color: var(--rust);
}

.queue-btn-done {
  color: #4caf6e !important;
  border-color: #4caf6e !important;
  opacity: 1 !important;
  font-size: 14px !important;
}

.ritem:hover .queue-btn,
.tli:hover .queue-btn,
.track-item:hover .queue-btn {
  width: 26px;
  opacity: 1;
  border-color: var(--border);
}

@media (max-width: 1180px) {
  .queue-btn {
    width: 26px;
    opacity: 0.5;
    border-color: var(--border);
  }
}

.sresults-section-title {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  padding: 12px 20px 6px;
}

.sresults-artists {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 4px 16px 12px;
}

.sresults-artist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  min-width: 0;
}

.sresults-artist img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
}

.sresults-artist:hover img {
  border-color: var(--rust);
  transform: scale(1.05);
}

.sresults-artist span {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  letter-spacing: 0.02em;
}

.ldots {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 20px;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  animation: db 1s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation-delay: .15s
}

.dot:nth-child(3) {
  animation-delay: .3s
}

@keyframes db {

  0%,
  80%,
  100% {
    opacity: .3;
    transform: scale(.8)
  }

  40% {
    opacity: 1;
    transform: scale(1)
  }
}

/* ── SETUP ── */
.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── First-login tour ── */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tour-card {
  position: relative;
  width: min(480px, 100%);
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 44px 40px 32px;
  animation: card-enter 0.35s var(--ease-smooth) both;
}

.tour-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s;
}

.tour-close:hover {
  color: var(--text);
}

.tour-glyph {
  font-size: 28px;
  color: var(--rust);
  margin-bottom: 12px;
  line-height: 1;
}

.tour-title {
  font-family: var(--font-d);
  font-size: 28px;
  letter-spacing: 0.12em;
  color: var(--cream);
  margin-bottom: 12px;
}

.tour-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
}

.tour-views {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.tour-view {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--bg2);
  border-left: 2px solid var(--rust);
}

.tour-view-name {
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cream);
}

.tour-view-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.tour-next {
  width: 100%;
  background: var(--rust);
  color: var(--cream);
  border: none;
  font-family: var(--font-d);
  font-size: 20px;
  letter-spacing: 0.15em;
  padding: 12px 0;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 8px;
}

.tour-next:hover {
  opacity: 0.85;
}

.tour-back {
  background: none;
  border: none;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
  display: block;
}

.tour-back:hover {
  color: var(--text);
}

.tour-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.tour-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border2);
  transition: background 0.2s;
}

.tour-dot.active {
  background: var(--rust);
}

/* Responsive copy */
.tour-mobile {
  display: none;
}

@media (max-width: 640px) {
  .tour-desktop {
    display: none;
  }

  .tour-mobile {
    display: block;
  }

  .tour-card {
    padding: 40px 24px 28px;
  }
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  animation: card-enter 0.4s var(--ease-smooth) both;
}

.setup-card {
  width: min(580px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 52px;
  position: relative;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.stitle {
  font-family: var(--font-d);
  font-size: 52px;
  color: var(--cream);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.stitle em {
  color: var(--rust);
  font-style: normal;
}

.ssub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.sflabel {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sfinput {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--cream);
  font-family: var(--font-m);
  font-size: 12px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  border-radius: 1px;
  margin-bottom: 12px;
}

.sfinput:focus {
  border-color: var(--rust);
}

.sfinput::placeholder {
  color: var(--muted);
}

.sfbtn {
  width: 100%;
  background: var(--rust);
  color: var(--cream);
  border: none;
  font-family: var(--font-d);
  font-size: 22px;
  letter-spacing: 0.15em;
  padding: 14px 0;
  cursor: pointer;
  transition: opacity 0.2s;
  border-radius: 1px;
}

.sfbtn:hover {
  opacity: .85;
}

/* ── ONBOARDING ── */
.onboard-lang-toggle {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.onboard-lang-btn {
  background: none;
  border: none;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.onboard-lang-btn.active {
  color: var(--cream);
}

.onboard-lang-btn:hover {
  color: var(--text);
}

.onboard-lang-sep {
  font-size: 10px;
  color: var(--border2);
}

.onboard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
}

.onboard-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
  transition: background 0.4s, transform 0.4s var(--ease-smooth);
}

.onboard-dot.active {
  background: var(--rust);
  transform: scale(1.35);
}

.onboard-dot.done {
  background: var(--amber);
  transform: scale(1);
}

.onboard-line {
  flex: 1;
  height: 1px;
  background: var(--border2);
  transition: background 0.4s;
}

.onboard-line.done {
  background: var(--amber);
}

/* Panel transitions */
.onboard-panel {
  transition: opacity 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth);
}

.onboard-panel.panel-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.onboard-panel.panel-in {
  opacity: 0;
  transform: translateY(-10px);
}

/* Welcome vinyl */
.onboard-vinyl {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.onboard-vinyl-svg {
  width: 140px;
  height: 140px;
  animation: onboard-spin 9s linear infinite;
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.35));
}

@keyframes onboard-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Descriptive paragraph */
.onboard-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 24px;
}

/* Feature pills */
.onboard-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.onboard-feature {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border2);
  padding: 5px 12px;
}

.onboard-feat-header {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.onboard-feat-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

.onboard-feat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 22px;
}

.onboard-feat-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-left: none;
  padding: 13px 14px 13px 16px;
  position: relative;
  transition: border-color 0.15s;
}

.onboard-feat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--rust);
  opacity: 0.55;
  transition: opacity 0.15s;
}

.onboard-feat-card:hover {
  border-color: color-mix(in srgb, var(--border2) 50%, var(--rust));
}

.onboard-feat-card:hover::before {
  opacity: 1;
}

.onboard-feat-glyph {
  font-size: 15px;
  line-height: 1;
  color: var(--rust);
  margin-bottom: 7px;
  font-family: var(--font-m);
}

.onboard-feat-name {
  font-family: var(--font-d);
  font-size: 14px;
  letter-spacing: 0.09em;
  color: var(--cream);
  margin-bottom: 4px;
}

.onboard-feat-desc {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.55;
  letter-spacing: 0.02em;
}

/* Instructions */
.onboard-instructions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.onboard-choice-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.onboard-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  border-radius: 1px;
  width: 100%;
}

.onboard-choice:hover {
  border-color: var(--rust);
  background: var(--surface);
}

.onboard-choice-label {
  font-family: var(--font-m);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--cream);
}

.onboard-choice-sub {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.onboard-instruction {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
  align-items: flex-start;
}

.onboard-instruction a {
  color: var(--amber);
  text-decoration: none;
}

.onboard-instruction a:hover {
  text-decoration: underline;
}

.onboard-instruction strong {
  color: var(--cream);
}

.onboard-num {
  font-family: var(--font-d);
  font-size: 22px;
  color: var(--rust);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  line-height: 1.2;
  margin-top: 1px;
}

.onboard-uri {
  display: flex;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 11px 14px;
  gap: 12px;
  margin-left: 38px;
}

.onboard-uri-text {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--amber);
  word-break: break-all;
  flex: 1;
  letter-spacing: 0.02em;
}

.onboard-copy {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-d);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}

.onboard-copy:hover {
  border-color: var(--rust);
  color: var(--rust);
}

.onboard-copy.copied {
  border-color: var(--amber);
  color: var(--amber);
}

/* Privacy note */
.onboard-privacy {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.65;
  padding: 10px 14px;
  background: var(--bg2);
  border-left: 2px solid var(--amber);
  margin-bottom: 20px;
}

.onboard-back {
  display: block;
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: color 0.2s;
}

.onboard-back:hover {
  color: var(--text);
}

/* ── AUTH BAR ── */
.authbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.atext {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.spotbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1DB954;
  color: #000;
  border: none;
  font-family: var(--font-m);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 12px 24px;
  cursor: pointer;
  border-radius: 1px;
  transition: opacity 0.2s;
  text-transform: uppercase;
  font-weight: 600;
}

.spotbtn:hover {
  opacity: .85;
}

.auth-disconnect-btn {
  background: none;
  border: none;
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.auth-disconnect-btn:hover {
  color: var(--rust);
}

.uchip {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.uavatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border2);
}

.uname {
  font-family: var(--font-s);
  font-size: 14px;
  color: var(--cream);
  letter-spacing: 0.05em;
}


.acct-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: background 0.15s;
}

.acct-trigger:hover {
  background: rgba(58, 48, 32, 0.07);
}

.acct-caret {
  font-size: 10px;
  color: var(--muted2);
  transition: transform 0.2s;
  line-height: 1;
}

.uchip[data-open] .acct-caret {
  transform: rotate(180deg);
}

/* ── Account Popup ── */
.acct-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 3px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 140px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}

.acct-popup.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.acct-popup-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.acct-popup-item:hover {
  background: var(--bg2);
  color: var(--text);
}

.acct-popup-item-sub {
  padding-left: 28px;
  font-size: 10px;
  opacity: 0.8;
  border-top: none;
}

.acct-popup-item-danger {
  color: #b04020;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.acct-popup-item-danger:hover {
  color: #c94f28;
}

/* ── Device Picker ── */
.dp-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dp-modal {
  width: min(440px, 100%);
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dp-header {
  margin-bottom: 24px;
}

.dp-title {
  font-family: var(--font-d);
  font-size: 32px;
  color: var(--cream);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.dp-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.dp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  max-height: 320px;
  overflow-y: auto;
}

.dp-device {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.dp-device:hover {
  border-color: var(--rust);
  background: var(--surface);
}

.dp-device.dp-active {
  border-color: var(--rust);
  background: var(--surface);
}

.dp-device-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.dp-device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dp-device-name {
  font-family: var(--font-s);
  font-size: 15px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-device-type {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dp-loading,
.dp-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.dp-cancel {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
  transition: color 0.15s;
}

.dp-cancel:hover {
  color: var(--text);
}

/* ── APP / SCENES ── */
.app {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  box-sizing: border-box;
  padding-top: var(--topbar-h);
  display: flex;
  flex-direction: column;
  z-index: 1;
}

#sceneWrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.scene {
  /* Always in the render tree — hidden via opacity/visibility, not display:none */
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;

  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* Fade out on exit; delay visibility so it hides only after fade */
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}

.scene.active {
  pointer-events: auto;
  visibility: visible;
  will-change: opacity, transform;
  /* Entrance animation overrides the transition */
  animation: scIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: none;

  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

@keyframes scIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes recordLand {
  0% {
    transform: translateX(-50%) translateY(-90px) scale(0.78);
    opacity: 0;
  }

  62% {
    transform: translateX(-50%) translateY(6px) scale(1.04);
    opacity: 1;
  }

  80% {
    transform: translateX(-50%) translateY(-3px) scale(0.99);
  }

  100% {
    transform: translateX(-50%);
    opacity: 1;
  }
}

.record-wrap.landing {
  animation: recordLand 0.65s cubic-bezier(0.34, 1.15, 0.64, 1) forwards;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.es-vinyl {
  margin-bottom: 32px;
  opacity: 0.9;
}

.es-vinyl-svg {
  width: clamp(120px, 18vw, 180px);
  height: clamp(120px, 18vw, 180px);
  display: block;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.18));
  transform-box: fill-box;
  transform-origin: center;
  animation: esSpin 18s linear infinite;
}

@keyframes esSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.es-heading {
  font-family: var(--font-s);
  font-style: italic;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--cream);
  margin-bottom: 10px;
  line-height: 1.1;
}

.es-sub {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
  max-width: 320px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.es-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.es-btn {
  font-family: var(--font-d);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.es-btn:hover {
  background: var(--bg2);
  border-color: var(--rust);
}

.es-btn-primary {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--surface);
}

.es-btn-primary:hover {
  background: #b8561f;
  border-color: #b8561f;
}

/* ── TRACK INFO ── */
.tname {
  font-family: var(--font-s);
  font-style: italic;
  font-size: clamp(34px, 4vw, 52px);
  color: var(--cream);
  line-height: 1.05;
  margin-bottom: 12px;
}

.tartist {
  font-family: var(--font-s);
  font-style: italic;
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--rust);
  letter-spacing: 0.02em;
}

.artist-link {
  cursor: pointer;
  transition: opacity 0.15s;
}

.artist-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.talbum {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 6px;
  margin-bottom: 40px;
  cursor: pointer;
  transition: color 0.18s ease, opacity 0.18s ease;
  width: fit-content;
}

.talbum:hover {
  color: var(--rust);
}

.vprog-cont {
  cursor: pointer;
  width: 100%;
  height: 6px;
  background: rgba(58, 48, 32, 0.15);
  margin-bottom: 32px;
  border-radius: 3px;
  overflow: hidden;
  display: none;
  transition: background 0.15s;
}

.vprog-cont:hover {
  background: rgba(58, 48, 32, 0.28);
}

.vprog-fill {
  height: 100%;
  width: 0%;
  background: var(--rust);
  border-radius: 3px;
}

/* ── CONTROLS ── */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.navbtn {
  flex: 1;
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-s);
  font-size: 18px;
  line-height: 1;
  padding: 8px 14px 10px;
  cursor: pointer;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
}

.navbtn:hover {
  color: var(--cream);
  border-color: var(--muted);
}

.playbtn {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--rust);
  color: var(--cream);
  border: none;
  font-family: var(--font-d);
  font-size: 14px;
  letter-spacing: 0.15em;
  padding: 9px 32px;
  cursor: pointer;
  border-radius: 1px;
  transition: opacity 0.2s, transform 0.1s;
  min-width: 130px;
  justify-content: center;
}

.playbtn:hover {
  opacity: .85;
}

.playbtn:active {
  transform: scale(0.98);
}

.cratebtn {
  display: none;
  transition: all 0.2s;
}

.cratebtn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.cratebtn.added {
  color: var(--rust);
  border-color: var(--rust);
}

/* ── VINFO (Lyrics / Similar) ── */
.vl-main {
  transition: opacity 0.3s ease-in-out;
}

.vl-panel.info-open .vl-main {
  transform: none;
}

.vl-panel.lyrics-open .vl-main {
  transform: none;
}

.vinfo-section {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: none;
  transition: max-height 0.45s ease-in-out,
    opacity 0.35s ease-in-out;
}

.vl-panel.info-open .vinfo-section {
  max-height: 500px;
  opacity: 1;
  transform: none;
}

.vl-panel.lyrics-open .vinfo-section {
  transform: none;
}

#vinylScene.lyrics-focus .vl-panel.info-open .vinfo-section {
  max-height: min(72dvh, 760px);
}

#vinylScene.lyrics-focus .vinfo-lyrics.panel-active {
  max-height: min(62dvh, 660px);
  height: min(56dvh, 600px);
}

#vinylScene.lyrics-focus .lyric-slot {
  padding: 0 clamp(12px, 2vw, 36px);
}

#vinylScene.lyrics-focus .lyrics-plain-wrap {
  padding-inline: clamp(12px, 2vw, 36px);
}

#vinylScene.lyrics-focus .lyric-slot.active {
  font-size: clamp(30px, 2.8vw, 42px);
}

#vinylScene.lyrics-focus .lyric-slot.upcoming {
  font-size: clamp(26px, 2.3vw, 36px);
}

#vinylScene.lyrics-focus .lyric-slot.near {
  font-size: clamp(20px, 1.8vw, 28px);
}

#vinylScene.lyrics-focus .lyric-slot.far {
  font-size: clamp(17px, 1.4vw, 22px);
}

.vinfo-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 36px;
}

.vinfo-tab {
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.vinfo-tab.active {
  background: var(--bg2);
  border-color: var(--border2);
  color: var(--text);
}

.vinfo-body {
  padding-top: 16px;
}

.vinfo-lyrics,
.vinfo-similar,
.vinfo-info,
.vinfo-queue {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
}

.vinfo-lyrics.panel-active {
  max-height: 320px;
  opacity: 1;
}

.vinfo-similar.panel-active,
.vinfo-info.panel-active,
.vinfo-queue.panel-active {
  max-height: 400px;
  opacity: 1;
}

/* ── Lyrics ── */
.vinfo-lyrics {
  height: 300px;
  position: relative;
}

.vinfo-lyrics.synced {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
}

.vinfo-lyrics.no-transition .lyric-slot {
  transition: none !important;
}

.lyric-slot {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  text-align: center;
  font-family: var(--font-s);
  font-size: 17px;
  line-height: 1.3;
  padding: 0 clamp(12px, 2.4vw, 40px);
  opacity: 0;
  color: rgba(196, 98, 45, 0.25);
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  appearance: none;
  width: 100%;
  transition: transform 0.32s ease-in-out,
    font-size 0.32s ease-in-out,
    color 0.25s ease-in-out,
    opacity 0.25s ease-in-out;
}

.lyric-slot.active {
  font-size: 26px;
  color: var(--rust);
  opacity: 1;
}

.lyric-slot:hover {
  color: var(--rust) !important;
  opacity: 1 !important;
}

.lyric-slot.upcoming {
  font-size: 24px;
  color: rgba(196, 98, 45, 0.52);
  opacity: 0.95;
}

.lyric-slot.near {
  font-size: 19px;
  color: rgba(196, 98, 45, 0.5);
  opacity: 0.9;
}

.lyric-slot.far {
  font-size: 17px;
  color: rgba(196, 98, 45, 0.25);
  opacity: 0.65;
}

/* Plain (unsynced): scrollable */
.lyrics-plain-wrap {
  height: 100%;
  overflow-y: auto;
  padding-inline: clamp(12px, 2.4vw, 40px);
}

.lyrics-nosync-note {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.lyric-plain-line {
  font-family: var(--font-s);
  font-size: 18px;
  line-height: 1.75;
  color: rgba(196, 98, 45, 0.55);
}

/* ── Similar Artists ── */
.vinfo-similar {
  overflow-y: auto;
  overflow-x: visible;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  padding-top: 4px;
}

.similar-artist {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  border: 1px solid transparent;
}

.similar-artist:hover {
  background: var(--bg2);
  border-color: var(--border);
  transform: translateY(-1px);
}

.similar-art {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}

.similar-name {
  font-family: var(--font-s);
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.vinfo-empty {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 20px 0;
}

.lyrics-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 20px 0;
}

.lyrics-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted2);
  animation: lyrics-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes lyrics-pulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.lyrics-status-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
  text-align: center;
}

.lyrics-status-glyph {
  font-size: 28px;
  color: var(--border2);
  margin-bottom: 4px;
}

.lyrics-status-empty>div:not(.lyrics-status-glyph) {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lyrics-status-sub {
  font-size: 9px !important;
  letter-spacing: 0.1em !important;
  color: var(--muted2) !important;
  text-transform: none !important;
}

/* ── RECONNECT OVERLAY ── */
.reconnect-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reconnect-card {
  width: min(400px, calc(100vw - 32px));
  padding: 44px 40px;
}

.reconnect-title {
  font-family: var(--font-d);
  font-size: 36px;
  color: var(--cream);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.reconnect-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

/* ── Artist Info tab ── */
.vinfo-info {
  overflow-y: auto;
  padding-right: 4px;
}

/* Queue tab */
.vinfo-queue {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  color: inherit;
  font: inherit;
}

.queue-item:hover:not(:disabled) {
  background: var(--bg2);
  border-color: var(--border);
}

.queue-item:disabled,
.queue-item.disabled {
  cursor: default;
  opacity: 0.7;
}

.queue-item-index {
  width: 18px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.08em;
  text-align: right;
}

.queue-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-item-name {
  font-family: var(--font-s);
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.queue-item-artist {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.tag-pill {
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  background: color-mix(in srgb, var(--rust) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rust) 30%, transparent);
  padding: 3px 8px;
  border-radius: 20px;
}

.artist-bio-text {
  font-family: var(--font-s);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}

.artist-stats-row {
  display: flex;
  gap: 24px;
}

.artist-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-val {
  font-family: var(--font-d);
  font-size: 22px;
  color: var(--cream);
  letter-spacing: 0.05em;
}

.stat-lbl {
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Explore artist header bio ── */
.artist-header-body {
  flex: 1;
  min-width: 0;
}

.artist-header-bio {
  font-family: var(--font-s);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  margin: 8px 0 0;
}

/* ══════════════════════════════════
   VINYL SCENE
══════════════════════════════════ */
#vinylScene {
  flex-direction: row;
  align-items: stretch;
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.vl-turntable {
  flex: 0 0 62%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  transition: flex-basis 0.35s ease-in-out;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#turntable3d-container {
  width: 100% !important;
  height: 100% !important;
  transform-origin: center center;
  transition: transform 0.35s ease-in-out;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

#vinylScene.lyrics-focus #turntable3d-container {
  transform: scale(0.8);
}

#turntable3d-container canvas {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: block;
}

.vl-panel {
  flex: 0 0 38%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: clamp(32px, 3vw, 52px);
  border-left: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
  transition: flex-basis 0.35s ease-in-out;
}

#vinylScene.lyrics-focus .vl-turntable {
  flex-basis: 38%;
}

#vinylScene.lyrics-focus .vl-panel {
  flex-basis: 62%;
  padding-inline: clamp(28px, 3vw, 44px);
}

.vl-label {
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.svg-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 100%;
}

.svg-container svg {
  width: 100%;
  height: 100%;
}

.turntable-group {
  animation: float 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

#spinning-record {
  animation: spinRecord 2.5s linear infinite;
  animation-play-state: paused;
}

.playing-spin {
  animation-play-state: running !important;
}

@keyframes spinRecord {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#tonearm-rotate {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-box: view-box;
  transform-origin: 520px 305px;
  transform: rotate(0deg);
}

#tonearm-lift {
  transition: transform 0.3s ease-in-out;
  transform: translateY(-5px);
}

/* ══════════════════════════════════
   CRATE — TWO PANEL LAYOUT
══════════════════════════════════ */
#stackScene {
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin-top: 0;
}

.crate-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ─── Playlist Sidebar ─── */
.playlist-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s ease;
}

#stackScene.transitionout .playlist-panel {
  transform: translateX(-100%);
  opacity: 0;
}

.pp-heading {
  font-family: var(--font-d);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--muted);
  padding: 32px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pp-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* hide scrollbar for elegance */
.pp-list::-webkit-scrollbar {
  display: none;
}

.pp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.pp-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.pp-card.active {
  background: rgba(196, 98, 45, 0.1);
}

.pp-art {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pp-info {
  min-width: 0;
  flex: 1;
}

.pp-name {
  font-family: var(--font-s);
  font-size: 16px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pp-count {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.pp-empty {
  padding: 24px 16px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ─── Sleeve Panel ─── */
.sleeve-panel {
  flex: 1;
  display: flex;
  flex-direction: row;
  /* pile on left, track list on right */
  overflow: hidden;
  background: var(--surface-bg);
}

.track-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.track-list {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.track-list::-webkit-scrollbar {
  display: none;
}

.pile-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pile-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pile-info {
  flex-shrink: 0;
  padding: 12px 24px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.pile-info-name {
  font-family: var(--font-d);
  font-size: 16px;
  color: var(--cream);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pile-info-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 3px;
}

.sleeve-stage {
  width: min(100%, 850px);
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: 100%;
  flex-shrink: 0;
  perspective: 1100px;
  perspective-origin: 50% 0%;
  position: relative;
  margin: 0 auto;
}

.sleeve-stack-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(50deg) rotateZ(-10deg);
  cursor: pointer;
}

.stage-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 300px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.8;
}

/* ─── Vinyl Sleeve (3D pile) ─── */
.vinyl-sleeve {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--iz, 0) * 12px)) rotate(calc(var(--rot, 0) * 1deg));
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.vinyl-sleeve.inspected {
  transform: translateY(80px) translateZ(var(--inspected-z, 600px)) rotateX(calc(-50deg + var(--my, 0) * 10deg)) rotateY(calc(var(--mx, 0) * 10deg)) scale(1.15) !important;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.vinyl-sleeve.inspected.inspected-live {
  transition: none !important;
}

.vinyl-sleeve.playing-intro {
  transform: translateY(120px) translateZ(calc(var(--inspected-z, 600px) + 200px)) rotateX(0deg) scale(1.5) !important;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.15s !important;
  pointer-events: none;
}

#stackScene.transitionout .vinyl-sleeve:not(.playing-intro) {
  opacity: 0;
  pointer-events: none;
}

/* active lift is applied via JS inline style */

.sleeve-box {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: 5px;
  z-index: 2;
  /* step shadows = cardboard thickness, keeping ambient shadow light to prevent huge dark blob from overlapping sleeves */
  box-shadow:
    1px 1px 0 #7a4828,
    2px 2px 0 #5a3018,
    3px 3px 0 #4a2810,
    0 4px 10px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.sleeve-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 55%);
  pointer-events: none;
}

.vinyl-sleeve:hover .sleeve-box {
  box-shadow:
    5px 5px 0 #7a4828,
    10px 10px 0 #5a3018,
    0 28px 60px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.vinyl-sleeve.inspected .sleeve-box {
  /* Flattens the edge shadows since we are looking straight at it */
  box-shadow:
    1px 1px 0 #7a4828,
    2px 2px 0 #5a3018,
    0 40px 100px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.sleeve-disc {
  position: absolute;
  width: 316px;
  height: 316px;
  border-radius: 50%;
  top: 42px;
  /* 400 - 316 = 84 / 2 = 42 for exact vertical center */
  right: -32px;
  /* barely peeks in pile; slides further on hover */
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-color: #111;
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  /* step shadows = vinyl edge thickness */
  box-shadow:
    3px 3px 0 #1a1a1a,
    5px 5px 0 #111,
    0 10px 28px rgba(0, 0, 0, 0.7);
}

.vinyl-sleeve:not(.inspected):hover .sleeve-disc {
  transform: translateX(65px);
}

.vinyl-sleeve.inspected .sleeve-disc {
  transform: translateX(180px) rotate(45deg);
  box-shadow:
    1px 1px 0 #1a1a1a,
    2px 2px 0 #111,
    0 15px 40px rgba(0, 0, 0, 0.8);
}

.disc-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%,
      transparent 28px,
      rgba(0, 0, 0, 0.18) 30px,
      transparent 31px);
  z-index: 1;
}

.disc-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255, 255, 255, 0.12);
  z-index: 2;
}

/* Solid black center hole so art doesn't awkwardly repeat in the very center */
.disc-label::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  z-index: 3;
}

.disc-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: inset 0 0 4px rgba(0, 0, 0, 0.5);
  z-index: 3;
}

/* ─── Track List ─── */
.tli {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.tli:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.tli.now {
  background: rgba(196, 98, 45, 0.1);
}

.tli-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}

.tli-info {
  min-width: 0;
  flex: 1;
}

.tli-name {
  font-family: var(--font-s);
  font-size: 16px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tli-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.tli-artist {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tli-dur {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.empty-crate {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  padding: 40px 0;
}

.crate-header {
  text-align: center;
}

.crate-title {
  font-family: var(--font-d);
  font-size: 52px;
  color: var(--cream);
  letter-spacing: 0.06em;
}

.crate-sub {
  font-family: var(--font-s);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

.crate-area {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  width: 100%;
}

.vinyl-crate {
  position: relative;
  width: 240px;
  height: 280px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  perspective-origin: 50% 20%;
}

.crate-stack-3d {
  transform-style: preserve-3d;
  transform: rotateX(52deg) rotateZ(-2deg);
  position: relative;
  width: 200px;
  height: 200px;
}

.stack-vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: translateZ(calc(var(--i, 0) * 8px));
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
}

.stack-vinyl::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
  z-index: 6;
  pointer-events: none;
}

.stack-vinyl:hover::after {
  background: rgba(255, 255, 255, 0.09);
}

.stack-vinyl.lifted {
  transform: translateZ(calc(var(--i, 0) * 8px + 38px)) rotateZ(11deg);
}

.stack-vinyl.ejecting {
  transform: translateZ(calc(var(--i, 0) * 8px + 150px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.4, 1), opacity 0.3s ease-in 0.15s;
}

.sv-art {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
}

.sv-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sv-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(0, 0, 0, 0.55) 0deg 0.3deg, rgba(0, 0, 0, 0.18) 0.3deg 0.9deg,
      rgba(0, 0, 0, 0.48) 0.9deg 1.5deg, rgba(0, 0, 0, 0.65) 1.5deg 2.2deg);
  z-index: 2;
}

.sv-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      rgba(196, 98, 45, 0) 0deg, rgba(196, 98, 45, 0.07) 45deg,
      rgba(212, 148, 26, 0.06) 90deg, rgba(100, 160, 80, 0.04) 130deg,
      rgba(80, 120, 200, 0.05) 180deg, rgba(160, 80, 200, 0.04) 220deg,
      rgba(196, 98, 45, 0.07) 270deg, rgba(196, 98, 45, 0) 360deg);
  mix-blend-mode: screen;
  z-index: 3;
}

.sv-edge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 0 28px rgba(0, 0, 0, 0.75);
  z-index: 4;
}

.sv-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #050504;
  border: 1px solid #2a2a24;
  z-index: 5;
}

/* ── TOAST ── */
.no-premium-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: #5a1a0a;
  border-top: 1px solid #8a3020;
  color: #f0c8b0;
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 12px 48px 12px 20px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 12px;
}

.no-premium-banner a {
  color: #f0a070;
  text-decoration: underline;
}

.no-premium-banner button {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #f0c8b0;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  opacity: 0.7;
}

.no-premium-banner button:hover {
  opacity: 1;
}

.toast {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border2);
  font-size: 10px;
  color: var(--text);
  letter-spacing: 0.05em;
  padding: 10px 16px;
  z-index: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  max-width: 280px;
  border-radius: 1px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.err {
  border-color: #803030;
  color: #e07070;
}

/* ══════════════════════════════════
       EXPLORE SCENE
    ══════════════════════════════════ */
#exploreScene {
  padding: 0;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.explore-layout {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.explore-layout::-webkit-scrollbar {
  width: 3px;
}

.explore-layout::-webkit-scrollbar-thumb {
  background: var(--border2);
}

/* ─── Explore Search ─── */
.explore-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 16px;
}

.explore-sinput {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--cream);
  font-family: var(--font-m);
  font-size: 16px;
  padding: 14px 20px;
  outline: none;
  letter-spacing: 0.04em;
  transition: border-color 0.25s, box-shadow 0.25s;
  border-radius: 2px;
}

.explore-sinput:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px var(--rust-dim);
}

.explore-sinput::placeholder {
  color: var(--muted);
}

/* ─── Artist Search Results ─── */
.explore-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 24px 24px;
  overflow-y: auto;
  overflow-x: visible;
  flex: 1;
  min-height: 0;
}

.explore-artist-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.explore-artist-card:hover {
  border-color: var(--rust);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.explore-artist-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}

.explore-artist-name {
  font-family: var(--font-s);
  font-size: 16px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-artist-genre {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.explore-artist-followers {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.explore-empty {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.explore-empty-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 48px 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.explore-empty-search-wrap {
  width: 100%;
}

.explore-sinput-hero {
  width: 100%;
  font-size: clamp(18px, 2.2vw, 26px);
  padding: 14px 20px;
  border-radius: 6px;
}

.explore-empty-section {}

.explore-hint-label {
  font-family: var(--font-d);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Reuse home-artist-grid inside explore empty */
.explore-empty-inner .home-artist-grid {
  grid-template-columns: repeat(6, 1fr);
  padding-top: 4px;
}

@media (max-width: 900px) {
  .explore-empty-inner {
    padding: 32px 24px 48px;
  }

  .explore-empty-inner .home-artist-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .explore-empty-inner {
    padding: 20px 16px 40px;
  }

  .explore-empty-inner .home-artist-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Artist Profile ─── */
/* ─── Artist Profile — split layout ─── */
.artist-profile {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

/* Left column: search + artist info + tracklist */
.artist-side {
  width: 380px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s ease;
}

/* When a vinyl is being played — mirrors crate tab's transitionout */
.artist-profile.shelf-inspecting .artist-side {
  transform: translateX(-100%);
  opacity: 0;
}

.artist-details-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

/* Right column: 3D shelf */
.shelf-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.artist-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.artist-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.artist-header-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.artist-header-name {
  font-family: var(--font-d);
  font-size: 30px;
  color: var(--cream);
  letter-spacing: 0.04em;
  line-height: 0.95;
}

.artist-header-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.artist-back-btn {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 1px;
  transition: color 0.2s, border-color 0.2s;
  margin-left: auto;
  flex-shrink: 0;
  align-self: flex-start;
}

.artist-back-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* Tracklist in the left column */
.artist-tracklist {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.artist-tracklist::-webkit-scrollbar {
  width: 3px;
}

.artist-tracklist::-webkit-scrollbar-thumb {
  background: var(--border2);
}

.track-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.track-item.active {
  background: rgba(196, 98, 45, 0.1);
}

.track-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.track-item-info {
  flex: 1;
  min-width: 0;
}

.track-item-name {
  font-family: var(--font-s);
  font-size: 16px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.track-item.active .track-item-name {
  color: var(--rust);
}

.track-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.track-item-artist {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-item-dur {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

/* Shelf-side layout — tabs on top, canvas fills remaining space */
.shelf-browser {
  display: contents;
  /* dissolve — children go directly into shelf-side */
}

.shelf-tabs {
  padding: 12px 16px 0;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  min-height: 31px;
}

.shelf-tabs-track {
  display: flex;
  gap: 2px;
  transform: translateX(0);
  transition: transform 0.28s ease-in-out;
  will-change: transform;
}

.shelf-tab {
  font-family: var(--font-m);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.shelf-tabs.has-back .shelf-tabs-track {
  transform: translateX(104px);
}

.shelf-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.shelf-tab-back {
  position: absolute;
  left: 16px;
  top: 12px;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transform: translateX(-10px);
  pointer-events: none;
  transition: opacity 0.22s ease-in-out,
    transform 0.28s ease-in-out;
  will-change: transform, opacity;
}

.shelf-tab-back.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ── Three.js Vinyl Shelf ── */
.shelf-scene {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

#shelfCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.shelf-play-overlay {
  display: none;
}

/* Navigation bar below shelf */
.shelf-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 14px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.shelf-nav-btn {
  font-family: var(--font-s);
  font-size: 28px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 10px;
  line-height: 1;
  transition: color 0.2s;
  user-select: none;
}

.shelf-nav-btn:hover {
  color: var(--text);
}

.shelf-active-info {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.shelf-active-name {
  font-family: var(--font-s);
  font-style: italic;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-active-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.shelf-counter {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.06em;
  margin-top: 1px;
}

/* loading spinner for explore */
.explore-loading {
  display: flex;
  gap: 5px;
  justify-content: center;
  padding: 40px;
}

@media (max-width: 1400px) {
  .vl-panel {
    flex-basis: 42%;
    padding: 0 clamp(28px, 4vw, 48px);
  }

  .playlist-panel,
  .track-panel {
    width: 280px;
  }

  .artist-side {
    width: 340px;
  }
}

@media (max-width: 1180px) {
  :root {
    --topbar-h: 116px;
  }

  .topbar {
    flex-wrap: wrap;
    align-content: center;
    gap: 10px 18px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .topbar-center {
    position: static;
    left: auto;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
  }

  #vinylScene {
    flex-direction: column;
    overflow-y: auto;
  }

  .vl-turntable {
    flex: 1 1 auto;
    min-height: min(52dvh, 520px);
  }

  .vl-panel {
    flex: 0 0 auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 28px clamp(20px, 5vw, 40px) 40px;
  }

  #vinylScene.lyrics-focus .vl-turntable {
    flex: 1 1 auto;
  }

  #vinylScene.lyrics-focus .vl-panel {
    flex: 0 0 auto;
    width: 100%;
    padding: 28px clamp(20px, 5vw, 40px) 40px;
  }

  #vinylScene.lyrics-focus .vl-panel.info-open .vinfo-section {
    max-height: min(58dvh, 520px);
  }

  #vinylScene.lyrics-focus .vinfo-lyrics.panel-active {
    height: min(52dvh, 460px);
    max-height: min(52dvh, 460px);
  }

  #stackScene,
  #exploreScene {
    overflow-y: auto;
  }

  .crate-layout {
    flex-direction: column;
  }

  /* ── Compact horizontal playlist strip ── */
  .playlist-panel {
    width: 100%;
    max-height: none;
    flex-direction: row;
    align-items: stretch;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .pp-heading {
    display: none;
  }

  .pp-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 12px;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .pp-card {
    flex-direction: column;
    align-items: center;
    padding: 8px;
    gap: 6px;
    min-width: 72px;
    max-width: 72px;
  }

  .pp-card:hover {
    transform: none;
  }

  .pp-art {
    width: 56px;
    height: 56px;
  }

  .pp-count {
    display: none;
  }

  .pp-name {
    font-size: 11px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ── Single panel below: pile OR tracklist ── */
  .sleeve-panel {
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
  }

  #stackScene:not(.has-playlist) .track-panel {
    display: none;
  }

  #stackScene.has-playlist .pile-column {
    display: none;
  }

  #stackScene.has-playlist .track-panel {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: none;
    flex: 1 1 0;
  }

  .track-panel {
    width: 100%;
    max-height: none;
    border-left: none;
  }

  .artist-profile {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
  }

  .artist-side {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    height: auto;
  }

  .artist-details-wrap {
    overflow: visible;
  }

  .shelf-side {
    min-height: min(46dvh, 420px);
    overflow: visible;
  }

  .artist-profile.shelf-inspecting .artist-side {
    transform: none;
    opacity: 1;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar-h: 136px;
  }

  .logo {
    font-size: 32px;
  }

  .search-trigger {
    padding: 8px 14px;
    font-size: 12px;
  }

  .srow {
    padding: 0 16px;
    gap: 12px;
  }

  .sinput {
    font-size: 22px;
    padding: 18px 0;
  }

  .setup-card {
    padding: 36px 28px;
  }

  .onboard-feat-grid {
    grid-template-columns: 1fr;
  }

  .onboard-vinyl-svg {
    width: 110px;
    height: 110px;
  }

  .onboard-uri {
    margin-left: 0;
  }

  .empty-glyph {
    font-size: min(120px, 28vw);
  }

  .controls {
    gap: 6px;
  }

  .playbtn {
    min-width: 0;
    padding-inline: 20px;
  }

  .vinfo-similar {
    grid-template-columns: 1fr;
  }

  .pp-heading {
    padding-inline: 20px;
  }

  .pp-list,
  .track-list,
  .explore-results {
    padding-inline: 12px;
  }

  .pile-wrap {
    min-height: 320px;
    padding: 20px 12px;
  }

  .sleeve-stage {
    width: min(100%, 560px);
  }

  .vinyl-sleeve {
    width: 320px;
    height: 320px;
    margin-top: -160px;
    margin-left: -160px;
  }

  .sleeve-disc {
    width: 252px;
    height: 252px;
    top: 34px;
    right: -26px;
  }

  .disc-label {
    width: 64px;
    height: 64px;
  }

  .artist-header-top {
    flex-wrap: wrap;
  }

  .artist-back-btn {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-h: 60px;
  }

  .topbar {
    flex-wrap: nowrap;
    padding: 0 16px;
    height: 60px;
  }

  /* Hide desktop nav and text search on mobile */
  .topbar-center {
    display: none !important;
  }

  .search-trigger {
    display: none !important;
  }

  .logo-handle {
    display: none;
  }

  .uname,
  .acct-caret {
    display: none;
  }

  .topbar-right {
    gap: 6px;
    margin-left: auto;
  }

  /* Show mobile-only controls */
  .mob-search-icon,
  .mob-burger {
    display: flex;
  }

  .logo {
    font-size: 28px;
  }

  .search-trigger kbd {
    display: none;
  }

  .soverlay {
    padding-top: 84px;
  }

  .vl-turntable {
    min-height: min(42dvh, 340px);
  }

  .vl-panel {
    padding: 22px 16px 28px;
  }

  .artist-stats-row {
    gap: 14px;
  }

  .sleeve-stage {
    width: min(100%, 420px);
  }

  .vinyl-sleeve {
    width: 240px;
    height: 240px;
    margin-top: -120px;
    margin-left: -120px;
  }

  .sleeve-disc {
    width: 188px;
    height: 188px;
    top: 26px;
    right: -20px;
  }

  .disc-label {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }

  .explore-search-wrap {
    padding: 16px 16px 12px;
  }

  .explore-results {
    padding: 4px 16px 16px;
  }

  .artist-header,
  .shelf-tabs,
  .shelf-nav {
    padding-inline: 16px;
  }

  .artist-header-name {
    font-size: 24px;
  }

  .tli,
  .track-item {
    padding-inline: 12px;
    gap: 12px;
  }

  .artist-tracklist {
    padding: 4px 0 12px;
  }

  .shelf-side {
    min-height: 320px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 20px;
    max-width: none;
  }

  .vinfo-similar {
    grid-template-columns: 1fr 1fr;
  }

  /* Lyrics focus on mobile: shrink turntable, fill rest with lyrics */
  #vinylScene.lyrics-focus {
    overflow: hidden;
    flex-direction: column;
  }

  #vinylScene.lyrics-focus .vl-turntable {
    flex: 0 0 26dvh;
    min-height: unset;
    max-height: 26dvh;
    overflow: hidden;
  }

  #vinylScene.lyrics-focus .vl-panel {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 10px 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  #vinylScene.lyrics-focus .vl-main {
    flex: 0 0 auto;
  }

  #vinylScene.lyrics-focus .vinfo-section {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    max-height: none;
    display: flex;
    flex-direction: column;
  }

  #vinylScene.lyrics-focus .vinfo-body {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  #vinylScene.lyrics-focus .vinfo-lyrics.panel-active,
  #vinylScene.lyrics-focus .vinfo-similar.panel-active,
  #vinylScene.lyrics-focus .vinfo-info.panel-active,
  #vinylScene.lyrics-focus .vinfo-queue.panel-active {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    max-height: none;
  }
}

/* ── Home Scene ─────────────────────────────────────────────────────────── */
#homeScene {
  overflow-y: auto;
  overflow-x: hidden;
  align-items: flex-start;
}

.home-layout {
  width: 100%;
  padding: 40px 48px 60px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Section header (title + range toggle inline) */
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.home-section-header .home-section-title {
  margin-bottom: 0;
}

.home-section-title {
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Range toggle */
.home-range-tabs {
  display: flex;
  gap: 4px;
}

.home-range-tab {
  font-family: var(--font-d);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.home-range-tab:hover {
  color: var(--text);
  border-color: var(--border2);
}

.home-range-tab.active {
  color: var(--rust);
  border-color: var(--rust);
  background: var(--rust-dim);
}

/* Top artists — full-bleed grid */
.home-artist-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.home-artist-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  border: none;
  padding: 0;
  background: var(--bg2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.home-artist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.home-artist-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease-in-out;
}

.home-artist-card:hover img {
  transform: scale(1.05);
}

.home-artist-card-overlay {
  position: absolute;
  bottom: -2px;
  left: -2px;
  right: -2px;
  padding: clamp(32px, 3.5vw, 56px) clamp(10px, 1vw, 18px) clamp(10px, 1vw, 16px);
  background: linear-gradient(to top, rgba(20, 15, 10, 0.92) 0%, transparent 100%);
}

.home-artist-card-name {
  font-family: var(--font-s);
  font-size: clamp(13px, 1.05vw, 20px);
  color: #faf7f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.home-artist-card-sub {
  font-family: var(--font-m);
  font-size: clamp(9px, 0.65vw, 13px);
  color: rgba(250, 247, 242, 0.55);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

/* Bottom section */
.home-bottom {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.home-bottom-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}

.home-tracks-col {
  min-width: 0;
}

.home-tracks-col .track-list {
  padding: 4px 0 0;
}

/* Sidebar */
.home-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.home-sidebar-block {
  min-width: 0;
}

.home-hist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: opacity 0.15s;
}

.home-hist-row:last-child {
  border-bottom: none;
}

.home-hist-row:hover {
  opacity: 0.7;
}

.home-hist-thumb {
  width: 38px;
  height: 38px;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}

.home-hist-circle {
  border-radius: 50%;
}

.home-hist-info {
  min-width: 0;
}

.home-hist-name {
  font-family: var(--font-s);
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hist-sub {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.home-hist-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
  /* room for cards to lift on hover without clipping */
}

.home-hist-card {
  width: calc(50% - 5px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: border-color 0.15s, transform 0.15s;
}

.home-hist-card:hover {
  border-color: var(--rust);
  transform: translateY(-2px);
}

.home-hist-card-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg2);
  position: relative;
  overflow: hidden;
}

.home-hist-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-card-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-family: var(--font-d);
  font-size: 8px;
  letter-spacing: 0.1em;
  background: rgba(26, 20, 16, 0.75);
  color: #faf7f2;
  padding: 2px 5px;
  border-radius: 2px;
}

.home-hist-card-name {
  font-family: var(--font-m);
  font-size: 10px;
  color: var(--text);
  padding: 6px 8px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hist-card-sub {
  font-family: var(--font-m);
  font-size: 9px;
  color: var(--muted);
  padding: 0 8px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-section-empty {
  font-family: var(--font-m);
  font-size: 11px;
  color: var(--muted);
  padding: 8px 0;
  letter-spacing: 0.05em;
}

.home-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  width: 100%;
  color: var(--muted);
  font-family: var(--font-m);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

.home-empty-glyph {
  font-size: 40px;
  opacity: 0.3;
}

/* ── Mobile nav ──────────────────────────────────────────────────────────── */
.mob-search-icon,
.mob-burger {
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.15s;
}

.mob-search-icon:active,
.mob-burger:active {
  background: rgba(0, 0, 0, 0.07);
}

@media (min-width: 641px) {

  .mob-search-icon,
  .mob-burger {
    display: none;
  }
}

.mob-burger {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.mob-burger span {
  display: block;
  height: 1.5px;
  width: 20px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

.mob-burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.mob-burger.open span:nth-child(2) {
  opacity: 0;
}

.mob-burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.mob-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 98;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-110%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-nav.open {
  transform: translateY(0);
}

.mob-nav-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-d);
  font-size: 22px;
  letter-spacing: 0.15em;
  color: var(--text);
  padding: 18px 24px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mob-nav-item:hover {
  background: var(--bg2);
}

.mob-nav-item.active {
  color: var(--rust);
}

.mob-nav-x {
  display: block;
  padding: 14px 24px;
  font-family: var(--font-m);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.mob-nav-x:hover {
  color: var(--rust);
}

@media (max-width: 640px) {
  .mob-nav {
    display: block;
  }

  .mob-search-icon {
    display: flex;
  }

  .mob-burger {
    display: flex;
  }
}

@media (max-width: 900px) {
  .home-layout {
    padding: 28px 24px 48px;
    gap: 28px;
  }

  .home-artist-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .home-bottom-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .home-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    min-width: 0;
  }

  .home-sidebar-block {
    flex: 1 1 240px;
    min-width: 0;
    overflow: hidden;
  }

  .home-hist-cards {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .home-hist-card {
    width: 120px;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .home-layout {
    padding: 20px 16px 40px;
    gap: 20px;
  }

  .home-artist-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Flush track rows — no extra side padding on mobile */
  .home-tracks-col .tli {
    padding-inline: 4px;
  }

  .home-tracks-col .tli-thumb {
    width: 46px;
    height: 46px;
  }

  /* Recent playlists/albums: horizontal carousel */
  .home-hist-cards {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    padding-bottom: 4px;
  }

  .home-hist-card {
    width: 130px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  /* Smaller track name on home to match surrounding type scale */
  .home-tracks-col .tli-name {
    font-size: 13px;
  }

  /* Sidebar stacks vertically, full width */
  .home-sidebar {
    flex-direction: column;
    min-width: 0;
  }

  .home-sidebar-block {
    flex: none;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
}

/* ── Crate: landscape tablet (horizontal split instead of stacked) ── */
@media (max-width: 900px) and (orientation: landscape) {
  #stackScene {
    overflow: hidden;
  }

  .crate-layout {
    flex-direction: row;
  }

  .playlist-panel {
    width: 240px;
    max-height: none;
    border-right: 1px solid var(--border);
    border-bottom: none;
  }

  .sleeve-panel {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: row;
    overflow: hidden;
  }

  /* Before a playlist is selected: show stack, hide tracklist */
  #stackScene:not(.has-playlist) .track-panel {
    display: none;
  }

  /* After a playlist is selected: show tracklist, hide stack */
  #stackScene.has-playlist .pile-column {
    display: none;
  }

  #stackScene.has-playlist .track-panel {
    width: 100%;
    max-height: none;
    border-left: none;
    border-top: none;
  }
}