/* Multiplayer Round Sharing Styles */

.multiplayer-container {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Round Creation */
.multiplayer-setup {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  color: white;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.multiplayer-setup h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setup-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.setup-input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255,255,255,0.2);
  color: white;
  backdrop-filter: blur(10px);
}

.setup-input::placeholder {
  color: rgba(255,255,255,0.7);
}

.setup-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.create-round-btn, .join-round-btn {
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.create-round-btn:hover, .join-round-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Round Code Display */
.round-code-display {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.round-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  margin: 0.5rem 0;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.round-code.highlight {
  animation: pulse 2s;
}

.round-code:hover {
  background: rgba(255,255,255,0.3);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Players List */
.multiplayer-players {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.multiplayer-players h3 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #f8f9fa;
  border-radius: 10px;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.player-item.current-user {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
  border-left-color: #4CAF50;
  color: white;
}

.player-item.online {
  border-left-color: #4CAF50;
}

.player-item.offline {
  border-left-color: #ccc;
  opacity: 0.7;
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-stats {
  font-size: 0.9rem;
  opacity: 0.8;
  display: flex;
  gap: 1rem;
}

.host-badge {
  font-size: 0.8rem;
}

.you-badge {
  background: rgba(255,255,255,0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 1rem;
}

.status-indicator.online {
  background: #4CAF50;
  animation: pulse-green 2s infinite;
}

.status-indicator.offline {
  background: #ccc;
}

@keyframes pulse-green {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Spectators */
.spectator-item {
  display: flex;
  align-items: center;
  justify-content: between;
  padding: 0.75rem;
  margin: 0.25rem 0;
  background: #f0f0f0;
  border-radius: 8px;
  font-size: 0.9rem;
}

.spectator-name {
  flex: 1;
}

.spectator-badge {
  opacity: 0.7;
}

/* Live Updates */
.live-updates {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.live-update {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  animation: slideIn 0.5s ease;
}

.live-update.fade-out {
  animation: fadeOut 0.5s ease;
  opacity: 0;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

.update-message {
  font-weight: 600;
}

.update-time {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Chat Interface */
.multiplayer-chat {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.chat-messages {
  height: 200px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fafafa;
}

.chat-message {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.message-header .player-name {
  font-weight: 600;
  color: #667eea;
}

.message-time {
  opacity: 0.7;
}

.message-content {
  color: #333;
  line-height: 1.4;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.chat-send-btn {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.chat-send-btn:hover {
  background: #5a67d8;
}

/* Status Bar */
.multiplayer-status {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

.status-info {
  background: #3498db;
}

.status-success {
  background: #2ecc71;
}

.status-warning {
  background: #f39c12;
}

.status-error {
  background: #e74c3c;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Leaderboard */
.multiplayer-leaderboard {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  background: #f8f9fa;
  border-radius: 10px;
  position: relative;
}

.leaderboard-item:first-child {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

.leaderboard-item:nth-child(2) {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.leaderboard-item:nth-child(3) {
  background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
  color: white;
}

.leaderboard-position {
  font-size: 1.5rem;
  font-weight: 700;
  margin-right: 1rem;
  min-width: 3rem;
  text-align: center;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.leaderboard-stats {
  font-size: 0.9rem;
  opacity: 0.8;
}

.leaderboard-score {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Controls */
.multiplayer-controls {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.control-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.control-btn.primary {
  background: #667eea;
  color: white;
}

.control-btn.secondary {
  background: #6c757d;
  color: white;
}

.control-btn.danger {
  background: #dc3545;
  color: white;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .multiplayer-container {
    padding: 0.5rem;
  }
  
  .multiplayer-setup {
    padding: 1.5rem;
  }
  
  .setup-row {
    flex-direction: column;
  }
  
  .round-code {
    font-size: 1.5rem;
    letter-spacing: 0.2em;
  }
  
  .player-stats {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .multiplayer-controls {
    flex-direction: column;
  }
  
  .control-btn {
    width: 100%;
    justify-content: center;
  }
  
  .chat-input-container {
    flex-direction: column;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .live-update,
  .round-code.highlight,
  .status-indicator.online {
    animation: none;
  }
  
  .control-btn:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .multiplayer-players,
  .live-updates,
  .multiplayer-chat,
  .multiplayer-leaderboard {
    background: #2d3748;
    color: white;
  }
  
  .player-item,
  .leaderboard-item {
    background: #4a5568;
  }
  
  .chat-messages {
    background: #4a5568;
    border-color: #718096;
  }
  
  .chat-message {
    background: #2d3748;
  }
  
  .chat-input {
    background: #4a5568;
    border-color: #718096;
    color: white;
  }
}