/* ═══════════════════════════════════════
   NEW RISE — REUNIONES PRIVADAS — style.css
   ═══════════════════════════════════════ */

*{ box-sizing:border-box; margin:0; padding:0; }

:root{
  --bg:#02030a;
  --gold:#e7c35c;
  --gold2:#ffe58f;
  --violet:#8e36ff;
  --blue:#168aff;
  --green:#00f08b;
  --red:#ff3850;
  --text:#f0f0f5;
  --text2:#bfc5db;
  --text3:#7a80a0;
  --bg2:#080a16;
  --bg3:#0d1020;
  --bg4:#111428;
  --bg5:#1a1d2e;
  --font-d:'Bebas Neue',sans-serif;
  --font-t:'Orbitron',monospace;
  --font-b:'DM Sans',sans-serif;
  --topbar-h:62px;
  --toolbar-h:74px;
}

html,body{ height:100%; background:var(--bg); color:var(--text); font-family:var(--font-b); font-size:13px; overflow:hidden; }

/* ── LOADING ── */
#screen-loading{
  position:fixed; inset:0; background:var(--bg);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  z-index:100; gap:14px;
}
.load-logo img{ width:200px; max-width:70vw; filter:drop-shadow(0 0 20px rgba(231,195,92,.42)); }
.load-sub{ font-family:var(--font-t); font-size:10px; color:var(--gold); letter-spacing:.2em; }
.load-bar{ width:200px; height:2px; background:rgba(255,255,255,.08); border-radius:2px; overflow:hidden; }
.load-fill{ height:100%; background:var(--gold); border-radius:2px; width:0%; transition:width .4s ease; }
.load-msg{ font-size:11px; color:var(--text3); }

/* ── ERROR ── */
#screen-error{
  position:fixed; inset:0; background:var(--bg);
  display:none; flex-direction:column; align-items:center; justify-content:center;
  z-index:100; gap:12px; padding:32px; text-align:center;
}
.err-icon{ font-size:46px; }
.err-title{ font-family:var(--font-d); font-size:30px; letter-spacing:.05em; }
.err-msg{ font-size:14px; color:var(--text2); max-width:400px; line-height:1.6; }
.err-btn{
  margin-top:10px; padding:9px 22px;
  background:rgba(231,195,92,.14); border:1px solid rgba(231,195,92,.35);
  border-radius:12px; color:var(--gold); font-size:13px; cursor:pointer;
}

/* ── PANTALLAS PREVIAS (login, lobby, cliente) ── */
#screen-login,
#screen-lobby,
#screen-cliente{
  position:fixed; inset:0; background:var(--bg);
  display:none; align-items:center; justify-content:center; z-index:90;
}

/* ── LOGIN CARD ── */
.login-card,
.lobby-card,
.cliente-card{
  background:var(--bg2);
  border:1px solid rgba(231,195,92,.28);
  border-radius:20px;
  padding:40px 36px;
  width:100%; max-width:420px;
  display:flex; flex-direction:column; align-items:center; gap:16px;
  box-shadow:0 0 40px rgba(231,195,92,.10), inset 0 0 0 1px rgba(255,229,143,.06);
}

.login-logo img,
.lobby-logo img,
.cliente-logo img{ width:160px; filter:drop-shadow(0 0 14px rgba(231,195,92,.35)); }

.login-title,
.lobby-title,
.cliente-title{
  font-family:var(--font-d); font-size:24px; letter-spacing:.12em; color:var(--gold);
}

.login-sub,
.lobby-sub,
.cliente-sub{
  font-size:12px; color:var(--text3); text-align:center; line-height:1.5;
}

.login-input,
.cliente-input{
  width:100%; padding:12px 16px;
  background:var(--bg4); border:1px solid rgba(231,195,92,.22);
  border-radius:12px; color:var(--text); font-size:14px; font-family:var(--font-b);
  outline:none; transition:border-color .2s;
}
.login-input:focus,
.cliente-input:focus{ border-color:rgba(231,195,92,.55); }

.login-btn,
.lobby-btn,
.cliente-btn{
  width:100%; padding:13px;
  background:linear-gradient(135deg,rgba(231,195,92,.18),rgba(231,195,92,.10));
  border:1px solid rgba(231,195,92,.40);
  border-radius:14px; color:var(--gold);
  font-family:var(--font-t); font-size:12px; letter-spacing:.10em;
  cursor:pointer; transition:background .2s, border-color .2s;
}
.login-btn:hover,
.lobby-btn:hover,
.cliente-btn:hover{
  background:linear-gradient(135deg,rgba(231,195,92,.28),rgba(231,195,92,.16));
  border-color:rgba(231,195,92,.65);
}
.lobby-btn.gold{ background:linear-gradient(135deg,rgba(231,195,92,.35),rgba(231,195,92,.20)); }

.login-err,
.lobby-err,
.cliente-err{ font-size:12px; color:var(--red); min-height:16px; text-align:center; }

/* ── LOBBY: room box ── */
.lobby-room-box{
  width:100%; background:var(--bg3);
  border:1px solid rgba(142,54,255,.35); border-radius:14px;
  padding:16px; display:flex; flex-direction:column; gap:10px;
}
.lobby-room-label{ font-family:var(--font-t); font-size:9px; letter-spacing:.15em; color:var(--text3); }
.lobby-room-link{
  font-size:11px; color:var(--gold2); word-break:break-all; line-height:1.5;
  background:rgba(231,195,92,.06); border-radius:8px; padding:8px 10px;
}
.lobby-copy-btn{
  padding:8px 14px; background:rgba(142,54,255,.18); border:1px solid rgba(142,54,255,.40);
  border-radius:10px; color:#b168ff; font-size:12px; cursor:pointer;
  transition:background .2s;
}
.lobby-copy-btn:hover{ background:rgba(142,54,255,.30); }
.lobby-copy-ok{ font-size:12px; color:var(--green); display:none; text-align:center; }

.lobby-logout{
  font-size:11px; color:var(--text3); background:none; border:none; cursor:pointer;
  text-decoration:underline; padding:4px;
}
.lobby-logout:hover{ color:var(--text2); }

/* ── SALA ── */
#screen-sala{
  display:none; flex-direction:column;
  height:100vh; background:var(--bg);
  border:1px solid rgba(231,195,92,.50);
  border-radius:16px; overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(255,229,143,.08), 0 0 40px rgba(231,195,92,.10);
}

/* ── TOPBAR ── */
.topbar{
  height:var(--topbar-h); flex-shrink:0;
  background:linear-gradient(90deg,rgba(2,3,10,.99),rgba(8,10,22,.96),rgba(2,3,10,.99));
  border-bottom:1px solid rgba(231,195,92,.22);
  display:flex; align-items:center; padding:0 24px; gap:18px;
}
.logo-img-wrap{
  display:flex; align-items:center;
  border-right:1px solid rgba(231,195,92,.12); padding-right:18px; height:100%;
}
.logo-img-wrap img{ height:34px; width:auto; object-fit:contain; filter:drop-shadow(0 0 12px rgba(231,195,92,.35)); }
.sala-badge{ font-family:var(--font-t); font-size:13px; letter-spacing:.12em; color:#f4e9c9; border-right:1px solid rgba(231,195,92,.12); padding-right:18px; }
.live-indicator{
  display:flex; align-items:center; gap:6px;
  border:1px solid rgba(255,56,80,.30); background:rgba(255,56,80,.07);
  border-radius:999px; padding:6px 14px;
}
.live-dot{ width:7px; height:7px; border-radius:50%; background:var(--text3); }
.live-dot.on{ background:var(--red); box-shadow:0 0 8px var(--red); animation:pulse 1.4s infinite; }
@keyframes pulse{ 0%,100%{opacity:1} 50%{opacity:.45} }
.live-lbl{ font-family:var(--font-t); font-size:10px; letter-spacing:.12em; color:var(--text2); }
.tb-right{ margin-left:auto; display:flex; align-items:center; gap:14px; }
.viewers{ display:flex; align-items:center; gap:6px; color:var(--text3); font-size:12px; }
.avatar{
  width:34px; height:34px; border-radius:50%;
  background:linear-gradient(135deg,var(--violet),var(--blue));
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-t); font-size:11px; color:#fff; cursor:default;
}

/* ── MAIN ── */
.main{ flex:1; display:flex; overflow:hidden; }

/* ── VIDEO AREA ── */
.video-area{ flex:1; display:flex; flex-direction:column; overflow:hidden; position:relative; }

/* ── STAGE ── */
.stage{
  flex:1; position:relative; background:#000; overflow:hidden;
  display:block;
}
.stage.empty{ background:var(--bg2); }

/* ── WAITING SCREEN ── */
.nr-waiting-screen{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at center, rgba(14,18,40,1) 0%, rgba(2,3,10,1) 100%);
}
.nr-bg-vignette{
  position:absolute; inset:0;
  background:radial-gradient(ellipse at center, transparent 40%, rgba(2,3,10,.85) 100%);
  pointer-events:none;
}
.nr-hero-shell{ position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; gap:20px; padding:32px; }
.nr-status-box{
  display:flex; align-items:flex-start; gap:14px;
  background:rgba(255,255,255,.04); border:1px solid rgba(231,195,92,.18);
  border-radius:16px; padding:18px 22px; max-width:400px;
}
.nr-pulse-dot{ width:10px; height:10px; border-radius:50%; background:var(--green); box-shadow:0 0 10px var(--green); flex-shrink:0; margin-top:3px; animation:pulse 2s infinite; }
.nr-status-text strong{ display:block; font-family:var(--font-t); font-size:11px; letter-spacing:.12em; color:var(--gold); margin-bottom:6px; }
.nr-status-text p{ color:var(--text3); font-size:12px; line-height:1.6; }

/* ── VIDEO TILES ── */
.video-tile{
  background:#000; overflow:hidden;
  border:1px solid rgba(231,195,92,.15);
  border-radius:8px;
  box-shadow:0 0 20px rgba(0,0,0,.5);
}
.tile-label{
  position:absolute; bottom:8px; left:10px;
  background:rgba(0,0,0,.65); border-radius:6px; padding:3px 8px;
  font-size:11px; color:#fff; z-index:5;
  backdrop-filter:blur(4px);
}
.tile-screen-badge{
  position:absolute; top:10px; left:10px; z-index:10;
  background:rgba(142,54,255,.80); border-radius:6px; padding:3px 10px;
  font-family:var(--font-t); font-size:9px; letter-spacing:.12em; color:#fff;
}

/* ── PIP ── */
.pip-bubble{
  position:absolute; bottom:90px; right:16px;
  width:180px; height:180px;
  border-radius:50%; overflow:hidden;
  border:2px solid rgba(231,195,92,.60);
  box-shadow:0 0 18px rgba(0,0,0,.70), 0 0 28px rgba(142,54,255,.25);
  z-index:30; cursor:grab;
  display:flex; align-items:center; justify-content:center;
  transition:width .25s, height .25s;
}
.pip-bubble video{ width:100%; height:100%; object-fit:cover; }
.pip-controls{
  position:absolute; bottom:8px; left:50%; transform:translateX(-50%);
  display:flex; gap:4px;
}
.pip-size-btn{
  width:22px; height:22px; border-radius:50%;
  background:rgba(0,0,0,.55); border:1px solid rgba(255,255,255,.20);
  color:#fff; font-size:9px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.pip-size-btn.active{ border-color:var(--gold); color:var(--gold); }

/* ── TOOLBAR ── */
.toolbar{
  height:var(--toolbar-h); flex-shrink:0;
  background:linear-gradient(180deg,rgba(8,10,22,.97) 0%,rgba(2,3,10,.99) 100%);
  border-top:1px solid rgba(231,195,92,.18);
  display:flex; align-items:center; justify-content:center;
  gap:10px; padding:0 20px;
}
.btn{
  display:flex; align-items:center; gap:7px;
  padding:9px 18px; border-radius:12px;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  color:var(--text2); font-family:var(--font-b); font-size:12px; cursor:pointer;
  transition:background .15s, border-color .15s, color .15s;
}
.btn:hover{ background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.22); color:var(--text); }
.btn.active{ background:rgba(0,240,139,.14); border-color:rgba(0,240,139,.40); color:var(--green); }
.btn.gold{ background:rgba(231,195,92,.12); border-color:rgba(231,195,92,.35); color:var(--gold); }
.btn.gold:hover{ background:rgba(231,195,92,.20); border-color:rgba(231,195,92,.55); }
.btn.danger{ background:rgba(255,56,80,.10); border-color:rgba(255,56,80,.30); color:var(--red); }
.btn.danger:hover{ background:rgba(255,56,80,.20); border-color:rgba(255,56,80,.55); }

/* ── SIDEBAR ── */
.sidebar{
  width:260px; flex-shrink:0;
  background:var(--bg2); border-left:1px solid rgba(231,195,92,.14);
  display:flex; flex-direction:column; overflow:hidden;
}
.stabs{
  display:flex; border-bottom:1px solid rgba(231,195,92,.12);
  flex-shrink:0;
}
.stab{
  flex:1; padding:14px 8px; text-align:center;
  font-family:var(--font-t); font-size:9px; letter-spacing:.12em; color:var(--text3);
  cursor:pointer; transition:color .15s; border-bottom:2px solid transparent;
}
.stab.active{ color:var(--gold); border-bottom-color:var(--gold); }
.stab-badge{
  display:inline-block; margin-left:5px; padding:1px 5px;
  background:rgba(231,195,92,.20); border-radius:999px; font-size:9px; color:var(--gold);
}

/* ── PANEL PARTICIPANTES ── */
#panel-participants{ flex:1; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column; gap:10px; }
#panel-participants::-webkit-scrollbar{ width:3px; }
#panel-participants::-webkit-scrollbar-track{ background:transparent; }
#panel-participants::-webkit-scrollbar-thumb{ background:rgba(231,195,92,.20); border-radius:2px; }

.section-lbl{ font-family:var(--font-t); font-size:9px; letter-spacing:.14em; color:var(--text3); margin-top:4px; }

.participant{ display:flex; align-items:center; gap:10px; padding:8px 6px; border-radius:10px; }
.participant:hover{ background:rgba(255,255,255,.03); }
.p-av{
  width:32px; height:32px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-t); font-size:10px;
}
.p-name{ font-size:12px; color:var(--text); margin-bottom:3px; }
.p-role{ display:flex; gap:5px; }

.chip{ display:inline-block; padding:2px 7px; border-radius:6px; font-family:var(--font-t); font-size:8px; letter-spacing:.10em; }
.chip-admin{ background:rgba(231,195,92,.18); border:1px solid rgba(231,195,92,.35); color:var(--gold); }
.chip-start{ background:rgba(142,54,255,.15); border:1px solid rgba(142,54,255,.30); color:#b168ff; }

/* ── REUNION INFO CARD ── */
.reunion-info-card{
  background:var(--bg3); border:1px solid rgba(142,54,255,.30);
  border-radius:14px; padding:14px; display:flex; flex-direction:column; gap:8px;
}
.reunion-info-label{ font-family:var(--font-t); font-size:9px; letter-spacing:.14em; color:var(--text3); }
.reunion-info-link{
  font-size:10px; color:var(--gold2); word-break:break-all; line-height:1.5;
  background:rgba(231,195,92,.05); border-radius:8px; padding:6px 8px;
}
.reunion-copy-btn{
  padding:7px 12px; background:rgba(142,54,255,.18); border:1px solid rgba(142,54,255,.35);
  border-radius:9px; color:#b168ff; font-size:11px; cursor:pointer;
}
.reunion-copy-btn:hover{ background:rgba(142,54,255,.28); }

/* ── CHAT ── */
#panel-chat{ flex:1; display:flex; flex-direction:column; overflow:hidden; }
.chat-messages{ flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:8px; }
.chat-messages::-webkit-scrollbar{ width:3px; }
.chat-messages::-webkit-scrollbar-thumb{ background:rgba(231,195,92,.20); border-radius:2px; }
.chat-msg{ display:flex; flex-direction:column; gap:3px; }
.chat-sender{ font-family:var(--font-t); font-size:9px; letter-spacing:.10em; }
.chat-text{ font-size:12px; color:var(--text2); line-height:1.5; word-break:break-word; }
.chat-input-row{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; border-top:1px solid rgba(231,195,92,.10);
  flex-shrink:0;
}
.chat-input{
  flex:1; padding:9px 12px;
  background:var(--bg4); border:1px solid rgba(231,195,92,.18);
  border-radius:10px; color:var(--text); font-size:12px; font-family:var(--font-b);
  outline:none;
}
.chat-input:focus{ border-color:rgba(231,195,92,.42); }
.chat-send{
  width:32px; height:32px; border-radius:50%;
  background:rgba(231,195,92,.18); border:1px solid rgba(231,195,92,.35);
  color:var(--gold); display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:13px; flex-shrink:0;
}
.chat-send:hover{ background:rgba(231,195,92,.30); }

/* ── MOBILE ── */
@media (max-width: 600px) {
  .sidebar{ display:none; }
  .topbar{ padding:0 14px; gap:10px; }
  .sala-badge{ display:none; }
  .toolbar{ gap:6px; padding:0 10px; }
  .btn{ padding:8px 12px; font-size:11px; }
  .login-card, .lobby-card, .cliente-card{ padding:28px 20px; margin:16px; }
}

/* ── AJUSTES NEW RISE 2026-06: permisos, mobile safe-area y cierre ── */
.permission-box{
  width:100%; background:rgba(255,255,255,.035); border:1px solid rgba(231,195,92,.20);
  border-radius:14px; padding:13px 14px; display:flex; flex-direction:column; gap:10px;
}
.permission-title{ font-family:var(--font-t); font-size:9px; letter-spacing:.14em; color:var(--gold); }
.permission-option{ display:flex; gap:9px; align-items:flex-start; color:var(--text2); font-size:12px; line-height:1.35; cursor:pointer; }
.permission-option input{ accent-color:var(--gold); margin-top:2px; }
.remote-video-bubble{
  position:absolute; top:14px; right:14px; z-index:25;
  width:88px; height:88px; border-radius:50%; overflow:hidden;
  border:2px solid rgba(231,195,92,.78); box-shadow:0 0 16px rgba(0,0,0,.65), 0 0 20px rgba(231,195,92,.18);
  background:#000;
}
.bubble-label{
  position:absolute; left:50%; bottom:4px; transform:translateX(-50%);
  background:rgba(0,0,0,.55); color:#fff; border-radius:999px; padding:2px 7px; font-size:9px; white-space:nowrap;
}
.mini-admin-btn{
  margin-left:6px; padding:2px 7px; border-radius:6px;
  background:rgba(231,195,92,.12); border:1px solid rgba(231,195,92,.35);
  color:var(--gold); font-size:8px; font-family:var(--font-t); cursor:pointer;
}
.btn.disabled,.btn:disabled{ opacity:.42; cursor:not-allowed; filter:grayscale(.35); }
#screen-ended{
  position:fixed; inset:0; z-index:200; display:none; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at center, rgba(14,18,40,1) 0%, rgba(2,3,10,1) 100%);
  padding:28px; text-align:center;
}
.ended-card{
  max-width:430px; width:100%; padding:38px 28px; border-radius:24px;
  background:rgba(8,10,22,.88); border:1px solid rgba(231,195,92,.28);
  box-shadow:0 0 44px rgba(231,195,92,.13), inset 0 0 0 1px rgba(255,229,143,.05);
}
.ended-card img{ width:210px; max-width:70%; margin-bottom:22px; filter:drop-shadow(0 0 18px rgba(231,195,92,.35)); }
.ended-card h1{ font-family:var(--font-d); font-size:36px; letter-spacing:.05em; color:var(--gold); margin-bottom:10px; }
.ended-card p{ color:var(--text2); font-size:15px; line-height:1.7; }

@media (max-width: 600px) {
  html, body{ height:100dvh; overflow:hidden; }
  #screen-sala{ height:100dvh; max-height:100dvh; padding-bottom:env(safe-area-inset-bottom); }
  .main{ min-height:0; }
  .video-area{ min-height:0; }
  .toolbar{
    height:auto; min-height:calc(74px + env(safe-area-inset-bottom));
    padding:8px 8px calc(10px + env(safe-area-inset-bottom));
    gap:6px; overflow-x:auto; justify-content:flex-start;
    scroll-snap-type:x proximity;
  }
  .toolbar::-webkit-scrollbar{ display:none; }
  .btn{ min-width:128px; justify-content:center; flex-shrink:0; scroll-snap-align:center; }
  .btn.end-room{ min-width:142px; }
  .remote-video-bubble{ width:76px; height:76px; top:10px; right:10px; }
  .pip-bubble{ bottom:calc(92px + env(safe-area-inset-bottom)); width:120px!important; height:120px!important; }
}
