/* Page shell, colour tokens and typography.
   The palette mirrors src/render/materials.js so the interface and the world
   look like they belong to the same night. No web fonts: the stack below is
   installed everywhere and costs zero requests. */

:root {
  --ink: #05070d;
  --ink-2: #0b0f16;
  --panel: rgba(9, 12, 19, 0.82);
  --panel-solid: #0c1119;
  --edge: rgba(160, 190, 220, 0.16);
  --edge-strong: rgba(190, 215, 245, 0.34);
  --text: #e8eef6;
  --text-dim: #9aa7b8;
  --text-faint: #61707f;

  --sodium: #ffa23a;
  --neon-cyan: #2ff5ff;
  --neon-magenta: #ff2f8e;
  --neon-lime: #8fff45;
  --police-red: #ff2b3c;
  --police-blue: #2b6bff;
  --nitro: #66d8ff;
  --danger: #ff5a3c;

  --hud-scale: 1;
  --safe: max(14px, env(safe-area-inset-left, 0px));

  --font: 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', system-ui, sans-serif;
  --font-num: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* High-contrast HUD: heavier plates, brighter text, no thin hairlines. */
.contrast {
  --panel: rgba(3, 5, 9, 0.94);
  --edge: rgba(255, 255, 255, 0.4);
  --edge-strong: rgba(255, 255, 255, 0.72);
  --text: #ffffff;
  --text-dim: #d5dee8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  display: block;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Every interface layer sits above the canvas; only the parts that need clicks
   opt back into pointer events. */
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: calc(16px * var(--hud-scale));
  user-select: none;
  -webkit-user-select: none;
}

#ui > * {
  pointer-events: none;
}

/* Two exceptions, both of which own every tap that lands on them: the modal
   full-screen surfaces, and the touch control overlay. The id has to be in the
   selector to outrank the rule above, which is otherwise more specific than a
   class. Without it a phone has no way in at all: the loading screen's
   tap-to-start does nothing and the steering pad and pedals are dead. */
#ui > .screen,
#ui > .touch-layer {
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
