#tennis-ball[hidden] {
  display: none;
}
#tennis-ball {
  position: fixed;
  z-index: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}
/* Only a ball in play comes forward. At the dock the recorder occludes it. */
#player-dock[data-state='idle'] ~ #tennis-ball:is([data-state='charging'], [data-state='flying'], [data-state='returning']) {
  z-index: 4;
}
#player-dock:not([data-state='idle']) ~ #tennis-ball {
  pointer-events: none;
}
#tennis-ball[data-state='charging'] {
  cursor: grabbing;
}
#tennis-ball:is([data-state='flying'], [data-state='returning']) {
  pointer-events: none;
}
.tennis-sphere {
  display: block;
  pointer-events: none;
  grid-area: 1 / 1;
  width: var(--ball-diameter);
  height: var(--ball-diameter);
}
.tennis-sphere canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.tennis-sphere canvas:not([data-ready]) {
  background: url('/assets/tennis-ball.webp') center/contain no-repeat;
}
