/* kapi-livehost.css — KAPI_LH1
   Pantalla del anfitrión (celular). Todo cuelga de  html.kapi-native-app #streaming-stage.kapi-lh
   (la clase kapi-lh la pone kapi-livehost.js solo cuando eres anfitrión y NO hay batalla). */

#kapi-lh { display: none; }

html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #kapi-lh {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 650;
    pointer-events: none;
    color: #fff;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
#kapi-lh button { pointer-events: auto; font-family: inherit; }

/* sombra suave abajo para que se lea el chat (queda debajo del chat) */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active)::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
    background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
    z-index: 450; pointer-events: none;
}

/* ── se oculta lo viejo (sigue en el DOM, el JS interno lo usa) ── */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) .kapi-hud-top,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) .engagement-wrapper,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) .kapi-zoom-hint,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-sidebar .chat-header,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-sidebar #live-chat-input-area,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-sidebar .chat-welcome {
    display: none !important;
}
/* dock viejo: oculto; solo sale cuando tocas "..." */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) .broadcaster-controls-bar { display: none !important; }
html.kapi-native-app #streaming-stage.kapi-lh.kapi-lh-more:not(.kapi-battle-active) .broadcaster-controls-bar {
    display: flex !important;
    right: 12px !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px) !important;
    z-index: 700 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh.kapi-lh-more:not(.kapi-battle-active) #kapi-fan-menu {
    top: auto !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px) !important;
    right: 62px !important;
    z-index: 700 !important;
    flex-direction: column-reverse;
}
/* la encuesta baja debajo de las fichas */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #live-poll-display.kapi-poll-compact {
    top: calc(max(12px, env(safe-area-inset-top)) + 104px) !important;
    bottom: auto !important;
    left: 12px !important;
}

/* ── arriba ── */
#kapi-lh .lh-top {
    position: absolute; left: 12px; right: 12px;
    top: calc(max(12px, env(safe-area-inset-top)) + 2px);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
#kapi-lh .lh-left {
    display: flex; align-items: center; gap: 0; min-width: 0;
    background: rgba(0,0,0,.34); border-radius: 22px; padding: 0 0 0 0; height: 36px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#kapi-lh .lh-host { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 8px 0 0; }
#kapi-lh .lh-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #333; flex-shrink: 0; }
#kapi-lh .lh-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
#kapi-lh .lh-name {
    font-size: 13px; font-weight: 600; max-width: 76px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
#kapi-lh .lh-sub { display: flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,.85); }
#kapi-lh .lh-sub i { font-style: normal; }
#kapi-lh .lh-likes {
    display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px 0 8px; margin-right: 3px;
    background: #fff; border-radius: 16px; color: #0a9be0; font-weight: 700; font-size: 13px;
}
#kapi-lh .lh-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#kapi-lh .lh-viewers {
    display: flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px;
    background: rgba(0,0,0,.34); border-radius: 16px; font-size: 13px; font-weight: 600;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#kapi-lh .lh-power { width: 36px; height: 36px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }

/* ── fichas ── */
#kapi-lh .lh-chips {
    position: absolute; left: 12px; right: 12px;
    top: calc(max(12px, env(safe-area-inset-top)) + 48px);
    display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden;
}
#kapi-lh .lh-chip {
    display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; flex-shrink: 0;
    background: rgba(0,0,0,.34); border-radius: 12px; font-size: 11.5px; font-weight: 500; letter-spacing: -.1px; white-space: nowrap;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#kapi-lh .lh-chip-gal { gap: 14px; }
#kapi-lh .lh-chip-gal b { font-weight: 500; color: rgba(255,255,255,.9); }
#kapi-lh .lh-fire { flex-shrink: 0; }
#kapi-lh .lh-chips2 {
    position: absolute; right: 12px;
    top: calc(max(12px, env(safe-area-inset-top)) + 80px);
}
#kapi-lh .lh-chip-home { gap: 5px; padding: 0 9px; }
#kapi-lh .lh-dot { width: 5px; height: 5px; border-radius: 50%; background: #00e5ff; display: inline-block; }

/* ── barra de abajo ── */
#kapi-lh .lh-bar {
    position: absolute; left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between;
}
#kapi-lh .lh-bar-l, #kapi-lh .lh-bar-r { display: flex; align-items: center; gap: 8px; }
#kapi-lh .lh-b {
    width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(20,40,64,.74); display: flex; align-items: center; justify-content: center;
}
#kapi-lh .lh-b:active { transform: scale(.94); }

/* ── chat transparente, abajo a la izquierda ── */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-sidebar {
    z-index: 500 !important;
    height: auto !important;
    max-height: none !important;
    top: 0 !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; max-width: none !important; transform: none !important;
    background: transparent !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages {
    position: absolute !important;
    left: 0 !important; right: 0 !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 48px) !important;
    max-height: 44% !important;
    padding: 0 10px 0 12px !important;
    display: flex !important; flex-direction: column !important; gap: 7px !important;
    overflow-y: auto !important;
    background: transparent !important;
    mask-image: linear-gradient(to bottom, transparent, #000 14%);
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%);
    scrollbar-width: none;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages::-webkit-scrollbar { display: none; }
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages::before { content: ''; margin-top: auto; flex: 0 0 0; }

#pro-chat-messages .lh-sys { display: flex; align-items: flex-start; gap: 9px; pointer-events: none; }
#pro-chat-messages .lh-sys-ic {
    flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,191,255,.38); display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
}
#pro-chat-messages .lh-sys-tx {
    font-size: 12.5px; line-height: 1.3; font-weight: 500; color: rgba(255,255,255,.92);
    text-shadow: 0 1px 3px rgba(0,0,0,.65), 0 0 6px rgba(0,0,0,.4);
}

/* comentarios de la gente: mismo estilo limpio, letra un poco más grande */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message { padding: 0 !important; margin: 0 !important; }
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message-text { font-size: 12.5px !important; line-height: 1.3; font-weight: 500; }

/* ── botones flotantes de antes que se montaban encima ── */
/* candado (abrir/cerrar acceso): escondido; sale junto al dock cuando tocas "..." */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #kapi-fan-lock { display: none !important; }
html.kapi-native-app #streaming-stage.kapi-lh.kapi-lh-more:not(.kapi-battle-active) #kapi-fan-lock {
    display: flex !important; top: auto !important; right: 12px !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 112px) !important; z-index: 700 !important;
}
/* 🧪 prueba de capacidad (solo dueño): si no lo has arrastrado, va debajo de la ficha de la casita, a la derecha */
html.kapi-native-app body:has(#streaming-stage.kapi-lh:not(.kapi-battle-active)) #kpc-btn:not([style*="left"]) {
    top: calc(max(12px, env(safe-area-inset-top)) + 116px) !important; bottom: auto !important; right: 12px !important;
    width: 36px !important; height: 36px !important; font-size: 17px !important;
}

/* botón VS (texto con degradado) */
#kapi-lh .lh-vs-t {
    font-size: 12px; font-weight: 800; letter-spacing: .3px; line-height: 1;
    background: linear-gradient(135deg, #00e5ff, #2f7bff); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
}

/* KAPI_AVISOS1: avisos del live (se unió, regalo, like, siguió, nivel...): letra más chica que la bienvenida de Kapivarapp, una sola línea */
#pro-chat-messages .chat-message.system {
    padding: 0 !important; margin: 0 !important; background: transparent !important;
    border: 0 !important; box-shadow: none !important; text-align: left !important;
}
#pro-chat-messages .chat-message.system em {
    display: block; font-style: normal !important; font-size: 10.5px !important; line-height: 1.25 !important;
    font-weight: 500 !important; color: rgba(255,255,255,.72) !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.65), 0 0 6px rgba(0,0,0,.4);
}

/* KAPI_ANILLO1: anillo de energía alrededor de la foto y palabra de nivel junto al corazoncito blanco */
#kapi-lh .lh-avw { position: relative; width: 36px; height: 36px; flex-shrink: 0; display: block; }
#kapi-lh .lh-avw .lh-ring { position: absolute; left: 0; top: 0; width: 36px; height: 36px; transform: rotate(-90deg); pointer-events: none; }
#kapi-lh .lh-avw .lh-av { position: absolute; left: 3px; top: 3px; width: 30px; height: 30px; }
#kapi-lh .lh-ring-bg { fill: none; stroke: rgba(255,255,255,.2); stroke-width: 2.6; }
#kapi-lh .lh-ring-fill { fill: none; stroke: #ff3b5c; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 128.8; stroke-dashoffset: 128.8; transition: stroke-dashoffset .4s ease; }
#kapi-lh .lh-lvl { font-style: normal; font-weight: 600; color: #ff9a3c; margin-left: 5px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

/* KAPI_ENTRADA1: "X se unió al stream" = entrada destacada a media pantalla, más chica y en cursiva (solo en pantalla sola: sin cuadros ni batalla) */
html.kapi-native-app #streaming-stage:not(.kv-lay):not(.kapi-battle-active) #viewer-join-notification {
    left: 50% !important; right: auto !important; top: 50% !important; bottom: auto !important;
    transform: translate(-50%, calc(-50% + 14px)) !important;
    padding: 5px 13px 5px 6px !important; gap: 7px !important;
    font-size: 0.72rem !important; font-style: italic !important;
    max-width: 78% !important; width: max-content !important; z-index: 520 !important;
}
html.kapi-native-app #streaming-stage:not(.kv-lay):not(.kapi-battle-active) #viewer-join-notification.show {
    transform: translate(-50%, -50%) !important;
}
html.kapi-native-app #streaming-stage:not(.kv-lay):not(.kapi-battle-active) #viewer-join-notification .notif-avatar {
    width: 22px !important; height: 22px !important; font-size: 0.62rem !important; font-style: normal !important;
}

/* KAPI_IZQ1: la entrada ("se unió") y los comentarios anclados comparten una zona a la izquierda, pegada al borde, encima del chat */
html.kapi-native-app #streaming-stage:not(.kv-lay):not(.kapi-battle-active) #viewer-join-notification {
    left: 0 !important; right: auto !important; top: auto !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 48px + 150px) !important;
    transform: translateX(-14px) !important;
    border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
    max-width: 82% !important; z-index: 520 !important;
}
html.kapi-native-app #streaming-stage:not(.kv-lay):not(.kapi-battle-active) #viewer-join-notification.show {
    transform: translateX(0) !important;
}
#viewer-join-notification .notif-avatar { overflow: hidden; }
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #kv-com-top {
    position: absolute !important; left: 0 !important; right: auto !important; top: auto !important;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 48px + 150px + 46px) !important;
    width: 74% !important; max-width: 320px !important; padding: 0 !important; z-index: 510 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #kv-com-top .kv-top-item {
    border-top-left-radius: 0; border-bottom-left-radius: 0; font-size: 11.5px;
}
/* tubito de prueba de capacidad: ya no hace falta */
#kpc-btn { display: none !important; }

/* KAPI_CHAT2: chat del live compacto: foto pequeña y el nombre pegado al texto */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message {
    align-items: flex-start !important; gap: 7px !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message-avatar {
    width: 22px !important; height: 22px !important; min-width: 22px !important; font-size: 10px !important;
    margin: 1px 0 0 !important; cursor: pointer; flex: 0 0 22px !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message-content {
    display: flex !important; flex-direction: column !important; gap: 0 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message-header {
    margin: 0 !important; padding: 0 !important; min-height: 0 !important; line-height: 1.15 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-username {
    font-size: 11px !important; line-height: 1.15 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message-text {
    margin: 0 !important; padding: 0 !important; line-height: 1.2 !important;
}

/* KAPI_MENC1: nombres más chicos y aviso de mención en la zona izquierda */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-username,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-username.neon-username {
    font-size: 9.5px !important; line-height: 1.1 !important;
}
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-message.kapi-mencion {
    background: rgba(0, 160, 255, .22) !important; border-left: 3px solid #00bfff !important;
    border-radius: 8px !important; padding: 2px 6px 2px 5px !important;
}
#kapi-mencion-aviso {
    position: absolute; left: 0; z-index: 530; pointer-events: none;
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 48px + 104px);
    display: flex; align-items: center; gap: 7px; max-width: 82%;
    padding: 5px 13px 5px 6px; border-radius: 0 16px 16px 0;
    background: linear-gradient(135deg, rgba(0, 150, 255, .94), rgba(47, 123, 255, .94));
    color: #fff; font-size: .74rem; font-weight: 600;
    box-shadow: 0 0 12px rgba(0, 160, 255, .5);
    transform: translateX(-110%); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
#kapi-mencion-aviso.show { transform: translateX(0); opacity: 1; }
#kapi-mencion-aviso .kma-ic {
    width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .25);
    display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none;
}
#kapi-mencion-aviso .kma-tx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* KAPI_NOMBRE2: nombre del comentario más chico */
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-username,
html.kapi-native-app #streaming-stage.kapi-lh:not(.kapi-battle-active) #pro-chat-messages .chat-username.neon-username {
    font-size: 8px !important; line-height: 1.1 !important;
}
