/* DJGeo touch and small-screen refinements. */
.crossfader > #crossfader {
  cursor: grab;
  touch-action: none;
}

.crossfader > #crossfader.is-dragging { cursor: grabbing; }

@media (pointer: coarse), (max-width:720px), (max-height:560px) and (orientation:landscape) {
  .crossfader > #crossfader {
    min-height:58px;
    margin:4px 0 0;
  }

  .crossfader > #crossfader::-webkit-slider-runnable-track { height:12px; }
  .crossfader > #crossfader::-webkit-slider-thumb {
    width:42px;
    height:42px;
    margin-top:-16px;
    border-width:4px;
    box-shadow:0 0 0 3px #071015,0 0 18px #5ce1df99;
  }
  .crossfader > #crossfader::-moz-range-track { height:12px; }
  .crossfader > #crossfader::-moz-range-thumb {
    width:38px;
    height:38px;
    border-width:4px;
  }
}

/* Keep the DJGeo challenge available without covering deck or mixer controls on phones. */
@media (max-width:640px), (max-height:560px) and (orientation:landscape) {
  .practice-room .studio-game-launch {
    right:10px;
    bottom:calc(10px + env(safe-area-inset-bottom));
    width:48px;
    min-width:48px;
    height:48px;
    padding:0;
    grid-template-columns:1fr;
    place-items:center;
    gap:0;
    overflow:hidden;
    border-radius:50%;
  }

  .practice-room .studio-game-launch span { font-size:21px; line-height:1; }
  .practice-room .studio-game-launch b,
  .practice-room .studio-game-launch small { display:none; }
  .practice-room main { padding-bottom:calc(70px + env(safe-area-inset-bottom)); }
}

/* Phone portrait: give the platter and performance controls separate rows. */
@media (max-width:649px) and (orientation:portrait) {
  .djgeo .workspace .deck-body {
    grid-template-columns:minmax(0,1fr);
    align-items:start;
    gap:18px;
  }

  .djgeo .workspace .platter-wrap {
    width:min(100%,240px);
    margin-inline:auto;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .djgeo .workspace .platter-wrap button {
    min-width:0;
    padding-inline:4px;
  }

  .djgeo .workspace .performance {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }

  .djgeo .workspace .performance .bpm,
  .djgeo .workspace .performance .pitch { grid-column:1 / -1; }
  .djgeo .workspace .performance .sync,
  .djgeo .workspace .performance .deck-fx { width:100%; min-width:0; }
}

/* Phone landscape: the top FX / LOOPS tab replaces the redundant deck button. */
@media (min-width:650px) and (max-width:1100px) and (orientation:landscape) {
  .djgeo .workspace .deck-body {
    grid-template-columns:minmax(92px,115px) minmax(0,1fr);
    align-items:start;
    gap:14px;
  }

  .djgeo .workspace .platter-wrap {
    width:100%;
    min-width:0;
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .djgeo .workspace .platter-wrap button {
    min-width:0;
    padding-inline:2px;
    overflow:hidden;
    font-size:7px;
  }

  .djgeo .workspace .performance { min-width:0; gap:6px; }
  .djgeo .workspace .deck-fx { display:none; }
}
