.listening-room-page {
  --room-wood: #724631;
  --room-wood-dark: #45291f;
  --room-cream: #f3e5c4;
  --room-amber: #d9943f;
  --room-red: #a94836;
  --room-charcoal: #242321;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 25% 10%, rgba(246, 211, 101, 0.13), transparent 32%),
    var(--desktop-bg);
}

.listening-room-topbar {
  position: relative;
}

.listening-room-topbar nav {
  flex: 0 0 auto;
}

.room-catalog {
  margin-left: auto;
  color: var(--muted);
  font: 700 11px "Space Grotesk";
  letter-spacing: 0.12em;
}

.listening-room-main {
  width: min(1500px, 100%);
  min-height: calc(100vh - var(--nav-height));
  margin: 0 auto;
  padding: clamp(50px, 6vw, 90px) clamp(22px, 6vw, 90px) 36px;
  overflow: hidden;
  border: var(--line);
  border-top: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(255, 253, 247, 0.9), rgba(255, 253, 247, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(17, 17, 17, 0.035) 42px 44px);
}

html[data-theme="dark"] .listening-room-main {
  background-image:
    linear-gradient(rgba(17, 19, 21, 0.9), rgba(17, 19, 21, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(243, 240, 232, 0.04) 42px 44px);
}

.room-intro {
  margin-bottom: clamp(42px, 5vw, 76px);
}

.room-intro h1 {
  max-width: 1000px;
  margin: 8px 0 14px;
  font: 700 clamp(56px, 8vw, 118px) / 0.88 "Space Grotesk";
  letter-spacing: -0.065em;
}

.room-intro > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.room-console {
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(390px, 0.92fr);
  gap: clamp(38px, 6vw, 90px);
  align-items: start;
}

.turntable-window {
  background: var(--surface);
}

.room-windowbar {
  min-width: 0;
  gap: 14px;
  background: var(--yellow);
}

.room-windowbar b {
  min-width: 0;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-windowbar > span:last-child {
  font-size: 12px;
  white-space: nowrap;
}

.turntable {
  position: relative;
  min-height: 490px;
  padding: 44px;
  overflow: hidden;
  background:
    repeating-linear-gradient(2deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    linear-gradient(135deg, var(--room-wood), var(--room-wood-dark));
  box-shadow: inset 0 0 0 8px rgba(17, 17, 17, 0.18);
}

.deck-screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #171717;
  border-radius: 50%;
  background: var(--chrome);
}

.screw-one { inset: 20px auto auto 20px; }
.screw-two { inset: 20px 20px auto auto; }
.screw-three { inset: auto auto 20px 20px; }
.screw-four { inset: auto 20px 20px auto; }

.platter {
  position: relative;
  width: min(370px, 76%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 8px solid #171717;
  border-radius: 50%;
  background: #3b3a37;
  box-shadow: 0 14px 0 rgba(17, 17, 17, 0.42), inset 0 0 0 3px #6b6861;
}

.platter-rings,
.mounted-record {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
}

.platter-rings {
  background: repeating-radial-gradient(circle, #3b3a37 0 3px, #292826 4px 6px);
}

.mounted-record {
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.94);
  background: repeating-radial-gradient(circle, #151515 0 5px, #242424 6px 8px);
  transition: opacity 160ms ease, transform 220ms ease;
}

.mounted-record.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.mounted-record.is-spinning {
  animation: vinyl-spin 1.8s linear infinite;
}

.mounted-label,
.travel-record::after,
.record-disc::after {
  width: 31%;
  aspect-ratio: 1;
  display: block;
  border: 2px solid #171717;
  border-radius: 50%;
  background-color: var(--record-accent, var(--room-amber));
  background-image: var(--record-cover, none);
  background-position: center;
  background-size: cover;
  content: "";
}

.spindle {
  position: absolute;
  z-index: 4;
  width: 10px;
  height: 10px;
  border: 2px solid #111;
  border-radius: 50%;
  background: #ddd9cc;
}

.tonearm-assembly {
  position: absolute;
  top: 70px;
  right: 38px;
  width: 130px;
  height: 330px;
}

.tonearm-pivot {
  position: absolute;
  top: 0;
  right: 4px;
  z-index: 3;
  width: 72px;
  height: 72px;
  border: 8px solid #252525;
  border-radius: 50%;
  background: var(--chrome);
  box-shadow: 0 5px 0 rgba(17, 17, 17, 0.45);
}

.tonearm {
  position: absolute;
  z-index: 2;
  top: 34px;
  right: 34px;
  width: 18px;
  height: 220px;
  border: 3px solid #171717;
  background: #d4d0c4;
  transform: rotate(-12deg);
  transform-origin: 50% 8px;
  transition: transform 680ms cubic-bezier(0.33, 1, 0.68, 1);
}

.tonearm::after {
  position: absolute;
  right: -3px;
  bottom: -28px;
  width: 18px;
  height: 38px;
  border: 3px solid #171717;
  background: #d4d0c4;
  content: "";
  transform: rotate(22deg);
  transform-origin: top center;
}

.tonearm-head {
  position: absolute;
  right: -13px;
  bottom: -48px;
  width: 38px;
  height: 25px;
  border: 3px solid #111;
  background: #262523;
  transform: rotate(3deg) translateY(-4px);
  transition: transform 200ms ease 620ms;
}

.tonearm-head::after {
  position: absolute;
  left: 7px;
  bottom: -10px;
  width: 3px;
  height: 10px;
  background: #d8d3c8;
  content: "";
  transform: rotate(8deg);
  transform-origin: top center;
}

.turntable.is-playing .tonearm {
  transform: rotate(45deg);
}

.turntable.is-playing .tonearm-head {
  transform: rotate(3deg) translateY(2px);
}

.power-readout {
  position: absolute;
  right: 42px;
  bottom: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--room-cream);
  font: 700 11px "Space Grotesk";
  letter-spacing: 0.12em;
}

.power-led {
  width: 10px;
  height: 10px;
  border: 2px solid #171717;
  border-radius: 50%;
  background: #4a302a;
}

.power-led.is-on {
  background: #e05238;
  box-shadow: 0 0 10px rgba(224, 82, 56, 0.78);
}

.deck-controls {
  position: absolute;
  right: 40px;
  bottom: 78px;
  display: flex;
  gap: 9px;
}

.deck-button {
  min-height: 44px;
  padding: 10px 14px;
  border: 3px solid #171717;
  border-radius: 0;
  color: #171717;
  background: var(--room-cream);
  box-shadow: 4px 4px 0 #171717;
  font: 700 13px "Space Grotesk";
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.play-button:not(:disabled):hover,
.play-button:not(:disabled):focus-visible {
  background: var(--yellow);
}

.deck-button:active:not(:disabled) {
  box-shadow: 1px 1px 0 #171717;
  transform: translate(3px, 3px);
}

.deck-button:disabled {
  color: #777168;
  background: #b8aa91;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.68;
}

.eject-button {
  background: var(--chrome);
}

.now-loaded {
  min-height: 150px;
  margin: 30px 0 0;
  padding: 24px 26px;
  border: var(--line);
  background: var(--surface);
  box-shadow: 7px 7px 0 var(--hard-shadow);
}

.now-loaded-label,
.room-status {
  margin: 0;
  font: 700 12px "Space Grotesk";
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.now-loaded h2 {
  margin: 9px 0 5px;
  font: 700 clamp(24px, 3vw, 36px) "Space Grotesk";
}

.now-loaded > p:nth-child(3) {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.room-status {
  width: fit-content;
  margin-top: 20px;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  background: var(--yellow);
}

.spotify-button {
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--green);
  box-shadow: 4px 4px 0 var(--hard-shadow);
  font: 700 13px "Space Grotesk";
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.spotify-button:hover:not(:disabled),
.spotify-button:focus-visible:not(:disabled) {
  background: var(--yellow);
}

.spotify-button:active:not(:disabled) {
  box-shadow: 1px 1px 0 var(--hard-shadow);
  transform: translate(3px, 3px);
}

.spotify-button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.48;
}

.collection-column {
  padding-top: 28px;
}

.collection-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.collection-heading h2 {
  margin: 5px 0 0;
  font: 700 clamp(40px, 5vw, 70px) / 0.92 "Space Grotesk";
  letter-spacing: -0.05em;
}

.collection-heading > p {
  max-width: 190px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
}

.record-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 20px;
  padding: 12px 16px 30px;
  overflow: hidden;
  border: var(--line);
  border-bottom: 0;
  background:
    linear-gradient(rgba(36, 35, 33, 0.94), rgba(36, 35, 33, 0.94)),
    repeating-linear-gradient(90deg, #493025 0 4px, #5c3828 4px 8px);
}

.record-choice {
  position: relative;
  min-width: 0;
  padding: 0 18% 0 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.record-shelf.is-busy .record-choice:not(.is-selected),
.record-shelf.has-selection .record-choice:not(.is-selected) {
  opacity: 0.48;
  filter: saturate(0.65);
}

.record-shelf.is-busy .record-choice {
  pointer-events: none;
}

.record-sleeve {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #111;
  background: var(--sleeve-color, var(--yellow));
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.58);
}

.record-cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.record-cover.is-ready {
  opacity: 1;
}

.record-disc {
  position: absolute;
  z-index: 1;
  top: 6%;
  right: 1%;
  width: 74%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px solid #050505;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 4px, #272727 5px 7px);
}

.record-choice-title {
  position: relative;
  z-index: 3;
  min-height: 34px;
  padding: 13px 4px 0;
  display: block;
  color: #f3e5c4;
  font: 700 16px "Space Grotesk";
}

.record-choice:hover,
.record-choice:focus-visible {
  z-index: 4;
  outline: none;
  filter: brightness(1.08) contrast(1.02);
  transform: translateY(-7px) rotate(-0.7deg) scale(1.02);
}

.record-choice:focus-visible .record-sleeve {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.record-choice.is-selected .record-sleeve {
  outline: 4px solid var(--room-amber);
  outline-offset: 4px;
}

.shelf-base {
  height: 30px;
  border: 3px solid #111;
  background: linear-gradient(#87583d, #4b2e23);
  box-shadow: 8px 9px 0 var(--hard-shadow);
}

.travel-record {
  position: fixed;
  z-index: 100;
  display: grid;
  place-items: center;
  border: 3px solid #050505;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #111 0 4px, #272727 5px 7px);
  pointer-events: none;
  will-change: transform, opacity;
}

.room-footnote {
  margin: 70px 0 0;
  color: var(--muted);
  font: 700 10px "Space Grotesk";
  letter-spacing: 0.12em;
  text-align: center;
}

@keyframes vinyl-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1050px) {
  .room-console {
    grid-template-columns: minmax(380px, 1fr) minmax(320px, 0.82fr);
    gap: 38px;
  }

  .turntable {
    min-height: 430px;
    padding: 34px;
  }

  .tonearm-assembly {
    right: 22px;
    transform: scale(0.82);
    transform-origin: top right;
  }
}

@media (max-width: 820px) {
  .room-catalog {
    display: none;
  }

  .listening-room-topbar nav {
    order: initial;
    flex: 1 1 auto;
    width: auto;
    overflow: visible;
  }

  .listening-room-topbar nav a {
    white-space: nowrap;
  }

  .room-console {
    grid-template-columns: minmax(0, 1fr);
  }

  .turntable-column {
    width: min(650px, 100%);
    margin: 0 auto;
  }

  .collection-column {
    order: 2;
    padding-top: 12px;
  }

  .record-shelf {
    grid-auto-columns: minmax(180px, 42vw);
    grid-template-columns: none;
    grid-auto-flow: column;
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
  }

  .record-choice {
    scroll-snap-align: start;
  }
}

@media (max-width: 620px) {
  .listening-room-topbar {
    flex-wrap: nowrap;
  }

  .listening-room-main {
    padding: 42px 14px 28px;
  }

  .room-intro {
    margin-bottom: 34px;
  }

  .room-intro h1 {
    font-size: clamp(52px, 18vw, 78px);
    overflow-wrap: anywhere;
  }

  .turntable {
    min-height: auto;
    aspect-ratio: 1.02;
    padding: 8%;
  }

  .platter {
    width: 76%;
  }

  .tonearm-assembly {
    top: 11%;
    right: 3%;
    transform: scale(0.58);
  }

  .deck-controls {
    right: 7%;
    bottom: 9%;
  }

  .power-readout {
    display: none;
  }

  .deck-button {
    min-height: 44px;
    padding: 9px 11px;
    font-size: 11px;
  }

  .now-loaded {
    min-height: 0;
    margin-top: 22px;
    padding: 20px;
  }

  .collection-heading {
    align-items: start;
  }

  .collection-heading > p {
    display: none;
  }

  .record-shelf {
    grid-auto-columns: minmax(168px, 68vw);
    padding-right: 28px;
  }

  .room-footnote {
    margin-top: 50px;
    line-height: 1.5;
  }
}

@media (max-width: 430px) {
  .listening-room-topbar .logo {
    flex-basis: 43px;
    width: 43px;
    height: 43px;
  }

  .listening-room-topbar nav a {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 13px;
  }

  .listening-room-topbar .theme-toggle {
    min-width: 52px;
    padding: 8px;
  }

  .listening-room-topbar .theme-label {
    display: none;
  }

  .turntable-window {
    box-shadow: 5px 5px 0 var(--hard-shadow);
  }

  .room-windowbar {
    min-height: 48px;
    padding: 10px 12px;
  }

  .room-windowbar > span:last-child {
    display: none;
  }

  .tonearm-assembly {
    transform: scale(0.47);
  }

  .deck-controls {
    right: 6%;
    bottom: 8%;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-choice,
  .mounted-record,
  .tonearm,
  .tonearm-head,
  .record-cover {
    transition-duration: 1ms !important;
  }

  .record-choice:hover,
  .record-choice:focus-visible {
    transform: none;
  }

  .mounted-record.is-spinning {
    animation: none;
  }
}
