html,
body {
  margin: 0;
  height: 100%;
  background: #0b0f14;
  color: #e7e9ee;
  font-family: system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hud {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

canvas {
  /* Board plus side panel is 336x480; leave room for the HUD and buttons. */
  height: min(calc(100vh - 110px), calc(90vw * 480 / 336));
  aspect-ratio: 336 / 480;
  background: #111823;
  border-radius: 8px;
}

.pad {
  display: none;
  gap: 6px;
}

.pad button {
  width: 44px;
  height: 40px;
  border: 1px solid #263244;
  border-radius: 8px;
  background: #151d2a;
  color: #e7e9ee;
  font-size: 18px;
  touch-action: none;
}

.pad button:active {
  background: #263244;
}

/* On-screen buttons only for touch screens; keyboards get the full height. */
@media (pointer: coarse) {
  .pad {
    display: flex;
  }
  canvas {
    height: min(calc(100vh - 160px), calc(90vw * 480 / 336));
  }
}

#message {
  margin: 0;
  min-height: 1.5em;
  color: #9aa1b2;
  text-align: center;
  font-size: 14px;
}
