/* Beweegdisco: home tile, the menu, and the play screen: Disco's room (its classes .dc-room, .dc-ball,
   .dc-spots, .dc-floor from games/disco/disco.css) with Blokje big in the middle doing the move, the
   move card (a picture, the big word, eight dots that count along) and the big pause and "Klaar"
   buttons. Blokje's moves are CSS on Disco's dancer groups, timed by the beat (--bw-beat-ms); with
   reduced motion each move is shown as its pose, still. */

#tile-beweeg .tile-art { display: flex; align-items: center; justify-content: center; }
.bw-tile-svg { width: 100%; height: 100%; max-width: 104px; display: block; }
.bw-menu-art { display: flex; justify-content: center; margin: 4px auto 6px; }
.bw-menu-art svg { width: min(100%, 260px); height: auto; display: block; }
.bw-ov { display: inline-flex; width: 210px; height: 70px; }
.bw-ov svg { width: 100%; height: 100%; }
.ov-art .bw-ov-dancer { display: block; width: 96px; height: 134px; }
.ov-art .bw-ov-dancer svg { width: 100%; height: 100%; }
.bw-parents { margin: 14px 4px 0; font-size: var(--bz-text-s); font-weight: var(--bz-weight-text); color: var(--bz-ink-soft); line-height: 1.35; }
.bw-song .option-art svg, .bw-length .option-art svg, .bw-mode .option-art svg { width: 100%; height: 100%; }

#screen-beweeg { --bw-beat-ms: 540ms; }
#bw-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 12px; }
#bw-room { flex: 1; min-height: 180px; }
#bw-room .dc-floor span { opacity: 0.7; }
#bw-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#bw-confetti i { position: absolute; width: 10px; height: 6px; border-radius: 2px; animation: dc-fall var(--dc-fall-ms, 1800ms) ease-in 1 forwards; }
.bw-dancer {
  position: absolute;
  left: 50%;
  bottom: 6%;
  height: 72%;
  aspect-ratio: 100 / 140;
  min-width: 0;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
}
.bw-dancer .dn-move { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }

/* the move card */
.bw-card {
  flex: none;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--bz-radius-l);
  background: var(--bz-surface);
  box-shadow: var(--bz-shadow-s);
}
.bw-pic { grid-row: 1 / span 3; width: 96px; height: 96px; border-radius: 18px; background: #eef7ff; }
.bw-pic svg { width: 100%; height: 100%; display: block; }
.bw-word { margin: 0; font-size: var(--bz-text-2xl); font-weight: var(--bz-weight-brand); color: var(--bz-ink); line-height: 1.05; }
.bw-card.frozen .bw-word { color: #2a7bb0; }
.bw-how { margin: 2px 0 0; font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); color: var(--bz-ink-soft); line-height: 1.25; }
.bw-dots { display: flex; gap: 6px; margin-top: 6px; }
.bw-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--bz-brand-tint); border: 2px solid var(--bz-brand-edge); }
.bw-dots i.on { background: var(--bz-group-acc); border-color: var(--bz-group-ink); }
.bw-up { margin: 0; text-align: center; font-size: var(--bz-text-s); font-weight: var(--bz-weight-head); color: var(--bz-ink-soft); min-height: 1.2em; }
.bw-controls { flex: none; display: flex; justify-content: center; gap: 14px; }
.btn.bw-play { width: 76px; height: 76px; border-radius: 24px; background: var(--bz-brand); color: #fff; box-shadow: var(--bz-edge-s) var(--bz-brand-dark); }
.btn.bw-play svg { width: 34px; height: 34px; fill: currentColor; }
/* the skip button is small and quiet: the moves go on by themselves (Mark: "moet vanzelf gaan") */
.btn.bw-next { align-self: center; width: 52px; height: 52px; min-width: 0; padding: 0; border-radius: 18px; background: var(--bz-surface); color: var(--bz-ink-quiet); box-shadow: var(--bz-edge-s) var(--bz-brand-edge); }
.btn.bw-next svg { width: 24px; height: 24px; fill: currentColor; }
/* the bar before the next move: the card shows it coming, the dots count down, Blokje rests */
.bw-card.upnext { background: #fff8e1; }
.bw-card.upnext .bw-word { color: var(--bz-group-ink); }
.bw-dots i.soon.on { background: #ffd166; border-color: #c98a00; }
.bw-dots i.soon:nth-child(n+5) { visibility: hidden; } /* a bar: four dots counting down */
#bw-room.playing .pose-rest .dn-move { animation: bw-bob var(--bw-beat-ms) ease-in-out infinite; }

/* Blokje's moves (each loops on the beat while the music plays) */
#bw-room.playing .pose-march .dn-leg-l { animation: bw-leg calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-march .dn-leg-r { animation: bw-leg calc(var(--bw-beat-ms) * 2) ease-in-out infinite calc(var(--bw-beat-ms) * -1); }
#bw-room.playing .pose-march .dn-move { animation: bw-bob var(--bw-beat-ms) ease-in-out infinite; }
#bw-room.playing .pose-arms .dn-arm-l { animation: dc-arm-l calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-arms .dn-arm-r { animation: dc-arm-r calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-tall .dn-move { animation: bw-tall calc(var(--bw-beat-ms) * 4) ease-in-out infinite; }
.pose-tall .dn-arm-l, .pose-breathe .dn-arm-l { transform: rotate(150deg); }
.pose-tall .dn-arm-r, .pose-breathe .dn-arm-r { transform: rotate(-150deg); }
#bw-room.playing .pose-toes .dn-move { animation: bw-toes calc(var(--bw-beat-ms) * 4) ease-in-out infinite; }
#bw-room.playing .pose-breathe .dn-move { animation: bw-breathe calc(var(--bw-beat-ms) * 8) ease-in-out infinite; }
#bw-room.playing .pose-wiggle .dn-body { animation: bw-sway calc(var(--bw-beat-ms) * 4) ease-in-out infinite; }
.pose-wiggle .dn-arm-l { transform: rotate(140deg); }
.pose-wiggle .dn-arm-r { transform: rotate(-140deg); }
#bw-room.playing .pose-clap .dn-arm-l { animation: bw-clap-l var(--bw-beat-ms) ease-in-out infinite; }
#bw-room.playing .pose-clap .dn-arm-r { animation: bw-clap-r var(--bw-beat-ms) ease-in-out infinite; }
#bw-room.playing .pose-spin .dn-move { animation: dc-spin calc(var(--bw-beat-ms) * 4) ease-in-out infinite; }
#bw-room.playing .pose-shake .dn-move { animation: bw-shake calc(var(--bw-beat-ms) / 2) linear infinite; }
#bw-room.playing .pose-freeze:not(.frozen) .dn-body { animation: dc-wiggle calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
.pose-freeze.frozen .dn-arm-l { transform: rotate(60deg); }
.pose-freeze.frozen .dn-arm-r { transform: rotate(-100deg); }
#bw-room.playing .pose-jump .dn-move { animation: dc-jump var(--bw-beat-ms) ease-in-out infinite; }
#bw-room.playing .pose-star .dn-move { animation: dc-jump calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-star .dn-arm-l { animation: bw-star-arm-l calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-star .dn-arm-r { animation: bw-star-arm-r calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-star .dn-leg-l { animation: bw-star-leg-l calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-star .dn-leg-r { animation: bw-star-leg-r calc(var(--bw-beat-ms) * 2) ease-in-out infinite; }
#bw-room.playing .pose-hop .dn-move { animation: dc-jump var(--bw-beat-ms) ease-in-out infinite; }
.pose-hop .dn-leg-r { transform: translateY(-14px); }
.bw-dancer .dn-leg-l { transform-origin: 35px 94px; }
.bw-dancer .dn-leg-r { transform-origin: 65px 94px; }
@keyframes bw-leg { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-16px); } 50% { transform: translateY(0); } }
@keyframes bw-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3%); } }
@keyframes bw-tall { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02, 1.1); } }
@keyframes bw-toes { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.7); } }
@keyframes bw-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes bw-sway { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes bw-clap-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-70deg); } }
@keyframes bw-clap-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(70deg); } }
@keyframes bw-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2%); } 75% { transform: translateX(2%); } }
@keyframes bw-star-arm-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(120deg); } }
@keyframes bw-star-arm-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-120deg); } }
@keyframes bw-star-leg-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
@keyframes bw-star-leg-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }

@media (min-width: 600px) and (min-height: 700px) {
  .bw-pic { width: 130px; height: 130px; }
  .bw-word { font-size: var(--bz-text-3xl); }
  .bw-card { padding: 14px 20px; }
}
/* short sideways phones: the room left, the card and the buttons right */
@media (orientation: landscape) and (max-height: 520px) {
  #screen-beweeg { flex-direction: row; }
  #bw-stage { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 300px; grid-template-rows: 1fr auto auto; padding: 8px 10px 8px 0; gap: 8px; }
  #bw-room { grid-row: 1 / span 3; min-height: 0; }
  .bw-pic { width: 76px; height: 76px; }
  .bw-word { font-size: var(--bz-text-xl); }
  .btn.bw-play { height: 64px; width: 64px; }
}
/* small phones: a smaller card */
@media (max-height: 640px) and (orientation: portrait) {
  .bw-pic { width: 72px; height: 72px; }
  .bw-word { font-size: var(--bz-text-xl); }
  .bw-how { display: none; }
  .btn.bw-play { height: 64px; width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  #bw-room.playing .bw-dancer *, #bw-room.playing .bw-dancer { animation: none !important; }
  #bw-confetti i { animation: none; display: none; }
  .pose-arms .dn-arm-l, .pose-star .dn-arm-l { transform: rotate(130deg); }
  .pose-arms .dn-arm-r, .pose-star .dn-arm-r { transform: rotate(-130deg); }
  .pose-clap .dn-arm-l { transform: rotate(-60deg); }
  .pose-clap .dn-arm-r { transform: rotate(60deg); }
  .pose-march .dn-leg-l { transform: translateY(-14px); }
  .pose-toes .dn-move { transform: scaleY(0.75); }
  .pose-jump .dn-move { transform: translateY(-10%); }
}
