:root {
  color-scheme: dark;
  background: #000;
  --outer-size: min(64vw, 34vh, 260px);
  --knob-size: calc(var(--outer-size) * 0.40);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

body {
  touch-action: none;
  font-family: system-ui, -apple-system, sans-serif;
}

#surface {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  touch-action: none;
}

#joystick {
  position: relative;
  width: var(--outer-size);
  height: var(--outer-size);
  opacity: 0.075;
  transition: opacity 180ms ease;
}

#joystick.revealed {
  opacity: 0.48;
}

#outer-ring,
#knob {
  position: absolute;
  border-radius: 50%;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.035);
}

#outer-ring {
  inset: 0;
}

#knob {
  left: 50%;
  top: 50%;
  width: var(--knob-size);
  height: var(--knob-size);
  transform: translate(-50%, -50%);
  will-change: transform;
}

#status {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.06;
  transform: translateX(-50%);
  transition: opacity 120ms ease, background-color 120ms ease;
}

#status.sending {
  opacity: 0.25;
}

#status.ok {
  opacity: 0.35;
}

#status.error {
  background: #ff3030;
  opacity: 0.55;
}

