/* Page shell: the canvas, the layer stack, and the boot screen.
   Everything else lives in ui.css, hud.css and touch.css. */

:root {
  color-scheme: dark;

  --ink:        #e9edf2;
  --ink-dim:    #9aa4b0;
  --ink-faint:  #6b7480;
  --bg:         #0b0d10;
  --panel:      rgba(16, 19, 24, 0.78);
  --panel-edge: rgba(255, 255, 255, 0.10);
  --accent:     #ffb020;
  --accent-ink: #1a1200;
  --good:       #4ec9a0;
  --bad:        #e2564d;

  --gap:   clamp(0.75rem, 2vw, 1.5rem);
  --round: 0.7rem;

  /* Notch and home-indicator insets, used by the HUD and touch layers. */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  --ui-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num-font: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui-font);
  /* A driving game is held with both thumbs. Nothing here should ever scroll,
     bounce, zoom, or pop a text-selection handle mid-corner. */
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

/* The overlay stack. Each layer is transparent to the pointer by default; the
   individual controls inside opt back in. Otherwise an invisible full-screen
   div eats every click meant for the game. */
.layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
#touch { z-index: 20; }
#menus { z-index: 30; }

/* ---- Boot screen -------------------------------------------------------- */

/* The loading screen lives in styles/boot.css. */
