* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  background: #07070c;
  overflow: hidden;
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  color: #e8e2d4;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #1b1524 0%, #07070c 70%);
}

canvas {
  position: absolute;
  display: block;
}

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a0a12;
}

#ui {
  pointer-events: none;
}

/* ---- boot / error overlays ---- */
#boot, #fatal {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: #07070cf2;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

/* the `hidden` attribute must beat the display rule above */
#boot[hidden], #fatal[hidden] { display: none; }

#boot p { opacity: .7; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }

.spin {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid #2a2438;
  border-top-color: #e8871e;
  border-right-color: #5fb4e8;
  border-bottom-color: #7db052;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#fatal { text-align: left; place-content: center start; justify-items: start; max-width: 720px; margin: auto; }
#fatal h2 { color: #e8704a; font-size: 20px; }
#fatal p { opacity: .85; line-height: 1.5; }
#fatal pre {
  background: #12121c;
  border: 1px solid #262636;
  border-radius: 6px;
  padding: 12px 14px;
  font: 12px/1.6 ui-monospace, monospace;
  color: #9fd8c8;
  white-space: pre-wrap;
  max-width: 100%;
  overflow: auto;
  max-height: 40vh;
}
