* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Creepster', cursive;
  cursor: none;
  touch-action: none;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

#sound-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  font-size: 24px;
  cursor: pointer;
  z-index: 100;
  opacity: 0.6;
  transition: opacity 0.2s;
  user-select: none;
}
#sound-toggle:hover { opacity: 1; }

#mobile-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none;
}

#dpad {
  position: fixed;
  bottom: 30px;
  left: 30px;
  display: grid;
  grid-template-areas:
    ". up ."
    "left . right"
    ". down .";
  grid-template-columns: 56px 56px 56px;
  grid-template-rows: 56px 56px 56px;
  gap: 4px;
  pointer-events: auto;
}

.dpad-btn {
  background: rgba(139, 0, 0, 0.3);
  border: 1px solid rgba(139, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
}
.dpad-btn:active {
  background: rgba(139, 0, 0, 0.6);
}
#btn-up { grid-area: up; }
#btn-left { grid-area: left; }
#btn-right { grid-area: right; }
#btn-down { grid-area: down; }

.action-btn {
  position: fixed;
  bottom: 60px;
  right: 40px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.2);
  border: 1px solid rgba(255, 204, 0, 0.4);
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}
.action-btn:active {
  background: rgba(255, 204, 0, 0.5);
}

#footer-overlay {
  position: fixed;
  bottom: 6px;
  width: 100%;
  text-align: center;
  z-index: 100;
  pointer-events: none;
}
#footer-overlay a {
  color: rgba(100, 100, 100, 0.4);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  pointer-events: auto;
}
#footer-overlay a:hover {
  color: rgba(139, 0, 0, 0.6);
}

@media (pointer: coarse) {
  body { cursor: default; }
  #mobile-controls { display: block; }
}