@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#gameCanvas {
  width: 100%;
  height: 100%;
}

#gameCanvas canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@media (max-width: 600px) {
  body {
    font-size: 10px;
  }
}

#touch-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  pointer-events: none;
  z-index: 200;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#touch-controls.touch-visible {
  pointer-events: auto;
}

#touch-controls.touch-hidden {
  display: none;
}

#touch-left-area {
  position: absolute;
  bottom: 20px;
  left: 10px;
  display: flex;
  gap: 12px;
}

#touch-right-area {
  position: absolute;
  bottom: 20px;
  right: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.touch-dash-btn {
  width: 70px;
  height: 70px;
  font-size: 11px;
  opacity: 0.9;
}

.touch-btn {
  border: none;
  border-radius: 50%;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: background 0.1s;
}

.touch-btn:active,
.touch-btn.pressed {
  background: rgba(0, 255, 136, 0.35);
  border-color: rgba(0, 255, 136, 0.6);
}

.touch-dir {
  width: 70px;
  height: 70px;
}

.touch-action {
  width: 90px;
  height: 90px;
  font-size: 14px;
  border-radius: 50%;
}

.touch-small {
  width: 44px;
  height: 44px;
  font-size: 14px;
  position: absolute;
}

#touch-pause {
  top: 10px;
  right: 10px;
}

.touch-restart-pos {
  top: 10px;
  right: 62px;
}

@media (max-width: 600px) {
  .touch-dir {
    width: 60px;
    height: 60px;
    font-size: 16px;
  }

  .touch-action {
    width: 76px;
    height: 76px;
    font-size: 12px;
  }

  .touch-dash-btn {
    width: 58px;
    height: 58px;
    font-size: 9px;
  }

  .touch-small {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .touch-dir {
    width: 52px;
    height: 52px;
  }

  .touch-action {
    width: 64px;
    height: 64px;
    font-size: 10px;
  }

  .touch-dash-btn {
    width: 50px;
    height: 50px;
    font-size: 8px;
  }
}
