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.2);
  border-radius: 50%;
}

#jump-button {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: none; 
  z-index: 1000;
  touch-action: none;
  text-align: center;
  line-height: 80px;
  font-weight: bold;
  color: #333;
  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);
}

#flight-indicator {
  position: fixed;
  bottom: 50px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
  display: none;
}

.flight-active {
  color: #1e90ff !important;
  text-shadow: 0 0 10px #00bfff;
}

#dash-indicator {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
  display: none;
}

.dash-active {
  color: #ff9900 !important;
  text-shadow: 0 0 10px #ff6600;
}

.speed-boost-indicator {
  position: fixed;
  bottom: 80px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 16px;
}

.boost-active {
  color: #ff0000 !important;
  text-shadow: 0 0 10px #ff3333;
}

.speed-boost-message, .speed-boost-end-message {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 20px;
  z-index: 2000;
  text-align: center;
  animation: pop-in 0.5s ease-out;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

.speed-boost-end-message {
  background-color: rgba(0, 0, 0, 0.8);
  color: #ff9999;
}

#controls-info {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  border-radius: 8px;
  z-index: 100;
  font-size: 14px;
  line-height: 1.4;
}

#achievements-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 100;
}

#achievements-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 500px;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 10px;
  padding: 20px;
  z-index: 200;
  display: none;
}

.achievement {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
}

.achievement-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  color: #333;
}

.achievement-locked {
  opacity: 0.5;
}

.achievement-locked .achievement-name {
}

.achievement-notification {
  position: fixed;
  top: 120px;
  right: 20px;
  background-color: rgba(30, 144, 255, 0.9);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 300;
  animation: slide-in 0.5s ease-out;
  max-width: 300px;
}

#achievement-notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: rgba(255, 215, 0, 0.9);
  color: #333;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 16px;
  z-index: 300;
  display: none;
  animation: slide-in 0.5s ease-out;
}

#minimap {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 150px;
  height: 150px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  z-index: 101;
  border: 2px solid white;
  overflow: hidden;
}

.minimap-player {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.minimap-bird {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: red;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

#sound-controls {
  position: fixed;
  top: 20px;
  right: 80px;
  z-index: 100;
  display: flex;
  gap: 10px;
}

#sound-controls button {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

#sound-controls button:hover {
  background-color: rgba(0, 0, 0, 0.9);
}

#friends-counter {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 18px;
  z-index: 100;
  font-weight: bold;
  cursor: pointer;
}

#friends-counter:hover {
  background-color: rgba(0, 0, 0, 0.9);
}

.friendship-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: #FFD700;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 20px;
  z-index: 2000;
  text-align: center;
  animation: pop-in 0.5s ease-out;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.heart-object {
  position: absolute;
  color: red;
  font-size: 20px;
  pointer-events: none;
  animation: float 2s infinite ease-in-out;
}

.chat-message, #chat-input-container, #chat-button, #close-chat {
  display: none;
}

#bird-list-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 500px;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 10px;
  padding: 20px;
  z-index: 200;
  display: none;
}

.bird-list-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.bird-list-tabs button {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 8px 16px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
}

.bird-list-tabs button.active {
  background-color: rgba(255, 255, 255, 0.3);
  font-weight: bold;
}

#bird-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.bird-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
}

.bird-icon {
  margin-right: 10px;
  font-size: 20px;
}

.empty-list {
  text-align: center;
  padding: 20px;
  font-style: italic;
  color: #aaa;
}

#close-bird-list {
  display: block;
  margin: 0 auto;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes slide-in {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes pop-in {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  80% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

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