/* Phones: the race's touch HUD (src/touch-controls.js) and the Controls screen's touch and tilt part
   (src/controls-screen.js). */

/* The touch HUD: a layer over the race taking every finger (no scrolling, zooming or long-press
   menus), shown only with the race's game HUD (from the countdown to the finish) and only while
   the touch screen drives; its pictures are placed by touch-controls.js in screen pixels. */
.touch-hud {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.race-hud__game[hidden] ~ .touch-hud { display: none; }
.touch-hud__image {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.touch-hud__image.is-flipped { transform: scaleX(-1); }

/* The Controls screen on a touch screen: the tablet (UI/Tutorial/Tablet, 400 x 250 from
   (340, 117)) with the chosen method's hints on it, as the game's Elements_Tilt / _TouchA / _TouchB
   place them (pictures centred on their positions; "Brake" ending or starting at its position,
   the steering hint centred in its width, all in font ButtonBelow, centred vertically). */
.controls-tablet__image {
  width: calc(400 * var(--g));
  height: calc(250 * var(--g));
}
.controls-tablet__hints { display: none; }
.controls-tablet[data-method='tilt'] [data-for='tilt'],
.controls-tablet[data-method='touchA'] [data-for='touchA'],
.controls-tablet[data-method='touchB'] [data-for='touchB'] { display: block; }
.controls-tablet__art {
  width: calc(var(--w) * var(--g));
  height: calc(var(--h) * var(--g));
  translate: -50% -50%;
}
.controls-tablet__art.is-flipped { transform: scaleX(-1); }
.controls-tablet__art--faint { opacity: calc(60 / 255); }     /* UI/Arrow drawn with alpha 60 */
.controls-tablet__label {
  margin: 0;
  translate: 0 -50%;
  line-height: 1;
  white-space: nowrap;
}
.controls-tablet__label--right { translate: -100% -50%; }
.controls-tablet__text {
  margin: 0;
  width: calc(var(--w) * var(--g));
  translate: -50% -50%;
  text-align: center;
  line-height: 1.1;
}
/* Steering Sensitivity: its 445-wide frame, the bars 20 in; the name 5 lower than the Audio
   sliders' (its Text Rect starts 5 down) */
.controls-sensitivity { --frame-w: 445; --bar-x: 20; }
.controls-sensitivity .slider__label { bottom: calc(100% - 2 * var(--g)); }
