/* Disco: home tile, the room (disco ball, spotlights, the floor, the dancers, confetti) and the
   controls (moves, lights, confetti, the songs). Shared look lives in css/style.css; the "sound is
   off" line is Drumstel's (.drums-muted). The lights change at most once a beat with a soft fade,
   never a strobe, and stand still with reduced motion. */

#tile-disco .tile-art { display: flex; align-items: center; justify-content: center; }
.dc-tile-svg { width: 100%; height: 100%; max-width: 104px; display: block; }

#screen-disco { --dc-beat-ms: 500ms; }
#dc-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 12px 12px;
}
.dc-room {
  --dc-spot-a: #ff8fb1;
  --dc-spot-b: #7bdff2;
  position: relative;
  flex: 1;
  min-height: 200px;
  border-radius: var(--bz-radius-l);
  overflow: hidden;
  background: linear-gradient(#2f2a66, #3f3784 70%, #4a4194);
  box-shadow: 0 5px 0 #231f52, var(--bz-shadow-s);
}
.dc-spots { position: absolute; inset: 0; pointer-events: none; }
.dc-spots-svg { width: 100%; height: 100%; display: block; }
.dc-spot { opacity: 0.18; transition: fill 0.35s ease, opacity 0.35s ease; }
.dc-spot-a { fill: var(--dc-spot-a); }
.dc-spot-b { fill: var(--dc-spot-b); }
.dc-room.playing .dc-spot { opacity: 0.3; }
.dc-ball { position: absolute; left: 50%; top: 0; width: min(28%, 120px); transform: translateX(-50%); pointer-events: none; }
.dc-ball-svg { width: 100%; display: block; }
.dc-sparkles { transform-box: view-box; transform-origin: 0 0; opacity: 0.35; transition: opacity 0.4s ease; }
.dc-room.playing .dc-sparkles { opacity: 1; animation: dc-turn 8s linear infinite; }
@keyframes dc-turn { to { transform: rotate(360deg); } }

.dc-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  pointer-events: none;
}
.dc-floor span { opacity: 0.55; transition: background-color 0.3s ease, opacity 0.3s ease; border-top: 2px solid rgba(255, 255, 255, 0.25); }
.dc-floor span + span { border-left: 2px solid rgba(255, 255, 255, 0.18); }
.dc-room.playing .dc-floor span { opacity: 0.8; }

#dc-dancers {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  height: 62%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2%;
  pointer-events: none;
}
.dn {
  pointer-events: auto;
  flex: 0 1 28%;
  max-width: 150px;
  min-width: 64px;
  height: 78%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.dn-blokje { height: 100%; flex-basis: 34%; max-width: 190px; }
.dn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 18px; }
.dn-move { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
.dn-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dn-svg g { transform-box: view-box; }
.dn-body { transform-origin: 50px 128px; }
.dn-arm-l { transform-origin: 20px 56px; }
.dn-arm-r { transform-origin: 80px 56px; }
.dn-bol .dn-arm-l { transform-origin: 20px 58px; }
.dn-bol .dn-arm-r { transform-origin: 80px 58px; }
.dn-punt .dn-arm-l { transform-origin: 20px 66px; }
.dn-punt .dn-arm-r { transform-origin: 80px 66px; }

/* the bob on every beat, and the moves (a move lasts its beats: --dc-move-ms) */
.dn.bob .dn-move { animation: dc-bob calc(var(--dc-beat-ms) * 0.9) ease-out 1; }
.dn.mv-jump .dn-move { animation: dc-jump var(--dc-move-ms, 500ms) ease-in-out 1; }
.dn.mv-spin .dn-move { animation: dc-spin var(--dc-move-ms, 1000ms) ease-in-out 1; }
.dn.mv-wiggle .dn-body { animation: dc-wiggle var(--dc-move-ms, 1000ms) ease-in-out 1; }
.dn.mv-arms .dn-arm-l { animation: dc-arm-l var(--dc-move-ms, 1000ms) ease-in-out 1; }
.dn.mv-arms .dn-arm-r { animation: dc-arm-r var(--dc-move-ms, 1000ms) ease-in-out 1; }
@keyframes dc-bob { 0% { transform: scaleY(1); } 30% { transform: scaleY(0.94); } 100% { transform: scaleY(1); } }
@keyframes dc-jump { 0%, 100% { transform: translateY(0); } 15% { transform: translateY(2%) scaleY(0.92); } 50% { transform: translateY(-22%); } 85% { transform: translateY(1%) scaleY(0.95); } }
@keyframes dc-spin { 0%, 100% { transform: scaleX(1); } 25% { transform: scaleX(0.05); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0.05); } }
@keyframes dc-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } }
@keyframes dc-arm-l { 0%, 100% { transform: rotate(0); } 25%, 75% { transform: rotate(130deg); } 50% { transform: rotate(110deg); } }
@keyframes dc-arm-r { 0%, 100% { transform: rotate(0); } 25%, 75% { transform: rotate(-130deg); } 50% { transform: rotate(-110deg); } }

#dc-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#dc-confetti i { position: absolute; width: 10px; height: 6px; border-radius: 2px; animation: dc-fall var(--dc-fall-ms, 1800ms) ease-in 1 forwards; }
#dc-confetti i.still { animation: dc-fade 2s ease 1 forwards; }
@keyframes dc-fall { to { top: 108%; transform: rotate(var(--dc-turn, 180deg)); opacity: 0.4; } }
@keyframes dc-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* the controls */
.dc-controls { flex: none; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.dc-moves, .dc-songs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn.dc-btn {
  width: 56px;
  height: 56px;
  min-width: 0;
  padding: 4px;
  border-radius: 18px;
  background: var(--bz-surface);
  box-shadow: var(--bz-edge-s) var(--bz-brand-edge);
  position: relative;
}
.btn.dc-btn svg { width: 100%; height: 100%; display: block; }
.btn.dc-btn:active { box-shadow: 0 1px 0 var(--bz-brand-edge); transform: translateY(3px); }
.btn.dc-move.last { background: var(--bz-group-tint); outline: 3px solid var(--bz-group-acc); outline-offset: -3px; }
.btn.dc-fx { background: #f4f1ff; }
.btn.dc-song[aria-pressed='true'] { background: var(--bz-group-tint); outline: 3px solid var(--bz-group-acc); outline-offset: -3px; }
.btn.dc-song.locked svg:not(.lock) { opacity: 0.55; }
.btn.dc-song .lock { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--bz-surface); fill: var(--bz-ink-quiet); box-shadow: var(--bz-shadow-s); }
.btn.dc-play { width: 64px; height: 64px; border-radius: 22px; background: var(--bz-brand); color: #fff; box-shadow: var(--bz-edge-s) var(--bz-brand-dark); }
.btn.dc-play svg { width: 30px; height: 30px; fill: currentColor; }
.btn.dc-play[aria-pressed='true'] { background: var(--bz-group-acc); box-shadow: var(--bz-edge-s) var(--bz-group-ink); }
.dc-songrow { display: flex; align-items: center; gap: 12px; }

@media (max-width: 420px) {
  .dc-moves { gap: 6px; max-width: 340px; }
  .btn.dc-btn { width: 50px; height: 50px; }
  .btn.dc-play { width: 60px; height: 60px; }
}
/* narrow phones: the six buttons in two rows of three, beside each other with the songs */
@media (max-width: 360px) {
  #dc-stage { padding: 4px 8px 10px; }
  .dc-moves { max-width: 168px; }
  .dc-controls { flex-direction: row; align-items: center; justify-content: center; gap: 8px; }
  .dc-songrow { flex-direction: column; gap: 6px; }
  .dc-songs { max-width: 110px; gap: 6px; }
  .btn.dc-btn { width: 48px; height: 48px; }
  .btn.dc-play { width: 56px; height: 56px; }
}
@media (min-width: 600px) {
  .btn.dc-btn { width: 68px; height: 68px; }
  .btn.dc-play { width: 76px; height: 76px; }
}
/* short sideways phones: the room on the left, the controls in a column on the right */
@media (orientation: landscape) and (max-height: 520px) {
  #screen-disco { flex-direction: row; }
  .dc-hud .bar-title h2 { font-size: 1.2rem; }
  .dc-hud .bar-sub { max-width: 90px; }
  #dc-stage { flex: 1; min-width: 0; flex-direction: row; padding: 10px 10px 10px 0; }
  .dc-room { min-height: 0; }
  .dc-controls { width: 232px; justify-content: center; gap: 8px; }
  .dc-moves, .dc-songs { gap: 6px; }
  .btn.dc-btn { width: 52px; height: 52px; }
  .btn.dc-play { width: 52px; height: 52px; }
  .dc-songrow { flex-wrap: wrap; justify-content: center; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .dn.bob .dn-move, .dn.mv-jump .dn-move, .dn.mv-spin .dn-move, .dn.mv-wiggle .dn-body, .dn.mv-arms .dn-arm-l, .dn.mv-arms .dn-arm-r { animation: none; }
  /* with reduced motion a move is still shown: the pose, held while the move lasts */
  .dn.mv-arms .dn-arm-l { transform: rotate(130deg); }
  .dn.mv-arms .dn-arm-r { transform: rotate(-130deg); }
  .dn.mv-jump .dn-move { transform: translateY(-10%); }
  .dn.mv-wiggle .dn-body { transform: rotate(-8deg); }
  .dn.mv-spin .dn-move { transform: scaleX(-1); }
  .dc-room.playing .dc-sparkles { animation: none; }
  .dc-spot, .dc-floor span { transition: none; }
}
