/* The touch controls (touch-controls.js, OS 1.9): only on a page whose <html> has the touch-mode class. */
.touch-mode {
  --touch-line: rgb(255 255 255 / 0.38);
  --touch-fill: rgb(255 255 255 / 0.2);
  --touch-line-pressed: rgb(255 255 255 / 0.7);
  --touch-fill-pressed: rgb(255 255 255 / 0.45);
  --touch-letter: rgb(255 255 255 / 0.5);
  --touch-letter-pressed: rgb(255 255 255 / 0.9);
}

/* The page never scrolls, zooms, selects text or shows a long-press menu. */
.touch-mode, .touch-mode body {
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-mode body { position: fixed; inset: 0; }
.touch-mode #fatal { z-index: 2; user-select: text; -webkit-user-select: text; }

.touch { position: fixed; inset: 0; z-index: 1; touch-action: none; }
/* Measures the safe-area insets (the notch, the home bar) for the layout. */
.touch-safe {
  position: absolute; inset: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.touch-control { position: absolute; box-sizing: border-box; pointer-events: none; }
/* Touch controls Off (OS 1.17): the D-pad and buttons hidden, the speaker and fullscreen button kept. */
.touch-off .touch-control { display: none; }
.touch-round, .touch-pill { border: 1.5px solid var(--touch-line); background: var(--touch-fill); }
.touch-round {
  display: grid; place-items: center; border-radius: 50%;
  color: var(--touch-letter); font-family: system-ui, sans-serif; font-weight: 600; line-height: 1;
}
.touch-pill { border-radius: 999px; }
.touch-round.pressed, .touch-pill.pressed { border-color: var(--touch-line-pressed); background: var(--touch-fill-pressed); }
.touch-round.pressed { color: var(--touch-letter-pressed); }

.touch-dpad svg { display: block; width: 100%; height: 100%; overflow: visible; }
.touch-arm, .touch-hub { fill: var(--touch-fill); }
.touch-arm.pressed { fill: var(--touch-fill-pressed); }
.touch-cross {
  fill: none; stroke: var(--touch-line); stroke-width: 1.5px; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.touch-fullscreen, .touch-sound {
  position: absolute; box-sizing: border-box; display: grid; place-items: center; margin: 0; padding: 0;
  border: 0; background: none; color: var(--touch-line-pressed); touch-action: none;
}
.touch-fullscreen[hidden] { display: none; }
.touch-fullscreen svg, .touch-sound svg {
  display: block; width: 70%; height: 70%;
  fill: none; stroke: currentColor; stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Either orientation plays (OS 1.15): the presenter places the canvas where the layout puts the picture. */
.touch-mode #screen { position: absolute; }
