:root {
  color-scheme: dark;
  --ui-cyan: #77f7ff;
  --ui-green: #7dff9b;
  --ui-red: #ff5871;
  --ui-yellow: #ffe66d;
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #020511;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body {
  touch-action: none;
  overscroll-behavior: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
  background: #020511;
  cursor: crosshair;
}

#touchControls {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 10;
}

body.touch #touchControls {
  opacity: 1;
}

#touchControls button {
  pointer-events: auto;
  border: 1px solid rgba(125, 247, 255, 0.68);
  color: #dffcff;
  background: rgba(3, 15, 29, 0.55);
  box-shadow: 0 0 14px rgba(88, 234, 255, 0.18), inset 0 0 11px rgba(87, 244, 255, 0.10);
  border-radius: 999px;
  min-width: 72px;
  padding: 10px 12px;
  font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  backdrop-filter: blur(5px);
}

#touchControls button:active {
  transform: translateY(1px) scale(0.98);
  color: white;
  border-color: white;
  background: rgba(47, 143, 180, 0.55);
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #020511;
  color: white;
  z-index: 20;
}

@media (hover: hover) and (pointer: fine) {
  body:not(.force-touch) #touchControls {
    display: none;
  }
}
