:root {
  color-scheme: dark;
  background: #0f0f1e;
  font-family: system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, #292748 0, #151427 42%, #0f0f1e 75%);
}

.game-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

canvas {
  display: block;
  outline: none;
  image-rendering: pixelated;
}

.loading,
.error {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  background: #0f0f1e;
}

.error {
  pointer-events: auto;
}

.loading[hidden],
.error[hidden] {
  display: none;
}

.loading p,
.error p {
  margin: 0;
  color: #c8c7dc;
}

.error h1 {
  margin: 0;
  font-size: 1.35rem;
}

.error button {
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.4rem;
  color: #0f0f1e;
  background: #f2cd5c;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #393652;
  border-top-color: #f2cd5c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: #393652;
  }
}
