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

body {
  background: #050508;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Special Elite', serif;
}

#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 18px;
  pointer-events: none;
  z-index: 10;
}

#hud-left, #hud-center, #hud-right {
  color: #c8c8ff;
  font-family: 'Creepster', cursive;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(138, 0, 180, 0.7), 0 0 4px #000;
  letter-spacing: 1px;
}

#hud-center {
  font-size: 24px;
  color: #2aff4e;
  text-shadow: 0 0 10px rgba(42, 255, 78, 0.5);
}

#hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#hud-bottom {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Special Elite', serif;
  font-size: 16px;
  color: rgba(200, 200, 255, 0.6);
  text-shadow: 0 0 8px rgba(138, 0, 180, 0.4);
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.5s;
}

#overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
}

#overlay.active {
  pointer-events: all;
}

#mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 15;
  opacity: 0.6;
}

.dpad-row {
  display: flex;
  gap: 4px;
}

.dpad-btn {
  width: 56px;
  height: 56px;
  background: rgba(42, 10, 46, 0.7);
  border: 1px solid rgba(200, 200, 255, 0.15);
  border-radius: 10px;
  color: rgba(200, 200, 255, 0.6);
  font-size: 22px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dpad-btn:active {
  background: rgba(100, 30, 120, 0.7);
  color: #fff;
}

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

@media (max-width: 600px) {
  #mobile-controls {
    display: flex;
  }
  #hud-left, #hud-center, #hud-right {
    font-size: 16px;
  }
  #hud-bottom {
    font-size: 13px;
    bottom: 140px;
  }
}

footer {
  position: fixed;
  bottom: 4px;
  right: 10px;
  z-index: 30;
}

footer a {
  color: #333;
  text-decoration: none;
  font-family: 'Special Elite', serif;
  font-size: 12px;
  transition: color 0.3s;
}

footer a:hover {
  color: #8b0000;
}