/* NightGame — page Lobby */

.hidden {
  display: none !important;
}

.lobby-main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  text-align: center;
}

.lobby-main h1 {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.lobby-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.lobby-join {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.lobby-join input {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  width: 180px;
  text-align: center;
}
.lobby-join input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.15);
}

.lobby-room {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.25rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 50px rgba(124, 92, 255, 0.12);
  backdrop-filter: blur(10px);
}

.lobby-room h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.lobby-code {
  font-family: "Orbitron", sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(56, 225, 255, 0.5);
  margin-bottom: 0.75rem;
}

.lobby-players-title {
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 1.5rem 0 0.75rem;
}

.lobby-players {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.lobby-player {
  padding: 0.6rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
  color: #e6e9f5;
}

.lobby-player .host-tag {
  float: right;
  color: #ffb86c;
  font-size: 0.75rem;
}

/* --- Contrôles hôte / attente invité --- */
.host-controls {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
}

.chosen-game {
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0.55rem 1.1rem;
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
}
.chosen-game.has-game {
  color: #e6e9f5;
  border-color: rgba(56, 225, 255, 0.5);
  background: rgba(56, 225, 255, 0.08);
  text-shadow: 0 0 12px rgba(56, 225, 255, 0.5);
}

.host-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.guest-waiting {
  margin: 1.25rem 0;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  animation: lobbyPulse 1.8s ease-in-out infinite;
}
@keyframes lobbyPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.lobby-join input.error {
  border-color: #ff5c7a;
  box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.2);
}

/* --- Sélecteur de jeu --- */
.game-picker {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.7);
  backdrop-filter: blur(6px);
}
.picker-card {
  background: #0c0f1a;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.75rem;
  width: min(360px, 90vw);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(124, 92, 255, 0.15);
  text-align: center;
}
.picker-card h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}
.picker-game {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: #e6e9f5;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.picker-game:hover {
  border-color: var(--cyan);
  background: rgba(56, 225, 255, 0.08);
  transform: translateY(-1px);
}
.picker-game.is-soon {
  cursor: not-allowed;
  opacity: 0.45;
}
.picker-game .picker-icon { font-size: 1.2rem; }
.picker-game .soon-tag {
  margin-left: auto;
  font-size: 0.7rem;
  color: #ffb86c;
  border: 1px solid rgba(255, 184, 108, 0.4);
  padding: 2px 8px;
  border-radius: 999px;
}

/* --- Chat du lobby (bas gauche, semi-transparent) --- */
.lobby-chat {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 40;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: rgba(11, 14, 26, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0.6;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lobby-chat:hover,
.lobby-chat:focus-within {
  opacity: 1;
}
.lobby-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  font: 700 0.85rem "Orbitron", sans-serif;
  color: #e6e9f5;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  user-select: none;
}
.chat-chevron {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
}
.lobby-chat-head:hover .chat-chevron { color: var(--cyan); }
.lobby-chat-body {
  display: flex;
  flex-direction: column;
}
.lobby-chat-msgs {
  height: 200px;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lobby-chat-msgs::-webkit-scrollbar { width: 6px; }
.lobby-chat-msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
.chat-msg {
  font-size: 0.86rem;
  line-height: 1.35;
  word-break: break-word;
}
.chat-msg .chat-who {
  font-weight: 700;
  color: var(--cyan);
}
.chat-msg.me .chat-who { color: var(--violet); }
.chat-msg .chat-text { color: #e6e9f5; }
.chat-msg.sys {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}
.lobby-chat-input {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--glass-border);
}
.lobby-chat-input input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 0.9rem;
}
.lobby-chat-input input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.15);
}
.lobby-chat-input .btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}
.lobby-chat.collapsed .lobby-chat-body { display: none; }
.lobby-chat.collapsed { opacity: 0.9; }

/* --- Chat : mode téléphone --- */
html.mode-phone .lobby-chat {
  left: 0.5rem;
  right: 0.5rem;
  bottom: 4.2rem;
  width: auto;
}
