/* Page d'une salle multijoueur. L'habillage commun (body, #app, top-bar, boutons,
   messages) vient de fichiers-partages-des-jeux/css/jeu.css et le plateau de
   mastermind-jeu.css : ici, seulement ce qui entoure le plateau. */

#app {
  max-width: 640px;
}

@media (min-width: 600px) {

  .page-multi #app {
    max-width: 780px;
  }
}

.top-bar-outils {
  display: flex;
  justify-content: flex-end;
  min-width: 60px;
}

/* Salle d'attente */
.attente {
  padding: 8px 0 20px;
}

.attente-libelle {
  color: var(--texte-doux);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* Code de partie : chasse fixe, c'est une suite de caractères à recopier */
.code-partie {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: #f0f3f6;
  letter-spacing: 8px;
  margin: 0 0 12px;
}

.attente-copies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.attente-reglages {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--texte);
  margin-bottom: 6px;
}

.attente-regle {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--texte-doux);
  margin: 0 auto 16px;
  max-width: 460px;
}

.joueurs-liste {
  margin: 0 auto 18px;
  max-width: 460px;
  text-align: left;
  border-top: 1px solid var(--line);
}

.joueur-item,
.adversaire-card,
.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.multi-pseudo {
  font-weight: 700;
  color: var(--texte);
  overflow-wrap: anywhere;
  text-align: left;
}

.joueur-badges {
  display: flex;
  gap: 6px;
}

.joueur-badge {
  padding: 2px 8px;
  border: 1px solid var(--line-forte);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-light);
}

/* Adversaires pendant la manche */
.adversaires {
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
}

.adversaire-card.mm-jeu {
  text-align: left;
}

.adversaire-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--texte-doux);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.adversaire-card .reperes-mini {
  margin-left: 0;
}

.adversaire-statut-gagne {
  color: #64ab7c;
  font-weight: 700;
}

.adversaire-statut-perdu {
  color: #d07070;
  font-weight: 700;
}

/* Délai en cours (30 s de la course, composition du code, fin de manche) */
.countdown-banner {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid #d2973a;
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #d2973a;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Dernières secondes : le compte à rebours clignote, c'est le seul endroit de la page
   où une animation en boucle est justifiée. */
.countdown-banner.urgent {
  border-left-color: #d07070;
  color: #d07070;
  animation: pulse-countdown 1s ease-in-out infinite;
}

@keyframes pulse-countdown {

  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* Duel : composition du code */
.multi-codage {
  max-width: 420px;
  margin: 0 auto 16px;
}

.multi-codage h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #f0f3f6;
  margin-bottom: 6px;
}

.multi-codage-texte {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--texte-doux);
  margin-bottom: 12px;
}

.mm-erreur-codage,
.rejoindre-erreur {
  min-height: 1.2rem;
  color: #d07070;
  font-size: 0.85rem;
}

/* Fin de manche */
.multi-fin {
  margin-top: 8px;
}

.multi-secrets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin-bottom: 12px;
}

.multi-secret-titre {
  font-size: 0.78rem;
  color: var(--texte-doux);
  margin-bottom: 6px;
}

.secret-reveal {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.multi-secrets .secret-reveal .pion {
  width: 30px;
  height: 30px;
}

.scores-manche {
  max-width: 460px;
  margin: 14px auto;
  border-top: 1px solid var(--line);
}

.score-points {
  font-weight: 700;
  color: var(--texte);
  font-variant-numeric: tabular-nums;
}

.score-row.gagnant .multi-pseudo,
.score-row.gagnant .score-points {
  color: #64ab7c;
}

.page-multi .actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.multi-pied {
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* Formulaire affiché à qui arrive par le lien d'invitation */
#formulaire-rejoindre {
  padding: 20px 0;
  text-align: center;
}

.rejoindre-texte {
  color: var(--texte-doux);
  margin-bottom: 14px;
}

.rejoindre-ligne {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

#pseudo-rejoindre-direct {
  width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--line-forte);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--texte);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

#pseudo-rejoindre-direct:disabled {
  opacity: 0.7;
}

#multi-message a {
  color: var(--color-light);
}

footer {
  font-size: 0.78rem;
  color: var(--texte-faible);
  margin-top: 8px;
}

footer a {
  color: var(--texte-doux);
  text-decoration: none;
}

footer a:hover {
  color: var(--color-light);
  text-decoration: underline;
}
