:root {
  color-scheme: dark;
  font-family: "Press Start 2P", system-ui, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% 20%, #2c2a4a 0%, #0b0b16 60%);
  color: #f0f0f0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: rgba(6, 8, 18, 0.4);
  z-index: 50;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-size: 1.1rem;
  color: #e0e4ff;
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  pointer-events: none;
}

.loading-bar {
  width: min(360px, 60vw);
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar__progress {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, #ffe8a3, #ffc46f);
  border-radius: inherit;
  animation: loading-bar-slide 1.2s linear infinite;
}

@keyframes loading-bar-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(300%);
  }
}


.damage-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 32, 32, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

#game {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  image-rendering: pixelated;
  cursor: default;
  z-index: 0;
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(5, 4, 12, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 1.5rem 2.5rem;
  text-align: center;
  color: #ff4c4c;
  font-size: 1.2rem;
  letter-spacing: 2px;
  z-index: 20;
  pointer-events: none;
}

.game-over p {
  margin: 0.5rem 0 0;
  color: #ffffff;
  font-size: 0.8rem;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


.touch-joystick {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 40;
}

.touch-joystick.hidden .touch-joystick__base,
.touch-joystick.hidden .touch-joystick__stick {
  display: none;
}

.touch-joystick__base {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 12, 24, 0.35);
  transform: translate(-50%, -50%);
}

.touch-joystick__stick {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 200, 110, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 0.04s ease;
}
