/* ========================================
   SPECTATEUR - Spectator mode
   ======================================== */

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-overlay.hidden {
  display: none;
}

/* Modal content */
.spectator-modal-content {
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  border: 3px solid #667eea;
  border-radius: 15px;
  padding: 25px;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(102, 126, 234, 0.4);
  animation: spectatorSlideIn 0.3s ease-out;
}

@keyframes spectatorSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Header */
.spectator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #667eea;
}

.spectator-header h2 {
  color: #ffd700;
  font-size: 1.5em;
  margin: 0;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

#spectator-player-name {
  color: #667eea;
}

.spectator-header .btn-close {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.spectator-header .btn-close:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

/* Body */
.spectator-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

#spectator-canvas {
  width: 100%;
  height: auto;
  border: 3px solid #3a6b1f;
  border-radius: 10px;
  background: #2d5016;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Stats */
.spectator-stats {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.spectator-stats span {
  color: white;
  font-weight: bold;
  font-size: 1em;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.15);
  border-radius: 8px;
}

/* Legend */
.spectator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 2px solid rgba(102, 126, 234, 0.2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 0.85em;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

