/* Multiplayer-specific styles for Bee Day Game */

/* Player counter and status indicators */
.multiplayer-indicator {
  position: absolute;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.75);
  border-radius: 20px;
  color: white;
  font-size: 14px;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
  transition: all 0.3s ease;
}

.multiplayer-indicator:hover {
  background-color: rgba(0, 0, 0, 0.85);
}

#player-counter {
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  border-left: 3px solid #FFD700;
}

#player-counter-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  background-color: #FFD700;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

#player-counter-icon::after {
  content: '👤';
  position: absolute;
  font-size: 13px;
}

#player-counter-number {
  font-weight: bold;
  margin-right: 6px;
  color: #FFD700;
  font-size: 16px;
  transition: transform 0.2s ease-out;
}

#multiplayer-status {
  top: 60px;
  right: 20px;
  display: flex;
  align-items: center;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}

.status-connecting .status-indicator {
  background-color: #FFA500;
  animation: blink 1s infinite;
}

.status-connected .status-indicator {
  background-color: #00FF00;
}

.status-disconnected .status-indicator {
  background-color: #888888;
}

.status-failed .status-indicator {
  background-color: #FF0000;
}

@keyframes blink {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Fallback message for multiplayer failure */
.fallback-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 80%;
  z-index: 1000;
  border: 2px solid #FF6347;
}

.fallback-message p {
  margin-bottom: 15px;
  font-size: 16px;
}

.fallback-message button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.fallback-message button:hover {
  background-color: #45a049;
}

/* Honey collection notification */
.honey-notification {
  position: absolute;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
              opacity 0.3s ease;
  border-left: 4px solid #FFD700;
  max-width: 250px;
  transform: translateX(300px);
  opacity: 0;
  display: flex;
  align-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.honey-notification::before {
  content: "🍯";
  font-size: 18px;
  margin-right: 8px;
  animation: bounce 0.6s ease infinite alternate;
}

.honey-notification.active {
  transform: translateX(0);
  opacity: 1;
}

.honey-notification.exit {
  transform: translateX(300px);
  opacity: 0;
}

.honey-notification .player-name {
  color: #FFD700;
  font-weight: bold;
}

.honey-notification .honey-amount {
  color: #FFA500;
  font-weight: bold;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

/* Leaderboard styling */
#leaderboard {
  position: absolute;
  left: 20px;
  top: 20px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 12px;
  padding: 10px;
  width: 240px;
  z-index: 100;
}

#leaderboard h3 {
  margin: 0 0 8px 0;
  text-align: center;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.5);
  padding-bottom: 6px;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: 6px;
}

.leaderboard-entry.current-player {
  background-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-entry .rank {
  width: 20px;
  font-weight: bold;
}

.leaderboard-entry .name {
  flex-grow: 1;
  text-align: left;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.leaderboard-entry .score {
  font-weight: bold;
  color: #FFD700;
}

/* Name customization for guest users */
#guest-name-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#guest-name-input {
  padding: 8px 12px;
  border-radius: 20px;
  border: 2px solid #FFD700;
  background-color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin-bottom: 10px;
  width: 200px;
  text-align: center;
}

#guest-name-save {
  padding: 6px 14px;
  background-color: #FFD700;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
}

#guest-name-save:hover {
  background-color: #FFC000;
}
