/* ════════════════════════════════════════════════════════════════
   LA RED — Super Chat BBS
   Todos los estilos del panel de chat (extraído de style.css)
   Requiere las variables CSS de style.css (--green, --font, etc.)
   ════════════════════════════════════════════════════════════════ */

/* ══ Overlay backdrop ══════════════════════════════════════════════ */
#chat-overlay {
    position: fixed; inset: 0;
    background: rgba(2, 6, 2, .88);
    display: flex; align-items: center; justify-content: center;
    z-index: 750; backdrop-filter: blur(3px);
}

/* ══ Panel container ════════════════════════════════════════════════ */
#chat-panel {
    background: var(--bg-term); border: 1px solid var(--green);
    box-shadow: 0 0 40px var(--green-glow2);
    width: min(580px, 96vw); height: min(82vh, 660px);
    display: flex; flex-direction: column; overflow: hidden;
}

/* ══ Header ═════════════════════════════════════════════════════════ */
#cp-hdr {
    display: flex; align-items: center; gap: .7rem;
    padding: .6rem 1rem; border-bottom: 1px solid var(--green-dim);
    background: rgba(32, 194, 14, .06); flex-shrink: 0;
}
#cp-logo {
    font-family: var(--font-title); font-size: 1.2rem; color: var(--green-bright);
    letter-spacing: .1em; text-shadow: 0 0 8px var(--green-glow2);
}
#cp-online { font-size: .75rem; color: var(--amber); flex: 1; }
#cp-user {
    font-size: .75rem; color: var(--cyan);
    border-radius: 2px;
    padding: .1rem .25rem;
    transition: color .15s, background .15s;
}
#cp-user:not(:empty):hover { color: var(--green-bright); background: rgba(0,232,255,.07); }
#cp-close, #cp-logout {
    background: transparent; border: 1px solid transparent;
    font-size: 1.1rem; cursor: pointer; padding: .3rem .55rem; line-height: 1;
    flex-shrink: 0;
}
#cp-close  { color: rgba(32,194,14,.45); }
#cp-logout { color: rgba(32,194,14,.35); font-size: .9rem; }
#cp-close:hover  { color: var(--red);   border-color: rgba(255,50,50,.3); }
#cp-logout:hover { color: var(--amber); border-color: rgba(255,176,0,.3); }

/* ══ Tabs ════════════════════════════════════════════════════════════ */
#cp-tabs {
    display: flex; flex-shrink: 0;
    border-bottom: 1px solid var(--green-dim);
    background: rgba(0, 0, 0, .25);
}
.cp-tab {
    flex: 1; background: transparent; border: none;
    border-right: 1px solid rgba(32, 194, 14, .12);
    color: var(--green-dim); font-family: var(--font); font-size: .66rem;
    letter-spacing: .05em; cursor: pointer; padding: .36rem 0;
    transition: all .15s; position: relative;
}
.cp-tab:last-child { border-right: none; }
.cp-tab:hover { background: rgba(32, 194, 14, .06); color: var(--green); }
.cp-tab.active {
    color: var(--green-bright);
    background: rgba(32, 194, 14, .08);
}
.cp-tab.active::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 2px; background: var(--green);
}

/* ══ Radio bar ═══════════════════════════════════════════════════════ */
#cp-radio-bar {
    display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
    padding: .28rem .8rem; flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 176, 0, .2);
    background: rgba(255, 176, 0, .03);
}
#cp-radio-freq-label {
    font-size: .68rem; color: var(--amber); letter-spacing: .08em;
    margin-right: .2rem; flex-shrink: 0;
}
.cp-radio-btn {
    font-family: var(--font); font-size: .61rem; padding: .13rem .42rem;
    background: transparent; border: 1px solid rgba(255, 176, 0, .25);
    color: rgba(255, 176, 0, .55); cursor: pointer;
    letter-spacing: .04em; transition: all .12s;
}
.cp-radio-btn:hover { background: rgba(255, 176, 0, .1); color: var(--amber); border-color: rgba(255,176,0,.5); }
.cp-radio-btn.active { background: rgba(255, 176, 0, .15); color: var(--amber); border-color: var(--amber); }
.cp-radio-off { color: rgba(255, 100, 100, .45); border-color: rgba(255, 100, 100, .2); }
.cp-radio-off:hover { background: rgba(255, 50, 50, .08); color: var(--red); border-color: rgba(255,50,50,.4); }

/* ══ Auth wall ═══════════════════════════════════════════════════════ */
#cp-auth {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 1.4rem 1.8rem;
}
.cp-auth-inner { width: 100%; display: flex; flex-direction: column; }
.cp-auth-title {
    font-family: var(--font-title); font-size: 1.15rem; color: var(--green);
    margin-bottom: 1rem; letter-spacing: .1em;
}
.cp-auth-lbl {
    display: block; font-size: .68rem; color: var(--green-dim);
    letter-spacing: .08em; margin: .55rem 0 .2rem;
}
.cp-auth-input {
    width: 100%; background: rgba(32, 194, 14, .05);
    border: 1px solid var(--green-dim); color: var(--green);
    font-family: var(--font); font-size: .82rem; padding: .38rem .6rem; outline: none;
}
.cp-auth-input:focus { border-color: var(--green); }
#cp-auth-err { color: var(--red); font-size: .72rem; min-height: .9rem; margin: .4rem 0; }
#cp-auth-btn {
    width: 100%; margin-top: .5rem;
    font-family: var(--font-title); font-size: 1rem;
    background: transparent; border: 1px solid var(--green); color: var(--green);
    padding: .42rem; cursor: pointer; letter-spacing: .06em;
}
#cp-auth-btn:hover { background: rgba(32, 194, 14, .1); }
#cp-auth-skip {
    width: 100%; margin-top: .45rem; background: transparent; border: none;
    color: var(--green-dim); font-family: var(--font); font-size: .74rem;
    cursor: pointer; letter-spacing: .04em; padding: .3rem;
}
#cp-auth-skip:hover { color: var(--green); }

/* ══ Log de mensajes ════════════════════════════════════════════════ */
#cp-log {
    flex: 1; overflow-y: auto; padding: .6rem .9rem;
    display: flex; flex-direction: column; gap: .2rem;
    scroll-behavior: smooth;
}
#cp-log::-webkit-scrollbar       { width: 5px; }
#cp-log::-webkit-scrollbar-track { background: var(--dim); }
#cp-log::-webkit-scrollbar-thumb { background: #336633; border-radius: 2px; }

/* ══ Cuerpo flex: log + panel de hilo lado a lado ════════════════════ */
#cp-body-row {
    display: flex;
    flex: 1;
    min-height: 0;      /* necesario en flex-column padre */
    overflow: hidden;
}
#cp-body-row.hidden { display: none; }

/* ══ Filtro de tabs (ocultar mensajes) ═══════════════════════════════ */
.cp-msg-hidden { display: none !important; }

/* ══ Mensajes base ═══════════════════════════════════════════════════ */
.cp-msg { font-size: .8rem; line-height: 1.5; word-break: break-word; animation: fadein .18s ease; }
.cp-ts  { color: #2a5a2a; font-size: .7rem; margin-right: .35rem; }

/* Avatar */
.cp-avatar    {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; color: var(--green-dim);
    margin-right: .25rem; flex-shrink: 0; vertical-align: middle;
    transition: color .15s;
}
.cp-avatar-me { color: var(--green); filter: drop-shadow(0 0 4px var(--green-glow2)); }
.cp-user      { color: var(--cyan); margin-right: .3rem; }
.cp-user-me   { color: var(--gold); }
.cp-text      { color: #c8e8c8; }

/* ══ Canales ════════════════════════════════════════════════════════ */

/* Room */
.cp-msg-room .cp-text { color: #aaddbb; }
.cp-ch-room { font-size: .68rem; color: var(--teal); margin-right: .3rem; opacity: .85; letter-spacing: .02em; }

/* Ghost */
.cp-msg-ghost { opacity: .78; }
.cp-msg-ghost .cp-avatar { color: rgba(160, 80, 255, .6); }
.cp-msg-ghost .cp-user   { color: rgba(180, 100, 255, .75); }
.cp-msg-ghost .cp-text   { color: rgba(180, 150, 255, .7); font-style: italic; }
.cp-ch-ghost { font-size: .68rem; color: rgba(180, 100, 255, .7); margin-right: .3rem; letter-spacing: .02em; }

/* Whisper */
.cp-msg-whisper { background: rgba(255, 176, 0, .04); border-left: 2px solid rgba(255, 176, 0, .3); padding-left: .4rem; }
.cp-msg-whisper .cp-text { color: var(--amber); }
.cp-ch-whisper { font-size: .68rem; color: var(--amber); margin-right: .3rem; letter-spacing: .02em; }

/* NPC */
.cp-msg-npc { border-left: 2px solid rgba(255, 50, 50, .3); padding-left: .4rem; }
.cp-npc-name {
    color: var(--red); font-size: .75rem; letter-spacing: .06em;
    text-shadow: 0 0 4px rgba(255, 50, 50, .4); margin-right: .35rem;
}
.cp-msg-npc .cp-text { color: rgba(255, 160, 160, .8); }

/* Glitch (NPC corruptos) */
.cp-glitch {
    color: rgba(255, 80, 80, .7);
    animation: cp-glitch-anim .15s steps(1) infinite;
}
@keyframes cp-glitch-anim {
    0%  { text-shadow:  1px 0 0 rgba(255,0,0,.5), -1px 0 0 rgba(0,255,255,.5); }
    33% { text-shadow: -1px 0 0 rgba(255,0,0,.5),  1px 0 0 rgba(0,255,255,.5); filter: hue-rotate(10deg); }
    66% { text-shadow:  2px 0 0 rgba(255,0,0,.3),  0   0 0 rgba(0,255,255,.3); }
   100% { text-shadow:  0   0 0 transparent; }
}

/* Logros */
.cp-msg-logro .cp-text { color: var(--gold); }
.cp-msg-logro::before  { content: '🏆 '; }
.cp-logro-badge {
    font-size: .65rem; color: #886622; margin: 0 .3rem;
    background: rgba(255, 215, 0, .08); padding: .05rem .3rem;
}

/* Suscripción NODO */
.cp-nodo-badge {
    font-size: .62rem;
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, .4);
    padding: .02rem .28rem;
    margin: 0 .25rem 0 .1rem;
    border-radius: 2px;
    letter-spacing: .04em;
    vertical-align: middle;
}
.cp-nodo-badge.cp-nodo-founder {
    color: #e8b4ff;
    border-color: rgba(232, 180, 255, .55);
    background: rgba(192, 132, 252, .08);
    font-weight: bold;
}

/* Radio */
.cp-msg-radio { border-left: 2px solid rgba(255, 176, 0, .2); padding-left: .4rem; }
.cp-msg-radio .cp-text { color: rgba(255, 200, 100, .85); }
.cp-ch-radio { font-size: .68rem; color: var(--amber); margin-right: .3rem; letter-spacing: .02em; }

/* System */
.cp-msg-system { color: #336633; font-size: .72rem; font-style: italic; }

/* Cmd response */
.cp-cmd-response {
    background: rgba(0, 0, 0, .2);
    border-left: 2px solid rgba(32, 194, 14, .2);
    padding: .3rem .5rem .3rem .8rem; margin: .2rem 0;
    font-size: .73rem; color: var(--green-dim);
}
.cp-cmd-response div { line-height: 1.5; }

/* Ghost history block */
.cp-ghost-block {
    border-left: 2px solid rgba(180, 100, 255, .2);
    margin: .5rem 0 .2rem; padding: .3rem .6rem .3rem .8rem;
    background: rgba(60, 0, 80, .08);
}
.cp-ghost-block-hdr {
    font-size: .66rem; color: rgba(180, 100, 255, .5);
    letter-spacing: .08em; margin-bottom: .2rem;
}

/* Separador */
.cp-sep {
    text-align: center; color: #224422; font-size: .68rem;
    border-top: 1px solid #1a3a1a; padding: .35rem 0 .1rem; margin: .2rem 0;
}

/* ══ Botón "ver anteriores" ════════════════════════════════════════ */
.cp-load-more {
    text-align: center; font-size: .7rem; letter-spacing: .06em;
    color: var(--green-dim); cursor: pointer;
    padding: .42rem 0; margin-bottom: .15rem;
    border-bottom: 1px solid #182818;
    transition: color .15s, background .15s;
    user-select: none;
}
.cp-load-more:hover { color: var(--green); background: rgba(32,194,14,.04); }

/* ══ Reputación ═════════════════════════════════════════════════════ */
.cp-rep {
    font-size: .58rem; padding: .02rem .28rem;
    border-radius: 2px; margin: 0 .2rem;
    letter-spacing: .04em; opacity: .85; vertical-align: middle;
}
/* Tiers actuales */
.cp-rep-errante    { color: var(--dim);              border: 1px solid rgba(42,82,42,.4); }
.cp-rep-explorador { color: var(--cyan);             border: 1px solid rgba(0,232,255,.3); }
.cp-rep-operador   { color: var(--gold);             border: 1px solid rgba(255,215,0,.4);  font-weight:bold; }
.cp-rep-infiltrado { color: #29d9c2;                 border: 1px solid rgba(41,217,194,.35); font-style:italic; }
.cp-rep-espectro   { color: #b468ff;                 border: 1px solid rgba(180,100,255,.35); }
.cp-rep-marcado    { color: #c0392b;                 border: 1px solid rgba(192,57,43,.45);  animation:cp-marcado-pulse 4s ease-in-out infinite; }
.cp-rep-sujeto     { color: var(--amber);            border: 1px solid rgba(255,176,0,.4); }
.cp-rep-traidor    { color: var(--red);              border: 1px solid rgba(255,51,51,.4);  animation:cp-traidor-pulse 3s ease-in-out infinite; }
@keyframes cp-traidor-pulse {
    0%,100% { opacity:.75; }
    50%     { opacity:1; box-shadow:0 0 6px rgba(255,51,51,.3); }
}
@keyframes cp-marcado-pulse {
    0%,100% { opacity:.8; }
    50%     { opacity:1; text-shadow:0 0 5px rgba(192,57,43,.5); }
}
/* Aliases legacy (datos anteriores al cambio de tiers) */
.cp-rep-sobreviviente { color: var(--gold);   border: 1px solid rgba(255,215,0,.4); }
.cp-rep-fantasma      { color: #b468ff;       border: 1px solid rgba(180,100,255,.35); }

/* Social MMO tiers (nuevo sistema de reputación) */
.cp-tier-desconocido   { color: #5a8a5a;       border: 1px solid rgba(42,82,42,.35); }
.cp-tier-observado     { color: #2a8a2a;       border: 1px solid rgba(42,138,42,.35); }
.cp-tier-contactado    { color: var(--green);  border: 1px solid rgba(32,194,14,.35); }
.cp-tier-sobreviviente { color: #90cc60;       border: 1px solid rgba(144,204,96,.4); }
.cp-tier-operador      { color: var(--bright); border: 1px solid rgba(57,255,20,.4); font-weight:bold; }
.cp-tier-espectro      { color: #aaaaaa;       border: 1px solid rgba(170,170,170,.35); }

/* ══ Evento global ([TRANSMISIÓN] ARG) ═════════════════════════════ */
.cp-event-banner {
    border-top:    1px solid rgba(255,176,0,.25);
    border-bottom: 1px solid rgba(255,176,0,.25);
    background:    rgba(255,176,0,.04);
    padding: .35rem .6rem;
    margin: .45rem 0;
    display: flex; gap: .5rem; align-items: baseline;
}
.cp-event-text {
    color: var(--amber);
    font-size: .8rem;
    letter-spacing: .06em;
    text-shadow: 0 0 8px rgba(255,176,0,.3);
    flex: 1;
}

/* ══ Canal tag (input row) ══════════════════════════════════════════ */
#cp-channel-tag {
    font-size: .62rem; padding: .08rem .32rem;
    flex-shrink: 0; letter-spacing: .04em; cursor: default;
    transition: color .15s, border-color .15s;
}
.cp-ch-global  { color: var(--green-dim);        border: 1px solid rgba(32, 194, 14, .2); }
.cp-ch-room    { color: var(--teal);             border: 1px solid rgba(0, 255, 170, .3); }
.cp-ch-ghost   { color: rgba(180, 100, 255, .7); border: 1px solid rgba(180, 100, 255, .3); }
.cp-ch-whisper { color: var(--amber);            border: 1px solid rgba(255, 176, 0, .3); }
.cp-ch-radio   { color: var(--amber);            border: 1px solid rgba(255, 176, 0, .4); }

/* ══ Notif bar ══════════════════════════════════════════════════════ */
#cp-notif-bar {
    display: flex; align-items: center; gap: .5rem;
    padding: .45rem .9rem; border-top: 1px solid var(--green-dim);
    background: rgba(0, 232, 255, .04); font-size: .75rem; flex-shrink: 0;
    color: var(--cyan);
}
#cp-notif-bar button {
    background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
    font-family: var(--font); font-size: .72rem; padding: .2rem .6rem; cursor: pointer;
}
#cp-notif-bar button:hover { background: rgba(0, 232, 255, .1); }
#cp-notif-bar span { flex: 1; }

/* ══ Input row ══════════════════════════════════════════════════════ */
#cp-input-row {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .9rem; border-top: 1px solid #1a3a1a;
    background: rgba(0, 0, 0, .3); flex-shrink: 0;
}
.cp-prompt { color: var(--green); font-size: 1rem; flex-shrink: 0; }
#cp-input  {
    flex: 1; background: none; border: none; border-bottom: 1px solid rgba(32,194,14,.3);
    color: var(--green); caret-color: var(--green-bright);
    font-family: var(--font); font-size: .82rem; outline: none; padding: .2rem 0;
}
#cp-input::placeholder { color: rgba(32,194,14,.28); }
#cp-input:focus { border-color: var(--green); }
#cp-send {
    font-size: 1.1rem; background: rgba(32,194,14,.07);
    border: 1px solid rgba(32,194,14,.35); color: var(--green);
    padding: .2rem .7rem; cursor: pointer; flex-shrink: 0;
    transition: background .12s, border-color .12s;
}
#cp-send:hover { background: rgba(32, 194, 14, .15); border-color: var(--green); }

/* ══ Status line ════════════════════════════════════════════════════ */
#cp-status {
    padding: .2rem .9rem; font-size: .67rem;
    color: #1e3e1e; border-top: 1px solid #0d1e0d; flex-shrink: 0;
}

/* ══ DM request inline ══════════════════════════════════════════════ */
.cp-dm-request {
    background: rgba(0, 232, 255, .04);
    border-left: 2px solid rgba(0, 232, 255, .3);
    padding: .4rem .7rem; margin: .25rem 0;
    font-size: .77rem; color: var(--cyan);
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
    animation: fadein .2s ease;
}
.cp-dm-req-from  { color: var(--green-bright); font-size: .8rem; font-weight: normal; }
.cp-dm-accept-btn, .cp-dm-reject-btn {
    font-family: var(--font); font-size: .68rem; cursor: pointer;
    padding: .13rem .45rem; border: 1px solid; background: transparent;
    transition: all .12s;
}
.cp-dm-accept-btn { color: var(--green);    border-color: rgba(32, 194, 14, .35); }
.cp-dm-accept-btn:hover { background: rgba(32, 194, 14, .1); }
.cp-dm-reject-btn { color: var(--green-dim); border-color: rgba(32, 194, 14, .15); }
.cp-dm-reject-btn:hover { color: var(--red); border-color: rgba(255,50,50,.3); }

/* ══ Live Event bar ═════════════════════════════════════════════════ */
#cp-event-bar {
    display: flex; align-items: center; gap: .55rem;
    padding: .28rem .9rem; flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 176, 0, .3);
    background: rgba(255, 176, 0, .06);
    font-size: .7rem; animation: cp-event-bar-in .3s ease;
}
@keyframes cp-event-bar-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
#cp-event-name {
    color: var(--amber); letter-spacing: .06em; flex: 1;
    text-shadow: 0 0 8px rgba(255,176,0,.3);
}
#cp-event-countdown {
    color: rgba(255,176,0,.7); font-size: .68rem; letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}
#cp-event-dismiss {
    background: transparent; border: none; color: rgba(255,176,0,.4);
    cursor: pointer; font-size: .9rem; padding: 0 .2rem; line-height: 1;
    transition: color .12s;
}
#cp-event-dismiss:hover { color: var(--amber); }

/* ══ DM session bar ══════════════════════════════════════════════════ */
#cp-dm-bar {
    display: flex; align-items: center; gap: .5rem;
    padding: .26rem .9rem; flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 232, 255, .18);
    background: rgba(0, 232, 255, .03);
    font-size: .7rem;
}
#cp-dm-with    { color: rgba(0, 232, 255, .45); letter-spacing: .04em; }
#cp-dm-partner { color: var(--cyan); font-size: .74rem; flex: 1; letter-spacing: .04em; }
#cp-dm-exit    {
    background: transparent; border: 1px solid rgba(0, 232, 255, .2);
    color: rgba(0, 232, 255, .45); font-family: var(--font);
    font-size: .63rem; cursor: pointer; padding: .08rem .32rem; transition: all .12s;
}
#cp-dm-exit:hover { color: var(--red); border-color: rgba(255,50,50,.3); }

/* ══ Username click ══════════════════════════════════════════════════ */
.cp-user[data-user] { cursor: pointer; }
.cp-user[data-user]:hover {
    text-decoration: underline; text-decoration-style: dotted;
    text-underline-offset: 2px;
}

/* ══ NPC name click ══════════════════════════════════════════════════ */
.cp-npc-name[data-npc] { cursor: pointer; }
.cp-npc-name[data-npc]:hover {
    text-decoration: underline; text-decoration-style: dotted;
    text-underline-offset: 2px;
    color: rgba(255, 80, 80, .95);
}

/* ══ User context menu ════════════════════════════════════════════════ */
#cp-user-menu {
    z-index: 950; background: var(--bg-term);
    border: 1px solid var(--green-dim);
    box-shadow: 0 4px 20px rgba(0,0,0,.7);
    min-width: 158px;
}
#cp-user-menu button {
    display: block; width: 100%;
    background: transparent; border: none;
    border-bottom: 1px solid rgba(32, 194, 14, .08);
    color: var(--green-dim); font-family: var(--font); font-size: .76rem;
    padding: .44rem .8rem; cursor: pointer; text-align: left;
    letter-spacing: .03em; transition: all .12s;
}
#cp-user-menu button:last-child { border-bottom: none; }
#cp-user-menu button:hover { background: rgba(32, 194, 14, .09); color: var(--green); }

/* ══ Game toast (notificación BBS flotante) ════════════════════════ */
#chat-toast {
    position: fixed; bottom: 3.6rem; right: 1rem;
    background: rgba(2, 8, 2, .93);
    border: 1px solid var(--green-dim);
    box-shadow: 0 0 14px var(--green-glow2);
    padding: .4rem .75rem; max-width: 260px;
    font-size: .72rem; cursor: pointer; z-index: 400;
    animation: toast-in .22s ease;
    pointer-events: auto;
}
#toast-user { color: var(--cyan); font-size: .69rem; }
#toast-text { color: #c8e8c8; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══ Mobile ═════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* Panel ocupa toda la pantalla */
    #chat-panel { width: 100vw; height: 100dvh; border: none; }

    /* Header: botón cerrar siempre visible y grande */
    #cp-hdr   { padding: .55rem .7rem; gap: .4rem; }
    #cp-logo  { font-size: 15px; }
    #cp-online, #cp-user { font-size: 13px; }
    #cp-close {
        font-size: 1.3rem;
        color: rgba(32,194,14,.7);
        padding: .4rem .65rem;
        min-height: 44px; min-width: 44px;
        display: flex; align-items: center; justify-content: center;
    }
    #cp-logout {
        font-size: 1.1rem;
        color: rgba(32,194,14,.6);
        padding: .4rem .5rem;
        min-height: 44px; min-width: 40px;
        display: flex; align-items: center; justify-content: center;
    }

    /* Tabs: legibles en pantalla pequeña */
    .cp-tab  { font-size: 12px; padding: 0; }

    /* Radio */
    #cp-radio-bar { padding: .25rem .5rem; gap: .2rem; }
    .cp-radio-btn { font-size: 11px; padding: .12rem .32rem; }

    /* Mensajes: tamaño cómodo para lectura */
    #cp-log { padding: .5rem .65rem; gap: .3rem; }
    .cp-msg { font-size: 15px; line-height: 1.65; }
    .cp-ts  { font-size: 12px; }
    .cp-user, .cp-npc-name { font-size: 14px; }
    .cp-text { font-size: 15px; }
    .cp-ch-room, .cp-ch-ghost, .cp-ch-whisper,
    .cp-ch-radio, .cp-ch-global { font-size: 12px; }

    /* Input row: cursor y botón visibles */
    #cp-input-row { padding: .6rem .7rem; gap: .5rem; }
    #cp-input {
        font-size: 16px !important;           /* evita zoom iOS */
        border-bottom: 1px solid rgba(32,194,14,.45);
        padding: .3rem 0;
    }
    #cp-send {
        font-size: 1.2rem; padding: .35rem .8rem;
        min-height: 44px; min-width: 52px;
        background: rgba(32,194,14,.12);
        border-color: rgba(32,194,14,.5);
    }

    /* Auth form */
    #cp-auth { padding: 1.2rem 1rem; }
    .cp-auth-title { font-size: 16px; }
    .cp-auth-input { font-size: 16px !important; }
    #cp-auth-btn   { font-size: 15px; min-height: 48px; }
    #cp-auth-skip  { font-size: 14px; min-height: 40px; }

    /* Separadores y respuestas */
    .cp-sep          { font-size: 12px; }
    .cp-cmd-response { font-size: 14px; }
    .cp-load-more    { font-size: 13px; padding: .5rem 0; }
}

/* ══ Touch targets (móvil táctil) ═══════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
    #cp-auth-btn, #cp-auth-skip { min-height: 48px; }
    .cp-tab  { min-height: 42px; }
    .cp-dm-accept-btn, .cp-dm-reject-btn { min-height: 36px; padding: .2rem .6rem; }
    #cp-send   { min-height: 44px; min-width: 52px; }
    #cp-close  { min-height: 44px; min-width: 44px; }
    #cp-logout { min-height: 44px; min-width: 40px; }
}

/* ══ Accesibilidad — Movimiento reducido ════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .cp-msg, .cp-npc-msg { animation: none; }
    *, *::before, *::after {
        animation-duration:        0.01ms !important;
        animation-iteration-count: 1      !important;
        transition-duration:       0.01ms !important;
    }
}

/* ══ Social MMO Layer ═══════════════════════════════════════════════ */

/* Mensajes de facción */
.cp-msg-faction { color: #39ff14; opacity: .92; }
.cp-ch-faction  {
    color: #39ff14; font-size: .65rem; margin-right: .25rem;
    text-shadow: 0 0 6px rgba(57,255,20,.5);
}

/* Título obtenido */
.cp-msg-title {
    border-left: 2px solid #ffb000;
    padding-left: .5rem;
    margin: .2rem 0;
    display: flex; flex-direction: column; gap: .1rem;
}
.cp-title-badge {
    font-size: .6rem; color: #ffb000; letter-spacing: .1em;
}
.cp-title-name {
    font-size: .85rem; color: #ffd700;
    text-shadow: 0 0 8px rgba(255,215,0,.4);
}
.cp-title-desc { font-size: .65rem; color: #2a522a; }

/* HUD social (pequeño indicador) */
#cp-social-hud {
    font-size: .6rem; color: #2a522a;
    letter-spacing: .08em;
    padding: .2rem .5rem;
    margin: 0 0 .3rem;
    border-bottom: 1px solid #0d200d;
    transition: color .3s;
}
#cp-social-hud.cp-rep-flash { color: #39ff14; }

/* ⟐ MOROCOTA — indicador de balance en HUD */
#cp-mrc-indicator {
    font-size: .58rem;
    color: rgba(255, 176, 0, .55);
    letter-spacing: .04em;
    padding: .15rem .5rem;
    cursor: pointer;
    transition: color .2s;
    border-bottom: 1px solid #0d200d;
    user-select: none;
}
#cp-mrc-indicator:hover { color: #ffb000; }
@keyframes _mrc-credit { 0%,100%{color:rgba(255,176,0,.55)} 40%{color:#20c20e;text-shadow:0 0 8px rgba(32,194,14,.6)} }
@keyframes _mrc-debit  { 0%,100%{color:rgba(255,176,0,.55)} 40%{color:#ff6b35;} }
#cp-mrc-indicator.mrc-credit-pulse { animation: _mrc-credit .5s ease; }
#cp-mrc-indicator.mrc-debit-pulse  { animation: _mrc-debit  .5s ease; }

/* Modal de invitación de facción */
.cp-faction-overlay {
    position: fixed; inset: 0; z-index: 9900;
    background: rgba(1,8,1,.92);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Share Tech Mono','Courier New',monospace;
    animation: cp-fi .25s ease;
    backdrop-filter: blur(3px);
}
@keyframes cp-fi { from { opacity:0; } to { opacity:1; } }

.cp-faction-box {
    width: min(480px, 92vw);
    border: 1px solid #39ff14;
    background: rgba(2,6,2,.97);
    padding: 1.4rem 1.6rem;
    display: flex; flex-direction: column; gap: .55rem;
    position: relative;
}
.cp-faction-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(to right, transparent, currentColor, transparent);
    animation: cp-scan 2.4s linear infinite;
}
@keyframes cp-scan { 0%{top:0;opacity:.8} 100%{top:100%;opacity:0} }

.cp-faction-npc   { font-size: .65rem; color: #2a522a; letter-spacing: .12em; }
.cp-faction-glyph { font-size: 2rem; text-align: center; line-height: 1; }
.cp-faction-name  { font-size: 1rem; color: #39ff14; text-align: center; letter-spacing: .1em; }
.cp-faction-lore  { font-size: .72rem; color: #20c20e; font-style: italic; }
.cp-faction-invite{ font-size: .75rem; color: #aaaaaa; white-space: pre-wrap; }
.cp-faction-freq  { font-size: .65rem; color: #00e8ff; }
.cp-faction-actions { display: flex; gap: .5rem; margin-top: .5rem; justify-content: flex-end; }
.cp-faction-btn {
    font-family: inherit; font-size: .72rem;
    background: transparent; border: 1px solid #0c420c;
    color: #20c20e; padding: .3rem .8rem; cursor: pointer;
    letter-spacing: .05em; transition: border-color .14s, color .14s;
}
.cp-faction-accept { color: #39ff14; border-color: rgba(57,255,20,.4); }
.cp-faction-accept:hover { background: rgba(57,255,20,.07); }
.cp-faction-reject:hover { color: #ff5555; border-color: rgba(255,85,85,.4); }

/* Mensajes de célula */
.cp-msg-cell { color: #00e8ff; opacity: .92; }
.cp-ch-cell  {
    color: #00e8ff; font-size: .65rem; margin-right: .25rem;
    text-shadow: 0 0 6px rgba(0,232,255,.5);
}

/* Footer de navegación del panel */
#cp-footer-nav {
    display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap;
    padding: .3rem .5rem;
    border-top: 1px solid #0d200d;
    font-size: .62rem;
}
#cp-footer-nav a {
    color: #1a4a1a;
    text-decoration: none;
    letter-spacing: .06em;
    transition: color .14s;
}
#cp-footer-nav a:hover { color: var(--green, #20c20e); }


/* ════════════════════════════════════════════════════════════════
   LA RED v2.0 — Sprint 2: Señales y Mensajes Anclados
   ════════════════════════════════════════════════════════════════ */

/* ── Barra de señales (per-message reaction bar) ─────────────── */
.cp-signal-bar {
    display: none;           /* visible solo en hover del mensaje */
    gap: .2rem;
    margin-top: .25rem;
    flex-wrap: wrap;
    align-items: center;
}
.cp-msg:hover .cp-signal-bar,
.cp-msg:focus-within .cp-signal-bar {
    display: flex;
}

.cp-signal-btn {
    background: transparent;
    border: 1px solid #1a3a1a;
    color: #3a7a3a;
    font-family: var(--font, 'Share Tech Mono', monospace);
    font-size: .75rem;
    padding: .05rem .28rem;
    cursor: pointer;
    border-radius: 2px;
    transition: border-color .15s, color .15s, background .15s;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    min-width: 1.4rem;
    justify-content: center;
}
.cp-signal-btn:hover {
    border-color: #20c20e;
    color: #a8e8a0;
    background: rgba(32,194,14,.06);
}
.cp-signal-btn.cp-signal-active {
    border-color: #20c20e;
    color: #20c20e;
    background: rgba(32,194,14,.12);
}
.cp-signal-btn.cp-signal-dead-only {
    opacity: .25;
    cursor: not-allowed;
}
.cp-signal-btn.cp-signal-dead-only:hover {
    border-color: #1a3a1a;
    color: #3a7a3a;
    background: transparent;
}
.cp-sig-count {
    font-size: .65rem;
    color: inherit;
    opacity: .8;
}

/* ── Barra de mensajes anclados ──────────────────────────────── */
#cp-pinned-bar {
    background: rgba(32, 194, 14, .04);
    border-bottom: 1px solid #0d200d;
    padding: .3rem .7rem;
    flex-shrink: 0;
    max-height: 90px;
    overflow-y: auto;
}
#cp-pinned-bar.hidden { display: none; }

.cp-pin-entry {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    padding: .1rem 0;
    cursor: pointer;
    font-size: .68rem;
    border-bottom: 1px solid #0a150a;
    transition: background .12s;
}
.cp-pin-entry:last-child { border-bottom: none; }
.cp-pin-entry:hover { background: rgba(32,194,14,.05); }

.cp-pin-icon {
    color: #20c20e;
    flex-shrink: 0;
    font-size: .75rem;
}
.cp-pin-user {
    color: #608060;
    flex-shrink: 0;
    font-weight: bold;
}
.cp-pin-text {
    color: #a0c0a0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.cp-pin-ann {
    color: #2a6a2a;
    font-style: italic;
    flex-shrink: 0;
    font-size: .63rem;
}

/* ── Highlight de mensaje al hacer click en pin ──────────────── */
.cp-msg-highlighted {
    outline: 1px solid #20c20e;
    background: rgba(32, 194, 14, .07);
    transition: background .4s, outline .4s;
}

/* ════════════════════════════════════════════════════════════════
   LA RED v2.0 — Sprint 5: Subtransmisiones
   ════════════════════════════════════════════════════════════════ */

/* ── Botón de hilo en la signal bar ─────────────────────────── */
.cp-thread-btn {
    background: none;
    border: 1px solid #0d200d;
    color: #2a5a2a;
    font-family: inherit;
    font-size: .62rem;
    padding: .1rem .35rem;
    cursor: pointer;
    margin-left: .4rem;
    transition: color .15s, border-color .15s;
}
.cp-thread-btn:hover            { color: #20c20e; border-color: #20c20e; }
.cp-thread-btn.cp-thread-active { color: #39ff14; border-color: #1a4a1a; }
.cp-thread-btn.cp-thread-corrupted { color: #ff4444; border-color: #4a1a1a; animation: cp-glitch-flicker .4s infinite; }

/* ── Panel lateral ───────────────────────────────────────────── */
#cp-thread-panel {
    width: 260px;
    min-width: 200px;
    max-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #040c04;
    border-left: 1px solid #0d200d;
    overflow: hidden;
    font-size: .7rem;
    color: #20c20e;
}
#cp-thread-panel.hidden { display: none; }

/* ── Encabezado del thread ───────────────────────────────────── */
.cp-thr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .4rem .6rem;
    border-bottom: 1px solid #0d200d;
    background: rgba(32,194,14,.04);
    flex-shrink: 0;
}

.cp-thr-label {
    font-size: .62rem;
    letter-spacing: .1em;
    color: #2a7a2a;
}
.cp-thr-corrupted { color: #ff4444 !important; animation: cp-glitch-flicker .5s infinite; }

.cp-thr-close {
    background: none; border: none;
    color: #2a4a2a; font-size: .75rem;
    cursor: pointer; padding: 0 .2rem;
}
.cp-thr-close:hover { color: #20c20e; }

/* ── Mensaje origen (cita) ───────────────────────────────────── */
.cp-thr-origin {
    padding: .35rem .6rem;
    border-bottom: 1px solid #0d200d;
    border-left: 2px solid #1a4a1a;
    background: rgba(0,0,0,.3);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.cp-thr-origin-user {
    font-size: .58rem;
    color: #2a7a2a;
    letter-spacing: .06em;
}

.cp-thr-origin-text {
    font-size: .63rem;
    color: #406040;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── Log de mensajes ─────────────────────────────────────────── */
.cp-thr-log {
    flex: 1;
    overflow-y: auto;
    padding: .4rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    scrollbar-width: thin;
    scrollbar-color: #1a3a1a #040c04;
}

.cp-thr-msg {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.cp-thr-user {
    font-size: .58rem;
    color: #2a6a2a;
    letter-spacing: .05em;
}

.cp-thr-text {
    font-size: .66rem;
    color: #a0d0a0;
    line-height: 1.35;
    word-break: break-word;
}

.cp-thr-msg-corrupted .cp-thr-text {
    color: #ff4444;
    animation: cp-glitch-flicker .6s infinite;
}

.cp-thr-system {
    font-size: .58rem;
    color: #1a4a1a;
    text-align: center;
    letter-spacing: .08em;
    padding: .1rem 0;
}

/* ── Input de respuesta ──────────────────────────────────────── */
.cp-thr-input-row {
    display: flex;
    border-top: 1px solid #0d200d;
    flex-shrink: 0;
}

.cp-thr-input {
    flex: 1;
    background: #040c04;
    border: none;
    color: #20c20e;
    font-family: inherit;
    font-size: .67rem;
    padding: .35rem .5rem;
    outline: none;
}
.cp-thr-input::placeholder { color: #1a3a1a; }

.cp-thr-send {
    background: none;
    border: none;
    border-left: 1px solid #0d200d;
    color: #2a6a2a;
    font-size: .7rem;
    padding: .3rem .5rem;
    cursor: pointer;
}
.cp-thr-send:hover { color: #20c20e; }

/* Mobile: panel ocupa pantalla completa */
@media (max-width: 600px) {
    #cp-thread-panel {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: 100%;
        z-index: 500;
        border-left: none;
    }
}

/* ════════════════════════════════════════════════════════════════
   LA RED v2.0 — Sprint 4: Perfiles + Contactos
   ════════════════════════════════════════════════════════════════ */

/* ── Overlay (scrim) ─────────────────────────────────────────── */
#cp-profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

/* ── Panel principal ─────────────────────────────────────────── */
.cp-profile-panel {
    background: #050f05;
    border: 1px solid #20c20e;
    box-shadow: 0 0 24px rgba(32, 194, 14, .18), inset 0 0 60px rgba(0,0,0,.5);
    font-family: inherit;
    font-size: .72rem;
    color: #20c20e;
    width: min(420px, 96vw);
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a3a1a #050f05;
}

/* ── Encabezado ──────────────────────────────────────────────── */
.cp-prf-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem .4rem;
    border-bottom: 1px solid #0d200d;
    background: rgba(32, 194, 14, .05);
    position: sticky;
    top: 0;
    z-index: 1;
}

.cp-prf-tier {
    font-size: .6rem;
    letter-spacing: .1em;
    flex-shrink: 0;
}

.cp-prf-online-dot {
    font-size: .75rem;
    flex-shrink: 0;
}
.cp-prf-online  { color: #39ff14; }
.cp-prf-offline { color: #2a4a2a; }

.cp-prf-username {
    flex: 1;
    font-size: .85rem;
    letter-spacing: .06em;
    color: #a0d0a0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-prf-close {
    background: none;
    border: none;
    color: #2a5a2a;
    font-size: .8rem;
    cursor: pointer;
    padding: 0 .2rem;
    flex-shrink: 0;
    line-height: 1;
}
.cp-prf-close:hover { color: #20c20e; }

/* ── Flags especiales ────────────────────────────────────────── */
.cp-prf-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    padding: .3rem .8rem;
    border-bottom: 1px solid #0d200d;
}

.cp-prf-flag {
    font-size: .6rem;
    letter-spacing: .08em;
    padding: .1rem .35rem;
    border: 1px solid currentColor;
}
.cp-prf-cursed { color: #ff4444; border-color: #ff4444; }
.cp-prf-marked { color: #ff8c00; border-color: #ff8c00; }

/* ── Secciones ───────────────────────────────────────────────── */
.cp-prf-section {
    padding: .5rem .8rem;
    border-bottom: 1px solid #0d200d;
}
.cp-prf-section:last-child { border-bottom: none; }

.cp-prf-sec-label {
    font-size: .6rem;
    letter-spacing: .12em;
    color: #2a5a2a;
    text-transform: uppercase;
    margin-bottom: .3rem;
}

.cp-prf-row {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .08rem 0;
}

.cp-prf-label {
    color: #2a6a2a;
    font-size: .65rem;
    letter-spacing: .06em;
    flex-shrink: 0;
}

.cp-prf-val {
    color: #a0d0a0;
    font-size: .68rem;
    text-align: right;
}

.cp-prf-sub {
    color: #2a6a2a;
    font-style: normal;
    font-size: .6rem;
}

/* ── Títulos ─────────────────────────────────────────────────── */
.cp-prf-title {
    font-size: .65rem;
    color: #2a6a2a;
    padding: .07rem 0;
}
.cp-prf-title-equipped {
    color: #20c20e;
    font-weight: bold;
}

/* ── Memorias del servidor ───────────────────────────────────── */
.cp-prf-memory {
    display: flex;
    gap: .4rem;
    align-items: baseline;
    padding: .07rem 0;
}

.cp-prf-mem-cat {
    font-size: .58rem;
    color: #2a5a2a;
    flex-shrink: 0;
    letter-spacing: .06em;
}

.cp-prf-mem-text {
    font-size: .63rem;
    color: #608060;
    line-height: 1.3;
}

/* ── Acciones de contacto ────────────────────────────────────── */
.cp-prf-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.cp-prf-btn {
    background: none;
    border: 1px solid #20c20e;
    color: #20c20e;
    font-family: inherit;
    font-size: .65rem;
    letter-spacing: .08em;
    padding: .25rem .6rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: background .15s, color .15s;
}
.cp-prf-btn:hover {
    background: rgba(32, 194, 14, .12);
}
.cp-prf-btn:disabled {
    opacity: .4;
    cursor: default;
}

.cp-prf-btn-accept {
    border-color: #39ff14;
    color: #39ff14;
}
.cp-prf-btn-accept:hover {
    background: rgba(57, 255, 20, .12);
}

.cp-prf-contact-status {
    font-size: .63rem;
    color: #2a8a2a;
    letter-spacing: .06em;
}

/* ════════════════════════════════════════════════════════════════
   LA RED v2.0 — Sprint 3: Frecuencias y No-Leídos
   ════════════════════════════════════════════════════════════════ */

#cp-freq-panel {
    padding: .35rem .6rem;
    border-bottom: 1px solid #0d200d;
    background: rgba(0,0,0,.18);
}

.cp-freq-header {
    font-size: .6rem;
    letter-spacing: .12em;
    color: #2a5a2a;
    text-transform: uppercase;
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.cp-freq-total-badge {
    background: #20c20e;
    color: #000;
    font-size: .55rem;
    font-weight: bold;
    padding: 0 .3rem;
    border-radius: 2px;
    min-width: 1.1rem;
    text-align: center;
}

.cp-freq-entry {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .1rem .2rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: border-color .15s, background .15s;
}

.cp-freq-entry:hover {
    background: rgba(32,194,14,.06);
    border-left-color: var(--freq-color, #20c20e);
}

.cp-freq-entry.cp-freq-active {
    border-left-color: var(--freq-color, #20c20e);
    background: rgba(32,194,14,.1);
}

.cp-freq-glyph {
    font-size: .68rem;
    color: var(--freq-color, #20c20e);
    flex-shrink: 0;
    min-width: 2rem;
}

.cp-freq-name {
    font-size: .65rem;
    color: #608060;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-freq-active .cp-freq-name {
    color: #a0d0a0;
}

.cp-freq-badge {
    background: var(--freq-color, #20c20e);
    color: #000;
    font-size: .55rem;
    font-weight: bold;
    padding: 0 .3rem;
    border-radius: 2px;
    min-width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    animation: cp-badge-pulse .6s ease-in-out;
}

@keyframes cp-badge-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ════════════════════════════════════════════════════════════════
   LA RED v2.0 — Sprint 1: Presencia, Feed de Actividad y Alertas
   ════════════════════════════════════════════════════════════════ */

/* ── Alertas estilo terminal ──────────────────────────────────── */
.cp-alerts-container {
    position: fixed;
    bottom: 1.2rem;
    right: 1.2rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    pointer-events: none;
    max-width: min(280px, 90vw);
}

.cp-terminal-alert {
    background: rgba(2, 10, 2, .92);
    border: 1px solid #20c20e;
    color: #a8f0a0;
    font-family: var(--font, 'Share Tech Mono', monospace);
    font-size: .72rem;
    padding: .35rem .6rem;
    letter-spacing: .04em;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(32, 194, 14, .2);
    word-break: break-word;
}

.cp-terminal-alert.cp-alert-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Variantes por tier */
.cp-terminal-alert.cp-alert-tier-espectro   { border-color: #aaa; color: #ccc; }
.cp-terminal-alert.cp-alert-tier-operador   { border-color: #39ff14; color: #39ff14; }
.cp-terminal-alert.cp-alert-tier-sobreviviente { border-color: #00cfff; color: #7de7ff; }
.cp-terminal-alert.cp-alert-tier-infectado  { border-color: #ff4444; color: #ff8888; }

/* Alertas clicables (con acción asociada) */
.cp-terminal-alert.cp-alert-actionable {
    cursor: pointer;
}
.cp-terminal-alert.cp-alert-actionable:hover {
    background: rgba(32, 194, 14, .08);
    border-color: #39ff14;
}

/* ── Panel de presencia (sidebar opcional) ────────────────────── */
#cp-presence-panel {
    padding: .4rem .6rem;
    overflow-y: auto;
    max-height: 200px;
    border-top: 1px solid #0a1a0a;
    font-size: .68rem;
}

.cp-presence-empty,
.cp-activity-empty {
    color: #2a4a2a;
    font-style: italic;
    padding: .2rem 0;
}

.cp-presence-entry {
    display: flex;
    align-items: center;
    gap: .3rem;
    padding: .12rem 0;
    white-space: nowrap;
    overflow: hidden;
}

.cp-presence-icon {
    font-size: .8rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.cp-presence-name {
    color: #a0d0a0;
    flex-shrink: 0;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-presence-room {
    color: #2a6a2a;
    font-size: .62rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Panel de actividad de LA RED (tab RED) ───────────────────── */
#cp-activity-panel {
    flex: 1;
    overflow-y: auto;
    font-size: .67rem;
    display: flex;
    flex-direction: column;
}

.cp-activity-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    font-size: .64rem;
    color: var(--dim, #2a522a);
    letter-spacing: .1em;
    border-bottom: 1px solid #0a1a0a;
    background: rgba(0,0,0,.25);
    flex-shrink: 0;
}
.cp-activity-header-glyph {
    color: var(--amber, #ffb000);
    font-size: .9rem;
}
.cp-activity-count {
    margin-left: auto;
    color: #1a3a1a;
    font-size: .6rem;
}

.cp-activity-list {
    overflow-y: auto;
    flex: 1;
    padding: .2rem 0;
}

.cp-activity-empty {
    color: #1a3a1a;
    font-style: italic;
    padding: 1rem .7rem;
    font-size: .64rem;
}

.cp-activity-entry {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    padding: .18rem .7rem;
    border-bottom: 1px solid rgba(0,0,0,.25);
    line-height: 1.3;
    transition: background .08s;
}
.cp-activity-entry:hover { background: rgba(57,255,20,.025); }

.cp-ae-icon  { flex-shrink: 0; width: 1em; text-align: center; font-size: .75rem; }
.cp-ae-ts    { flex-shrink: 0; color: #1a3a1a; font-size: .58rem; min-width: 2.8rem; }
.cp-ae-text  { color: #4a7a4a; line-height: 1.35; word-break: break-word; }

/* Colores por tipo */
.cp-ae-connect    .cp-ae-icon { color: var(--green, #20c20e); }
.cp-ae-connect    .cp-ae-text { color: #3a6a3a; }
.cp-ae-disconnect .cp-ae-icon { color: #2a522a; }
.cp-ae-disconnect .cp-ae-text { color: #254025; }
.cp-ae-title      .cp-ae-icon { color: var(--amber, #ffb000); }
.cp-ae-title      .cp-ae-text { color: #7a6040; }
.cp-ae-special    .cp-ae-icon { color: var(--cyan, #00e8ff); }
.cp-ae-special    .cp-ae-text { color: #2a5060; }
.cp-ae-broadcast  .cp-ae-icon { color: var(--amber, #ffb000); }
.cp-ae-broadcast  .cp-ae-text { color: #608060; }

/* Dot de notificación en el tab */
.cp-tab-dot {
    font-size: .5rem;
    color: var(--amber, #ffb000);
    margin-left: .2rem;
    vertical-align: super;
    animation: cp-dot-blink 1.2s step-end infinite;
}
@keyframes cp-dot-blink { 0%,100%{opacity:1} 50%{opacity:0} }
