/* ════════════════════════════════════════════════════════════
   lobby.css — Interface lobby partagée — multiplayergameshub.com
   Définir par jeu :  :root { --accent: #xxx; --accent-dim: rgba(r,g,b,.1); }
════════════════════════════════════════════════════════════ */

:root {
  --accent:     #4CC9F0;
  --accent-dim: rgba(76,201,240,.1);
  --lb-bg:    #080814;
  --lb-card:  rgba(10,10,22,.97);
  --lb-text:  #e8e8ff;
  --lb-muted: #555577;
  --lb-error: #ff4466;
}

/* ── Container ───────────────────────────────────────────── */
#lobby {
  position: fixed; inset: 0; z-index: 200;
  background: var(--lb-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
}
#lobby::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(76,201,240,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76,201,240,.025) 1px, transparent 1px);
  background-size: 40px 40px;
}
#lobby > * { position: relative; z-index: 1; }

/* ── State containers ────────────────────────────────────── */
#state-connect, #st-connect { display: flex; flex-direction: column; gap: 10px; }
#state-waiting, #st-waiting { display: none; flex-direction: column; gap: 12px; }
#state-joining, #st-joining { display: none; flex-direction: column; gap: 12px; align-items: center; }

/* ── Title ───────────────────────────────────────────────── */
.lobby-title, .ltitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 30px; font-weight: 900;
  letter-spacing: .28em;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: center;
}

/* ── Subtitle ────────────────────────────────────────────── */
.lobby-sub, .lsub {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin-bottom: 28px;
  text-align: center;
  opacity: 0.8;
}

/* ── Card ────────────────────────────────────────────────── */
.lobby-card, .lcard {
  background: var(--lb-card);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 24px;
  width: 360px;
  box-shadow: 0 0 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
}

/* ── Label ───────────────────────────────────────────────── */
.lbl, .code-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--lb-muted);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

/* ── Separator ───────────────────────────────────────────── */
.sep {
  text-align: center;
  color: rgba(255,255,255,.1);
  font-size: 10px;
  letter-spacing: .18em;
  margin: 10px 0;
}

/* ── Input ───────────────────────────────────────────────── */
.linput {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.3);
  color: var(--lb-text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.linput:focus { border-color: var(--accent); }
.linput::placeholder { color: rgba(255,255,255,.2); }

/* ── Join row ────────────────────────────────────────────── */
.join-row { display: flex; gap: 7px; }
.join-row .linput {
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
}
.join-row .linput::placeholder { font-family: 'Inter', sans-serif; text-transform: none; letter-spacing: .04em; }
.join-row .lbtn { width: auto; padding: 10px 16px; }

/* ── Buttons ─────────────────────────────────────────────── */
.lbtn {
  width: 100%;
  padding: 11px 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.5);
  transition: all .15s;
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
  display: block;
  text-transform: uppercase;
}
.lbtn:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.8);
}
.lbtn:disabled { opacity: .3; cursor: default; }

.lbtn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.lbtn.primary:hover:not(:disabled) { filter: brightness(1.15); }

.lbtn.success {
  background: rgba(6,214,160,.1);
  border-color: #06D6A0;
  color: #06D6A0;
  font-weight: 700;
}
.lbtn.success:hover:not(:disabled) { filter: brightness(1.15); }

.lbtn.danger {
  background: rgba(247,37,133,.1);
  border-color: #F72585;
  color: #F72585;
  font-weight: 700;
}
.lbtn.danger:hover:not(:disabled) { filter: brightness(1.15); }

/* ── Error ───────────────────────────────────────────────── */
#lobby-error {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--lb-error);
  min-height: 16px;
  letter-spacing: .04em;
  margin-top: 6px;
  text-align: center;
}

/* ── Code box ────────────────────────────────────────────── */
.code-box {
  background: rgba(0,0,0,.3);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 10px 18px;
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  letter-spacing: .36em;
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  user-select: all;
  text-shadow: 0 0 20px currentColor;
}

/* ── Invite link ─────────────────────────────────────────── */
.invite-row { display: flex; gap: 6px; }
.invite-input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.3);
  color: var(--lb-muted);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  outline: none;
  min-width: 0; cursor: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invite-input:focus { border-color: var(--accent); }

.btn-copy-small, .copy-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px; letter-spacing: .05em;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn-copy-small:hover, .copy-btn:hover { background: rgba(255,255,255,.08); }

/* ── Player slots ────────────────────────────────────────── */
.players-list, .player-list, .slots { display: flex; flex-direction: column; gap: 6px; }

.player-slot, .player-row, .slot, .player-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--lb-text);
}
.player-slot.empty, .slot.empty { opacity: .3; font-style: italic; color: var(--lb-muted); }
.player-dot, .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.player-badge { font-size: 10px; color: var(--lb-muted); letter-spacing: .06em; margin-left: auto; }
.player-name  { flex: 1; color: var(--lb-text); }

/* ── Waiting message ─────────────────────────────────────── */
.waiting-msg {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--lb-muted);
  text-align: center;
  letter-spacing: .06em;
}

/* ── Animated dots ───────────────────────────────────────── */
.waiting-dots { display: inline-flex; gap: 5px; align-items: center; margin-left: 8px; }
.waiting-dots span, .wdots span {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: lbDot 1.4s infinite both;
}
.waiting-dots span:nth-child(2), .wdots span:nth-child(2) { animation-delay: .2s; }
.waiting-dots span:nth-child(3), .wdots span:nth-child(3) { animation-delay: .4s; }
@keyframes lbDot { 0%,80%,100%{opacity:.15;transform:scale(.7);} 40%{opacity:1;transform:scale(1);} }

/* ── Home link ───────────────────────────────────────────── */
.home-link {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,.2);
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
  text-align: center;
  transition: color .15s;
  margin-top: 12px;
}
.home-link:hover { color: rgba(255,255,255,.5); }

/* ── Option buttons (taille grille, difficulté) ──────────── */
.size-row, .diff-row { display: flex; gap: 5px; flex-wrap: wrap; }
.size-btn, .diff-btn {
  flex: 1; min-width: 60px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
  color: var(--lb-muted);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  cursor: pointer; transition: all .15s;
  letter-spacing: .04em; text-align: center;
}
.size-btn:hover:not(.active), .diff-btn:hover:not(.active) { border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.5); }
.size-btn.active, .diff-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Rounds input (Blob Blast) ───────────────────────────── */
.rounds-row { display: flex; align-items: center; gap: 10px; }
.rounds-label { font-family: 'Inter', sans-serif; font-size: 12px; color: var(--lb-muted); white-space: nowrap; }
.rounds-input {
  width: 64px; padding: 7px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.3); color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 16px; text-align: center; outline: none;
  transition: border-color .2s;
}
.rounds-input:focus { border-color: var(--accent); }
.rounds-input:disabled { color: rgba(255,255,255,.2); border-color: rgba(255,255,255,.05); }
