/* Lobby specific styling */
.lobby-screen {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid var(--neon-cyan);
  padding: 2rem;
  box-shadow:
    0 0 20px rgba(0, 255, 255, 0.3),
    inset 0 0 20px rgba(0, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  max-height: 90vh;
  overflow: hidden;
}

.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-group label {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

/* Color palette */
.color-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
}

.color-swatch::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--swatch-color);
  box-shadow:
    0 0 10px var(--swatch-color),
    inset 0 0 10px var(--swatch-color);
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: var(--text-primary);
}

.color-swatch.selected {
  border-color: var(--text-primary);
  box-shadow:
    0 0 20px var(--swatch-color),
    inset 0 0 10px var(--swatch-color);
  transform: scale(1.15);
}

.color-swatch::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  text-shadow: 0 0 10px black;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.color-swatch.selected::after {
  opacity: 1;
}

/* Waiting screen */
.waiting-screen {
  text-align: center;
  padding: 2rem 0;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(0, 255, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
  box-shadow: 0 0 20px var(--neon-cyan);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.waiting-text {
  font-size: 1.5rem;
  color: var(--neon-cyan);
  margin-bottom: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

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

.player-preview {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border: 1px solid rgba(0, 255, 255, 0.3);
  margin-top: 2rem;
}

.player-preview p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.color-preview {
  width: 60px;
  height: 60px;
  margin: 0 auto;
  border: 2px solid var(--text-primary);
  box-shadow:
    0 0 20px var(--preview-color),
    inset 0 0 20px var(--preview-color);
}

/* Countdown screen */
.countdown-screen {
  text-align: center;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.countdown-screen h2 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  animation: neonPulse 1s ease-in-out infinite;
}

.countdown-number {
  font-size: 4rem;
  font-weight: bold;
  color: var(--neon-cyan);
  text-shadow:
    0 0 20px var(--neon-cyan),
    0 0 40px var(--neon-cyan),
    0 0 60px var(--neon-cyan);
  animation: countdownPulse 1s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

@keyframes countdownPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.players-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0;
  flex-wrap: nowrap;
}

.player-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
}

.player-color {
  width: 50px;
  height: 50px;
  border: 2px solid var(--text-primary);
  box-shadow:
    0 0 20px var(--player-color),
    inset 0 0 20px var(--player-color);
  flex-shrink: 0;
}

.player-card p {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.vs-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--neon-magenta);
  text-shadow: 0 0 20px var(--neon-magenta);
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .lobby-screen {
    padding: 2rem 1rem;
  }

  .color-palette {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }

  .countdown-number {
    font-size: 3rem;
    margin-bottom: 1rem;
  }

  .countdown-screen h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .players-info {
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0;
  }

  .player-card {
    flex-direction: row;
    gap: 0.6rem;
  }

  .player-color {
    width: 40px;
    height: 40px;
  }

  .player-card p {
    font-size: 0.85rem;
    max-width: 100px;
  }

  .vs-text {
    font-size: 1.2rem;
  }
}
