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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
  font-family: 'Press Start 2P', monospace;
}

#game-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #1a1a2e;
  max-width: 100%;
  max-height: 100%;
}

#mobile-controls {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  padding: 10px 20px;
  pointer-events: none;
}

@media (max-width: 768px), (pointer: coarse) {
  #mobile-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
}

#dpad {
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  grid-template-columns: 50px 50px 50px;
  grid-template-rows: 50px 50px 50px;
  gap: 2px;
  pointer-events: auto;
}

.dpad-btn {
  width: 50px;
  height: 50px;
  background: rgba(60, 60, 80, 0.85);
  border: 2px solid #6a6a9a;
  border-radius: 8px;
  color: #c8c8ff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
}

.dpad-btn:active {
  background: #8a8aff;
  transform: scale(0.95);
}

#btn-up { grid-area: up; }
#btn-left { grid-area: left; }
#btn-right { grid-area: right; }
#btn-down { grid-area: down; }

#action-btns {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  pointer-events: auto;
}

.action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.1s;
  border: 3px solid;
}

#btn-a {
  background: rgba(200, 80, 80, 0.85);
  border-color: #ff6666;
  color: #fff;
}

#btn-b {
  background: rgba(80, 80, 200, 0.85);
  border-color: #6666ff;
  color: #fff;
}

#btn-shield {
  background: rgba(80, 160, 80, 0.85);
  border-color: #66ff66;
  color: #fff;
  font-size: 20px;
}

.action-btn:active {
  transform: scale(0.9);
  filter: brightness(1.3);
}

.pause-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: rgba(40, 40, 60, 0.9);
  border: 2px solid #6a6a9a;
  border-radius: 8px;
  color: #c8c8ff;
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 100;
}

.pause-btn:active {
  background: #5a5a8a;
}