:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #1a1a1a;
  color: #cfcfcf;
  font-family: "Courier New", monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* Letterbox bars are just the dark page background around the centered canvas. */
  overflow: hidden;
}

#stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* The display canvas. Its width/height attributes (bitmap resolution) and CSS
   size are both set from JS (renderer.js) — do not size it here. These rules
   only kill anti-aliasing so the integer-scaled pixels stay crisp. */
canvas#game {
  /* content-box (not the global border-box) so the 2px border stays OUTSIDE the
     bitmap; with border-box the drawn area shrinks by 4px and integer scaling
     breaks into uneven pixels (see ai-docs/lessons-learned.md). */
  box-sizing: content-box;
  /* Order matters: browsers use the LAST value they understand, so the modern
     `pixelated` keyword is placed last for Chromium/WebKit. */
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: none; /* stop touch-scroll/zoom so drags steer the paddle */
  display: block;
  background: #2a2a3c;
  border: 2px solid #333;
  /* The paddle IS the cursor here, so hide the OS pointer while it's over the
     game (desktop only — touch devices have no persistent cursor to hide). */
  cursor: none;
}

canvas#game:focus-visible {
  outline: 3px solid #66ccff;
  outline-offset: 2px;
}

#controls {
  margin: 0;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0.85;
}

kbd {
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 0.9em;
}
