/* ============= SESIÓN EN VIVO (DIRECTOR / SEGUIDORES) ============= */

.live-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(52, 153, 128, .14);
    color: #4ade80;
    border: 1px solid rgba(52, 153, 128, .35);
    white-space: nowrap;
}
.live-btn:hover { background: rgba(52, 153, 128, .22); color: #86efac; }
.live-btn-active {
    background: rgba(52, 153, 128, .25);
    color: #86efac;
    border-color: rgba(52, 153, 128, .6);
}
.live-btn-label { font-size: .72rem; font-weight: 700; }

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
    animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ---------- Barra inferior ---------- */
#live-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(24, 24, 27, .97);
    border-top: 1px solid rgba(52, 153, 128, .4);
    border-bottom: 1px solid rgba(52, 153, 128, .15);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .4);
}
body.live-session-active .page.active { padding-bottom: 150px; }

.live-bar-info { flex: 1; min-width: 0; }
.live-bar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-bar-title > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.live-bar-sub {
    margin-top: 1px;
    font-size: .64rem;
    color: #a1a1aa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.live-bar-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.live-bar-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    border-radius: 8px;
    border: 1px solid rgba(63, 63, 70, .6);
    background: rgba(39, 39, 42, .85);
    color: #d4d4d8;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.live-bar-btn:active { transform: scale(.94); }
.live-bar-btn-danger { color: #f87171; border-color: rgba(248, 113, 113, .35); }
.live-bar-offline { font-size: .6rem; color: #fbbf24; white-space: nowrap; }

/* ---------- Modal ---------- */
.live-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.live-modal.active { display: flex; }
.live-modal-card {
    width: 100%;
    max-width: 400px;
    max-height: 86vh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(63, 63, 70, .55);
    background: #18181b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .6);
}
.live-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.live-modal-title { font-size: 1.08rem; font-weight: 700; color: #fff; }
.live-modal-sub { margin-top: 2px; font-size: .68rem; color: #71717a; }
.live-icon-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(63, 63, 70, .5);
    background: rgba(39, 39, 42, .7);
    color: #a1a1aa;
    font-size: .85rem;
    cursor: pointer;
}
.live-icon-btn:active { transform: scale(.94); }

.live-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: #27272a;
}
.live-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a1a1aa;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}
.live-tab.active { background: rgba(52, 153, 128, .2); color: #86efac; }

.live-help {
    margin: 0 0 14px;
    font-size: .78rem;
    line-height: 1.55;
    color: #a1a1aa;
}
.live-help strong { color: #d4d4d8; }

.live-status {
    margin-bottom: 12px;
    padding: 14px;
    text-align: center;
    border-radius: 12px;
    border: 1px solid rgba(52, 153, 128, .3);
    background: rgba(52, 153, 128, .08);
}
.live-status-role { font-size: .8rem; color: #d4d4d8; }
.live-code {
    margin: 6px 0 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: .12em;
    color: #86efac;
    word-break: break-all;
}
.live-status-sub { font-size: .68rem; color: #a1a1aa; }
.live-note {
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(63, 63, 70, .4);
    background: rgba(39, 39, 42, .4);
    font-size: .64rem;
    line-height: 1.45;
    color: #71717a;
}
.live-connected {
    margin-bottom: 14px;
    max-height: 150px;
    overflow-y: auto;
    border-top: 1px solid rgba(63, 63, 70, .35);
    border-bottom: 1px solid rgba(63, 63, 70, .35);
    padding: 6px 0;
}
.live-person {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 2px;
    font-size: .75rem;
    color: #d4d4d8;
}
.live-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-person-role { font-size: .6rem; color: #71717a; }
.live-empty { padding: 10px 0; text-align: center; font-size: .7rem; color: #71717a; }

/* Lista de sesiones activas (panel Unirme, sin códigos) */
.live-sessions-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.live-session-option {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 10px 12px; text-align: left;
    background: rgba(39, 39, 42, .6);
    border: 1px solid rgba(113, 113, 122, .35);
    border-radius: 10px;
    color: #d4d4d8; font-size: .8rem; font-family: inherit;
}
.live-session-option:hover:not([disabled]) { border-color: rgba(52, 153, 128, .55); background: rgba(52, 153, 128, .08); }
.live-session-option:disabled { cursor: default; color: #71717a; }
.live-session-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e4e4e7; }
.live-session-when { font-size: .62rem; color: #71717a; flex-shrink: 0; }
.live-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- CTA de sesión en vivo dentro del repertorio ---------- */
.rep-live-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    border: 1px solid rgba(52, 153, 128, .3);
    background: rgba(52, 153, 128, .07);
}
.rep-live-cta-active {
    border-color: rgba(52, 153, 128, .6);
    background: rgba(52, 153, 128, .14);
}
.rep-live-cta-icon {
    flex-shrink: 0;
    width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}
.rep-live-cta-copy { flex: 1; min-width: 0; }
.rep-live-cta-title {
    font-size: .82rem;
    font-weight: 700;
    color: #f4f4f5;
    line-height: 1.25;
}
.rep-live-cta-sub {
    font-size: .68rem;
    color: #a1a1aa;
    line-height: 1.4;
    margin-top: 1px;
}
.rep-live-cta .btn { flex-shrink: 0; }

@media (max-width: 480px) {
    .rep-live-cta { flex-wrap: wrap; }
    .rep-live-cta-copy { flex: 1 1 calc(100% - 36px); }
    .rep-live-cta .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .live-btn-label { display: none; }
    .live-btn { padding: 6px 8px; }
    .live-code { font-size: 1.5rem; }
    .live-bar-sub { font-size: .6rem; }
}
