/* The DJ Booth (djbooth.js, MUSIC-CORNER-PLAN.md). The benches, crystals and the
   play button are shared with the Beat Lab in beatlab.css (.loop-room); this is the
   deck and the room's own light. */

/* ---------------------------------------------------------------- the room */

.dj-beam { mix-blend-mode: screen; opacity: 0.55; transform-box: fill-box; transition: opacity 0.4s ease; }
.dj-beam-a { transform-origin: 6% 0; }
.dj-beam-b { transform-origin: 94% 0; }
/* while the deck plays, the two spotlights sway in time, a bar each way */
.spinning .dj-beam-a { animation: beam-sway-a 4.3636s ease-in-out infinite; opacity: 0.8; }
.spinning .dj-beam-b { animation: beam-sway-b 4.3636s ease-in-out infinite; opacity: 0.8; }
@keyframes beam-sway-a { 50% { transform: rotate(-9deg); } }
@keyframes beam-sway-b { 50% { transform: rotate(9deg); } }

/* The creature stands behind the deck as the DJ: the cabinet (.dj-table) is drawn
   over its legs. A little smaller than in the other rooms so its head and wings
   clear the title. */
#djbooth .creature-slot { width: 36%; z-index: 1; }
.dj-table { position: absolute; z-index: 2; overflow: visible; pointer-events: none; }

/* ----------------------------------------------------------------- the deck */

/* The turntable: cabinet, platter, record, tonearm. The platter turns once a bar
   (2.18 s at 110 BPM) while the deck plays, and the tonearm swings onto the record. */
.deck-cab-body { fill: #2a2150; stroke: var(--rock-edge); stroke-width: 4; }
.deck-cab-top { fill: #3b2f6b; }
.deck-cab-strip { fill: #221a44; }
.deck-rim { fill: #15182a; stroke: #e36fc0; stroke-width: 4; opacity: 0.9; }
.deck-record { fill: #1b1b22; }
.deck-groove { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 2; }
.deck-label { fill: #ff8a7a; stroke: #ffc46b; stroke-width: 4; }
.deck-label-mark { stroke: #1b1233; stroke-width: 5; stroke-linecap: round; }
.deck-spindle { fill: #f3ecff; }
.deck-pivot { fill: #3b2f6b; stroke: #ffc46b; stroke-width: 3; }
.deck-arm { stroke: #d9c8ff; stroke-width: 8; stroke-linecap: round; }
.deck-head { fill: #ffc46b; stroke: #1b1233; stroke-width: 2; }
.platter { transform-box: view-box; }
.spinning .platter { animation: platter-spin 2.1818s linear infinite; }
@keyframes platter-spin { to { transform: rotate(360deg); } }
.tonearm { transform-box: view-box; transform: rotate(-26deg); transition: transform 0.6s cubic-bezier(.3, 1.2, .5, 1); }
.spinning .tonearm { transform: rotate(0deg); }

/* The drop zone over the record. It breathes gold the moment a tile is picked up,
   lights up as one comes over it, and nudges for an eleventh or one already on. */
.deck {
  position: absolute; transform: translate(-50%, -50%); z-index: 3; border-radius: 50%;
  pointer-events: auto; touch-action: none;
  box-shadow: 0 0 0 0 rgba(255, 196, 107, 0);
  transition: box-shadow 0.2s ease;
}
.deck.over { box-shadow: 0 0 0 6px rgba(255, 196, 107, 0.85), 0 0 34px 10px rgba(255, 196, 107, 0.5); }
.deck.can-drop:not(.over) { animation: deck-wants 1.2s ease-in-out infinite; }
@keyframes deck-wants {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 196, 107, 0.45), 0 0 10px 2px rgba(255, 196, 107, 0.25); }
  50% { box-shadow: 0 0 0 5px rgba(255, 196, 107, 0.85), 0 0 30px 8px rgba(255, 196, 107, 0.5); }
}
.deck.nudge { animation: zap-nudge 0.4s ease; }
.deck-fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; }

/* The ten lights: dark until a loop is on; lit, they show its picture and pulse on
   the beat. A tap on a lit one sends the loop home. 50 px, a little bigger than the
   44 px minimum, since they are the deck's only way to take one sound off
   (BEAT-LAB-REVIEW.md, C12). */
.deck-lights {
  position: absolute; transform: translate(-50%, -50%); z-index: 4;
  display: flex; justify-content: space-between; align-items: center; pointer-events: auto;
}
.deck-light {
  width: var(--light, 50px); height: var(--light, 50px); padding: 0; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 35%, #2e2a4a, #15182a 70%);
  border: 3px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.deck-light.lit {
  background: radial-gradient(circle at 40% 35%, #fff6d6, #ffc46b 60%, #d98a2a);
  border-color: #fff;
  box-shadow: 0 0 18px 4px rgba(255, 196, 107, 0.75), inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}
.deck-light img { width: 72%; height: 72%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(7, 4, 15, 0.5)); }
.deck-light.lit:active { transform: translateY(-3px); }
.on-beat .deck-light.lit { animation: light-pulse 0.3s ease; }
@keyframes light-pulse { 40% { scale: 1.15; box-shadow: 0 0 26px 8px rgba(255, 196, 107, 0.9); } }
.deck-lights.over .deck-light:not(.lit),
.deck-lights.can-drop .deck-light:not(.lit) { border-color: rgba(255, 196, 107, 0.85); }

/* Stopped: the lights keep their pictures but go dim, and the platter stands still
   with the arm up until play. */
.deck-lights.paused .deck-light.lit {
  background: radial-gradient(circle at 40% 35%, #8a7d5e, #6b5530 60%, #4a3a20);
  border-color: rgba(255, 255, 255, 0.45); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.deck-lights.paused .deck-light.lit img { opacity: 0.6; }
/* the first load: the dark lights glow teal one by one as the loops arrive (T11) */
.loading .deck-light.load-on { border-color: #5fd3c8; box-shadow: 0 0 12px 2px rgba(95, 211, 200, 0.6), inset 0 2px 6px rgba(0, 0, 0, 0.6); }

/* ------------------------------------------------------------ the buttons */

/* Start and stop, on the cabinet's left: the Beat Lab's big button, a little
   smaller so it sits on the cabinet. */
#djbooth .dj-play { width: max(60px, 8.6%); z-index: 4; }
/* ↻ in the lights' gold, on the cabinet's right */
.result-reset-deck { color: #ffc46b; border-color: rgba(255, 196, 107, 0.6); z-index: 4; }

@media (prefers-reduced-motion: reduce) {
  .spinning .platter, .spinning .dj-beam-a, .spinning .dj-beam-b, .on-beat .deck-light.lit { animation: none; }
  .deck.can-drop:not(.over) { animation: none; box-shadow: 0 0 0 5px rgba(255, 196, 107, 0.85); }
}
