* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  touch-action: none;
  font-family: 'Press Start 2P', monospace, sans-serif;
}

#game-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Mobile Controls Overlay */
#mobile-controls {
  display: none;
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
}

.mobile-dpad, .mobile-actions {
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.touch-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(22, 27, 34, 0.7);
  border: 2px solid rgba(88, 166, 255, 0.7);
  color: #f0f6fc;
  font-family: inherit;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  touch-action: manipulation;
}

.touch-btn:active, .touch-btn.active {
  background: rgba(56, 139, 253, 0.85);
  transform: scale(0.92);
  border-color: #ffffff;
}

.action-btn {
  font-size: 10px;
}

.primary-btn {
  background: rgba(31, 111, 235, 0.8);
  border-color: #58a6ff;
  width: 70px;
  height: 70px;
  font-size: 11px;
}

/* Show touch controls on touch-capable or small screens */
@media (hover: none) and (pointer: coarse), (max-width: 900px) {
  #mobile-controls {
    display: flex;
  }
}
