/* Joystick */
.game-joystick {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent; 
}

.game-joystick.editing {
  border-color: #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.game-joystick-labels {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: rgba(255,255,255,0.5);
  font-weight: bold;
  font-family: sans-serif;
  font-size: 14px;
}

.game-joystick-labels span {
  position: absolute;
  user-select: none;
}

.game-joystick-labels .up { top: 8px; left: 50%; transform: translateX(-50%); }
.game-joystick-labels .down { bottom: 8px; left: 50%; transform: translateX(-50%); }
.game-joystick-labels .left { left: 8px; top: 50%; transform: translateY(-50%); }
.game-joystick-labels .right { right: 8px; top: 50%; transform: translateY(-50%); }

.game-joystick-divider {
    position: absolute;
    background: rgba(255,255,255,0.2);
    pointer-events: none;
}

.game-joystick-divider.diagonal1 {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}

.game-joystick-divider.diagonal2 {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.game-joystick-handle {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Button */

.game-button {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  color: white;
  font-weight: bold;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent; 
}

.game-button.editing {
  border-color: #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.game-button:active {
  transform: scale(0.95);
  background: rgba(255,255,255,0.25);
}


/* Resize Handler */

.game-resize-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #00ff00;
  border: 2px solid white;
  border-radius: 50%;
  cursor: nw-resize;
  display: none;
}

.game-resize-handle.show {
  display: block;
}

.game-resize-handle.bottom-right {
  bottom: -10px;
  right: -10px;
}