* { margin:0; padding:0; box-sizing:border-box; }
html, body {
  background: #000;
  overflow: hidden;
  height: 100%;
  width: 100%;
  font-family: 'Press Start 2P', monospace;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
#game-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}
#mobile-controls {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  padding: 10px 20px;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}
#dpad, #action-btns {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}
.ctrl-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.ctrl-btn:active, .ctrl-btn.pressed {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.7);
}
.ctrl-btn.act {
  width: 65px;
  height: 65px;
  background: rgba(228,56,56,0.3);
  border-color: rgba(228,56,56,0.6);
}
.ctrl-btn.act:active, .ctrl-btn.act.pressed {
  background: rgba(228,56,56,0.55);
}
footer {
  position: fixed;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: #666;
  z-index: 5;
  font-family: 'Press Start 2P', monospace;
}
footer a {
  color: #888;
  text-decoration: none;
  margin-left: 12px;
}
footer a:hover { color: #ccc; }
@media (hover: none) and (pointer: coarse) {
  #mobile-controls { display: flex; }
  footer { display: none; }
}