* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0f0f23;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#app {
  text-align: center;
  width: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 2.5em;
  color: #e94560;
  text-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
  margin-bottom: 10px;
}

h2 {
  color: #16213e;
  background: #e94560;
  padding: 8px 24px;
  border-radius: 8px;
  font-size: 1.3em;
}

/* Join Form */
.join-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 300px;
}

.join-form input {
  padding: 14px 18px;
  border: 2px solid #16213e;
  border-radius: 8px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 1.1em;
  outline: none;
  transition: border-color 0.2s;
}

.join-form input:focus {
  border-color: #e94560;
}

button {
  padding: 14px 32px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

button:hover {
  background: #c0392b;
  transform: scale(1.02);
}

button:active {
  transform: scale(0.98);
}

.hint {
  color: #888;
  font-size: 0.9em;
  max-width: 400px;
}

.back-link {
  color: #e94560;
  text-decoration: none;
  font-size: 0.9em;
}

.back-link:hover {
  text-decoration: underline;
}

.lobby-options {
  margin: 10px 0;
}

.toggle-btn {
  padding: 10px 24px;
  background: #16213e;
  color: #888;
  border: 2px solid #333;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: #2ecc71;
  color: #fff;
  border-color: #27ae60;
}

/* Player list */
.player-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: #1a1a2e;
  border-radius: 6px;
  font-size: 1.1em;
  margin: 4px 0;
  min-width: 200px;
}

.player-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Game */
.game-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

canvas {
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 4em;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

#scoreboard {
  background: #1a1a2e;
  border: 2px solid #16213e;
  border-radius: 8px;
  padding: 16px;
  min-width: 180px;
  text-align: left;
}

#scoreboard h3 {
  color: #e94560;
  margin-bottom: 10px;
  text-align: center;
}

.score-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 4px 0;
  border-radius: 4px;
  font-size: 0.95em;
}

.score-entry.dead {
  opacity: 0.4;
  text-decoration: line-through;
}

/* Responsive */
@media (max-width: 1100px) {
  .game-container {
    flex-direction: column;
    align-items: center;
  }

  canvas {
    width: 100%;
    max-width: 800px;
    height: auto;
  }

  .overlay {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  #scoreboard {
    width: 100%;
    max-width: 800px;
  }
}

@media (max-width: 500px) {
  h1 {
    font-size: 1.8em;
  }

  .join-form {
    width: 90%;
  }
}
