:root {
  color-scheme: dark;
  --font-pixel: 'Press Start 2P', 'PressStart2P', ui-monospace, 'Cascadia Mono', 'Courier New', monospace;
  --ink: #141013;
  --font-xs: clamp(8px, 1.8vw, 10px);
  --font-sm: clamp(9px, 2vw, 11px);
  --font-md: clamp(11px, 2.4vw, 13px);
  --font-lg: clamp(14px, 3vw, 18px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-pixel);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow: 1px 1px 0 #000;
}

#stage,
.game-canvas,
#touch-layer,
.touch-zone,
#ui-hits,
.ui-hit {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
}

.game-canvas {
  position: absolute;
  display: block;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: none;
}

#boot-splash {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--ink);
  color: #94b0c2;
  font-size: var(--font-sm);
  letter-spacing: 1px;
  text-align: center;
  padding: 0 12px;
  pointer-events: none;
}

#boot-splash .splash-title {
  color: #ffe066;
  font-size: var(--font-lg);
  max-width: 100%;
  overflow-wrap: break-word;
}

#boot-splash.gone {
  display: none;
}

#touch-layer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.touch-zone {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  background: transparent;
}

#ui-hits {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.ui-hit {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ui-hit:focus-visible {
  outline: 2px solid #ffe066;
  outline-offset: -2px;
}

@media (hover: hover) and (pointer: fine) {
  .ui-hit {
    cursor: pointer;
  }

  .touch-zone {
    cursor: grab;
  }
}

#safe-probe {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.ui-text-field {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: 700 16px var(--font-pixel);
  text-shadow: none;
  text-transform: uppercase;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}

.ui-text-field::selection {
  background: transparent;
}

.aura-touch {
  display: none !important;
}
