/* ── Entry / Join screens ────────────────────────────────────────── */

#screen-entry,
#screen-lobby-host,
#screen-lobby-join,
#screen-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 80vh;
  gap: 0;
}

#screen-entry header,
#screen-lobby-host header,
#screen-lobby-join header,
#screen-waiting header {
  margin-bottom: 2rem;
}

#entry-form,
#join-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(360px, 100%);
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  align-self: flex-start;
  margin-bottom: -0.4rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"]::placeholder { color: var(--muted); font-weight: 400; }

.entry-buttons {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.25rem;
}

.entry-buttons .btn { flex: 1; }

.back-link {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

.error-msg {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--red);
  align-self: flex-start;
}

/* ── Host Lobby ──────────────────────────────────────────────────── */

#lobby-host-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: min(400px, 100%);
}

#game-code-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem 2.5rem;
  text-align: center;
  width: 100%;
}

.code-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

#game-code-display {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-shadow: 0 0 28px var(--accent-glow);
  font-family: 'Inter', monospace;
  margin-bottom: 0.4rem;
}

.code-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

#lobby-countdown-wrap {
  text-align: center;
}

.countdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

#lobby-timer {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 18px var(--gold-glow);
  font-variant-numeric: tabular-nums;
}

#lobby-timer.urgent { color: var(--red); text-shadow: 0 0 18px var(--red-glow); }

/* ── Lobby Player Slots ──────────────────────────────────────────── */

#lobby-players,
#waiting-lobby-players {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.lobby-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.lobby-slot.filled { border-color: rgba(34,197,94,0.3); }
.lobby-slot.empty  { opacity: 0.45; }

.lobby-slot-num {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}

.lobby-slot.filled .lobby-slot-num {
  background: var(--accent);
  color: #fff;
}

.lobby-slot-name { flex: 1; }
.lobby-slot-tag  { font-size: 0.65rem; color: var(--muted); font-weight: 500; }

#lobby-host-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

#lobby-host-actions .btn { flex: 1; }

.waiting-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* ── In-game multiplayer UI ──────────────────────────────────────── */

#mp-turn-indicator {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 1.2rem;
  text-align: center;
}

.player-area.left {
  opacity: 0.5;
}

.player-area.left .player-name::after {
  content: ' (left)';
  color: var(--red);
  font-size: 0.65em;
  text-transform: none;
}
