:root {
  --board-w: min(92vmin, 520px);
  --board-h: min(92vmin, 640px);
}

.header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.board-wrapper {
  display: flex;
  justify-content: center;
}

.board {
  position: relative;
  width: var(--board-w);
  aspect-ratio: 4 / 5;
  max-height: 78vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: #050010;
  box-shadow: 0 0 22px rgba(120, 80, 255, 0.18) inset, var(--shadow-md);
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* In-canvas HUD (DOM overlay so text is crisp at any zoom) */
.game-hud {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  user-select: none;
  z-index: 5;
}
.hud-col { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hud-col-left  { align-items: flex-start; }
.hud-col-right { align-items: flex-end; }
.hud-label {
  font-size: 10px;
  color: #aaa;
  font-weight: 700;
  margin-bottom: 3px;
}
.hud-value {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(124, 255, 124, 0.5);
}

/* Overlay */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 20, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  animation: fadein .25s ease;
}
.overlay[hidden] { display: none; }
.overlay-text {
  font-size: clamp(22px, 5.4vmin, 38px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 14px #6a4cff, 0 2px 6px rgba(0,0,0,.7);
  text-align: center;
  padding: 0 16px;
  letter-spacing: 1px;
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }

/* Mobile arcade controls live in shared/joystick.css. */

.app {
  padding-bottom: max(40px, calc(40px + env(safe-area-inset-bottom)));
}
