
/* --------------------------------------------------------- Ecran lobby */

.lobby-page {
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(120% 55% at 50% 108%, #7a2f24 0%, rgba(122, 47, 36, 0.35) 38%, transparent 72%),
    radial-gradient(circle at 50% -10%, #2a2016, #0b0a08 70%);
}

/* Poussiere de la plaine : de fines particules derivent lentement en fond. */
.lobby-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 24%, rgba(224, 163, 58, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 68% 58%, rgba(224, 163, 58, 0.22), transparent 60%),
    radial-gradient(1px 1px at 38% 82%, rgba(217, 192, 138, 0.30), transparent 60%),
    radial-gradient(1.5px 1.5px at 84% 16%, rgba(224, 163, 58, 0.18), transparent 60%),
    radial-gradient(1px 1px at 52% 40%, rgba(217, 192, 138, 0.22), transparent 60%);
  background-size: 640px 420px;
}

@keyframes derivee {
  from { background-position: 0 0; }
  to { background-position: 640px -420px; }
}

@keyframes apparition {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes fondu {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .lobby-page::before { animation: derivee 90s linear infinite; }
  .panneau-lobby { animation: apparition 0.45s ease both; }
  .contenu-lobby > .panneau-lobby:nth-child(2) { animation-delay: 0.08s; }
  .liste-parties li:not(.vide) { animation: fondu 0.35s ease both; }
}

.entete {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--bord);
}

.entete h1 {
  margin: 0;
  font-size: 2.6rem;
  letter-spacing: 0.35em;
  color: var(--accent);
}

.entete .sous-titre { margin: 0.3rem 0 1.2rem; }

.identite {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
}

.identite input { width: 200px; text-align: center; }

.contenu-lobby {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  max-width: 62rem;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem;
}

@media (max-width: 820px) {
  .contenu-lobby { grid-template-columns: 1fr; }
}

.panneau-lobby {
  background: var(--nuit-clair);
  border: 1px solid var(--bord);
  border-radius: 6px;
  padding: 1.2rem;
}

.panneau-lobby h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.panneau-lobby label { display: block; margin-top: 0.7rem; }
.panneau-lobby input, .panneau-lobby select { width: 100%; }

fieldset {
  margin: 1rem 0 0;
  border: 1px solid var(--bord);
  border-radius: 4px;
}

legend { color: var(--texte-faible); font-size: 0.78rem; padding: 0 0.4rem; }

#creer { margin-top: 1.2rem; }

.liste-parties { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }

.liste-parties li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--bord);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(224, 163, 58, 0.06), transparent);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.liste-parties li:not(.vide):hover {
  border-color: var(--accent);
  background: rgba(224, 163, 58, 0.10);
  transform: translateY(-1px);
}

.infos { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.nom-partie { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 0.75rem; color: var(--texte-faible); }

/* Sieges : un point plein par joueur inscrit, un point creux par place libre. */
.sieges { display: flex; gap: 0.28rem; }
.siege {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--texte-faible);
  background: transparent;
}
.siege.plein {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(224, 163, 58, 0.55);
}

.liste-parties button {
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.liste-parties button:disabled { background: var(--nuit); color: var(--texte-faible); }

/* Etat vide : deux dunes suggerent la plaine. */
.liste-parties li.vide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem 1.6rem;
  border-style: dashed;
  text-align: center;
  color: var(--texte-faible);
  font-size: 0.85rem;
}
.liste-parties li.vide p { margin: 0; }
.vide-aide { color: var(--accent); font-size: 0.78rem; }
.vide-dune { display: block; position: relative; width: 130px; height: 44px; }
.vide-dune::before,
.vide-dune::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(180deg, var(--accent), #7a3b1e);
}
.vide-dune::before { left: 0; width: 68%; height: 32px; opacity: 0.5; }
.vide-dune::after { right: 0; width: 70%; height: 44px; opacity: 0.32; }

/* --------------------------------------------------------- Ecran de fin */

.classement { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.classement th {
  text-align: left; padding: 0.3rem 0.4rem; color: var(--texte-faible);
  font-weight: 500; border-bottom: 1px solid var(--bord);
}
.classement td { padding: 0.3rem 0.4rem; border-bottom: 1px solid rgba(74,66,55,0.5); }
.classement tr.vainqueur td { color: var(--accent); font-weight: 600; }

.bouton-lien {
  display: block; margin-top: 1.2rem; padding: 0.6rem; text-align: center;
  background: var(--accent); color: #241f16; border-radius: 4px;
  font-weight: 600; text-decoration: none;
}

/* --- Salle en attente ------------------------------------------------- */

.liste-joueurs {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.liste-joueurs li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bord);
}

.liste-joueurs li:last-child { border-bottom: none; }

.liste-joueurs li.pret .marque { color: var(--accent); }

.liste-joueurs .marque {
  color: var(--texte-faible);
  font-size: 0.85rem;
}

#salle .actions {
  display: flex;
  gap: 0.6rem;
}

#salle .actions button { flex: 1; }

button.discret {
  width: 100%;
  margin-top: 0.8rem;
  background: transparent;
  color: var(--texte-faible);
  border-color: var(--bord);
}

/* --------------------------------------------------- Etat des joueurs */

.liste-joueurs li.moi .nom-joueur { color: var(--texte); font-weight: 600; }
.liste-joueurs .nom-joueur em { color: var(--texte-faible); font-style: normal; font-size: 0.75rem; }

.liste-joueurs li.pret { border-color: rgba(224, 163, 58, 0.45); }
.liste-joueurs li.pret .marque { color: var(--accent); }

.liste-joueurs li.bot .nom-joueur,
.liste-joueurs li.bot .marque { color: var(--texte-faible); }

/* Celui qui n'est pas pret est celui qui bloque : on le signale en clair. */
.liste-joueurs li:not(.pret):not(.bot):not(.absent) .marque { color: #d98a5a; }

/* Deconnecte, mais encore dans la salle : le tour de reconnexion. */
.liste-joueurs li.absent { opacity: 0.55; }
.liste-joueurs li.absent .marque { color: #b06a5a; }

#salle-compo { padding-left: 0; margin: 0 0 1rem; }

@keyframes pulsation {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 163, 58, 0); }
  50% { box-shadow: 0 0 0 7px rgba(224, 163, 58, 0.16); }
}

.pret-pulse { animation: pulsation 1.3s ease-in-out 3; }

@media (prefers-reduced-motion: reduce) {
  .pret-pulse { animation: none; }
}
