/* Battlezone — vector-CRT presentation. The framebuffer is 512x384; the
   canvas scales to fit while keeping the cabinet's aspect ratio. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
}
#boot {
  color: #4a6;
  font: 14px/1.4 system-ui, sans-serif;
}
#stage {
  width: min(100vw, calc(100vh * 4 / 3));
  aspect-ratio: 4 / 3;
}
#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: #000;
}

/* Touch overlay — coarse pointers only. Sits over the canvas' lower
   corners like a control panel; the 4:3 stage keeps it inside the view. */
#touch { display: none; }
@media (pointer: coarse) {
  #touch {
    display: flex;
    position: absolute;
    left: 0; right: 0; bottom: 4%;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 4%;
    pointer-events: none; /* only the buttons take touches */
  }
  #stage { position: relative; }
}
#pad {
  display: grid;
  grid-template-areas: ". fwd ." "left fire right" ". rev .";
  gap: 10px;
  pointer-events: auto;
}
#t-fwd   { grid-area: fwd; }
#t-left  { grid-area: left; }
#t-fire  { grid-area: fire; }
#t-right { grid-area: right; }
#t-rev   { grid-area: rev; }
#coinrow {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}
.tbtn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid #4a6;
  background: rgba(0, 20, 8, 0.55);
  color: #7d9;
  font: bold 13px system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tbtn.small { width: auto; height: 36px; border-radius: 18px; padding: 0 16px; }
.tbtn.held { background: rgba(40, 90, 40, 0.75); }
#t-fire { width: 72px; height: 72px; }