html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #02020d;
  color: #dff7ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

#game-shell {
  position: fixed;
  inset: 0;
  background: #02020d;
  touch-action: none;
  user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: auto;
}

#touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

#touch-controls.visible {
  opacity: 1;
}

.touch-button {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 16px;
  background: color-mix(in srgb, currentColor 22%, transparent);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.42;
  touch-action: none;
}

.touch-button:active {
  opacity: 0.7;
}

.thrust {
  left: max(24px, env(safe-area-inset-left));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 144px;
  height: 144px;
  color: #ff9d25;
  font-size: 18px;
}

.shield {
  left: max(51px, calc(env(safe-area-inset-left) + 27px));
  bottom: max(186px, calc(env(safe-area-inset-bottom) + 186px));
  width: 90px;
  height: 90px;
  color: #2ee9ff;
  font-size: 13px;
}

.side {
  bottom: max(42px, calc(env(safe-area-inset-bottom) + 42px));
  width: 90px;
  height: 90px;
  color: #45a8ff;
  font-size: 38px;
}

.left {
  right: max(126px, calc(env(safe-area-inset-right) + 126px));
}

.right {
  right: max(24px, env(safe-area-inset-right));
}

#name-input {
  position: fixed;
  left: 50%;
  top: 20vh;
  width: min(360px, 72vw);
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 2px solid #51f2ff;
  border-radius: 6px;
  background: rgba(0, 10, 18, 0.88);
  color: #f6feff;
  font-size: clamp(20px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  opacity: 0;
  pointer-events: none;
}

#name-input.visible {
  opacity: 1;
  pointer-events: auto;
}

@media (pointer: fine) {
  #touch-controls {
    display: none;
  }
}
