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

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

#game-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px solid #2a2a4a;
  border-radius: 4px;
}

#touch-controls {
  display: none;
  width: 100%;
  max-width: 800px;
  padding: 10px 20px;
  justify-content: space-between;
  align-items: flex-end;
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

.touch-btn {
  pointer-events: all;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 12px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
}

.touch-btn:active {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.6);
}

.touch-btn-big {
  width: 70px;
  height: 70px;
  font-size: 24px;
}

.touch-btn-sm {
  width: 50px;
  height: 50px;
  font-size: 16px;
}

#touch-left, #touch-right {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

#footer {
  margin-top: 10px;
  color: #555;
  font-size: 9px;
  font-family: 'Comic Neue', cursive;
  text-align: center;
  display: flex;
  gap: 15px;
  align-items: center;
}

#footer a {
  color: #7a7aff;
  text-decoration: none;
}

#footer a:hover {
  text-decoration: underline;
}

@media (pointer: coarse) {
  #touch-controls {
    display: flex;
  }
}

@media (max-width: 500px) {
  .touch-btn {
    width: 50px;
    height: 50px;
    font-size: 16px;
  }
  .touch-btn-big {
    width: 60px;
    height: 60px;
  }
}