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;
}

#joystick-container {
  position: fixed;
  bottom: 50px;
  left: 20px;
  width: 150px;  
  height: 150px; 
  z-index: 1000;
  display: none; 
  touch-action: none;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

#jump-button {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 80px;
  height: 80px;
  background-color: rgba(255, 0, 0, 0.5);
  border-radius: 50%;
  display: none; 
  z-index: 1000;
  touch-action: none;
  text-align: center;
  line-height: 80px;
  font-weight: bold;
  color: white;
  user-select: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

#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);
  font-weight: bold;
}

#player-count {
  position: fixed;
  top: 15px;
  right: 15px;
  font-size: 14px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
}

.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;
}

#chat-button {
  position: fixed;
  bottom: 50px;
  right: 120px; /* Moved from 50px to 120px to position beside jump button */
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  text-align: center;
  line-height: 60px;
  font-weight: bold;
  color: #333;
  z-index: 1000;
  touch-action: none;
  cursor: pointer;
}

#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;
}

#roblox-logo {
  display: none; /* Hide the old logo */
}

#dynablocks-logo {
  position: fixed;
  top: 15px;
  left: 15px;
  font-size: 24px;
  font-weight: bold;
  z-index: 1000;
  pointer-events: none;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
  letter-spacing: 1px;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

#dynablocks-logo span:nth-child(1) { color: #FF69B4; } /* pink */
#dynablocks-logo span:nth-child(2) { color: #00FF00; } /* green */
#dynablocks-logo span:nth-child(3) { color: #0000FF; } /* blue */
#dynablocks-logo span:nth-child(4) { color: #FFA500; } /* orange */
#dynablocks-logo span:nth-child(5) { color: #90EE90; } /* light green */
#dynablocks-logo span:nth-child(6) { color: #4F7942; } /* fern */
#dynablocks-logo span:nth-child(7) { color: #800080; } /* purple */
#dynablocks-logo span:nth-child(8) { color: #ADD8E6; } /* light blue */
#dynablocks-logo span:nth-child(9) { color: #FF69B4; } /* pink */
#dynablocks-logo span:nth-child(10) { color: #00FF00; } /* green */

#sky-background {
  display: none; /* Hide the div background since we're using a skybox now */
}

#chat-log-container {
  position: fixed;
  left: 15px;
  bottom: 15px;
  width: 300px;
  max-height: 200px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 10px;
  overflow-y: auto;
  z-index: 1500;
  color: white;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#chat-log {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

#chat-log li {
  margin-bottom: 5px;
  word-wrap: break-word;
}

.chat-username {
  font-weight: bold;
  margin-right: 5px;
}

.chat-toggle {
  position: fixed;
  left: 15px;
  bottom: 225px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  z-index: 1500;
  font-size: 12px;
}

.creator-tag {
  background-color: #FFD700;
  color: #000;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 5px;
}

@media (max-width: 768px) {
  #joystick-container {
    display: block;
  }
  
  #jump-button {
    display: block;
  }
  
  .instructions {
    display: none !important; 
  }
}