/* ==========================================================================
   HUK — Turntable Mixer (hidden two-deck scratch page)
   Sits on top of style.css + reuses record-player.css's illustrated
   turntable (.turntable__plinth/.turntable__record/.turntable__tonearm
   etc.) and mixer.css's deck-chrome/control/crossfader components — this
   file only adds what's specific to pairing two turntables and scratching
   them directly (see assets/js/turntable-mixer.js).
   ========================================================================== */

/* style.css's generic `section { padding: clamp(4.5rem,9vw,7.5rem) 0; }`
   would otherwise stack #mixShelfSection's bottom padding with
   #mixDecksSection's top padding into a very wide gap. */
#mixShelfSection { padding-bottom: clamp(1rem, 2vw, 1.5rem); }
#mixDecksSection { padding-top: clamp(1rem, 2vw, 1.5rem); }

/* ---- Shelf — reuses .record-shelf/.record-shelf__item/.record-shelf__disc
   from record-player.css; this page's item is a plain div with two
   "load" buttons instead of one click-to-select action. ---- */
.mix-shelf-note { color: var(--text-faint); font-size: 0.85rem; margin: -0.4rem 0 0.4rem; }

.record-shelf__item { cursor: default; }

.record-shelf__assign {
  display: flex;
  gap: 0.4rem;
}
.record-shelf__assign-btn {
  appearance: none;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.record-shelf__assign-btn:hover { border-color: var(--text-dim); color: var(--text); }
.record-shelf__assign-btn--a:hover { border-color: #ff2e92; color: #ff2e92; }
.record-shelf__assign-btn--b:hover { border-color: #00e5ff; color: #00e5ff; }

/* ---- Two decks + center crossfader column ---- */
.mixdeck-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
/* mixer.css reuses this same .mixer__master class for Mix Lab's own
   center column and pushes it to the end (order:3) once ITS OWN layout
   stacks at 900px — that rule isn't scoped to .mixer, so it was leaking
   in here too and swapping Deck B and the crossfader column out of
   order while this page's grid was still three columns wide. Reset it
   explicitly; our own stacking breakpoint below re-applies order:3. */
.mixdeck-grid .mixer__master { order: 0; }
/* Two turntables side by side is the whole point of this page (classic
   twin-deck DJ setup, mixer in the middle) — keep that arrangement down
   to real phone widths instead of stacking early, shrinking the plinth
   and tightening spacing in between so nothing gets cramped or overflows. */
@media (max-width: 900px) {
  .mixdeck .turntable__plinth { max-width: 190px; }
  .mixdeck-grid { gap: clamp(0.6rem, 2vw, 1rem); }
  .mixer__master { min-width: 120px; padding-top: 0; }
  .deck.mixdeck { padding: 1.1rem 0.8rem; }
  .deck__controls { gap: 0.25rem; }
}
@media (max-width: 620px) {
  .mixdeck-grid { grid-template-columns: 1fr; }
  .mixdeck-grid .mixer__master { order: 3; }
  .mixdeck .turntable__plinth { max-width: 280px; }
  .deck.mixdeck { padding: clamp(1.5rem, 3vw, 2rem); }
  .deck__controls { gap: 0.5rem; }
}

/* Not align-items:center — .deck is a column flexbox, and its children
   (the controls row especially) rely on the default stretch to fill the
   card's full width; centering is handled per-element below instead
   (the plinth already centers itself via record-player.css's own
   margin-inline:auto). */
.mixdeck { text-align: center; }

.mixdeck__now-playing { min-height: 2.6em; }
.mixdeck__now-playing h3 {
  font-size: 1.05rem;
  margin: 0.2rem 0 0;
  word-break: break-word;
}
.mixdeck__now-playing .tag { margin: 0; }

/* Smaller plinth than Record Player's single centerpiece turntable, so
   two fit comfortably side by side. */
.mixdeck .turntable__plinth { max-width: 280px; }

/* Rotation here is fully JS-driven (assets/js/turntable-mixer.js), not
   the CSS spin-record keyframe record-player.css defines — a drag needs
   to take over the exact same transform the animation would otherwise
   still be asserting mid-gesture. */
.mixdeck .turntable__record {
  animation: none;
  cursor: grab;
  touch-action: none;
}
.mixdeck .turntable__record.is-scratching { cursor: grabbing; }
.mixdeck .turntable__record:active { cursor: grabbing; }

/* Tonearm — record-player.css makes it pointer-events:none (purely
   decorative there); here it's the cueing control itself, so it needs
   the opposite: grabbable, and clear of the record's own touch-action
   override above so a drag on the arm doesn't also pan the page. */
.mixdeck .turntable__tonearm {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.mixdeck .turntable__tonearm.is-dragging { cursor: grabbing; }
/* Only while the arm is swinging programmatically — parking (by hand
   via the button, or automatically at track end/preview cap) and
   swinging onto the record on Play. Manual dragging stays instant;
   this just eases the hands-free moves, like a real turntable's cue
   lever. */
.mixdeck .turntable__tonearm.is-swinging { transition: transform 1s ease; }
.mixdeck .turntable__tonearm:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 4px;
}

.mixdeck .deck__transport { justify-content: center; }

.mixdeck__secondary-controls {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.mixdeck__error {
  color: var(--pink);
  font-size: 0.78rem;
}

.mixdeck__stream {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--card-border);
}
.mixdeck__stream.is-visible { display: flex; }
.mixdeck__stream span { color: var(--text-faint); font-size: 0.72rem; }

.mixdeck-note {
  max-width: 680px;
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  padding: 0 1rem;
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
}

/* ---- Auto-Mix settings — Mix Lab's Auto-Mix buttons (reused as-is via
   mixer.css's .auto-mix/.auto-mix-btn) plus this page's own additions:
   an adjustable transition length and an auto-sync-beat toggle. ---- */
.auto-mix-settings {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}
.auto-mix-settings__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.auto-mix-settings__row label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
#autoMixDurationLabel {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
#autoMixDuration { width: 100%; accent-color: var(--purple); }

.auto-mix-settings__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
}
.auto-mix-settings__toggle input { accent-color: var(--purple); }

/* ---- Advanced Auto-Mix options — collapsed by default so the main
   panel stays uncluttered; three experimental, testing-stage toggles. ---- */
.auto-mix-advanced {
  border-top: 1px solid var(--card-border);
  padding-top: 0.5rem;
  margin-top: 0.1rem;
}
.auto-mix-advanced summary {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
}
.auto-mix-advanced[open] summary { margin-bottom: 0.5rem; }
.auto-mix-advanced .auto-mix-settings__toggle:not(:last-child) { margin-bottom: 0.4rem; }
