/* Generated by GitHub Copilot */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a1a;
  color: #eee;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10;
}

/* Lobby */
#lobby h1 {
  font-family: 'Jersey 10', cursive;
  font-size: 6rem;
  letter-spacing: 0.4rem;
  margin-bottom: 0.5rem;
  color: #f1c40f;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: throb 1s ease-in-out infinite;
  user-select: none;
}

/* Room Selection */
#room-select {
  width: fit-content;
  align-items: center;
}

#room-select h1 {
  font-family: 'Jersey 10', cursive;
  font-size: 6rem;
  letter-spacing: 0.4rem;
  margin-bottom: 2rem;
  color: #f1c40f;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: throb 1s ease-in-out infinite;
  user-select: none;
}

@keyframes throb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

#room-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 66%;
}

#join-room-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

#input-room-id {
  padding: clamp(0.6rem, 1.5vw, 1.2rem) clamp(0.8rem, 1.5vw, 1.5rem);
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.15rem;
  border: 2px solid #555;
  border-radius: 8px;
  background: #2a2a3e;
  color: #eee;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s;
}

#input-room-id::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

#input-room-id:focus-visible {
  border-color: #f1c40f;
}

#btn-create-room {
  background: #e74c3c;
  color: white;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  padding: clamp(0.75rem, 1.5vw, 1.2rem) 2rem;
  width: 100%;
}

#btn-join-room {
  background: #3498db;
  color: white;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  padding: clamp(0.6rem, 1.5vw, 1.2rem) clamp(1.5rem, 2vw, 2.5rem);
}

#room-error {
  color: #e74c3c;
  font-size: 0.95rem;
  margin-top: 1rem;
  min-height: 1.2em;
}

/* Room code badge in lobby */
.room-code {
  font-size: 1.2rem;
  font-weight: bold;
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.12);
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.2rem;
  user-select: none;
  cursor: default;
}

#room-code-value {
  user-select: text;
}

/* Profile setup */
#profile-setup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

#profile-setup label,
#color-label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1;
}

#input-name {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  border: 2px solid #555;
  border-radius: 6px;
  background: #2a2a3e;
  color: #eee;
  width: 140px;
  height: 36px;
  outline: none;
  transition: border-color 0.2s;
}

#input-name:focus-visible {
  border-color: #f1c40f;
}

#color-swatches {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  padding: 0;
  background: none;
}

.color-swatch:hover {
  transform: scale(1.2);
}

.color-swatch:focus-visible {
  outline: 3px solid #f1c40f;
  outline-offset: 2px;
}

.color-swatch.selected {
  border-color: #fff;
  transform: scale(1.15);
}

#player-list {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 60px;
  min-width: 520px;
}

.player-card {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  min-width: 120px;
  text-align: center;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  line-height: 1.2;
}

.player-card.ready {
  border-color: #2ecc71;
}

.player-card.host::after {
  content: ' ★';
  color: #f1c40f;
}

.color-swatch.taken {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

#lobby {
  min-height: 350px;
  position: relative;
}

#btn-leave-room {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: #e74c3c;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  z-index: 20;
}

#btn-leave-room:hover {
  background: #c0392b;
  color: #fff;
  transform: scale(1.12);
}

#btn-leave-room:focus-visible {
  outline: 3px solid #f1c40f;
  outline-offset: 2px;
}

#lobby-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

button {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover {
  transform: scale(1.12);
}

button:active {
  transform: scale(1);
}

button:focus-visible {
  outline: 3px solid #f1c40f;
  outline-offset: 2px;
}

#btn-ready {
  background: #3498db;
  color: white;
}

#btn-ready.active {
  background: #2ecc71;
}

#btn-start {
  background: #e74c3c;
  color: white;
}

#lobby-status {
  color: #999;
  font-size: 0.9rem;
}

/* Countdown */
#countdown-number {
  font-size: 10rem;
  font-weight: bold;
  color: #f1c40f;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Game canvas */
#game {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

#game-canvas {
  display: block;
  background: #333;
  border: 2px solid #555;
}

#game-canvas:focus-visible {
  outline: 3px solid #f1c40f;
  outline-offset: 2px;
}

/* HUD */
#hud {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  min-width: 140px;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.hud-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.hud-player.dead {
  opacity: 0.4;
  text-decoration: line-through;
}

/* Game Over */
#gameover h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #f1c40f;
}

#gameover-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

#btn-restart {
  background: #2ecc71;
  color: white;
}

#btn-main-menu {
  background: #e74c3c;
  color: white;
}
