/* The letter on each side names the wing that drops when the handle moves there. */
#stage, .sellers-workshop { --stick-size: clamp(112px, 31vmin, 146px); }
html.touch-flight-controls #touchPad:not([hidden]) {display:flex}
html:not(.touch-flight-controls) #touchPad {display:none}
:is(#pilotStick, #workshopStick) {
  --handle: clamp(38px, 11vmin, 48px);
  display: block;
  position: relative;
  flex: none;
  margin-inline-start: auto;
  width: var(--stick-size);
  height: var(--stick-size);
  border: 2px solid #49392a;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #231c18 0 18%, transparent 19%),
    repeating-radial-gradient(circle at center, #262c29 0 3px, #46504a 4px, #363c36 6px);
  box-shadow: inset 0 0 0 2px #d3b17f, inset 0 0 0 5px #785b3f,
    inset 0 0 0 7px #252e29, 0 2px 6px #191a1880;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}
:is(#pilotStick, #workshopStick)[data-held] { cursor: grabbing; }
:is(#pilotStick, #workshopStick):focus-visible { outline: 3px solid #fff1bf; outline-offset: 2px; }
:is(#pilotStick, #workshopStick) > span { position: absolute; pointer-events: none; }
.stick-legend {
  color: #f5dfad;
  font: 700 clamp(9px, 2.5vmin, 11px)/1 Barlow, sans-serif;
  text-shadow: 0 1px 2px #191917;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stick-forward, .stick-back { left: 50%; transform: translateX(-50%); }
.stick-forward { top: 9%; }
.stick-back { bottom: 9%; }
.stick-port, .stick-starboard { top: 50%; transform: translateY(-50%); }
.stick-port { left: 9%; }
.stick-starboard { right: 9%; }
.pilot-stick-shaft {
  left: 50%;
  top: calc(50% - 5px);
  height: 10px;
  width: var(--stick-length, 0px);
  border-radius: 4px;
  background: linear-gradient(#72522e, #ebd4a0 40%, #a28350 65%, #57402c);
  transform-origin: 0 50%;
  transform: rotate(var(--stick-angle, 0rad));
}
.pilot-stick-grip {
  left: 50%;
  top: 50%;
  width: var(--handle);
  height: var(--handle);
  border-radius: 50%;
  border: 2px solid #452c1e;
  background:
    radial-gradient(ellipse at 33% 24%, #ffe5af75, transparent 46%),
    repeating-linear-gradient(112deg, transparent 0 3px, #552b161b 4px 5px),
    radial-gradient(circle at 38% 30%, #d7a36c 0%, #96623a 53%, #563a28 86%);
  box-shadow: inset 0 0 0 1px #d5ae78, inset -2px -3px 4px #37261978, 1px 4px 5px #141512a3;
  transform: translate(-50%, -50%) translate(var(--stick-x, 0px), var(--stick-y, 0px));
}
:is(#pilotStick, #workshopStick)[data-held] .pilot-stick-grip { border-color: #704a28; }
@media (pointer: coarse) and (orientation: portrait) {
  #stage :is(#launchCue, #routeNotice) {
    top: auto;
    bottom: calc(var(--stick-size) + 20px);
  }
  .phone-flight-screen #stage :is(#launchCue, #routeNotice) {
    bottom: calc(var(--stick-size) + var(--flight-bottom) + var(--flight-dash) + 16px);
  }
}
@media (pointer: coarse) and (orientation: landscape) {
  #stage :is(#launchCue, #routeNotice) {
    max-width: calc(100% - var(--stick-size) * 2 - max(32px, env(safe-area-inset-right) * 2));
  }
}
