/* Muziekmaker: the dot board and the shelf with songs (needs /shared/base.css). */
body { background: #a8dcff; }
#maker, #shelf { background: linear-gradient(#a8dcff, #fff0c8); }

/* --- top bar ------------------------------------------------------------------------- */
#maker { display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 18px); }
.bar { display: flex; align-items: center; gap: clamp(8px, 1.4vw, 18px); --b: min(10vh, 6vw, 86px); }
.bar .gap { flex: 1; }
.bar .play { --b: min(13vh, 8vw, 112px); }
.bar .play.ready { animation: pulse 1.2s ease-in-out infinite; }
.bar .play.playing { background: #e65046; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* --- the board ------------------------------------------------------------------------- */
.board {
  --dot: 60px;
  position: relative; flex: 1; min-height: 0; touch-action: none;
  display: grid; grid-template-columns: minmax(64px, 11vw) repeat(8, 1fr); grid-template-rows: repeat(7, 1fr);
  padding: min(8vh, 62px) clamp(6px, 1vw, 14px) clamp(6px, 1vw, 14px);
  background: rgba(255, 255, 255, .55); border: 6px solid #fff; border-radius: 36px;
  box-shadow: 0 6px 0 rgba(60, 40, 90, .15);
}
.cell { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.cell.alt { background: rgba(110, 130, 200, .1); }
.dot {
  position: relative; width: var(--dot); height: var(--dot); border-radius: 50%;
  background: var(--soft); transform: scale(.55); transition: transform .12s, background .12s; pointer-events: none;
}
.cell.on .dot {
  background: var(--c); transform: scale(1);
  border: max(3px, calc(var(--dot) * .07)) solid #fff; box-shadow: 0 4px 0 rgba(60, 40, 90, .25);
}
.cell.on .dot::after {
  content: ''; position: absolute; left: 16%; top: 12%; width: 32%; height: 22%;
  border-radius: 50%; background: rgba(255, 255, 255, .55); transform: rotate(-25deg);
}
/* empty song: the dots wave to invite a tap */
.board.invite .dot { animation: invite 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); }
@keyframes invite { 0%, 70%, 100% { transform: scale(.55); } 80% { transform: scale(.78); } }

/* row heads: xylophone bars, and the figure / drum (tap = next one) */
.head { width: 100%; height: 100%; min-width: 0; min-height: 0; }
.head .key {
  position: relative; height: min(62%, calc(var(--dot) * .8)); border-radius: 14px; background: var(--c);
  border: 4px solid #fff; box-shadow: 0 4px 0 rgba(60, 40, 90, .25);
}
.head .key i { position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: rgba(255, 255, 255, .8); }
.head .key i:first-child { left: 9px; }
.head .key i:last-child { right: 9px; }
.head .face {
  width: min(96%, calc(var(--dot) * 1.15)); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: max(4px, calc(var(--dot) * .07)) solid var(--c); box-shadow: 0 4px 0 rgba(60, 40, 90, .25);
}
.head .face img, .head .face svg { width: 100%; height: 100%; }
.head .face svg { width: 84%; height: 84%; }

/* the step that is playing, with the figure running on top */
.playhead {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 0; border-radius: 28px;
  background: rgba(255, 220, 90, .45); pointer-events: none; opacity: 0;
  transition: transform .09s ease-out, opacity .2s;
}
.board.playing .playhead { opacity: 1; }
.runner { position: absolute; left: 50%; top: 2px; width: min(7vh, 56px); height: min(7vh, 56px); margin-left: max(-3.5vh, -28px); }
.runner img, .runner svg { width: 100%; height: 100%; }

@media (orientation: portrait) {
  .bar { --b: min(9vw, 76px); gap: 8px; }
  .bar .play { --b: min(12vw, 100px); }
  .board { grid-template-columns: minmax(56px, 13vw) repeat(8, 1fr); }
}

/* --- shelf --------------------------------------------------------------------------- */
#shelf { display: flex; flex-direction: column; gap: 14px; }
#shelf header { display: flex; align-items: center; justify-content: space-between; --b: min(10vh, 84px); }
#shelf .title svg { width: min(13vh, 110px); height: min(13vh, 110px); }
#shelf .songs {
  flex: 1; overflow-y: auto; touch-action: pan-y; display: grid; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 42vw), 1fr)); gap: clamp(12px, 2vw, 26px); padding: 6px;
}
.song {
  aspect-ratio: 8 / 7; padding: 12px; background: #fff; border-radius: 28px;
  border: 7px solid #fff; box-shadow: 0 6px 0 rgba(60, 40, 90, .22);
}
.song canvas { width: 100%; height: 100%; pointer-events: none; }
#shelf .empty { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 10vh; opacity: .5; }
#shelf .empty svg { width: 30vmin; height: 30vmin; }
