:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1b1d22;
  --text: #e6e6e6;
  --muted: #9aa0a6;
  --accent: #3b6ea8;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, sans-serif;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 8px 16px;
  background: var(--panel);
}

nav { display: flex; flex-wrap: wrap; gap: 6px; }

button, .button {
  font: inherit;
  color: var(--text);
  background: #2a2d34;
  border: 1px solid #3a3e47;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
}

button:hover, .button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }

main { position: relative; min-height: 0; }

/* The game stays clear of notches and rounded corners (viewport-fit=cover). */
canvas {
  position: absolute;
  top: 0;
  left: env(safe-area-inset-left, 0);
  right: env(safe-area-inset-right, 0);
  bottom: 0;
  width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: 100%;
  display: block;
  touch-action: none;
}

footer { padding: 6px 16px 10px; background: var(--panel); }
#message { margin: 0 0 4px; color: var(--muted); }
#status { margin: 0; font: 12px/1.35 ui-monospace, monospace; white-space: pre-wrap; }
