:root {
  --tooltip-bg: #1e1e1e;
}

/* ================= GLOBAL ================= */

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: #fff;
  width: 420px;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.lobbies-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty {
  text-align: center;
  color: #777;
}

/* ================= LOBBY CARD ================= */

.lobby {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.25s ease;

  overflow: visible !important; /* 🔥 indispensable pour la flèche */
}

.lobby-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lobby-main strong {
  font-size: 1.05rem;
}

.lobby-meta {
  font-size: 13px;
  color: #555;
  opacity: 0.85;
}

/* ================= ACTIONS ================= */

.lobby-actions {
  display: flex;
  gap: 8px;
}

.lobby-actions button {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  background: #2196f3;
  transition: background 0.15s ease;
}

.lobby-actions button:hover {
  background: #1976d2;
}

.lobby-actions .copy:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ================= PLAYERS TOOLTIP ================= */

.players-count {
  font-size: 0.9rem;
  opacity: 1;
  position: relative;
  cursor: help;
}

/* tooltip box */
.players-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  outline: 1px solid var(--tooltip-bg); /* 🔥 BLOQUE l’effet pseudo-transparence */
  color: #fff;

  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;

  box-shadow: none;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 220px;
}

/* affichage */
.players-count:hover .players-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* flèche opaque */
.players-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);

  border-width: 7px;
  border-style: solid;
  border-color: var(--tooltip-bg) transparent transparent transparent;
}

/* ================= SCROLL INTELLIGENT ================= */

.players-tooltip.scroll {
  max-height: 220px;
  overflow-y: auto;
}

.players-tooltip.scroll::-webkit-scrollbar {
  width: 6px;
}

.players-tooltip.scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}

.players-tooltip.scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* ================= JOUEURS (UNE LIGNE) ================= */

.players-tooltip * {
  display: block;
  white-space: nowrap;      /* 🚫 pas de retour à la ligne */
  overflow: hidden;
  text-overflow: ellipsis;  /* … si pseudo trop long */
}

/* ================= ANIMATION ================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


