html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #231F20;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #f4f4f5;
  -webkit-font-smoothing: antialiased;
}

body.mobile {
  /* Stops iOS Safari from bouncing the page while the player drags on the canvas. */
  touch-action: none;
  overscroll-behavior: none;
}

#container {
  position: fixed;
  inset: 0;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  /* Pixel art stays crisp; harmless for smooth art. */
  image-rendering: pixelated;
}

#loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #231F20;
  transition: opacity 0.4s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

#loader-title {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}

#loader-track {
  width: min(320px, 60vw);
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

#loader-fill {
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: #f4f4f5;
  transition: width 0.2s ease;
}

#loader-hint {
  font-size: 0.85rem;
  opacity: 0.55;
}

#banner {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(600px, 90vw);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  display: none;
}

#banner.visible {
  display: block;
}

#banner.warning {
  background: #713f12;
  color: #fef3c7;
}

#banner.error {
  background: #7f1d1d;
  color: #fee2e2;
}
