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

body {
  background: #0a0a0a;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  font-family: 'Creepster', cursive;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

#mobile-controls {
  display: none;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  z-index: 100;
  pointer-events: none;
}

.dpad-btn {
  position: absolute;
  width: 50px;
  height: 50px;
  background: rgba(139, 0, 0, 0.25);
  border: 1px solid rgba(139, 0, 0, 0.5);
  color: rgba(200, 50, 50, 0.7);
  font-size: 20px;
  border-radius: 8px;
  pointer-events: all;
  touch-action: manipulation;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.dpad-btn:active {
  background: rgba(139, 0, 0, 0.6);
}

#btn-up { top: 0; left: 50px; }
#btn-left { top: 50px; left: 0; }
#btn-right { top: 50px; left: 100px; }
#btn-down { top: 100px; left: 50px; }

#footer-link {
  position: fixed;
  bottom: 6px;
  right: 10px;
  z-index: 200;
}

#footer-link a {
  color: rgba(139, 0, 0, 0.4);
  font-family: 'Creepster', cursive;
  font-size: 12px;
  text-decoration: none;
}

#footer-link a:hover {
  color: rgba(139, 0, 0, 0.8);
}

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

@media (max-width: 500px) {
  #mobile-controls {
    bottom: 15px;
    width: 130px;
    height: 130px;
  }
  .dpad-btn {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
  #btn-up { top: 0; left: 44px; }
  #btn-left { top: 44px; left: 0; }
  #btn-right { top: 44px; left: 88px; }
  #btn-down { top: 88px; left: 44px; }
}