.touch-joystick {
  position: relative;
  width: 126px;
  height: 126px;
  padding: 0;
  border: 3px solid #a58eb7;
  border-radius: 50%;
  color: #d9cce3;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 28%, #ffffff12 29% 31%, transparent 32%),
    radial-gradient(circle, #33253f 0 52%, #17111f 54% 100%);
  box-shadow: inset 0 0 24px #000b, 0 5px 14px #000b;
  opacity: .78;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.touch-joystick::before,
.touch-joystick::after {
  content: "";
  position: absolute;
  inset: 12px 50%;
  width: 1px;
  background: #d8c9e333;
  pointer-events: none;
}

.touch-joystick::after {
  inset: 50% 12px;
  width: auto;
  height: 1px;
}

.joystick-arrows {
  position: absolute;
  inset: 7px;
  display: grid;
  place-items: center;
  border: 1px solid #ffe07933;
  border-radius: 50%;
  color: #ffe07988;
  font-size: 16px;
  pointer-events: none;
}

.joystick-knob {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border: 3px solid #ffe59a;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff0ad, #d77e35 40%, #6b3154 100%);
  box-shadow: 0 4px 10px #000c, inset -4px -5px 8px #30152f88;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: transform;
}

.touch-joystick.active {
  opacity: .94;
  border-color: #ffe38c;
}

@media (pointer: coarse) and (orientation: landscape) {
  .touch-joystick {
    position: absolute;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 390px) {
  .touch-joystick { width: 108px; height: 108px; }
  .joystick-knob { width: 48px; height: 48px; }
}
