* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #121218;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  color: #c8c8d0;
}

#game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  width: 100%;
  max-width: 680px;
}

#header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

#title {
  font-size: 28px;
  letter-spacing: 6px;
  color: #ff9800;
  text-shadow: 0 0 20px rgba(255,152,0,0.5), 0 3px 0 #e65100;
}

#stats {
  display: flex;
  gap: 20px;
  font-size: 9px;
  color: #8888aa;
  flex-wrap: wrap;
  justify-content: center;
}

#stats span {
  padding: 3px 8px;
  border: 1px solid #333348;
  border-radius: 2px;
  background: #1a1a24;
}

#canvas-container {
  position: relative;
  line-height: 0;
}

#canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px solid #333348;
  border-radius: 2px;
  cursor: crosshair;
}

#controls-hint {
  display: flex;
  gap: 14px;
  font-size: 7px;
  color: #555568;
  flex-wrap: wrap;
  justify-content: center;
}

#controls-hint span {
  white-space: nowrap;
}

#footer {
  margin-top: 8px;
}

#footer a {
  color: #555568;
  font-size: 7px;
  text-decoration: none;
  font-family: 'Press Start 2P', monospace;
}

#footer a:hover {
  color: #ff9800;
}

/* Mobile controls */
#mobile-dpad, #btn-fire {
  display: none;
}

@media (pointer: coarse), (max-width: 768px) {
  #mobile-dpad, #btn-fire {
    display: block;
  }
  #controls-hint {
    display: none;
  }
}

#mobile-dpad {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 120px;
  height: 120px;
}

.dpad-btn {
  position: absolute;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 16px;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.dpad-btn:active {
  background: rgba(255,152,0,0.4);
}

#btn-up { top: 0; left: 50%; transform: translateX(-50%); }
#btn-down { bottom: 0; left: 50%; transform: translateX(-50%); }
#btn-left { top: 50%; left: 0; transform: translateY(-50%); }
#btn-right { top: 50%; right: 0; transform: translateY(-50%); }

#btn-fire {
  position: absolute;
  bottom: 30px;
  right: 15px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,235,59,0.25);
  border: 2px solid rgba(255,235,59,0.5);
  color: #ffeb3b;
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
  touch-action: none;
  user-select: none;
}

#btn-fire:active {
  background: rgba(255,235,59,0.5);
}