:root {
  --hud-h: 0px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #0a0812;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  font-family: monospace;
}

.game-root {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0812;
}

#game-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
  display: block;
}

.scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.22) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 5;
}

.rotate-hint {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%; transform: translateX(-50%);
  color: #ffd75e; background: rgba(0,0,0,0.6);
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; letter-spacing: 2px;
  z-index: 8; display: none;
  white-space: nowrap;
}
.rotate-hint.visible { display: block; }

/* ---- touch controls ---- */
.touch-controls {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 6;
  display: none;
}
.touch-controls.active { display: block; }

.tc-left, .tc-right {
  position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  display: flex; gap: 12px; align-items: flex-end;
}
.tc-left { left: calc(env(safe-area-inset-left, 0px) + 14px); }
.tc-right { right: calc(env(safe-area-inset-right, 0px) + 14px); }

.tc-btn {
  pointer-events: auto;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  background: rgba(20, 16, 40, 0.55);
  color: #fff;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tc-btn:active, .tc-btn.pressed { background: rgba(255, 200, 80, 0.55); border-color: #ffd75e; }
.tc-fire { width: 76px; height: 76px; font-size: 28px; }

@media (max-aspect-ratio: 16/10) {
  .rotate-hint.visible { display: block; }
}
@media (min-width: 900px) and (pointer: fine) {
  .touch-controls.active { display: none; }
}
