﻿/* ═══════════════════════════════════════════════════════════════
   escenas.css — Escenas de Rol (Redesign v2)
   ═══════════════════════════════════════════════════════════════ */

/* ─── 1. Variables ─── */
:root {
    --esc-bg: #060e1a;
    --esc-surface: rgba(9, 18, 33, 0.85);
    --esc-surface-strong: rgba(10, 20, 38, 0.96);
    --esc-surface-hover: rgba(18, 33, 56, 0.65);
    --esc-glass: rgba(12, 24, 44, 0.55);
    --esc-glass-border: rgba(148, 163, 184, 0.12);
    --esc-border: rgba(148, 163, 184, 0.14);
    --esc-border-strong: rgba(125, 211, 252, 0.22);
    --esc-text: #eaf2ff;
    --esc-text-secondary: #8da4c2;
    --esc-text-muted: rgba(141, 164, 194, 0.6);
    --esc-primary: #38bdf8;
    --esc-primary-glow: rgba(56, 189, 248, 0.25);
    --esc-accent: #f59e0b;
    --esc-me: #c084fc;
    --esc-do: #60a5fa;
    --esc-ooc: #64748b;
    --esc-narrador: #fbbf24;
    --esc-join: #10b981;
    --esc-leave: #ef4444;
    --esc-shadow: 0 32px 80px rgba(2, 6, 18, 0.5);
    --esc-shadow-lg: 0 48px 120px rgba(2, 6, 18, 0.6);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Orbitron', 'Inter', sans-serif;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 2. Scoped Reset (avoids breaking main.css / portal-unified) ─── */
.escenas-app *, .escenas-app *::before, .escenas-app *::after,
.esc-modal-overlay *, .esc-modal-overlay *::before, .esc-modal-overlay *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

body.esc-page {
    position: relative;
    background: var(--esc-bg);
    color: var(--esc-text);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ─── 3. Topbar ─── */
.esc-topbar {
    position: relative;
    z-index: 30;
    width: 100%;
    border-bottom: 1px solid rgba(148,163,184,0.2);
    box-shadow: 0 16px 34px rgba(2,6,23,0.26);
    padding-inline: 1rem;
    background: linear-gradient(180deg, rgba(8,13,25,0.92) 0%, rgba(8,13,25,0.5) 100%);
    backdrop-filter: blur(14px);
    flex-shrink: 0;
}
.esc-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 62px;
    width: min(1280px, 100% - 2rem);
    margin-inline: auto;
}
.esc-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 0.88rem;
    flex-shrink: 0;
    padding: 0.3rem 0;
}
.esc-brand img {
    width: auto;
    height: 34px;
    object-fit: contain;
}
.esc-brand span {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
}

/* Nav pills */
.esc-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.25);
    background: rgba(11,19,36,0.68);
}
.esc-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #cbd5e1;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.esc-nav-item:hover {
    color: #f1f5f9;
    background: rgba(56,189,248,0.08);
}
.esc-nav-item.is-active {
    background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(14,165,233,0.12));
    color: #fff;
    box-shadow: 0 2px 12px rgba(56,189,248,0.15);
}
.esc-nav-item i {
    font-size: 1.05rem;
}
.esc-nav-item span {
    white-space: nowrap;
}

/* Top actions */
.esc-top-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.esc-connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    color: #6ee7b7;
    transition: all 0.2s ease;
}
.esc-connection-pill i { font-size: 0.9rem; }
.esc-connection-pill.reconnecting {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.2);
    color: #fbbf24;
    animation: blink 1.2s ease-in-out infinite;
}
.esc-connection-pill.disconnected {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
    color: #fca5a5;
}
.esc-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(15,23,42,0.4);
}
.esc-user-pill img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.esc-user-pill span {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.esc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.18);
    background: rgba(255,255,255,0.03);
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.05rem;
}
.esc-action-btn:hover {
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.06);
}

/* ─── 3. Ambient Background ─── */
.esc-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.esc-ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.esc-orb-1 {
    width: 500px; height: 500px;
    top: -15%; left: -8%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
    animation-delay: 0s;
}

.esc-orb-2 {
    width: 400px; height: 400px;
    top: 10%; right: -5%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25), transparent 70%);
    animation-delay: -7s;
    animation-duration: 25s;
}

.esc-orb-3 {
    width: 350px; height: 350px;
    bottom: -10%; left: 30%;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.2), transparent 70%);
    animation-delay: -14s;
    animation-duration: 30s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 15px) scale(0.95); }
    75% { transform: translate(15px, 25px) scale(1.02); }
}

.esc-ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.3), transparent 80%);
}

/* ─── 4. App Container ─── */
.escenas-app {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    grid-template-rows: 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: rgba(5, 12, 23, 0.4);
    backdrop-filter: blur(2px);
}

/* Overlay lives outside .escenas-app now; keep fixed */
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
}

.mobile-sidebar-overlay.show {
    display: block;
    animation: modalOverlayIn 0.2s ease;
}

/* ─── 5. Sidebar ─── */
.escenas-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(11, 22, 40, 0.95), rgba(6, 13, 24, 0.98));
    border-right: 1px solid var(--esc-border);
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--esc-border);
    display: grid;
    gap: 0.75rem;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(15, 25, 44, 0.6), transparent);
}

.sidebar-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--esc-text);
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.06));
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--esc-primary);
    font-size: 1.15rem;
    position: relative;
    overflow: hidden;
}

.sidebar-brand-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    animation: iconShimmer 3s ease-in-out infinite;
}

@keyframes iconShimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.sidebar-brand h2 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-brand p {
    margin-top: 0.15rem;
    color: var(--esc-text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.sidebar-back-btn,
.sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--esc-text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
    cursor: pointer;
}

.sidebar-back-btn:hover,
.sidebar-close-btn:hover {
    color: var(--esc-text);
    border-color: var(--esc-border-strong);
    background: rgba(56, 189, 248, 0.08);
    transform: translateX(-2px);
}

/* ─── 6. User card ─── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--esc-border);
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    transition: var(--transition);
}

.sidebar-user:hover {
    border-color: rgba(56, 189, 248, 0.15);
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.sidebar-user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.sidebar-user-avatar-wrap img {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(56, 189, 248, 0.2);
}

.sidebar-online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--esc-join);
    border: 2px solid rgba(6, 13, 24, 0.95);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    color: var(--esc-text-secondary);
    font-size: 0.7rem;
}

/* ─── 7. Connection badge ─── */
.sidebar-connection-badge {
    width: 32px; height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-connection-badge.connected {
    color: var(--esc-join);
    background: rgba(16, 185, 129, 0.1);
}

.sidebar-connection-badge.reconnecting {
    color: var(--esc-accent);
    background: rgba(245, 158, 11, 0.1);
    animation: blink 1.2s ease-in-out infinite;
}

.sidebar-connection-badge.disconnected {
    color: var(--esc-leave);
    background: rgba(239, 68, 68, 0.1);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── 8. Search ─── */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--esc-border);
    background: rgba(2, 6, 23, 0.4);
    transition: var(--transition);
}

.sidebar-search:focus-within {
    border-color: var(--esc-border-strong);
    background: rgba(2, 6, 23, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.06);
}

.sidebar-search i {
    color: var(--esc-text-muted);
    font-size: 0.95rem;
    transition: var(--transition);
}

.sidebar-search:focus-within i {
    color: var(--esc-primary);
}

.sidebar-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--esc-text);
    font-family: inherit;
    font-size: 0.8rem;
}

.sidebar-search input::placeholder {
    color: var(--esc-text-muted);
}

.search-kbd {
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--esc-text-muted);
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ─── 9. Sidebar Body & Sections ─── */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0;
}

.sidebar-section {
    margin-bottom: 0.25rem;
}

.sidebar-section-title {
    padding: 0.7rem 1rem 0.45rem;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--esc-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sidebar-section-title i {
    font-size: 0.85rem;
    opacity: 0.7;
}

.sidebar-section-title span:first-of-type {
    flex: 1;
}

.section-count {
    min-width: 20px;
    height: 18px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--esc-primary);
    font-size: 0.6rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-escenas-list {
    padding: 0 0.65rem 0.4rem;
}

/* ─── 10. Scene Cards ─── */
.escena-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
    padding: 0.8rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: var(--esc-text);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.escena-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), transparent 60%);
    transition: opacity var(--transition);
}

.escena-card:hover {
    border-color: var(--esc-border);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(3px);
}

.escena-card:hover::before {
    opacity: 1;
}

.escena-card.active {
    border-color: rgba(56, 189, 248, 0.25);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(56, 189, 248, 0.02));
    box-shadow: inset 3px 0 0 var(--esc-primary);
}

.escena-card.active::before {
    opacity: 1;
}

.escena-card-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.escena-card:hover .escena-card-icon {
    transform: scale(1.05);
}

.escena-card-info {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.escena-card-info h4 {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.escena-card-info p {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--esc-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.escena-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.escena-badge-tipo {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.escena-badge-tipo.publico {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.escena-badge-tipo.dinamico {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.escena-participantes {
    font-size: 0.68rem;
    color: var(--esc-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sidebar-empty-note {
    padding: 0.75rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(148, 163, 184, 0.14);
    color: var(--esc-text-muted);
    background: rgba(255, 255, 255, 0.015);
    font-size: 0.73rem;
    line-height: 1.5;
    text-align: center;
}

/* ─── 11. Skeletons ─── */
.skeleton-list { display: grid; gap: 0.4rem; }

.escena-skeleton {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.skel-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    flex-shrink: 0;
    animation: skelPulse 1.5s ease-in-out infinite;
}

.skel-lines {
    flex: 1;
    display: grid;
    gap: 0.35rem;
}

.skel-line {
    height: 10px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.08);
    animation: skelPulse 1.5s ease-in-out infinite;
    animation-delay: 0.15s;
}

.skel-line.w70 { width: 70%; }
.skel-line.w60 { width: 60%; }
.skel-line.w50 { width: 50%; }
.skel-line.w40 { width: 40%; }
.skel-line.w30 { width: 30%; }

@keyframes skelPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ─── 12. Sidebar Footer & Create Button ─── */
.sidebar-footer {
    padding: 0.65rem;
    border-top: 1px solid var(--esc-border);
    flex-shrink: 0;
    background: linear-gradient(0deg, rgba(6, 13, 24, 0.8), transparent);
}

.sidebar-create-btn {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(56, 189, 248, 0.3);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.04));
    color: #b8e4ff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.sidebar-create-btn:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.08));
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.12);
}

.sidebar-create-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    transition: left 0.5s ease;
}

.sidebar-create-btn:hover::before {
    left: 100%;
}

/* ─── 13. Main Area ─── */
.escenas-main {
    min-width: 0;
    height: 100%;
    background:
        radial-gradient(ellipse at top right, rgba(56, 189, 248, 0.06), transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(192, 132, 252, 0.04), transparent 50%),
        linear-gradient(180deg, rgba(8, 16, 29, 0.85), rgba(5, 10, 19, 0.95));
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ─── 14. Empty State ─── */
.escenas-empty {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

.empty-content {
    text-align: center;
    max-width: 580px;
}

.empty-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px; height: 88px;
    margin: 0 auto 1.5rem;
}

.empty-icon {
    width: 68px; height: 68px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(192, 132, 252, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--esc-primary);
    position: relative;
    z-index: 2;
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.empty-icon-ring {
    position: absolute;
    inset: -4px;
    border-radius: 26px;
    border: 1px solid rgba(56, 189, 248, 0.15);
    animation: ringPulse 3s ease-in-out infinite;
}

.empty-icon-ring.ring-2 {
    inset: -12px;
    border-radius: 30px;
    border-color: rgba(56, 189, 248, 0.08);
    animation-delay: -1.5s;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.06); opacity: 0.3; }
}

.empty-content h3 {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--esc-text), var(--esc-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-content > p {
    margin-top: 0.65rem;
    color: var(--esc-text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

/* Guide cards */
.empty-guide {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    margin-top: 1.5rem;
}

.guide-card {
    padding: 1rem 0.8rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--esc-border);
    background: linear-gradient(180deg, rgba(15, 28, 48, 0.7), rgba(8, 16, 30, 0.7));
    text-align: center;
    transition: var(--transition);
}

.guide-card:hover {
    border-color: var(--esc-border-strong);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(2, 6, 18, 0.3);
}

.guide-num {
    width: 32px; height: 32px;
    margin: 0 auto 0.55rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--esc-primary), #0ea5e9);
    color: var(--esc-bg);
    font-size: 0.78rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px var(--esc-primary-glow);
}

.guide-card strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.guide-card span {
    font-size: 0.7rem;
    color: var(--esc-text-secondary);
    line-height: 1.45;
}

/* Command tags */
.empty-commands {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.cmd-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: var(--transition);
}

.cmd-tag strong {
    font-weight: 800;
    font-size: 0.72rem;
}

.cmd-tag.me {
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.2);
    color: #deb6ff;
}

.cmd-tag.do {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.2);
    color: #b0d4ff;
}

.cmd-tag.ooc {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(148, 163, 184, 0.18);
    color: #c8d5e3;
}

/* ─── 15. Chat Header ─── */
#chat-view { min-height: 0; }

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--esc-border);
    background: rgba(8, 16, 29, 0.9);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.chat-header-icon {
    width: 44px; height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    border: 1px solid;
    flex-shrink: 0;
    color: var(--esc-primary);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
    transition: var(--transition);
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-info h3 {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-desc {
    display: block;
    color: var(--esc-text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.chat-meta-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.chat-meta-row span {
    font-size: 0.65rem;
    color: var(--esc-text-muted);
}

.meta-dot {
    font-size: 0.5rem !important;
}

.chat-header-actions {
    display: flex;
    gap: 0.4rem;
}

.chat-header-btn,
.mobile-toggle-btn {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--esc-text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-header-btn:hover,
.mobile-toggle-btn:hover {
    color: var(--esc-text);
    border-color: var(--esc-border-strong);
    background: rgba(56, 189, 248, 0.08);
}

.chat-header-btn.leave-btn:hover {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.chat-header-btn.sound-on {
    color: var(--esc-primary);
    border-color: rgba(56, 189, 248, 0.2);
    background: rgba(56, 189, 248, 0.08);
}

/* ─── 16. Participants Bar ─── */
.chat-participants-bar {
    padding: 0.65rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(255, 255, 255, 0.015);
    flex-shrink: 0;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem 0.25rem 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    transition: var(--transition);
}

.participant-chip:hover {
    border-color: var(--esc-border-strong);
    background: rgba(56, 189, 248, 0.06);
}

.participant-chip img {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-chip span {
    font-size: 0.68rem;
    font-weight: 700;
}

/* ─── 17. Messages Area ─── */
.chat-messages-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.chat-msg {
    display: flex;
    gap: 0.7rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.07);
    background: rgba(9, 18, 34, 0.6);
    animation: msgIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    transition: background var(--transition);
}

.chat-msg:hover {
    background: rgba(15, 26, 44, 0.7);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg-avatar { flex-shrink: 0; }

.chat-msg-avatar img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.12);
    transition: var(--transition);
}

.chat-msg:hover .chat-msg-avatar img {
    border-color: rgba(148, 163, 184, 0.22);
}

.chat-msg-content {
    flex: 1;
    min-width: 0;
}

.chat-msg-header {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.chat-msg-name {
    font-size: 0.8rem;
    font-weight: 800;
}

.chat-msg-type {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
}

.chat-msg-time {
    font-size: 0.63rem;
    color: var(--esc-text-muted);
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition);
}

.chat-msg:hover .chat-msg-time {
    opacity: 1;
}

.chat-msg-text {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #d4e5ff;
    word-break: break-word;
}

/* ─── 18. Message Types ─── */
.chat-msg.tipo-me {
    border-left-color: var(--esc-me);
    background: linear-gradient(135deg, rgba(58, 30, 78, 0.2), rgba(17, 21, 40, 0.65));
}
.chat-msg.tipo-me .chat-msg-name { color: #deb6ff; }
.chat-msg.tipo-me .chat-msg-type { background: rgba(192, 132, 252, 0.14); color: var(--esc-me); }
.chat-msg.tipo-me .chat-msg-text { color: #e4d0ff; font-style: italic; }

.chat-msg.tipo-do {
    border-left-color: var(--esc-do);
    background: linear-gradient(135deg, rgba(24, 47, 79, 0.22), rgba(14, 23, 40, 0.7));
}
.chat-msg.tipo-do .chat-msg-name { color: #9bd0ff; }
.chat-msg.tipo-do .chat-msg-type { background: rgba(96, 165, 250, 0.14); color: var(--esc-do); }
.chat-msg.tipo-do .chat-msg-text { color: #c3dfff; font-style: italic; }

.chat-msg.tipo-ooc {
    border-left-color: var(--esc-ooc);
    background: linear-gradient(135deg, rgba(36, 45, 58, 0.28), rgba(14, 19, 29, 0.7));
}
.chat-msg.tipo-ooc .chat-msg-name { color: #cbd5e1; }
.chat-msg.tipo-ooc .chat-msg-type { background: rgba(100, 116, 139, 0.16); color: #cbd5e1; }
.chat-msg.tipo-ooc .chat-msg-text { color: #b0bdd0; }

.chat-msg.tipo-narrador {
    border-left-color: var(--esc-narrador);
    background: linear-gradient(135deg, rgba(92, 63, 16, 0.22), rgba(23, 18, 8, 0.75));
}
.chat-msg.tipo-narrador .chat-msg-name { color: #fde68a; }
.chat-msg.tipo-narrador .chat-msg-type { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.chat-msg.tipo-narrador .chat-msg-text { color: #fff0ae; font-weight: 600; }

/* ─── 19. System Messages ─── */
.chat-system-msg {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 0.68rem;
    color: var(--esc-text-muted);
    animation: msgIn 0.3s ease;
}

.chat-system-msg.join { color: #86efac; }
.chat-system-msg.leave { color: #fca5a5; }

/* ─── 20. Typing Indicator ─── */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.7rem;
    color: var(--esc-text-muted);
    animation: fadeInUp 0.2s ease;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--esc-primary);
    opacity: 0.4;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* ─── 21. Scroll to Bottom ─── */
.scroll-bottom-btn {
    position: absolute;
    bottom: 12px;
    right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--esc-border);
    background: rgba(12, 22, 40, 0.92);
    backdrop-filter: blur(12px);
    color: var(--esc-text);
    font-size: 1.2rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 10;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(2, 6, 18, 0.4);
    animation: fadeInUp 0.2s ease;
}

.scroll-bottom-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--esc-border-strong);
    transform: translateY(-2px);
}

.new-msg-badge {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--esc-primary);
    color: var(--esc-bg);
    font-size: 0.58rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* ─── 22. Input Area ─── */
.chat-input-area {
    padding: 0.75rem 1.15rem 0.85rem;
    border-top: 1px solid var(--esc-border);
    background: rgba(7, 15, 27, 0.92);
    flex-shrink: 0;
}

.chat-input-type-selector {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.chat-type-btn {
    min-height: 34px;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--esc-text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.chat-type-btn:hover {
    color: var(--esc-text);
    background: rgba(255, 255, 255, 0.05);
}

.chat-type-btn.active-me {
    background: rgba(192, 132, 252, 0.12);
    border-color: rgba(192, 132, 252, 0.3);
    color: #e9d5ff;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.1);
}

.chat-type-btn.active-do {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.3);
    color: #cbe4ff;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.1);
}

.chat-type-btn.active-ooc {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(148, 163, 184, 0.25);
    color: #d5dfeb;
}

.chat-type-btn.active-narrador {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.25);
    color: #fde68a;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.08);
}

.chat-input-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    min-height: 48px;
    max-height: 130px;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--esc-border);
    background: rgba(2, 6, 23, 0.3);
    color: var(--esc-text);
    font-size: 0.86rem;
    line-height: 1.55;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input::placeholder {
    color: var(--esc-text-muted);
}

.chat-input:focus {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.06);
}

.chat-send-btn {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    border: 0;
    background: linear-gradient(135deg, #7dd3fc, #38bdf8 58%, #0ea5e9);
    color: var(--esc-bg);
    font-size: 1.15rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.chat-send-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.3);
}

.chat-send-btn:not(:disabled):active {
    transform: translateY(0) scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.45rem;
    padding: 0 0.15rem;
}

.char-count {
    font-size: 0.63rem;
    color: var(--esc-text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: color var(--transition);
}

.char-count.warning { color: var(--esc-accent); }
.char-count.danger { color: var(--esc-leave); }

.input-hints {
    font-size: 0.62rem;
    color: var(--esc-text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.input-hints kbd,
.chat-input-footer kbd {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(255, 255, 255, 0.03);
    font-family: inherit;
    font-size: 0.58rem;
    font-weight: 600;
}

/* ─── 23. Modal ─── */
.esc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 1rem;
}

.esc-modal-overlay.show {
    display: flex;
    animation: modalOverlayIn 0.25s ease;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.esc-modal-overlay.show .esc-modal {
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.esc-modal {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--esc-border);
    background: linear-gradient(180deg, rgba(14, 24, 42, 0.98), rgba(8, 15, 28, 0.98));
    box-shadow: var(--esc-shadow-lg);
}

.esc-modal-header {
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 1px solid var(--esc-border);
}

.modal-header-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.05));
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: grid;
    place-items: center;
    color: var(--esc-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.modal-header-text {
    flex: 1;
    min-width: 0;
}

.modal-header-text h3 {
    font-size: 0.95rem;
    font-weight: 800;
}

.modal-header-text p {
    color: var(--esc-text-secondary);
    font-size: 0.72rem;
    margin-top: 0.1rem;
}

.esc-modal-close {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--esc-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition);
}

.esc-modal-close:hover {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.esc-modal-body {
    padding: 1.1rem 1.2rem;
    display: grid;
    gap: 0.8rem;
}

.esc-form-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    color: var(--esc-text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.esc-form-group label i {
    font-size: 0.85rem;
    color: var(--esc-primary);
    opacity: 0.7;
}

.esc-form-group input,
.esc-form-group textarea {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--esc-border);
    background: rgba(2, 6, 23, 0.3);
    color: var(--esc-text);
    padding: 0.75rem 0.85rem;
    font-size: 0.84rem;
    font-family: inherit;
    outline: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.esc-form-group input:focus,
.esc-form-group textarea:focus {
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.06);
}

.esc-form-group textarea { resize: vertical; }

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.64rem;
    color: var(--esc-text-muted);
}

.esc-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--esc-border);
    background: rgba(2, 6, 23, 0.3);
}

.color-picker-wrap input[type="color"] {
    width: 32px; height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-wrap input[type="color"]::-webkit-color-swatch { border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }

#color-preview {
    font-size: 0.74rem;
    color: var(--esc-text-secondary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.esc-modal-footer {
    padding: 0.95rem 1.2rem;
    border-top: 1px solid var(--esc-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
}

.esc-btn {
    min-height: 40px;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.esc-btn-secondary {
    border: 1px solid var(--esc-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--esc-text-secondary);
}

.esc-btn-secondary:hover {
    color: var(--esc-text);
    background: rgba(255, 255, 255, 0.06);
}

.esc-btn-primary {
    border: 0;
    color: var(--esc-bg);
    background: linear-gradient(135deg, #7dd3fc, #38bdf8 58%, #0ea5e9);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.2);
}

.esc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.3);
}

/* ─── 24. Toast ─── */
.esc-toast {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    transform: translateY(80px);
    opacity: 0;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 160;
    box-shadow: 0 16px 40px rgba(2, 6, 18, 0.4);
    backdrop-filter: blur(12px);
}

.esc-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.esc-toast.success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9)); }
.esc-toast.error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9)); }

/* ─── 25. Mobile Toggle ─── */
.mobile-toggle-btn { display: none; }

/* ─── 26. Scrollbar ─── */
.chat-messages::-webkit-scrollbar,
.sidebar-body::-webkit-scrollbar,
.sidebar-escenas-list::-webkit-scrollbar,
.chat-participants-bar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar-body::-webkit-scrollbar-track,
.sidebar-escenas-list::-webkit-scrollbar-track,
.chat-participants-bar::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-body::-webkit-scrollbar-thumb,
.sidebar-escenas-list::-webkit-scrollbar-thumb,
.chat-participants-bar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.14);
    border-radius: 999px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.25);
}

/* ─── 27. Time separator ─── */
.chat-time-separator {
    align-self: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(148, 163, 184, 0.08);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--esc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.5rem 0;
}

/* ─── 28. Responsive ─── */
@media (max-width: 1024px) {
    .escenas-app {
        grid-template-columns: 300px minmax(0, 1fr);
    }
    .esc-brand span { display: none; }
}

@media (max-width: 768px) {
    .escenas-app {
        grid-template-columns: 1fr;
    }

    .esc-topbar-inner {
        min-height: 54px;
        gap: 0.5rem;
    }

    .esc-nav { display: none; }
    .esc-brand span { display: none; }
    .esc-connection-pill span { display: none; }
    .esc-user-pill span { display: none; }

    .escenas-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: min(85vw, 340px);
        z-index: 110;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 16px 0 48px rgba(2, 6, 18, 0.5);
    }

    .escenas-sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle-btn {
        display: inline-flex !important;
        width: auto;
        padding: 0.6rem 0.85rem;
        gap: 0.4rem;
        font-size: 0.76rem;
        font-weight: 700;
    }

    .chat-header {
        padding: 0.85rem;
    }

    .chat-messages {
        padding: 0.85rem;
    }

    .chat-input-area {
        padding: 0.65rem 0.85rem 0.75rem;
    }

    .chat-participants-bar {
        padding: 0.55rem 0.85rem;
    }

    .empty-guide {
        grid-template-columns: 1fr;
    }

    .chat-input-row {
        flex-direction: column;
    }

    .chat-send-btn {
        width: 100%;
        height: 44px;
    }

    .esc-form-row {
        grid-template-columns: 1fr;
    }

    .search-kbd {
        display: none;
    }

    .input-hints {
        display: none;
    }
}

@media (max-width: 480px) {
    .empty-content h3 {
        font-size: 1.15rem;
    }

    .empty-commands {
        flex-direction: column;
        align-items: center;
    }

    .chat-header-desc {
        display: none;
    }

    .chat-meta-row {
        display: none;
    }
}
