:root {
  --tooltip-bg: #1e1e1e;
}

/* ================= GLOBAL ================= */

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.15);
  width: 400px;
  text-align: center;
}

h1 {
  margin-bottom: 20px;
}

/* ================= CONFIG ================= */

.grid-config input {
  padding: 8px;
  margin: 5px 0;
  width: 80%;
  border-radius: 5px;
  border: 1px solid #ccc;
  text-align: center;
}

.grid-config button {
  padding: 8px 15px;
  margin-top: 10px;
  border: none;
  background: #4caf50;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.grid-config button:hover {
  background: #45a049;
}

/* ================= GAME LINK ================= */

.game-link {
  margin-top: 20px;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.game-link input {
  width: 70%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
  text-align: center;
}

.game-link button {
  padding: 8px 12px;
  border-radius: 5px;
  border: none;
  background: #2196f3;
  color: white;
  cursor: pointer;
}

.game-link button:hover {
  background: #1976d2;
}

/* ================= TOAST ================= */

.toast {
  display: none;
  margin-top: 15px;
  background: #4caf50;
  color: white;
  padding: 8px 12px;
  border-radius: 5px;
}

/* ================= LOBBY CARD ================= */

.lobby-item {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fafafa;
  overflow: visible !important; /* 🔥 flèche visible */
}

.lobby-main {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
}

.lobby-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  display: flex;
  gap: 15px;
}

/* ================= ACTIONS ================= */

.lobby-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.lobby-actions button {
  padding: 8px 12px;
  border-radius: 5px;
  border: none;
  background: #2196f3;
  color: white;
  cursor: pointer;
}

.lobby-actions button:hover {
  background: #1976d2;
}

/* ================= PLAYERS TOOLTIP ================= */

.players-count {
  position: relative;
  cursor: help;
  font-size: 0.9rem;
  opacity: 1;
}

/* 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 identique lobby */
.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;
}

/* ================= JOUEURS ================= */

.players-tooltip * {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.delete:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
