/* La colección en vinilo: batea de discos + bandeja. Usa los tokens de site.css. */
.crate-page { padding-bottom: 40px; }
.crate-page .nav a[aria-current="page"] { color: var(--gold); }

.room { position: relative; z-index: 1; padding-top: 24px; }
.room-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  letter-spacing: 0.04em;
  line-height: 1;
}
.room-head p { margin: 10px 0 0; max-width: 52ch; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }

.year-tabs { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.year-tabs::-webkit-scrollbar { display: none; }
.year-tabs button {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.year-tabs button:hover { color: var(--ink); border-color: var(--line-strong); }
.year-tabs button[aria-selected="true"] { color: #0b0c0d; background: var(--gold); border-color: var(--gold); }

.room-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  margin-top: 18px;
}

/* ---------- Batea ---------- */
.bin { --s: min(clamp(230px, 27vw, 380px), 37vh); min-width: 0; }
.bin-view {
  position: relative;
  height: calc(var(--s) + 190px);
  perspective: 1300px;
  perspective-origin: 50% -10%;
  outline: none;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.bin-view:active { cursor: grabbing; }
.bin-view:focus-visible { box-shadow: 0 0 0 2px var(--line-strong); border-radius: 18px; }
.bin-stack { position: absolute; left: 50%; bottom: 60px; width: var(--s); height: var(--s); margin-left: calc(var(--s) / -2); transform-style: preserve-3d; }

.sleeve {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #141516;
  transform-origin: 50% 100%;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  will-change: transform;
  cursor: pointer;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.16), 0 26px 50px rgba(0, 0, 0, 0.5);
  backface-visibility: hidden;
}
.sleeve img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px; pointer-events: none; }
/* Los discos de atrás se oscurecen para que el de adelante mande. */
.sleeve::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: #050607; opacity: var(--dim, 0); transition: opacity 0.4s ease; pointer-events: none; }
.sleeve.is-front { cursor: pointer; }
.sleeve.is-front:hover { filter: brightness(1.06); }
.sleeve.is-gone { pointer-events: none; }

.bin-front {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(var(--s) + 84px);
  height: 74px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  border-radius: 6px 6px 12px 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #17181a 0%, #0c0d0e 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.bin-front span { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.5rem; letter-spacing: 0.34em; color: var(--gold); opacity: 0.85; }

.bin-caption { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 22px; }
.bin-nav { display: flex; align-items: center; gap: 10px; }
.bin-step {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.bin-step:hover { border-color: var(--line-strong); }
.bin-step:active { transform: scale(0.94); }
.bin-step:disabled { opacity: 0.3; cursor: default; }
.bin-count { font-family: var(--mono); min-width: 62px; text-align: center; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bin-info { min-width: 0; }
.bin-info h2 { margin: 2px 0; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.7rem; letter-spacing: 0.04em; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-cat, .deck-cat { margin: 0; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.bin-artist, .deck-artist { margin: 0; font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-play, .deck-buy {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #0b0c0d;
  font: 700 0.76rem "Sora", sans-serif;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, filter 0.2s;
}
.bin-play:hover, .deck-buy:hover { filter: brightness(1.08); }
.bin-play:active, .deck-buy:active { transform: translateY(1px) scale(0.98); }

/* ---------- Bandeja ---------- */
.deck { min-width: 0; }
.deck-scene { perspective: 1500px; perspective-origin: 50% 20%; padding: 0 2%; }
/* Bandeja estilo Technics SL-1210: todo dibujado con CSS y un SVG para el brazo, sin imágenes. */
.deck-plinth {
  position: relative;
  aspect-ratio: 1.3 / 1;
  width: min(100%, 60vh);
  margin: -3% auto 1%;
  border-radius: 14px;
  transform: rotateX(33deg);
  transform-style: preserve-3d;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.09) 0%, transparent 28%, transparent 70%, rgba(255, 255, 255, 0.05) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #232625 0%, #17191a 55%, #101212 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 60px 70px -20px rgba(0, 0, 0, 0.85);
}
/* Canto frontal: le da espesor al mueble. */
.deck-plinth::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 30px;
  transform-origin: 50% 0;
  transform: rotateX(-90deg);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #151717 0%, #0a0b0b 70%, #050606 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.deck-brand {
  position: absolute; left: 5%; top: 5.5%;
  margin: 0;
  font: 700 clamp(0.7rem, 1.5vw, 1rem) var(--display); text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #c9ccc9;
  opacity: 0.8;
}
.deck-brand span { display: block; font: 500 0.5em "Sora", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; margin-top: 2px; }

.deck-platter {
  position: absolute;
  top: 50%; left: 39%;
  width: 60%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) translateZ(8px);
  transform-style: preserve-3d;
  border-radius: 50%;
  background: conic-gradient(from 40deg, #8f9391, #f3f4f2 8%, #9a9e9b 17%, #d8dad7 30%, #7d817e 44%, #eceeeb 58%, #8b8f8c 71%, #dfe1de 85%, #8f9391);
  box-shadow: 0 0 0 1px #0a0b0b, 0 14px 26px rgba(0, 0, 0, 0.7);
}
/* Puntos estroboscópicos del borde del plato: giran con la música. */
.deck-strobe {
  position: absolute; inset: 0.6%;
  border-radius: 50%;
  background: repeating-conic-gradient(#1a1c1b 0 0.9deg, transparent 0.9deg 2deg);
  -webkit-mask: radial-gradient(circle, transparent 0 67.5%, #000 68% 70.2%, transparent 70.7%);
  mask: radial-gradient(circle, transparent 0 67.5%, #000 68% 70.2%, transparent 70.7%);
  animation: vinyl-spin var(--spin, 1.8s) linear infinite;
  animation-play-state: paused;
}
.deck-mat { position: absolute; inset: 4.6%; border-radius: 50%; background: radial-gradient(circle, #1b1d1c 0 30%, #0d0e0e 31% 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.deck-vinyl { position: absolute; inset: 5.4%; opacity: 0; transform: translateZ(4px); }
.deck-vinyl.is-loaded { opacity: 1; }
.deck-vinyl.is-dropping { animation: vinyl-drop 0.85s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes vinyl-drop {
  from { opacity: 0; transform: translate3d(-64%, 4%, 90px) rotate(-40deg); }
  to { opacity: 1; transform: translateZ(4px); }
}
.deck-disc {
  position: absolute; inset: 0;
  border-radius: 50%;
  /* Surcos finos, con bandas lisas entre temas y borde de entrada. */
  background:
    radial-gradient(circle, transparent 0 34.5%, rgba(0, 0, 0, 0.55) 35% 35.6%, transparent 36% 49.5%, rgba(0, 0, 0, 0.5) 50% 50.5%, transparent 51% 61%, rgba(0, 0, 0, 0.5) 61.4% 61.9%, transparent 62.4% 68.4%, #070808 69% 100%),
    repeating-radial-gradient(circle, #0a0b0b 0 0.7px, #1b1d1d 1.1px 1.7px);
  box-shadow: 0 0 0 1px #000, 0 6px 14px rgba(0, 0, 0, 0.6);
  animation: vinyl-spin var(--spin, 1.8s) linear infinite;
  animation-play-state: paused;
}
.deck-plinth.is-playing .deck-disc, .deck-plinth.is-playing .deck-strobe { animation-play-state: running; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
/* El brillo no gira: queda fijo respecto de la luz, como en un disco real. */
.deck-sheen {
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    conic-gradient(from 300deg, transparent 0deg, rgba(255, 255, 255, 0.27) 22deg, rgba(255, 255, 255, 0.04) 40deg, transparent 62deg, transparent 180deg, rgba(255, 255, 255, 0.18) 204deg, rgba(255, 255, 255, 0.03) 222deg, transparent 244deg);
  -webkit-mask: radial-gradient(circle, transparent 0 34%, #000 36% 68%, transparent 70%);
  mask: radial-gradient(circle, transparent 0 34%, #000 36% 68%, transparent 70%);
  mix-blend-mode: screen;
}
.deck-label {
  position: absolute; inset: 33%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px #060707, inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.deck-label img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-label::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, transparent 0 60%, rgba(0, 0, 0, 0.28) 100%); }
.deck-spindle {
  position: absolute; top: 50%; left: 50%;
  width: 3.4%; aspect-ratio: 1;
  transform: translate(-50%, -50%) translateZ(12px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #a9adaa 55%, #5b5f5c);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* Brazo en S: gira sobre el pivote. 0 = apoyado; 36 a 57 grados = recorriendo el disco. */
.deck-arm { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateZ(22px); pointer-events: none; overflow: visible; }
.arm-rot { transform-origin: 1090px 250px; transform: rotate(var(--arm, 0deg)); transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }

.deck-start {
  position: absolute; left: 4.5%; bottom: 6%;
  width: 11.5%; aspect-ratio: 1 / 1.05;
  padding: 0;
  border-radius: 5px;
  border: 1px solid #050606;
  background: linear-gradient(180deg, #3a3e3c 0%, #1d201f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 0 #060707, 0 8px 12px rgba(0, 0, 0, 0.6);
  color: #e8eae7;
  font: 600 clamp(0.42rem, 0.82vw, 0.6rem) "Sora", sans-serif;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
  cursor: pointer;
  transform: translateZ(6px);
  transition: transform 0.1s, box-shadow 0.1s;
}
.deck-start:active, .deck-plinth.is-playing .deck-start { transform: translateZ(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 #060707, 0 3px 6px rgba(0, 0, 0, 0.6); }
.deck-start:disabled { color: #6c706d; cursor: default; }
.deck-start:focus-visible, .deck-speed button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.deck-speed { position: absolute; left: 18.5%; bottom: 6%; display: flex; gap: 6px; transform: translateZ(4px); }
.deck-speed button {
  position: relative;
  width: clamp(26px, 3.4vw, 40px); height: clamp(18px, 2.3vw, 26px);
  padding: 0;
  border-radius: 4px;
  border: 1px solid #050606;
  background: linear-gradient(180deg, #343836, #1c1f1e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 0 #060707;
  color: #cfd2cf;
  font: 600 clamp(0.44rem, 0.8vw, 0.58rem) "Sora", sans-serif;
  cursor: pointer;
}
.deck-speed button::before { content: ""; position: absolute; left: 50%; top: -9px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #3a1512; }
.deck-speed button[aria-pressed="true"]::before { background: #ff4a36; box-shadow: 0 0 8px 2px rgba(255, 74, 54, 0.7); }

.deck-pitch { position: absolute; right: 3.5%; bottom: 6%; width: 8%; height: 38%; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translateZ(4px); }
.deck-pitch span { font: 600 clamp(0.4rem, 0.72vw, 0.54rem) "Sora", sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: #aeb2af; }
.deck-pitch-slot { position: relative; flex: 1; width: 100%; container-type: size; }
/* Un range horizontal girado 90 grados: hacia abajo acelera, como en la bandeja real. */
.deck-pitch input {
  position: absolute; left: 50%; top: 50%;
  width: 100cqh; height: 100cqw;
  margin: 0;
  transform: translate(-50%, -50%) rotate(90deg);
  -webkit-appearance: none; appearance: none;
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent calc(50% - 2px), #050606 calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 8.33%);
  cursor: ns-resize;
}
.deck-pitch input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 78cqw;
  border-radius: 3px;
  border: 1px solid #050606;
  background: linear-gradient(90deg, #4a4e4c 0 42%, #f1f2f0 42% 58%, #2a2d2c 58% 100%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}
.deck-pitch input::-moz-range-thumb { width: 16px; height: 78cqw; border-radius: 3px; border: 1px solid #050606; background: linear-gradient(90deg, #4a4e4c 0 42%, #f1f2f0 42% 58%, #2a2d2c 58% 100%); }
.deck-pitch input::-moz-range-track { background: transparent; }

.deck-panel { margin-top: 22px; }
.deck-empty h2, .deck-now h2 { margin: 4px 0 2px; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 2rem; letter-spacing: 0.04em; line-height: 1.05; }
.deck-empty p { margin: 6px 0 0; color: var(--muted); font-size: 0.86rem; }
.deck-progress { position: relative; height: 16px; margin-top: 16px; cursor: pointer; outline: none; }
.deck-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--line); }
.deck-progress span { position: absolute; left: 0; top: 7px; height: 2px; width: 0; background: var(--gold); }
.deck-progress:focus-visible::before { background: var(--line-strong); }
.deck-times { font-family: var(--mono); display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.deck-tracks { list-style: none; margin: 16px 0 0; padding: 0; max-height: 300px; overflow-y: auto; }
.deck-tracks li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 10px; }
.deck-tracks li + li { margin-top: 2px; }
.deck-tracks li.is-current { background: var(--panel-soft); }
.deck-tracks .t-num { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.deck-tracks li.is-current .t-num { color: var(--gold); }
.deck-tracks .t-play { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.deck-tracks .t-title { display: block; font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-tracks .t-artist { display: block; font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-tracks .t-play:hover .t-title { color: var(--gold); }
.deck-tracks .t-dur { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.deck-tracks .t-link { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; color: var(--gold); text-decoration: none; white-space: nowrap; }
.deck-tracks .t-link:hover { text-decoration: underline; }
.deck-buy { margin-top: 18px; }
.deck-buy[hidden] { display: none; }

@media (max-width: 900px) {
  .room-stage { grid-template-columns: 1fr; gap: 34px; }
  .bin { --s: clamp(210px, 58vw, 320px); }
  .bin-view { height: calc(var(--s) + 200px); }
  .bin-caption { grid-template-columns: 1fr auto; }
  .bin-info { grid-column: 1 / -1; grid-row: 1; }
  .deck-plinth { width: min(100%, 520px); transform: rotateX(26deg); }
  .deck-tracks { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sleeve, .arm-rot { transition: none; }
  .deck-vinyl.is-dropping { animation: none; }
  .deck-disc, .deck-strobe { animation: none; }
}

/* ---------- Home: la colección es el hero ---------- */
.home-room { padding-top: 22px; padding-bottom: 10px; }
.home-room { padding-top: 14px; }
.home-room .room-head { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: end; }
.home-room .room-head h1 { font-size: clamp(2.4rem, 4.4vw, 3.6rem); letter-spacing: 0.01em; }
.home-room .room-head p { margin: 0 0 6px; max-width: none; font-size: 0.86rem; }
.home-room .year-tabs { grid-column: 1 / -1; margin-top: 12px; }
@media (max-width: 900px) { .home-room .room-head { grid-template-columns: 1fr; } .home-room .room-head p { margin-top: 8px; } }
.room-head h1 { letter-spacing: 0.01em; }
.room-stage { position: relative; }
/* Analizador de espectro: se dibuja con el audio real del preview. */
.room-scope { grid-column: 1 / -1; display: block; width: 100%; height: 72px; margin-top: 6px; opacity: 0.9; }
.bin-play, .deck-buy { border-radius: 4px; font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; }
.bin-step { border-radius: 4px; }
