
/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --bg-app: #121212;
  --bg-panel: #1e1e1e;
  --bg-surface: #2c2c2c;
  
  --primary: #5865F2; 
  --primary-hover: #4752c4;
  --danger: #ef4444;
  --success: #10b981;
  
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  
  --border-subtle: rgba(255, 255, 255, 0.1);
  --radius: 8px;
  
  --header-height: 60px;
  --controls-height: 64px;
}

* { box-sizing: border-box; outline: none; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-x: hidden; 
  font-size: 15px;
}

.hidden { display: none !important; }
.icon-svg { width: 20px; height: 20px; }

/* =========================================
   2. ESTRUCTURA APP
   ========================================= */
.app { 
  display: flex; 
  flex-direction: column; 
  height: 100dvh; 
  width: 100vw; 
}

/* =========================================
   3. LOGIN
   ========================================= */
#auth-container {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, #2a2a2a 0%, #121212 100%);
  padding: 20px;
  overflow-y: auto; 
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--bg-panel);
  border: 1px solid var(--border-subtle); border-radius: 16px;
  padding: 30px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  margin: auto; 
}
.auth-header h1 { margin: 0; font-size: 2rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 20px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: 0.7; }
input {
  width: 100%; padding: 12px 12px 12px 40px;
  background: #000; border: 1px solid var(--border-subtle);
  border-radius: var(--radius); color: #fff; font-size: 1rem;
}
.btn-primary {
  background: var(--primary); color: white; border: none; padding: 12px;
  border-radius: var(--radius); font-weight: 600; cursor: pointer; width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }

/* =========================================
   4. HEADER / SETUP
   ========================================= */
#setup-panel {
  flex-shrink: 0;
  background: var(--bg-panel); border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  z-index: 20;
  min-height: var(--header-height);
  transition: all 0.3s ease;
}

.logo-text { font-weight: 700; font-size: 1.2rem; }

#guest-controls { display: flex; gap: 10px; align-items: center; flex: 1; max-width: 500px; margin: 0 auto; }
#guest-controls input { background: #111; border-color: #444; }

#host-controls { display: flex; gap: 10px; align-items: center; width: 100%; justify-content: flex-end; }

.btn-action { background: var(--success); color: #fff; border:none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.btn-ghost { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.btn-danger-ghost { background: transparent; border: 1px solid var(--danger); color: var(--danger); padding: 8px 12px; border-radius: 6px; cursor: pointer; }

/* =========================================
   5. BARRA DE CONTROLES
   ========================================= */
.main-content {
  flex: 1; display: flex; flex-direction: column; 
  position: relative; overflow: hidden;
}

.controls-bar {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  height: var(--controls-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; flex-shrink: 0; z-index: 30;
  gap: 10px;
}

.controls-left { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-indicator { color: var(--success); font-weight: 500; font-size: 0.9rem; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.status-indicator::before { content:''; display: block; width: 8px; height: 8px; background: currentColor; border-radius: 50%; }
.badge { background: #333; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; color: #aaa; border: 1px solid #444; }

.controls-center-scroll { flex: 2; display: flex; justify-content: center; min-width: 0; }
.controls-center { display: flex; align-items: center; gap: 8px; }
.controls-right { flex: 1; display: flex; justify-content: flex-end; }

.media-controls { display: flex; gap: 8px; background: rgba(0,0,0,0.2); padding: 4px; border-radius: 99px; }
.media-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: #3a3a3a; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.media-btn:hover { background: #4a4a4a; }
.media-btn.off { background: #dc2626; color: #fff; }

.separator { width: 1px; height: 24px; background: var(--border-subtle); margin: 0 4px; }
.control-btn { background: transparent; border: none; color: var(--text-muted); width: 40px; height: 40px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.control-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.host-moderation { display: flex; gap: 5px; margin-left: 5px; }
.mod-btn { width: 36px; height: 36px; border-radius: 50%; background: #2a2a2a; border: 1px solid #444; cursor: pointer; font-size: 1.1rem; }

.btn-leave { background: #dc2626; color: white; border: none; height: 36px; padding: 0 20px; border-radius: 18px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-leave .btn-icon { display: none; width: 20px; height: 20px; }
.btn-leave:hover { background: #b91c1c; }

/* =========================================
   6. GRID DE VIDEO & PANELES
   ========================================= */
.content-wrapper { flex: 1; display: flex; overflow: hidden; position: relative; background: #000; }
#grid-container { flex: 1; overflow-y: auto; padding: 10px; display: flex; align-items: center; justify-content: center; }

#grid { width: 100%; max-width: 1400px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; align-content: center; justify-content: center; }
#grid:has(.tile:only-child) { grid-template-columns: 1fr; max-width: 900px; }

.tile { background: #1a1a1a; border-radius: 8px; overflow: hidden; position: relative; aspect-ratio: 16/9; border: 2px solid transparent; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.tile.me { border-color: var(--primary); }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.namepill { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; pointer-events: none; }
.state-badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.tile .spectator-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; fill: #555; display: none; }
.tile.spectator .spectator-icon, .tile.video-paused .spectator-icon { display: block; }
.tile.spectator video, .tile.video-paused video { opacity: 0; }

.side-panel { width: 320px; background: var(--bg-panel); border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; flex-shrink: 0; }
.panel-header { height: 50px; padding: 0 12px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { margin: 0; font-size: 1rem; }
.close-panel-mobile { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; display: none; }

#chat-messages { flex: 1; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.chat-message { background: #333; padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; max-width: 90%; word-wrap: break-word; }
.chat-message-wrapper.me .chat-message { background: var(--primary); align-self: flex-end; margin-left: auto; }
#chat-form { padding: 10px; background: var(--bg-surface); display: flex; gap: 8px; align-items: center; }
#chat-input { flex: 1; background: #111; border: none; color: #fff; padding: 8px; border-radius: 20px; resize: none; }
#btn-send-chat, #btn-attach-file { background: transparent; border: none; color: var(--primary); cursor: pointer; font-size: 1.2rem; padding: 4px; }

.lobby-list { padding: 10px; overflow-y: auto; flex: 1; }
.lobby-item { display: flex; justify-content: space-between; align-items: center; background: #333; padding: 8px; margin-bottom: 8px; border-radius: 6px; }
.lobby-btn { border: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.lobby-btn.accept { background: rgba(16,185,129,0.2); color: var(--success); }
.lobby-btn.reject { background: rgba(239,68,68,0.2); color: var(--danger); }

#admission-notifications { position: fixed; top: 70px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.notification-card { background: var(--bg-panel); padding: 10px; border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); display: flex; gap: 10px; align-items: center; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-content { background: var(--bg-panel); padding: 20px; border-radius: 12px; border: 1px solid var(--border-subtle); width: 90%; max-width: 400px; position: relative; }
.modal-close-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #fff; font-size: 1.5rem; }
#changePasswordForm { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }

/* =========================================
   7. RESPONSIVE MOBILE
   ========================================= */
@media (max-width: 768px) {
  
  /* --- SOLUCIÓN INPUT: Panel cubre toda la pantalla y permite scroll --- */
  #setup-panel {
    height: 100vh; 
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    position: absolute; 
    top: 0; left: 0; width: 100%;
    background: var(--bg-app); 
    overflow-y: auto; /* Permite scroll vertical */
  }

  /* Si el HOST ya entró, ocultamos este panel */
  #setup-panel:has(#host-controls:not(.hidden)) {
     position: relative;
     min-height: 0; height: auto; display: none;
  }
  
  /* Si el GUEST ya entró, ocultamos este panel */
  #setup-panel:has(#guest-controls.hidden) {
    display: none;
  }

  #guest-controls { flex-direction: column; width: 100%; gap: 15px; }
  #guest-controls input { padding: 15px; font-size: 1.1rem; width: 100%; }
  #guest-controls button { width: 100%; padding: 15px; font-size: 1.1rem; }
  .logo-text { margin-bottom: 30px; font-size: 2rem; }

  /* --- BARRA DE CONTROLES ARRIBA --- */
  .controls-bar {
    order: -1;
    height: auto; min-height: 56px;
    padding: 8px 12px;
    background: #181818;
    border-bottom: 1px solid var(--border-subtle); border-top: none;
  }
  
  .controls-left { flex: 0 0 auto; width: auto; }
  .status-indicator span, .badge { display: none; }

  .controls-center-scroll {
    overflow-x: auto; justify-content: flex-start;
    padding: 0 10px;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .controls-center-scroll::-webkit-scrollbar { display: none; }

  .media-btn, .control-btn, .mod-btn { width: 36px; height: 36px; flex-shrink: 0; }
  .media-controls { padding: 0; background: transparent; gap: 12px; }

  .controls-right { flex: 0 0 auto; }
  .btn-leave { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: #ef4444; }
  .btn-leave .btn-text { display: none; }
  .btn-leave .btn-icon { display: block; width: 18px; height: 18px; }

  #grid { grid-template-columns: 1fr; gap: 8px; align-content: start; padding-bottom: 80px; }
  .tile { aspect-ratio: 4/3; }
  
  .side-panel { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; z-index: 50; border-left: none; }
  .close-panel-mobile { display: block; }
  .welcome-section { display: none; }
}
.tile.speaking {
  border: 3px solid #22c55e;
  box-shadow: 0 0 15px rgba(34,197,94,0.6);
}

/* ================================
   SIDE PANEL (LOBBY + PARTICIPANTS)
================================ */

.side-panel {
  width: 320px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-panel.hidden {
  display: none;
}

/* ================================
   LOBBY
================================ */

.lobby-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lobby-title {
  font-weight: 600;
  font-size: 15px;
}

.lobby-admit-all {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}

.lobby-admit-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.lobby-list {
  max-height: 35%;
  overflow-y: auto;
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
}

/* ================================
   PARTICIPANTS (DEBAJO DEL LOBBY)
================================ */

.participants-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Header */
.participants-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Lista */
.participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Item */
.participants-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.participants-item:hover {
  background: #f3f4f6;
}

/* Lado izquierdo */
.participants-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Avatar */
.participants-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  flex-shrink: 0;
}

/* Meta */
#lobby-panel .participants-meta .name{
  display: block !important;
  max-width: 17ch !important;              /* 👈 limite 17 caracteres aprox */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.participants-meta .sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* Acciones */
.participants-actions {
  display: flex;
  gap: 6px;
}

/* Botones */
.participants-btn {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.participants-btn:hover {
  background: #d1d5db;
}

/* Toggle ON */
.participants-btn.on {
  background: #dcfce7;
  color: #065f46;
}

/* Toggle OFF */
.participants-btn.off {
  background: #fee2e2;
  color: #991b1b;
}

/* Badge Admin */
.participants-you {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

/* Scrollbar */
.lobby-list::-webkit-scrollbar,
.participants-list::-webkit-scrollbar {
  width: 6px;
}

.lobby-list::-webkit-scrollbar-thumb,
.participants-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 6px;
}

/* ================================
   RESPONSIVE
================================ */

@media (max-width: 900px) {
  .side-panel {
    width: 100%;
    height: 45%;
    border-left: none;
    border-top: 1px solid #e5e7eb;
  }

  .lobby-list {
    max-height: 40%;
  }
}
/* ================================
   DIFERENCIACIÓN DE ESTADOS
================================ */

/* -------- SALA DE ESPERA -------- */

.lobby-header {
  background: #fff7ed; /* naranja suave */
  border-bottom: 1px solid #fed7aa;
}

.lobby-title {
  color: #9a3412;
  font-weight: 700;
}

.lobby-title::before {
  content: "⏳ ";
}

.lobby-list {
  background: #fffbf5;
}

/* Item lobby */
.lobby-item {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Nombre invitado */
.lobby-meta .name {
  font-size: 14px;
  font-weight: 600;
  color: #111827; /* negro real */
}
/* Subtexto */
.lobby-meta .sub {
  font-size: 12px;
  color: #6b7280;
}
.lobby-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;

  /* 🔴 CLAVE: texto blanco para contraste */
  color: #ffffff !important;
}

/* -------- SEPARADOR VISUAL -------- */

.participants-panel {
  border-top: 4px solid #e5e7eb;
  background: #f9fafb;
}

/* Etiqueta separadora */
.participants-header {
  background: #ecfeff; /* azul verdoso */
  border-bottom: 1px solid #67e8f9;
}

.participants-header h3 {
  font-weight: 700;
  color: #0f766e;
}

.participants-header h3::before {
  content: "🟢 ";
}

/* -------- EN SALA -------- */

.participants-list {
  background: #f8fafc;
}

/* Item participante */
.participants-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Participante activo */
.participants-item:hover {
  background: #f0fdfa;
}

/* -------- BADGES DE ESTADO -------- */

/* Badge mic/cam ON */
.participants-meta .sub span {
  font-weight: 600;
}

/* Badge admin */
.participants-you {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* -------- BOTONES -------- */

.participants-btn.on {
  background: #dcfce7;
  color: #065f46;
  border: 1px solid #86efac;
}

.participants-btn.off {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* -------- RESPONSIVE -------- */

@media (max-width: 900px) {
  .participants-header h3::before {
    content: "👥 ";
  }

  .lobby-title::before {
    content: "⌛ ";
  }
}
.participants-btn.danger{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}
.participants-btn.danger:hover{
  filter:brightness(0.98);
}
/* ===============================
   LOBBY + PARTICIPANTS ALWAYS ON
   (solo Admin)
================================ */
body.is-host #lobby-panel {
  display: flex !important;
}

#lobby-panel {
  display: flex;
  flex-direction: column;
}

/* =========================================
   FIX: NO compartir estilos de side-panel
   Chat (dark) vs Lobby (light)
   Pegar al FINAL del CSS
   ========================================= */

/* --- CHAT: dark premium --- */
#chat-panel.side-panel{
  background: rgba(30,30,30,0.92);
  color: var(--text-main);
  border-left: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

#chat-panel .panel-header{
  height: 54px;
  background: linear-gradient(180deg, rgba(88,101,242,0.12), transparent);
  border-bottom: 1px solid var(--border-subtle);
}

#chat-panel .panel-header h3{
  font-weight: 700;
  letter-spacing: .2px;
}

#chat-messages{
  padding: 14px 12px;
  gap: 10px;
  background:
    radial-gradient(1200px 300px at 50% 0%, rgba(88,101,242,0.10), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.18), transparent 40%);
  scrollbar-width: thin;
}

#chat-messages::-webkit-scrollbar{ width: 8px; }
#chat-messages::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
}
#chat-messages::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,0.22);
}

/* Mensajes: layout + burbujas */
.chat-message-wrapper{
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-message{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.25rem;
  font-size: 0.95rem;
  max-width: 85%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* Yo */
.chat-message-wrapper.me{
  justify-content: flex-end;
}
.chat-message-wrapper.me .chat-message{
  background: linear-gradient(135deg, rgba(88,101,242,1), rgba(71,82,196,1));
  border: 1px solid rgba(255,255,255,0.18);
  margin-left: auto;
}

/* Input bar */
#chat-form{
  padding: 10px;
  background: rgba(44,44,44,0.88);
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

#chat-input{
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  outline: none;
}
#chat-input:focus{
  border-color: rgba(88,101,242,0.75);
  box-shadow: 0 0 0 4px rgba(88,101,242,0.18);
}

/* Botones chat */
#btn-send-chat,
#btn-attach-file{
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  transition: transform .12s ease, background .12s ease;
}

#btn-send-chat{
  background: rgba(88,101,242,0.18);
  color: #fff;
}
#btn-send-chat:hover{
  background: rgba(88,101,242,0.28);
  transform: translateY(-1px);
}

#btn-attach-file{
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
#btn-attach-file:hover{
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}

/* =========================================================
   ✅ MEJORA PRO: SOLO LOBBY + PARTICIPANTS (DARK)
   Pegar AL FINAL del CSS para sobreescribir lo anterior
   ========================================================= */


/* =========================================================
   ✅ INVITADO: barra arriba sticky + grid pasa por debajo
   ========================================================= */

body.is-guest .controls-bar{
  position: sticky !important;
  top: 0 !important;
  bottom: auto !important;
  z-index: 1000 !important;
  border-top: none;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
}

/* el que scrollea es grid-container */
body.is-guest #grid-container{
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  height: 100%;

  /* ✅ para que el contenido quede debajo de la barra */
  padding-top: calc(var(--controls-height) + 12px) !important;
  padding-bottom: 80px !important;
}

/* iOS: poder deslizar aunque el dedo toque el video */
@media (max-width: 900px){
  body.is-guest .tile video{ pointer-events:none !important; }
}

/* notch iPhone */
@supports (padding: max(0px)){
  body.is-guest #grid-container{
    padding-top: calc(var(--controls-height) + env(safe-area-inset-top) + 12px) !important;
  }
}




/* =========================================================
   TARJETA PARTICIPANTE – ICONOS ABAJO DEL AVATAR
   ========================================================= */

#lobby-panel .participants-item {
  background: #111214 !important;
  border-radius: 16px !important;
  padding: 14px !important;
  margin: 12px !important;

  display: grid !important;
  grid-template-columns: 64px 1fr !important;
  grid-template-rows: auto auto !important;
  column-gap: 16px !important;
  row-gap: 10px !important;

  align-items: start !important;
  overflow: hidden !important; /* recorta cualquier desborde */

}

/* =====================
   AVATAR (ARRIBA)
   ===================== */
#lobby-panel .participants-avatar {
  grid-column: 1 !important;
  grid-row: 1 !important;

  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;

  background: linear-gradient(135deg, #5865f2, #4752c4) !important;
  color: #fff !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 18px !important;
  font-weight: 800 !important;
}

/* =====================
   ICONOS (ABAJO DEL AVATAR)
   ===================== */
#lobby-panel .participants-actions {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 64px !important;          /* igual a la columna izquierda */
  max-width: 64px !important;
  
  justify-content: center !important;
  align-content: flex-start !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;

  /* por si alguna regla vieja los mueve */
  position: relative !important;
  left: auto !important;
  transform: none !important;
}

/* Botón icono */
#lobby-panel .participants-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Estados */
#lobby-panel .participants-btn.on {
  color: #43b581 !important;
}

#lobby-panel .participants-btn.off {
  color: #f23f43 !important;
}


/* =====================
   BADGE ADMIN
   ===================== */
#lobby-panel .participants-you {
  background: #5865f2 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  padding: 3px 6px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
}