body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  touch-action: manipulation;
  -webkit-touch-callout: none; /* iOS Safari */
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.instructions {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 8px;
  font-size: 18px;
  color: #fff;
  z-index: 100;
  max-width: 400px;
  text-align: center;
}

.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1000;
  display: none; /* Hide crosshair for third-person view */
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background-color: white;
}

.crosshair::before {
  top: 9px;
  left: 0;
  width: 20px;
  height: 2px;
}

.crosshair::after {
  top: 0;
  left: 9px;
  width: 2px;
  height: 20px;
}

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

#joystick-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 150px;  
  height: 150px; 
  z-index: 1000;
  touch-action: none;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  pointer-events: auto;
}

#vehicle-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.vehicle-control-button {
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #333;
  touch-action: none;
  user-select: none;
}

#action-buttons {
  position: absolute;
  bottom: 110px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

#jump-button, #chat-button {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #333;
  touch-action: none;
  user-select: none;
}

#camera-controls {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  padding: 5px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 100;
}

.player-name {
  position: absolute;
  font-size: 14px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.chat-message {
  position: absolute;
  font-size: 14px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translate(-50%, -100%);
  margin-top: -25px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#chat-input-container {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 500px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 10px;
  display: none;
  z-index: 2000;
}

#chat-input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: none;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 16px;
}

#close-chat {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

@media (max-width: 768px) {
  #mobile-controls {
    display: block;
  }
  .instructions {
    display: none !important; 
  }
}