*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  width: 100%;
  height: 100%;
  background: #050510;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
canvas#game {
  position: relative;
  z-index: 1;
  display: block;
  margin: auto;
  image-rendering: crisp-edges; 
  image-rendering: pixelated; /* For the DMD */
}

/* Hide touch zones on desktop to prevent accidental clicks if needed, 
   though we handle this in JS logic mostly. */
@media (hover: hover) {
  .touch-zone-overlay { display: none; }
}



canvas#gl { z-index: 0; display: block; }

/* Phase 4 settings panel */
#settings-btn {
  position: fixed; top: 6px; right: 8px; z-index: 5; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid #3a4a66; background: rgba(10, 14, 28, 0.85); color: #b9c8e4; font-size: 20px; line-height: 1; cursor: pointer;
}
#settings-btn:hover, #settings-btn:focus-visible { color: #fff; border-color: #7fb8ff; }
#settings {
  position: fixed; z-index: 6; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(340px, 92vw);
  padding: 18px 20px; border-radius: 12px; border: 1px solid #33415c; background: rgba(8, 11, 24, 0.96);
  color: #dfe8f7; font: 14px/1.3 system-ui, sans-serif; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); user-select: none;
}
#settings[hidden] { display: none; }
#settings h2 { font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: #ffb347; margin-bottom: 12px; }
#settings .row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; margin: 10px 0; }
#settings .row.check { grid-template-columns: 110px auto; }
#settings input[type=range] { width: 100%; accent-color: #5fe0ff; touch-action: pan-x; }
#settings output { text-align: right; color: #9fb3cc; font-variant-numeric: tabular-nums; }
#settings select { grid-column: 2 / 4; background: #111827; color: #dfe8f7; border: 1px solid #33415c; border-radius: 6px; padding: 4px; }
#settings .close { margin-top: 8px; width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #3a4a66; background: #16213a; color: #fff; cursor: pointer; }
