:root {
  --bg: #07090f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --panel-w: calc(366px + var(--safe-right));
  --top-h: calc(56px + var(--safe-top));
  --dock-h: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; overscroll-behavior: none; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #e6e9f2; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
#stage { position: fixed; left: 0; top: var(--top-h); right: var(--panel-w); bottom: var(--dock-h); }
#game { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#game:focus-visible { outline: none; } /* the keyboard tile cursor already shows focus */
#game.panning { cursor: grabbing; }
#game.building { cursor: crosshair; }
@media (orientation: portrait) and (max-width: 1024px), (max-width: 699px) {
  :root { --panel-w: 0px; --dock-h: var(--measured-dock, 118px); }
}
@media (max-width: 699px) {
  :root { --top-h: calc(80px + var(--safe-top)); }
}
