/* ==========================================================================
   VARIABLES GLOBALES (LE COEUR DU THEME)
   ========================================================================== */
:root {
    /* Couleurs d'Accentuation (Hexa pour textes/bordures) */
    --theme-primary: #ffb75e;
    --theme-danger: #f85149;
    --theme-success: #3fb950;
    
    /* Couleurs RGB */
    --theme-primary-rgb: 255, 183, 94;
    --theme-danger-rgb: 248, 81, 73;
    --theme-success-rgb: 63, 185, 80;

    /* Couleurs de l'Interface */
    --bg-base: #0d1117;
    --bg-surface: #161b22;
    --bg-surface-hover: rgba(255, 255, 255, 0.05);
    --border-subtle: #30363d;

    /* Typographie */
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --text-bright: #ffffff;
    
    /* Paramètres système */
    --glass-bg: rgba(13, 1, 1, 0.7);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Orbitron', sans-serif;
}

/* ==========================================================================
   RÉINITIALISATION ET BASES
   ========================================================================== */
* { 
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100vh;
    width: 100%;
    overflow: hidden !important;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* --- LE STANDARD DES SÉPARATEURS --- */
.chaos-separator {
    width: 80%;
    height: 1px;
    background: rgba(var(--theme-primary-rgb), 0.2);
    margin: 15px auto;
    position: relative;
    border: none;
}

.chaos-separator::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: var(--theme-primary);
    border-radius: 2px;
    box-shadow: 
        0 0 5px var(--theme-primary),
        0 0 10px var(--theme-primary),
        0 0 20px rgba(var(--theme-primary-rgb), 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% { opacity: 0.8; box-shadow: 0 0 10px var(--theme-primary); }
    50% { opacity: 1; box-shadow: 0 0 18px var(--theme-primary); }
    100% { opacity: 0.8; box-shadow: 0 0 10px var(--theme-primary); }
}

/* ==========================================================================
   ÉCRAN D'AUTHENTIFICATION (LOGIN)
   ========================================================================== */
.auth-container {
    position: fixed;
    inset: 0;
    background-color: var(--bg-base);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    pointer-events: auto;
}

.auth-box {
    background-color: var(--bg-surface);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    text-align: center;
    width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.auth-box h1 {
    font-family: var(--font-title);
    margin-bottom: 25px;
    color: var(--theme-primary);
}

.auth-box input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-bright);
    outline: none;
}

.auth-box input:focus {
    border-color: var(--theme-primary);
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons .cyber-btn:first-child {
    background-color: var(--theme-primary);
    color: var(--bg-base);
    border: none;
    transition: background-color 0.2s, transform 0.1s;
}

.auth-buttons .cyber-btn:first-child:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.auth-buttons .cyber-btn:first-child:active {
    transform: translateY(0);
}

.auth-buttons .btn-alt {
    background-color: var(--bg-surface) !important;
    color: var(--text-main);
    border: 1px solid var(--border-subtle) !important;
}

.auth-footer {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-footer span {
    color: var(--theme-primary);
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s, filter 0.2s;
}

.auth-footer span:hover {
    filter: brightness(1.2) drop-shadow(0 0 5px var(--theme-primary));
}

.oauth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: #484f58;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.oauth-separator::before,
.oauth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #30363d;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    color: #3c4043;
    border: none;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.btn-google:hover {
    background: #f1f3f4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.error-msg {
    color: var(--theme-danger);
    font-size: 0.8rem;
    margin-top: 10px;
    min-height: 1.2em;
}

/* ==========================================================================
   MENU CONTEXTUEL
   ========================================================================== */

.context-menu {
    position: fixed;
    display: none;
    z-index: 10000;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.1), 
        rgba(var(--theme-primary-rgb), 0.1)
    ), rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    border-radius: 8px;
    width: 180px;
    padding: 5px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    color: #fce4e4;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.menu-item:hover {
    background: rgba(var(--theme-primary-rgb), 0.2);
}

.menu-item.delete {
    color: var(--theme-danger);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-item.delete:hover {
    background: rgba(var(--theme-danger-rgb), 0.4);
}

.icon-btn-mini {
    background: none;
    border: none;
    color: var(--chaos-red);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    opacity: 0.5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-mini:hover {
    opacity: 1;
    transform: rotate(90deg);
    text-shadow: 0 0 8px var(--chaos-red);
}

.alert-box {
    border: 2px solid var(--theme-danger) !important;
    box-shadow: 0 0 30px rgba(var(--theme-danger-rgb), 0.4) !important;
    max-width: 400px;
}

#alert-message {
    color: #fce4e4;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    line-height: 1.6;
}

#vortex-container {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 150px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

#vortex-container.active {
    bottom: 20px;
    pointer-events: all;
}

.vortex {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #000 20%, var(--theme-danger) 70%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 30px var(--theme-danger);
    animation: spin-vortex 1s linear infinite;
    position: relative;
}

.vortex-label {
    color: var(--theme-danger);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    margin-top: 10px;
    text-shadow: 0 0 5px #000;
}

@keyframes spin-vortex {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); opacity: 0.8; }
    to { transform: rotate(360deg) scale(1); }
}

/* ==========================================================================
   SOCIAL
   ========================================================================== */

/* =========================================
   BOUTON ACCUEIL (LE VORTEX DU CHAOS)
========================================= */
.home-chaos-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 8px;
}

.home-chaos-btn .vortex-svg {
    width: 32px;
    height: 32px;

    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, filter 0.3s ease;
}

/* L'effet d'aspiration quand on survole */
.home-chaos-btn:hover .vortex-svg {
    color: var(--theme-primary, #58a6ff);
    transform: rotate(180deg) scale(1.1);
    filter: drop-shadow(0 0 5px var(--theme-primary, #58a6ff));
}

/* Quand on est SUR l'accueil (Bouton Actif) */
.home-chaos-btn.active .vortex-svg {
    color: var(--theme-primary, #58a6ff);
    filter: drop-shadow(0 0 8px var(--theme-primary, #58a6ff));
    animation: slow-vortex-spin 20s linear infinite;
}

@keyframes slow-vortex-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.view-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#vue-social {
    padding: 20px;
    color: #e6edf3;
    overflow-y: auto;
    height: 100%;
}

.social-trigger {
    position: relative;
}

.sphere-icon.social-trigger {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible;
}

.sphere-icon.social-trigger img {
    width: 50px !important;
    height: 50px !important;
    object-fit: contain;
    filter: invert(1);
    padding: 4px;
    margin: auto;
}

.sphere-icon.social-trigger:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* --- LE STYLE DU DRAG & DROP --- */
.sphere-icon.dragging {
    background: rgba(var(--theme-primary-rgb), 0.1) !important;
    border: 2px dashed rgba(var(--theme-primary-rgb), 0.5) !important;
    box-shadow: inset 0 0 15px rgba(var(--theme-primary-rgb), 0.2) !important;
    transform: scale(0.9);
    color: transparent !important;
}

.draggable-sphere {
    cursor: grab;
}

/* Badge de notification sur les sphères — positionné sur .sphere-btn-wrapper */
.sphere-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--theme-danger, #f85149);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    border-radius: 9px;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(248, 81, 73, 0.6);
    z-index: 10;
}

.sphere-notif-badge.sphere-badge-mention {
    background: var(--theme-primary);
    box-shadow: 0 0 8px var(--theme-primary);
}

/* Mentions @pseudo dans les messages */
.mention {
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 600;
    cursor: default;
    /* color et background définis en inline style depuis la couleur de l'agent */
}

.mention-self {
    font-weight: 700;
}

.sphere-icon.dragging img {
    opacity: 0 !important;
}

.sphere-dnd-placeholder {
    height: 60px;
    width: 60px;
    background: rgba(var(--theme-primary-rgb), 0.1);
    border: 2px dashed rgba(var(--theme-primary-rgb), 0.5);
    border-radius: 50%;
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(var(--theme-primary-rgb), 0.2);
}

.social-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.social-header {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid #30363d;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.social-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.social-column h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 15px;
}

.btn-add-friend {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    border: none;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-friend:hover {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
    transform: rotate(90deg);
}

.social-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
}

.social-subtitle-inbox {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 10px;
    text-align: center;
}

.demande-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.demande-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn-action svg {
    width: 20px;
    height: 20px;
    display: block;
}

.btn-action:hover svg {
    stroke: #ffffff !important;
}

.btn-action {
    background: #2b2d31;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    outline: none;
}

.btn-action.accept:hover { background: #23a559; }
.btn-action.refuse:hover { background: #f23f43; }

.ami-avatar {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
    font-size: 0.8rem;
}

.ami-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin: 0 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    transition: background 0.1s;
    cursor: pointer;
}

.ami-card-row:first-child {
    border-top: none;
}

.ami-card-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-top-color: transparent;
}

.ami-card-row:hover + .ami-card-row {
    border-top-color: transparent;
}

.ami-left-side {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ami-name-group {
    display: flex;
    flex-direction: column;
}

.ami-pseudo-text {
    color: #dbdee1;
    font-weight: 500;
}

.ami-status-sub {
    font-size: 0.75rem;
    color: #b5bac1;
}

.ami-actions {
    display: flex;
    gap: 8px;
}

.ami-actions-side {
    display: flex;
    gap: 8px;
}

.action-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2b2d31;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b5bac1;
    transition: color 0.2s, background 0.2s;
}

.action-circle svg {
    width: 20px;
    height: 20px;
}

.action-circle:hover {
    color: #ffffff;
    background: #35373c;
}

.action-circle.more-trigger:hover {
    color: #f23f43;
}

/* Le bouton Inbox */
.request-inbox-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.request-inbox-trigger:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

/* Taille du SVG à l'intérieur */
.icon-inbox {
    width: 24px;
    height: 24px;
}

.badge-notif {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f23f43;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-base);
}

/* Le volet déroulant */
.request-dropdown {
    position: absolute;
    top: 65px;
    left: 20px;
    width: 320px;
    max-height: 400px;
    background: var(--bg-base);
    border: 1px solid #30363d;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: fadeInScale 0.2s ease-out;
}

.inbox-header {
    padding: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 1px solid #30363d;
    letter-spacing: 1px;
}

#container-demandes-attente {
    overflow-y: auto;
    padding: 10px;
}

/* Animation d'apparition */
@keyframes fadeInScale {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */

.dashboard-container {
    padding: 40px 20px;
    overflow-y: auto !important;
    flex: 1;
}

#dashboard-accueil {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.terminal-welcome {
    color: var(--text-main);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.hint-tag {
    color: var(--text-muted);
}

.terminal-hint {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #30363d;
}

.chat-main-area {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    overflow: hidden;
}

.news-item {
    color: var(--text-main);
    margin-bottom: 12px;
    list-style:none;
    font-size: 0.9rem;
}

.tag-tag-stable {
    background: #238636;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight:bold;
    margin-right:8px;
}

.tag-tag-glitch {
    background: #661a1a;
    color: var(--theme-danger);
    border: 1px solid var(--theme-danger);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight:bold;
    margin-right:8px;
}

.tag-tag-nouveau {
    background: rgba(255, 183, 94, 0.1);
    border: 1px solid var(--theme-primary);
    color: var(--theme-primary);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight:bold;
    margin-right:8px;
}

/* La vidéo en plein écran arrière-plan */
#bg-video-chaos {
    position: fixed !important;
    top: 0; left: 0; width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: -2;
    opacity: 0.4;
}

.video-overlay {
    position: fixed !important;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle, rgba(var(--theme-primary-rgb), 0.15) 0%, rgba(0, 0, 0, 0.85) 90%) !important;
    z-index: -1;
    pointer-events: none;
}


.dash-header {
    animation: glowPulse 3s infinite alternate;
    position: relative;
    z-index: 2;
    margin-top: 20px;
    text-align: center;
    margin-bottom: 40px;
}

.dash-content {
    position: relative;
    padding-top: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    margin-top: -60px;
}

@keyframes glowPulse {
    from { filter: drop-shadow(0 0 5px rgba(255, 75, 43, 0.4)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 75, 43, 0.8)); }
}


.dash-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    background: linear-gradient(90deg, var(--theme-danger), var(--theme-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(var(--theme-primary-rgb), 0.4));
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.dash-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px;
    width: 100%;
    max-width: 1200px;
    margin: 30px auto 0 auto;
    margin-top: 20px !important;
}

.dash-grid::-webkit-scrollbar { width: 4px; }
.dash-grid::-webkit-scrollbar-track { background: transparent; }
.dash-grid::-webkit-scrollbar-thumb { background: var(--theme-primary); border-radius: 10px; }

.dash-card {
    background: rgba(22, 27, 34, 0.8) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3) !important;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 10px rgba(255, 183, 94, 0.1); 
    transition: box-shadow 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: var(--theme-primary);
    box-shadow: 0 0 15px rgba(255, 183, 94, 0.2);
}

.card-header {
    font-weight: bold;
    color: #f0f6fc;
    border-bottom: 1px solid #30363d;
    margin-bottom: 20px;
    padding-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.stat-value {
    font-size: 24px;
    display: block;
    color: var(--theme-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 8px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
    position: relative;
}

.dash-card:has(.btn-destruct) .card-header {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 183, 94, 0.1);
}

.dash-card:has(.btn-destruct) .card-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 30px;
    opacity: 0.7;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="40" viewBox="0 0 400 40" preserveAspectRatio="none"><path d="M0,20 L40,20 L45,5 L55,35 L65,20 L120,20 L125,10 L130,30 L140,20 L210,20 L220,0 L235,40 L250,20 L320,20 L325,10 L335,30 L350,20 L400,20" fill="none" stroke="%23ffb75e" stroke-width="1.5"/></svg>');
    background-size: 100% 30px;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to right,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0) var(--mask-pos, 0%),
        rgba(0,0,0,1) var(--mask-pos, 0%),
        rgba(0,0,0,0) calc(var(--mask-pos, 0%) + 10%)
    );
    mask-image: linear-gradient(to right,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0) var(--mask-pos, 0%),
        rgba(0,0,0,1) var(--mask-pos, 0%),
        rgba(0,0,0,0) calc(var(--mask-pos, 0%) + 10%)
    );
    -webkit-mask-size: 200% 100%;
    mask-size: 200% 100%;
    animation: radarScan 4s linear infinite;
}

@keyframes radarScan {
    0% { -webkit-mask-position: 150% 0; }
    100% { -webkit-mask-position: -50% 0; }
}

#btn-destruct {
    background: #238636;
    transition: all 0.2s ease;
    text-transform: uppercase;
    border: 1px solid #30363d;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

#btn-destruct:hover {
    background: var(--theme-danger);
    box-shadow: 0 0 20px rgba(248, 81, 73, 0.6);
    transform: scale(1.05) rotate(1deg);
    animation: jitter 0.1s infinite;
}

@keyframes jitter {
    0% { transform: translate(0,0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(1px, 1px); }
}

.news-list li {
    color: var(--text-main);
    border-bottom: 1px solid #30363d;
    padding: 10px 0;
}

.news-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    font-size: 13px;
}

.news-tag {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 3px;
    margin-right: 5px;
}

.news-tag.update {
    background: #238636;
}

.news-tag.chaos {
    background: #8957e5;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

@keyframes shake {
    0% { transform: translate(0,0) scale(1); filter: hue-rotate(0deg); }
    10% { transform: translate(-10px, -10px) scale(1.03); filter: hue-rotate(90deg); }
    20% { transform: translate(10px, 10px) scale(0.97); }
    30% { transform: translate(-15px, 0px) scale(1.08); filter: invert(1); }
    40% { transform: translate(15px, -10px) scale(1); }
    50% { transform: translate(-5px, 15px) scale(1.15); filter: contrast(200%); }
    60% { transform: translate(20px, -20px) scale(0.9); }
    70% { transform: translate(-20px, 10px) scale(1.1); filter: hue-rotate(270deg); }
    80% { transform: translate(10px, 20px) scale(1); }
    90% { transform: translate(-10px, -10px) scale(1.05); }
    100% { transform: translate(0,0) scale(1); filter: hue-rotate(0deg); }
}

@keyframes chaos-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.shake-anim {
    animation: shake 0.1s infinite, chaos-opacity 0.1s infinite;
    overflow: hidden;
    background-color: rgba(255, 0, 0, 0.1);
}

@media (max-width: 1000px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   BARRE LATERALE GAUCHE - SPHERES DU CHAOS
   ========================================================================== */

#spheres-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
}

.sphere-btn-wrapper {
    position: relative;
    display: flex;
    flex-shrink: 0;
}

.sphere-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    background: rgba(22, 27, 34, 0.6) !important;
    border: 1px solid rgba(88, 166, 255, 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border-radius: 50% !important;
    overflow: hidden;
    padding: 0;
}

.sphere-icon:hover {
    border-color: var(--theme-danger) !important;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
    border-radius: 15px;
    background: #30363d;
    transform: scale(1.1);
}

.sphere-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%; 
}

#dynamic-spheres {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    padding-left: 5px;
    padding-right: 5px;
}

/* Le conteneur de la bulle doit être en relatif pour le badge */
.active-contact-bubble {
    position: relative;
    overflow: visible !important;
}

/* Le badge lui-même */
.bubble-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--chaos-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0d0101;
    box-shadow: 0 0 8px rgba(255, 75, 43, 0.5);
    z-index: 10;
}

.close-bubble {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--theme-danger);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 20;
    border: 1px solid var(--bg-base);
}

.active-contact-bubble:hover .close-bubble {
    display: flex;
}



#self-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    border-color: #58a6ff !important;
}

#btn-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 22px;
    transition: transform 0.2s;
    outline: none;
    color: var(--theme-primary);
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(88, 166, 255, 0.3));
    margin: 0;
    padding: 0;
}

#btn-settings:hover {
    transform: rotate(45deg);
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.8));
    cursor: pointer;
}

.logout-mini {
    background: none;
    border: none;
    color: var(--chaos-red);
    cursor: pointer;
    font-size: 1.2rem;
    margin-bottom: 5px;
    opacity: 0.6;
}

.logout-mini:hover {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--chaos-red));
}

/* ─── Dropdown paramètres rapides (restauré) ─── */
#profile-dropdown {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 20px;
    width: 300px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 15px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#profile-dropdown input,
#profile-dropdown textarea,
#profile-dropdown select {
    background: var(--bg-base, #0d1117);
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 8px;
    font-family: inherit;
    margin-top: 5px;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Paramètres avancés — fenêtre flottante cyberpunk ─── */
.params-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 99000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Fenêtre principale : glassmorphism + bordure thème */
.params-container {
    display: flex;
    width: min(960px, 100%);
    height: min(680px, 100%);
    background: rgba(13, 17, 23, 0.96);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.35);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(var(--theme-primary-rgb), 0.08),
        0 0 40px rgba(var(--theme-primary-rgb), 0.12),
        0 24px 60px rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

/* ── Sidebar ── */
.params-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(22, 27, 34, 0.85);
    border-right: 1px solid rgba(var(--theme-primary-rgb), 0.15);
    display: flex;
    flex-direction: column;
    padding: 28px 8px 16px;
    overflow-y: auto;
}

.params-nav-label {
    font-family: var(--font-title, 'Orbitron', sans-serif);
    color: var(--theme-primary);
    font-size: 0.62em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 12px 8px;
    opacity: 0.85;
}

.params-nav-item {
    background: none;
    border: none;
    border-left: 2px solid transparent;
    color: var(--text-muted, #8b949e);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88em;
    text-align: left;
    padding: 9px 12px;
    border-radius: 0 6px 6px 0;
    width: 100%;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 9px;
}

.params-nav-item:hover {
    background: rgba(var(--theme-primary-rgb), 0.08);
    color: var(--text-main, #c9d1d9);
}

.params-nav-item.active {
    background: rgba(var(--theme-primary-rgb), 0.15);
    border-left-color: var(--theme-primary);
    color: var(--theme-primary);
    font-weight: 600;
}

.params-nav-danger {
    color: var(--theme-danger, #f85149) !important;
    margin-top: 4px;
}
.params-nav-danger:hover {
    background: rgba(248, 81, 73, 0.12) !important;
    border-left-color: var(--theme-danger) !important;
    color: var(--theme-danger) !important;
}

.params-nav-divider {
    height: 1px;
    background: rgba(var(--theme-primary-rgb), 0.12);
    margin: 10px 12px;
}

.params-nav-close {
    background: none;
    border: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    color: var(--text-muted, #8b949e);
    font-family: inherit;
    font-size: 0.82em;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-top: auto;
    border-radius: 0 6px 6px 0;
    width: 100%;
    transition: color 0.15s, background 0.15s;
}
.params-nav-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main, #c9d1d9);
}

.params-close-icon {
    font-size: 1.3em;
    line-height: 1;
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    color: var(--theme-primary);
}
.params-close-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Zone de contenu ── */
.params-main {
    flex: 1;
    overflow-y: auto;
    padding: 36px 40px 40px;
    background: transparent;
    /* Subtle scanline texture */
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(var(--theme-primary-rgb), 0.012) 2px,
        rgba(var(--theme-primary-rgb), 0.012) 4px
    );
}

.params-content-wrap {
    max-width: 560px;
}

.params-section-title {
    font-family: var(--font-title, 'Orbitron', sans-serif);
    color: var(--theme-primary);
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.25);
    text-shadow: 0 0 12px rgba(var(--theme-primary-rgb), 0.4);
}

.params-subsection-title {
    color: var(--theme-primary);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    opacity: 0.85;
}

/* ── Carte profil ── */
.params-profile-card {
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb), 0.06);
}

.params-profile-banner {
    height: 80px;
    background: rgba(var(--theme-primary-rgb), 0.3);
}

.params-profile-row {
    display: flex;
    align-items: flex-end;
    padding: 0 16px 14px;
}

.params-profile-avatar {
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 3px solid rgba(var(--theme-primary-rgb), 0.5);
    box-shadow: 0 0 14px rgba(var(--theme-primary-rgb), 0.35);
    margin-top: -34px;
    background: rgba(var(--theme-primary-rgb), 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5em; font-weight: bold; color: #fff;
    flex-shrink: 0;
}

.params-profile-info { margin-left: 14px; padding-bottom: 4px; }
.params-profile-pseudo {
    font-family: var(--font-title, 'Orbitron', sans-serif);
    font-size: 0.9em;
    font-weight: 700;
    color: var(--theme-primary);
    text-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.4);
    letter-spacing: 0.04em;
}

/* ── Rangées d'info ── */
.params-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
}

.params-field-label {
    color: var(--theme-primary);
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.8;
}

.params-field-value {
    color: var(--text-main, #c9d1d9);
    font-size: 0.88em;
}

.params-field-divider {
    height: 1px;
    background: rgba(var(--theme-primary-rgb), 0.1);
}

/* ── Toggles Notifications ── */
.notif-toggle-list { display: flex; flex-direction: column; gap: 0; }

.notif-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.notif-toggle-info { flex: 1; min-width: 0; }

.notif-toggle-label {
    color: var(--text-main, #c9d1d9);
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 3px;
}

.notif-toggle-desc {
    color: #6e7681;
    font-size: 0.78em;
    line-height: 1.4;
}

.cyber-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cyber-toggle input { opacity: 0; width: 0; height: 0; }

.cyber-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #30363d;
    border-radius: 24px;
    transition: background 0.2s;
    border: 1px solid rgba(255,255,255,0.08);
}

.cyber-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: #8b949e;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.cyber-toggle input:checked + .cyber-toggle-slider {
    background: rgba(var(--theme-primary-rgb), 0.25);
    border-color: var(--theme-primary);
}

.cyber-toggle input:checked + .cyber-toggle-slider::before {
    transform: translate(20px, -50%);
    background: var(--theme-primary);
    box-shadow: 0 0 6px var(--theme-primary);
}

/* ── Cartes Appareils ── */
.appareil-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.12);
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}

.appareil-card.appareil-current {
    border-color: rgba(var(--theme-primary-rgb), 0.4);
    background: rgba(var(--theme-primary-rgb), 0.06);
}

.appareil-icon {
    font-size: 1.4em;
    color: var(--theme-primary);
    opacity: 0.7;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

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

.appareil-label {
    color: var(--text-main, #c9d1d9);
    font-size: 0.88em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.appareil-badge {
    background: rgba(var(--theme-primary-rgb), 0.2);
    color: var(--theme-primary);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.appareil-meta {
    color: #6e7681;
    font-size: 0.75em;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appareil-revoke-btn {
    background: none;
    border: 1px solid rgba(248, 81, 73, 0.4);
    color: #f85149;
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 0.78em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.appareil-revoke-btn:hover {
    background: rgba(248, 81, 73, 0.12);
    border-color: #f85149;
}

.btn-save-mini {
    background: #238636;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
}

.btn-save-mini:hover { background: #2ea043; }

/* ─── Lang picker (auth + settings) ─── */

.auth-lang-corner {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10002;
}

.settings-lang-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.lang-picker {
    position: relative;
    display: inline-block;
}

.lp-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary, #0d1117);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 8px;
    color: var(--text-main, #c9d1d9);
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    padding: 5px 10px;
    transition: border-color 0.2s;
}

.lp-trigger:hover,
.lang-picker.is-open .lp-trigger {
    border-color: var(--theme-primary, #58a6ff);
}

.lp-flag { font-size: 1.15rem; line-height: 1; }

.lp-arrow {
    font-size: 0.65rem;
    color: var(--text-muted, #8b949e);
    transition: transform 0.2s;
}

.lang-picker.is-open .lp-arrow { transform: rotate(180deg); }

.lp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 8px;
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 145px;
    z-index: 10010;
    box-shadow: 0 6px 24px rgba(0,0,0,.5);
}

.lp-dropdown.lp-up {
    top: auto;
    bottom: calc(100% + 6px);
}

.lang-picker.is-open .lp-dropdown { display: flex; }

.lp-option {
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-main, #c9d1d9);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 7px 10px;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
}

.lp-option:hover {
    background: color-mix(in srgb, var(--theme-primary, #58a6ff) 12%, transparent);
}

.lp-option.active {
    color: var(--theme-primary, #58a6ff);
    font-weight: 600;
}

.dropdown-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-main);
}

#profile-dropdown label {
    font-size: 0.85em;
    color: var(--text-muted);
}

#status-picker {
    display: none;
    position: fixed !important;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 5px;
    z-index: 10005 !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

#status-picker::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -12px;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #30363d;
}

#status-picker::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #2b2d31;
}

.status-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    transition: background 0.2s;
    font-size: 0.9em;
}

.status-item:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

.status-item:first-child { border-radius: 8px 8px 0 0; }
.status-item:last-child { border-radius: 0 0 8px 8px; }

#self-avatar { pointer-events: auto; }

.channel-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-top: 10px;
}

.section-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.channel-link, .channel-item {
    cursor: pointer !important;
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.channel-icon {
    margin-right: 8px;
    opacity: 0.7;
}

.add-channel-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.add-channel-btn:hover {
    color: var(--theme-success);
}

.cyber-separator {
    border: 0;
    border-top: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    margin: 0 10px;
}

#liste-salons {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

/* Style salons vocaux */

.vocal-members-list {
    margin-left: 25px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vocal-agent-tag {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    transition: background 0.2s;
}

.vocal-agent-tag:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 183, 94, 0.3);
}

.mini-avatar-chaos {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    background-color: var(--theme-danger);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.cyber-label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Le contour dur pour la détection de voix (VAD) */
.is-speaking-border {
    border: 3px solid var(--theme-success) !important;
    box-shadow: 0 0 8px var(--theme-success) !important;
    transition: border 0.1s ease, box-shadow 0.1s ease;
}

.stream-video-element {
    width: 80%;
    max-width: 800px;
    margin: 20px auto;
    border-radius: 12px;
    border: 2px solid var(--theme-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: block;
    z-index: 100;
}

/* Le badge pour signaler un stream en cours */
.live-badge {
    background-color: var(--theme-danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: pulse-live 2s infinite;
}

.live-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px var(--theme-danger);
}

@keyframes pulse-live {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Vocal dans les mp */

#mp-call-banner {
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.15), 
        rgba(var(--theme-primary-rgb), 0.15)
    ), rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Pour la compatibilité Safari */
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    box-shadow: 0 8px 32px rgba(var(--theme-primary-rgb), 0.15);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--theme-primary);
    z-index: 100;
}

#mp-call-banner .mp-call-info i {
    color: var(--theme-primary) !important;
    text-shadow: 0 0 8px rgba(255, 183, 94, 0.5);
}

/* Bouton Raccrocher rouge vif */
.hangup-btn {
    color: var(--theme-danger) !important;
}
.hangup-btn:hover {
    background: rgba(248, 81, 73, 0.2) !important;
}

/* Bouton Regarder le stream en évidence */
.watch-btn {
    color: var(--theme-success) !important;
}

.watch-btn:hover {
    background: rgba(63, 185, 80, 0.2) !important;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.4);
}

/* ==========================================================================
   MODALE DE CREATION DE SPHERE
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.modal-box {
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 400px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-box h2 {
    color: var(--theme-primary);
    margin: 0;
    font-size: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-body label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: -5px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--theme-danger);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.cyber-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #30363d;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.cyber-btn:not(.btn-alt) {
    background: #238636;
    color: white;
    border-color: rgba(240, 246, 252, 0.1);
}

.cyber-btn:not(.btn-alt):hover {
    background: #2ea043;
    box-shadow: 0 0 12px rgba(46, 160, 67, 0.4);
}

.btn-alt {
    background: #21262d;
    color: var(--text-main);
}

.btn-alt:hover {
    background: #30363d;
}

#sphere-desc-input {
    resize: none;
}

.modal-body input, .modal-body textarea {
    background: var(--bg-base);
    border: 1px solid #30363d;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

.choices-container {
    display: flex;
    gap: 15px;
    padding: 10px 0;
}

.choice-card {
    flex: 1;
    background: #2b2d31;
    border: 1px solid #3f4147;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-card:hover {
    background: #35373c;
    border-color: var(--theme-danger);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}

.choice-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.choice-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #ffffff;
}

.choice-card p {
    font-size: 0.85rem;
    color: #b5bac1;
    line-height: 1.3;
}

/* ==========================================================================
   Intérieur des Sphères
   ========================================================================== */


.hidden-input {
    display: none !important;
}

.welcome-area {
    margin-top: 0px;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    text-align: center;
    padding: 20px;
    padding-top: 50px;
    padding-right: 50px;
    padding-bottom: 100px;
    background: transparent !important;
}

.welcome-icon {
    font-size: 60px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--theme-danger));
}

.welcome-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--theme-primary);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 183, 94, 0.3);
}

.welcome-text {
    color: var(--text-main);
    font-style: italic;
    max-width: 400px;
    line-height: 1.5;
}

.welcome-hint {
    margin-top: 30px;
    padding: 10px 20px;
    border: 1px dashed rgba(255, 183, 94, 0.3);
    border-radius: 8px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    width: fit-content;    
    max-width: 40%;        
    margin-left: auto;     
    margin-right: auto; 
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.welcome-title, .welcome-text, .welcome-hint {
    margin: 10px 0;
    width: 80%;
}

#channels-column {
    position: fixed;
    left: 70px;
    top: 50px;
    bottom: 15px;
    width: 180px;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.08), 
        rgba(var(--theme-primary-rgb), 0.08)
    ), rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    border-radius: 0 15px 15px 0;
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#channels-column.closed {
    left: -110px; 
}

.sidebar-toggle-tab {
    position: absolute;
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 50px;
    background: rgba(var(--theme-primary-rgb), 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 10px 10px 0;
    box-shadow: 5px 0 15px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: background 0.3s;
}

#channels-column.closed .sidebar-toggle-tab i {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.sidebar-toggle-tab:hover {
    background: var(--theme-primary);
}

#channels-column,
.sidebar {
    overflow: visible !important; 
}

#liste-salons,
#liste-pseudos,
#dynamic-spheres-container,
.social-main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
}

#channels-column.closed .channel-header, 
#channels-column.closed #liste-salons {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#content-wrapper {
    position: fixed !important;
    top: 50px;
    bottom: 0;
    left: 70px !important;
    right: 240px !important;
    width: auto !important;
    display: flex;
    flex-direction: column;
    z-index: 5;
    background: transparent !important;
    margin: 0 !important;
    overflow: visible;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#content-wrapper.full-width {
    right: 0px !important;
}

#content-wrapper.full-width .input-area {
    right: 20px !important;
}

/* Quand le panneau des salons est ouvert, on pousse le chat et l'input */
body.channels-open #content-wrapper {
    left: 270px !important;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.channels-open .input-area {
    left: 285px !important;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.channel-header {
    padding: 15px; 
    border-bottom: 1px solid #30363d;
}

#current-sphere-name {
    font-size: 14px;
    color: #f0f6fc;
    margin: 0;
}

#liste-salons {
    list-style: none;
    padding: 10px;
    margin: 0;
}

/* Modale d'invitation dans une sphère */

/* La boîte de groupe pour l'input et le bouton */
.invite-input-group {
    display: flex !important;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin: 15px 0;
}

/* L'input du code */
#generated-invite-code {
    flex: 1;
    text-align: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.4rem;
    color: var(--theme-primary);
    background: var(--bg-base);
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(255, 183, 94, 0.1);
    min-width: 0;
}

/* Le bouton Copier spécifique à cette modale */
.btn-copy-invite {
    width: 100px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

/* Style des salons à l'intérieur */
#liste-salons li {
    list-style: none;
    padding: 12px 20px;
    color: #fce4e4;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

#liste-salons li:hover {
    background: rgba(255, 75, 43, 0.1);
    border-left: 3px solid var(--theme-danger);
    padding-left: 25px;
    cursor: pointer;
}
.dropdown-wrapper { position: relative; }

#sphere-dropdown {
    position: absolute;
    top: 40px;
    left: 10px;
    background: #111214;
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    width: 160px;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.cyber-dropdown {
    position: absolute;
    top: 30px;
    right: 0;
    width: 200px;
    background: #111214;
    border: 1px solid #3f4147;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 8px;
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    color: #dbdee1;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.dropdown-item:hover { background: var(--theme-primary); color: white; }
.dropdown-item.danger:hover { background: #f23f42; }


/* ==========================================================================
   STRUCTURE DU CHAT
   ========================================================================== */

.markdown-body code {
    background: #2b2d31;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.markdown-body pre {
    background: #1e1f22;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
}

/* Empêche les paragraphes du markdown de créer des sauts de ligne géants */
.message-content.markdown-body p {
    margin: 0;
    display: inline;
}

/* Style pour les blocs de code */
.message-content.markdown-body pre {
    background: #1e1f22;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: block;
}

#typing-indicator {
    height: 25px;
    bottom: 85px;
    left: 100px;
    line-height: 25px;
    padding: 5px 15px;
    padding-left: 15px;
    margin-top: -25px; 
    position: fixed !important;
    z-index: 5;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    z-index: 9999;
    display: block;
    pointer-events: none;
}

#chat-header {
    color: var(--theme-primary) !important;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    text-shadow: 0 0 10px rgba(255, 183, 94, 0.4);
}

#chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: transparent !important;
    width: 100%;
    height: 100%;
    position: relative;
}

#chat-header.header-general { color: var(--theme-primary) !important; }
#chat-header.header-private { color: var(--theme-primary) !important; font-style: italic; }

#chat-screen {
    position: relative;
    display: none; /* Changé en 'flex' par le JS */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: transparent !important;
}


/* Conteneur principal qui prend le reste de l'écran */

#main-content-area, .private-messages-container {
    margin-left: 80px !important;
    margin-right: 220px !important;
    width: calc(100vw - 300px) !important;
}

.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}


/* Zone de chat centrale */

#messages {
    position: relative !important;
    top: 0px;
    left: 0;
    right: 0;
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    width: calc(100% - 15px) !important;
    max-width: 100% !important;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    padding: 10px 20px 100px 20px !important;
    height: calc(100vh - 220px) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(88, 166, 255, 0.2) transparent;
    scrollbar-gutter: stable;
    pointer-events: auto !important;
    z-index: 10;
    box-sizing: border-box;
}


/* Messages privés */

.message-item, .private-messages-container, [class*="private"] {
    border-left: none !important;
    background: transparent !important;
}

.message-item:has(.message-reply-quote) .message-left {
    padding-top: 22px;
}

/* Footer et Input */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-base);
}

.input-area {
    margin: 10px 20px 20px 20px;
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2) !important;
    border-radius: 8px;
    padding: 10px;
    display: block !important;
    position: fixed !important;
    left: 85px !important; 
    right: 265px !important;
    bottom: -10px !important;
    z-index: 200;
    height: auto;
}

.input-wrapper-inner {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-container {
    flex: 1;
    position: relative;
}

/* --- SYSTÈME DE RÉPONSE --- */
#reply-preview-banner {
    background: rgba(var(--theme-primary-rgb), 0.1);
    border-left: 3px solid var(--theme-primary);
    padding: 8px 15px;
    margin-bottom: 8px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
}

/* Séparateur messages non lus */
.unread-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    list-style: none;
    pointer-events: none;
    user-select: none;
}

.unread-separator::before,
.unread-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(240, 192, 64, 0.5), transparent);
}

.unread-separator span {
    font-family: 'Orbitron', monospace;
    font-size: 0.65rem;
    color: #f0c040;
    background: rgba(240, 192, 64, 0.1);
    border: 1px solid rgba(240, 192, 64, 0.35);
    padding: 2px 9px;
    border-radius: 10px;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

#edit-preview-banner {
    background: rgba(240, 192, 64, 0.08);
    border-left: 3px solid var(--theme-warning, #f0c040);
    padding: 8px 15px;
    margin-bottom: 8px;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
}

.reply-close-btn {
    background: transparent;
    border: none;
    color: var(--theme-danger);
    cursor: pointer;
    font-size: 1.1rem;
}

/* La petite citation qui apparaît dans le chat */
.message-reply-quote {
    position: relative;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
}

/* Le petit coude qui relie la citation à l'avatar ! */
.message-reply-quote::before {
    content: '';
    position: absolute;
    left: -40px; 
    top: 50%;
    width: 32px;
    height: 14px;
    border-left: 2px solid #4f545c;
    border-top: 2px solid #4f545c;
    border-top-left-radius: 6px;
    transform: translateY(-50%);
}

.reply-author-name {
    font-weight: 700;
    color: var(--text-main);
    opacity: 0.9;
}

.reply-text-preview {
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

/* Un petit effet lumineux quand on survole la citation */
.message-reply-quote:hover .reply-author-name,
.message-reply-quote:hover .reply-text-preview {
    color: #ffffff;
    opacity: 1;
}

/* --- LE MENU DE RÉACTIONS RAPIDES (v2) --- */
#quick-reaction-menu {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    gap: 4px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
}

.quick-react-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: transform 0.1s, background 0.1s;
}

.quick-react-btn:hover {
    background: rgba(88, 166, 255, 0.15);
    transform: translateY(-3px) scale(1.1);
}

.react-separator {
    width: 1px;
    background: #30363d;
    margin: 2px 4px;
}

.quick-react-btn.plus-btn {
    color: #ffb158;
}

.message-reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 4px;
}

.reaction-badge {
    background: rgba(48, 54, 61, 0.6) !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    font-size: 0.95rem !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border 0.15s, transform 0.1s;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.reaction-badge:hover {
    background: rgba(var(--theme-primary-rgb), 0.1) !important;
    border-color: rgba(var(--theme-primary-rgb), 0.5) !important;
    transform: translateY(-2px); 
}

.reaction-badge.je-suis-dessus {
    background: rgba(var(--theme-primary-rgb), 0.15) !important;
    border-color: var(--theme-primary) !important;
}

.reaction-badge.je-suis-dessus .reaction-count {
    color: var(--theme-primary) !important;
}

.reaction-count {
    font-weight: bold;
    color: var(--text-main);
    font-size: 0.9rem;
}

.message-actions-bar {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-surface);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    gap: 4px;
    z-index: 10;
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.message-item:hover .message-actions-bar {
    opacity: 1;
    visibility: visible;
}

.action-bar-btn {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.action-bar-btn:hover {
    background: rgba(248, 81, 73, 0.15);
    color: var(--theme-primary);
}

/* --- LE GROS MENU EMOJIS --- */
#full-emoji-picker-container {
    position: absolute;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4);
}

emoji-picker {
    --background: rgba(22, 27, 34, 0.85);
    --border-color: rgba(var(--theme-primary-rgb), 0.2);
    --input-border-color: var(--theme-primary);
    --indicator-color: var(--theme-primary);
    --hover-color: rgba(var(--theme-primary-rgb), 0.2);
    --num-columns: 8;
    width: 350px;
    height: 400px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Message bienvenue salons */

@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.welcome-container div:first-child {
    animation: pulse-glow 3s infinite ease-in-out;
}

/* Custom Scrollbar pour Chrome/Edge/Safari */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 10px;
}

/* --- LE PANNEAU DES ÉPINGLES --- */
.side-panel-cyber {
    position: fixed;
    top: 0;
    right: -350px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.08), 
        rgba(var(--theme-primary-rgb), 0.08)
    ), rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.side-panel-cyber.open {
    right: 0;
}

.pins-header {
    padding: 20px;
    border-bottom: 1px dashed rgba(var(--theme-primary-rgb), 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pins-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.1em;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(var(--theme-primary-rgb), 0.4);
}

.pins-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.pinned-msg-card {
    background: linear-gradient(90deg, rgba(var(--theme-primary-rgb), 0.08) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--theme-primary);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pinned-msg-card:hover {
    transform: translateX(-3px);
    box-shadow: 0 5px 15px rgba(var(--theme-primary-rgb), 0.15);
    border-color: rgba(var(--theme-primary-rgb), 0.3);
}

.pinned-msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(var(--theme-primary-rgb), 0.2);
    padding-bottom: 4px;
}

.pinned-action-bar {
    margin-top: 10px;
    text-align: right;
}

.btn-jump {
    background: transparent;
    border: 1px solid var(--theme-primary);
    color: var(--theme-primary);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: 0 0 5px rgba(var(--theme-primary-rgb), 0.1);
}

.btn-jump:hover {
    background: rgba(var(--theme-primary-rgb), 0.15);
    box-shadow: 0 0 12px rgba(var(--theme-primary-rgb), 0.4);
    text-shadow: 0 0 5px var(--theme-primary);
}

/* --- PANNEAU MODÉRATION : cartes de signalement --- */
.moderation-card {
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.08) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid #d29922;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.moderation-card:hover {
    transform: translateX(-3px);
    box-shadow: 0 5px 15px rgba(210, 153, 34, 0.2);
}

.mod-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed rgba(210, 153, 34, 0.25);
}

.mod-card-motif {
    color: #d29922;
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
}

.mod-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.mod-card-details {
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid #8b949e;
    padding: 6px 10px;
    margin: 8px 0;
    font-size: 0.85em;
    color: #c9d1d9;
    border-radius: 0 4px 4px 0;
}

.mod-card-message {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 10px;
    font-size: 0.9em;
    color: #c9d1d9;
    margin: 8px 0;
    word-wrap: break-word;
    max-height: 150px;
    overflow-y: auto;
}

.mod-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(var(--theme-primary-rgb), 0.15);
}

.mod-action-btn {
    background: transparent;
    border: 1px solid;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.mod-action-btn.mod-reject  { border-color: #8b949e; color: #8b949e; }
.mod-action-btn.mod-warn    { border-color: #d29922; color: #d29922; }
.mod-action-btn.mod-mute    { border-color: #58a6ff; color: #58a6ff; }
.mod-action-btn.mod-delete  { border-color: #f85149; color: #f85149; }

.mod-action-btn:hover {
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}
.mod-action-btn:hover i { color: #0d1117; }

/* ==========================================================================
   BARRE LATERALE DROITE - AGENTS DU CHAOS
   ========================================================================== */

/* --- ACTIVATION DU SCROLL POUR LES COLONNES --- */
#channels-column, 
.sidebar, 
#dynamic-spheres-container, 
.social-main-content {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Pour les colonnes principales */
#channels-column:hover ::-webkit-scrollbar-thumb,
.sidebar:hover ::-webkit-scrollbar-thumb,
.social-main-content:hover ::-webkit-scrollbar-thumb {
    background: #30363d;
}

/* Pour la zone des Sphères */
#dynamic-spheres-container:hover ::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
}

.add-btn {
    margin: 15px auto !important;
}

#dynamic-spheres-container {
    width: 100%;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary) !important;
    box-shadow: 0 0 5px var(--theme-primary);
}

/* Style des agents dans la liste de droite */

/* Style pour "Moi" en haut de la liste */
.agent-item-moi {
    cursor: pointer;
    padding: 8px 12px;
    border-bottom: 1px solid #30363d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style pour les agents normaux */
.agent-item {
    cursor: pointer;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

/* On réutilise l'effet de hover ambré d'avant */
.agent-item:hover {
    background: rgba(255, 183, 94, 0.1);
    transform: translateX(-5px);
}

/* Le séparateur Hors-Ligne */
.agent-separator {
    list-style: none;
    pointer-events: none;
}

/* Nom de l'agent */
.agent-name {
    font-weight: bold;
    font-size: 14px;
}

#liste-pseudos li {
    list-style: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    margin: 4px 8px;
    padding: 8px 12px;
    position: relative;
    color: #e6edf3;
    display: flex;
    align-items: center;
    gap: 10px;
}

#liste-pseudos li:not(:has(h4)):hover {
    background: rgba(255, 183, 94, 0.1);
    transform: translateX(-5px);
    cursor: pointer;
}

#liste-pseudos li:not(:has(h4)):hover::after {
    content: "Écrire";
    position: absolute;
    right: 105%;
    background: var(--chaos-orange);
    color: var(--bg-base);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: bold;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 183, 94, 0.3);
}

.user-sidebar-controls {
    position: relative;
    margin-top: auto;
    padding-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sidebar-separator {
    width: 32px;
    border: none;
    border-top: 2px solid #30363d;
    margin-bottom: 20px;
    position: relative;
}

.user-sidebar-controls::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: var(--chaos-orange);
    box-shadow: 0 0 12px var(--chaos-orange);
    border-radius: 1px;
    z-index: 1000;
}

.self-avatar-trigger {
    width: 48px;
    height: 48px;
    background: var(--couleur-agent, #58a6ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
    position: relative;
    border: 2px solid var(--bg-surface);
}

/* Le menu qui se déploie au survol de l'orbe */
.agent-orb-container {
    position: relative;
    width: 52px;
    height: 52px;
}

.main-agent-orb {
    width: 52px;
    height: 52px;
    background: var(--couleur-agent, var(--theme-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--bg-surface);
    z-index: 10;
    position: relative;
    font-weight: bold;
    color: var(--bg-surface);
    font-size: 1.2rem;
    overflow: visible !important;
}

.orb-menu-flyout {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 20px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    z-index: 100;
}

.orb-menu-flyout::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.agent-orb-container:hover .orb-menu-flyout {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.orb-menu-flyout.pinned {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.orb-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.orb-btn:hover { background: #21262d; color: var(--theme-primary); }
.orb-btn.disconnect:hover { color: var(--theme-danger); background: rgba(248, 81, 73, 0.1); }
.orb-btn.active-suppression { color: var(--theme-primary); }
.orb-btn#btn-suppression:not(.active-suppression) { color: var(--text-muted); opacity: 0.45; }

/* Popover de volume par utilisateur (clic droit / appui long sur un participant vocal) */
.volume-popover {
    position: fixed;
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    padding: 12px 14px;
    z-index: 9999;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    user-select: none;
}
.volume-popover-title {
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.95em;
    color: var(--theme-primary);
}
.volume-slider {
    width: 100%;
    accent-color: var(--theme-primary);
    cursor: pointer;
}
.volume-value {
    text-align: center;
    font-size: 0.85em;
    margin: 4px 0 8px;
    color: var(--text-muted);
}
.volume-reset {
    width: 100%;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.15s;
}
.volume-reset:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--theme-primary);
}
.vocal-agent-tag { cursor: context-menu; }

/* ============================================================
   APPEL MP — Bandeau v2 (gros avatars, gros boutons, zone stream)
   Visible uniquement quand on est dans le MP de l'appel.
   ============================================================ */
#mp-call-banner {
    display: none;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(30,32,40,0.45), rgba(20,22,28,0.30));
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(63, 185, 80, 0.30);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    padding: 10px 18px;
    gap: 10px;
}
.mpc-stream-zone {
    display: none;
    width: 100%;
    max-height: 50vh;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0,0,0,0.5);
    transition: max-height 0.3s ease;
}
.mpc-stream-zone.has-stream {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    justify-content: center;
}
.mpc-stream-zone video {
    max-width: 100%;
    max-height: 45vh;
    border-radius: 8px;
    background: #000;
}
.mpc-main-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.mpc-participants {
    display: flex;
    gap: -10px;
    align-items: center;
}
.mpc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--theme-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid rgba(63,185,80,0.6);
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: default;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.mpc-avatar + .mpc-avatar { margin-left: -12px; }
.mpc-avatar.mpc-avatar-remote { cursor: context-menu; }
.mpc-avatar.has-avatar .mpc-initial { display: none; }
.mpc-avatar.is-speaking-border {
    border-color: var(--theme-success);
    box-shadow: 0 0 14px 3px rgba(63, 185, 80, 0.7);
}
.mpc-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.mpc-lock { color: var(--theme-success); }
#mp-call-status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-call-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.mpc-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.mpc-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.mpc-btn.hangup-btn {
    background: rgba(248, 81, 73, 0.18);
    color: #ff7b73;
    border-color: rgba(248,81,73,0.4);
}
.mpc-btn.hangup-btn:hover { background: rgba(248,81,73,0.35); color: #fff; }
.mpc-btn.watch-btn {
    background: rgba(63, 185, 80, 0.18);
    color: #7be38a;
    border-color: rgba(63,185,80,0.4);
    width: auto;
    border-radius: 22px;
    padding: 0 14px;
    gap: 6px;
}
.mpc-btn.watch-btn:hover { background: rgba(63,185,80,0.35); color: #fff; }
.mpc-rejoin-timer {
    font-family: monospace;
    color: var(--theme-primary);
    font-size: 0.9rem;
    margin-right: 4px;
    opacity: 0.8;
}

/* ============================================================
   MODAL APPEL ENTRANT (centré, au-dessus de tout)
   ============================================================ */
.incoming-call-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: icm-fade-in 0.2s ease;
}
.icm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}
.icm-card {
    position: relative;
    background: linear-gradient(160deg, rgba(30,32,40,0.97), rgba(20,22,28,0.97));
    border: 1px solid var(--theme-primary);
    border-radius: 18px;
    padding: 28px 36px;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 30px rgba(63,185,80,0.2);
    text-align: center;
    color: var(--text-primary);
}
.icm-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 14px;
    background: var(--theme-primary);
    color: #fff;
    font-size: 2.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--theme-success);
    animation: icm-ring 1.5s ease-in-out infinite;
}
.icm-avatar.has-avatar #icm-initial { display: none; }
.icm-pseudo {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.icm-status {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 22px;
}
.icm-buttons {
    display: flex;
    gap: 28px;
    justify-content: center;
}
.icm-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    transition: transform 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.icm-btn:hover { transform: scale(1.08); }
.icm-accept {
    background: var(--theme-success);
    box-shadow: 0 4px 18px rgba(63,185,80,0.5);
}
.icm-refuse {
    background: var(--theme-danger);
    box-shadow: 0 4px 18px rgba(248,81,73,0.5);
}
@keyframes icm-fade-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes icm-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0.6); }
    50%      { box-shadow: 0 0 0 14px rgba(63,185,80,0); }
}

/* ============================================================
   PASTILLE APPEL SORTANT (bas-droite)
   ============================================================ */
.floating-call-pill {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 16px;
    background: linear-gradient(135deg, rgba(30,32,40,0.95), rgba(20,22,28,0.95));
    border: 1px solid var(--theme-primary);
    border-radius: 28px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
    color: var(--text-primary);
    font-size: 0.9rem;
    animation: pill-slide-in 0.25s ease;
}
@keyframes pill-slide-in {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.floating-call-pill .pill-icon {
    color: var(--theme-success);
    animation: pill-ring 1s ease-in-out infinite;
}
@keyframes pill-ring {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}
.floating-call-pill .pill-text { white-space: nowrap; }
.floating-call-pill .pill-cancel {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(248,81,73,0.2);
    color: #ff7b73;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.floating-call-pill .pill-cancel:hover {
    background: rgba(248,81,73,0.45);
    color: #fff;
}

/* ============================================================
   BOUTON RACCROCHER au-dessus du self-avatar (visible en MP actif)
   ============================================================ */
.self-avatar-wrapper {
    position: relative;
    display: inline-block;
}
.self-hangup-btn {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid rgba(20,22,28,0.9);
    background: var(--theme-danger);
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 14px rgba(248,81,73,0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.self-hangup-btn:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 0 22px rgba(248,81,73,1);
}

/* Badges et Glow */
.status-badge-on-avatar {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--bg-surface);
    z-index: 15;
}

.status-enligne { background: var(--theme-success); }
.status-occupe { background: var(--theme-danger); }
.status-absent { background: var(--theme-primary); }

/* L'aura lumineuse verdoyante 🟢 */
.vocal-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0px 0px rgba(63, 185, 80, 0);
    transition: box-shadow 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.is-vocal-active {
    box-shadow: 0 0 15px 5px rgba(63, 185, 80, 0.6);
    animation: breathing-glow 2s infinite alternate;
}

@keyframes breathing-glow {
    from { opacity: 0.6; transform: scale(1); }
    to { opacity: 1; transform: scale(1.05); }
}

.vocal-current-info {
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.vocal-label { font-size: 0.6rem; color: var(--theme-success); font-weight: bold; }
.vocal-room { font-size: 0.8rem; color: #f0f6fc; }

.role-crown {
    color: #ffd700;
    font-size: 0.8rem;
    margin-left: 5px;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
    cursor: help;
}

.agent-item-moi .role-crown {
    animation: crown-glow 2s infinite alternate;
}

@keyframes crown-glow {
    from { opacity: 0.6; }
    to { opacity: 1; text-shadow: 0 0 5px #ffd700; }
}

.role-global {
    font-size: 0.85rem;
    margin-left: 4px;
    cursor: help;
}
.role-global-admin { filter: drop-shadow(0 0 3px rgba(248, 81, 73, 0.7)); }
.role-global-modo  { filter: drop-shadow(0 0 3px rgba(88, 166, 255, 0.6)); }

#chaos-sidebar-nav {
    position: fixed;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 70px;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.05), 
        rgba(var(--theme-primary-rgb), 0.05)
    ), rgba(5, 5, 5, 0.5);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    border-radius: 12px;
    padding: 15px 0;
    z-index: 1005;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    margin-top: 40px;
}

.conv-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}


#chaos-sidebar-nav::-webkit-scrollbar { display: none; } /* Cache sur Chrome */

.sidebar {
    position: fixed !important;
    right: 5px;
    top: 40px;
    bottom: 5px;
    width: 240px;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.06), 
        rgba(var(--theme-primary-rgb), 0.06)
    ), rgba(5, 5, 5, 0.6) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 900;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.sidebar.collapsed {
    transform: translateX(105%);
}

.sidebar-separator {
    width: 50px;
    height: 2px;
    background: #30363d;
    margin: 5px 0;
    border-radius: 1px;
}

.header-area {
    position: fixed;
    top: 0;
    left: 0px;
    right: 260px;
    height: 35px;
    border-radius: 0 0 8px 8px !important;
    background: linear-gradient(
        rgba(var(--theme-primary-rgb), 0.05),
        rgba(var(--theme-primary-rgb), 0.05)
    ), rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000 !important;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.1);
    width: 100%;
    padding-left: 20px;
}


.nav-arrow {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px;
    z-index: 1000;
}

.nav-arrow:hover {
    color: var(--chaos-orange);
    transform: scale(1.2);
}



.sidebar h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--theme-danger), var(--theme-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 75, 43, 0.4));
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-left: 20px;
}

.sidebar h4 {
    all: unset;
    display: block;
    color: rgba(252, 228, 228, 0.3) !important;
    font-size: 10px !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 25px 0 10px 10px !important;
    font-family: 'Orbitron', sans-serif;
}

/* La base de la pastille */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

/* On cible les deux variantes pour être tranquille */
.status-dot.enligne { background-color: var(--theme-success); }
.status-dot.absent { background-color: #d29922; }
.status-dot.occupe { background-color: var(--theme-danger); }
.status-dot.invisible { background-color: var(--text-muted); }


.notif-badge {
    background-color: var(--theme-danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    box-shadow: 0 0 5px rgba(248, 81, 73, 0.5);
}

/* ==========================================================================
   MESSAGES ET CONTENU
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-system {
    animation: fadeIn 0.4s ease-out;
}


.message-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--chaos-red);
}


#messages li {
    position: relative;
    display: flex;
    gap: 16px;
    padding: 12px 20px;
    transition: background-color 0.2s;
}

#messages li:hover {
    background-color: rgba(79, 84, 92, 0.08);
}

/* Infos système (ex: X a rejoint le chat) */
#messages li[style*="italic"] {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Barre de défilement de la zone de messages */
#messages::-webkit-scrollbar {
    width: 4px;
}

#messages::-webkit-scrollbar-track {
    background: transparent; 
}

#messages::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: var(--chaos-orange);
}

#messages::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary);
    box-shadow: 0 0 10px var(--theme-primary);
}

.message-left {
    flex-shrink: 0;
}

.avatar-clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.avatar-clickable:hover {
    transform: scale(1.1);
}

.message-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--theme-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.popover-card {
    position: fixed;
    width: 280px;
    background: rgba(23, 28, 35, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10000;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: white;
}

.popover-banner {
    height: 80px;
    background: linear-gradient(45deg, var(--theme-primary), var(--theme-primary)); /* Par défaut */
    background-size: cover;
}

.popover-avatar-wrapper {
    margin-top: -40px;
    padding: 0 15px;
    display: flex;
    align-items: flex-end;
}

.popover-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid #171c23;
    background-color: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.message-body {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.message-author {
    color: var(--theme-primary);
    font-size: 14px;
    margin-right: 8px;
    font-weight: bold;
}

.message-time {
    font-size: 11px;
    color: #768390;
    margin-left: 8px;
}

.message-text {
    color: #d1d5db;
    font-size: 15px;
    line-height: 1.5;
}

.safe-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: pre-wrap;
}

.message-text, .safe-text {
    color: #e6edf3 !important;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    display: block;
    margin-top: 4px;
}

.message-body {
    flex: 1;
    min-width: 0;
    padding-bottom: 5px;
}

.message-gif {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin-top: 8px;
    display: block;
}

/* Bulles d'actions au survol */
.message-actions {
    position: absolute;
    right: 20px;
    top: -15px;
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    display: none;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#messages li:hover .message-actions {
    display: flex;
    gap: 8px;
}

.message-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
}

.message-actions button:hover {
    background-color: #30363d;
}


/* ==========================================================================
   BOUTONS ET FORMULAIRES DE SAISIE
   ========================================================================== */
.cyber-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: filter 0.2s;
}

.cyber-btn:hover {
    filter: brightness(1.2);
}

.btn-alt { background-color: #30363d; }

#btn-envoi { background-color: #21262d; border: 1px solid #30363d; color: var(--theme-primary); }

.btn-stop { background-color: var(--theme-danger); margin-top: 10px; }

.btn-alt:hover {
    background-color: var(--theme-danger) !important;
    color: white !important;
    border-color: var(--theme-danger) !important;
    box-shadow: 0 0 15px rgba(248, 81, 73, 0.6);
}

#input {
    resize: none;
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background-color: var(--bg-base);
    color: white;
    outline: none;
    overflow: hidden;
    scrollbar-width: none;
    width: 100%;
    min-height: 40px;
    overflow-y: hidden;
    font-family: var(--font-main);
    font-size: 0.93rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}


#input::-webkit-scrollbar {
    display: none;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
}

/* ==========================================================================
   PICKERS (GIF & EMOJI)
   ========================================================================== */

#gif-picker {
    display: none;
    position: absolute;
    bottom: 85px;
    left: 70px;
    z-index: 2000;
    background: rgba(22, 27, 34, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--theme-primary);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    width: 320px;
    height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- LE CHAMP DE RECHERCHE DU MENU GIF --- */
.gif-search-container {
    padding: 10px;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.3);
}

#gif-search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: var(--text-main);
    transition: border-color 0.2s;
}

#gif-search-input:focus {
    outline: none;
    border-color: var(--theme-primary);
}

/* --- LA MOSAÏQUE (RÉSULTATS) --- */
#gif-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-content: flex-start;
    padding: 10px;
}

/* Les carrés de la mosaïque */
#gif-results img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    border: 2px solid transparent;
}

#gif-results img:hover {
    transform: scale(1.05);
    border-color: var(--theme-primary);
}

/* --- LA BARRE DE SCROLL DU MENU GIF --- */
#gif-results::-webkit-scrollbar { 
    width: 8px; 
}
#gif-results::-webkit-scrollbar-track { 
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 4px;
}
#gif-results::-webkit-scrollbar-thumb { 
    background: var(--theme-primary);
    border-radius: 4px; 
}
#gif-results::-webkit-scrollbar-thumb:hover { 
    background: var(--theme-primary);
}

/* --- LE BOUTON GIF DE LA BARRE D'OUTILS --- */
.gif-label {
    font-family: 'Orbitron', monospace;
    font-weight: bold;
    color: var(--text-main);
    background: transparent;
    border: none;
}
.gif-label:hover {
    color: var(--theme-primary);
}

#chat-emoji-picker-container {
    position: absolute;
    bottom: 85px;
    left: 20px;
    z-index: 1001;
    background: rgba(22, 27, 34, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.6);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

#chat-picker {
    --num-columns: 8;
    --category-emoji-size: 1.1rem;
    width: 350px;
    height: 400px;
}

/* ==========================================================================
   VIDÉO ET PARTAGE
   ========================================================================== */
#video-container {
    display: none;
    background-color: #000;
    padding: 15px;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid #30363d;
}

#screen-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 2px solid var(--theme-primary);
}

/* Aligne bien les boutons à gauche du champ texte */
.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    filter: grayscale(1);
    transition: 0.2s;
}

.icon-btn:hover {
    filter: grayscale(0);
    transform: scale(1.1);
}

/* =========================================
   🔍 PANNEAU DE RECHERCHE (GLASSMORPHISM)
   ========================================= */

#search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    /* Effet verre dépoli */
    background: rgba(13, 17, 23, 0.4); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    flex-shrink: 0;
    z-index: 10;
}

#search-panel.is-open {
    max-height: 80px;
    border-bottom-color: rgba(255, 255, 255, 0.05); /* Ligne très discrète */
    padding: 12px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.search-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.search-icon-lead {
    color: var(--theme-primary, #58a6ff); /* Prend la couleur du thème ! */
    font-size: 1.1rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--theme-primary) 50%, transparent));
}

/* Les champs de saisie façon "Pilule" */
#search-kw,
#search-author {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 20px;
    color: var(--text-main, #c9d1d9);
    font-size: 0.85rem;
    padding: 8px 16px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

#search-kw { flex: 2; min-width: 0; }
#search-author { flex: 1; min-width: 0; }

#search-kw:focus,
#search-author:focus {
    border-color: var(--theme-primary, #58a6ff);
    box-shadow: 0 0 8px color-mix(in srgb, var(--theme-primary) 40%, transparent), inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Les tags cliquables */
.search-chips {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.search-chip {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 20px;
    color: var(--text-muted, #8b949e);
    font-size: 0.78rem;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-chip:hover {
    border-color: var(--theme-primary, #58a6ff);
    color: var(--text-main);
    box-shadow: 0 0 8px color-mix(in srgb, var(--theme-primary) 30%, transparent);
}

.search-chip.active {
    border-color: var(--theme-primary, #58a6ff);
    background: color-mix(in srgb, var(--theme-primary, #58a6ff) 20%, transparent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 10px color-mix(in srgb, var(--theme-primary) 40%, transparent);
}

.search-close-btn {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid transparent;
    color: #f85149;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px 10px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.search-close-btn:hover {
    background: #f85149;
    color: white;
    box-shadow: 0 0 10px rgba(248, 81, 73, 0.5);
}

.search-run-btn {
    background: transparent;
    border: 1px solid var(--theme-primary, #58a6ff);
    border-radius: 20px;
    color: var(--theme-primary, #58a6ff);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 8px 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-run-btn:hover { 
    background: var(--theme-primary, #58a6ff);
    color: #000;
    box-shadow: 0 0 12px var(--theme-primary, #58a6ff);
}

#btn-search.search-active {
    color: var(--theme-primary, #58a6ff) !important;
    text-shadow: 0 0 8px var(--theme-primary, #58a6ff);
}

/* =========================================
   📋 PANNEAU LATÉRAL DES RÉSULTATS
   ========================================= */

#search-results-panel {
    position: fixed;
    top: 60px; /* Aligné sous le header */
    right: 0;
    bottom: 0;
    width: 350px;
    
    /* Le fameux verre dépoli ! */
    background: rgba(18, 22, 29, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    border-left: 1px solid color-mix(in srgb, var(--theme-primary) 30%, transparent);
    display: flex;
    flex-direction: column;
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Animation "rebond" ultra fluide */
    box-shadow: -8px 0 30px rgba(0,0,0,0.5);
}

#search-results-panel.is-open {
    transform: translateX(0);
}

.srp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.srp-title {
    font-size: 0.85rem;
    color: var(--theme-primary, #58a6ff);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.srp-close-btn {
    background: none;
    border: none;
    color: var(--text-muted, #8b949e);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    transition: color 0.2s, transform 0.2s;
}

.srp-close-btn:hover { 
    color: white; 
    transform: scale(1.1);
}

.srp-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar futuriste pour les résultats */
.srp-list::-webkit-scrollbar { width: 4px; }
.srp-list::-webkit-scrollbar-thumb {
    background: var(--theme-primary, #58a6ff);
    border-radius: 4px;
}

.srp-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 10px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.srp-card:hover {
    border-color: var(--theme-primary, #58a6ff);
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 10px color-mix(in srgb, var(--theme-primary) 15%, transparent);
}

.srp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 5px;
}

.srp-author {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.srp-time {
    font-size: 0.75rem;
    color: #8b949e;
}

.srp-excerpt {
    font-size: 0.85rem;
    color: #c9d1d9;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Le bouton d'action dans la carte de résultat */
.srp-goto-btn {
    align-self: flex-end;
    margin-top: 5px;
    background: transparent;
    border: 1px solid var(--theme-primary);
    color: var(--theme-primary);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.srp-goto-btn:hover {
    background: var(--theme-primary);
    color: #000;
    box-shadow: 0 0 8px var(--theme-primary);
}

/* Le surlignage des mots clés trouvés */
.search-mark {
    background: color-mix(in srgb, var(--theme-primary) 40%, transparent);
    color: #fff;
    padding: 0 3px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 0 5px color-mix(in srgb, var(--theme-primary) 50%, transparent);
}

/* L'effet de "Flash" quand on clique sur "Aller au message" */
.search-flash {
    animation: flashHighlight 2s ease-out;
}

@keyframes flashHighlight {
    0% { background-color: color-mix(in srgb, var(--theme-primary) 60%, transparent); box-shadow: 0 0 15px var(--theme-primary); }
    100% { background-color: transparent; box-shadow: none; }
}

.srp-empty {
    text-align: center;
    color: #8b949e;
    font-style: italic;
    margin-top: 30px;
}

/* ─── Bouton scroll-to-bottom ─── */

#btn-scroll-bottom {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--border-subtle, #30363d);
    border-radius: 20px;
    color: var(--text-main, #c9d1d9);
    font-size: 0.85rem;
    padding: 6px 16px;
    cursor: pointer;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    white-space: nowrap;
}

#btn-scroll-bottom.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

#btn-scroll-bottom:hover {
    border-color: var(--theme-primary, #58a6ff);
    color: var(--theme-primary, #58a6ff);
}

/* Flash d'un message trouvé */

@keyframes search-flash {
    0%   { background: color-mix(in srgb, var(--theme-primary, #58a6ff) 28%, transparent); }
    70%  { background: color-mix(in srgb, var(--theme-primary, #58a6ff) 10%, transparent); }
    100% { background: transparent; }
}

#messages li.search-flash {
    animation: search-flash 2.2s ease-out forwards;
    border-radius: 6px;
}
/* ═══════════════════════════════════════════════════════
   MODALE GESTION DES RÔLES
═══════════════════════════════════════════════════════ */

.roles-modal-box {
    width: min(900px, 96vw);
    height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.roles-modal-box .modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

.roles-tabs {
    display: flex;
    gap: 4px;
    padding: 10px 20px 0;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.roles-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #8b949e;
    font-family: 'Orbitron', monospace;
    font-size: 0.78rem;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.roles-tab.active {
    color: var(--theme-primary, #f0c040);
    border-bottom-color: var(--theme-primary, #f0c040);
}

.roles-panel-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.roles-split {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Colonne gauche : liste des rôles */
.roles-list-col {
    width: 200px;
    min-width: 180px;
    border-right: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.roles-create-btn {
    margin: 12px;
    padding: 7px 12px;
    background: rgba(var(--theme-primary-rgb, 240,192,64), 0.12);
    border: 1px dashed rgba(var(--theme-primary-rgb, 240,192,64), 0.4);
    color: var(--theme-primary, #f0c040);
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.2s;
}

.roles-create-btn:hover {
    background: rgba(var(--theme-primary-rgb, 240,192,64), 0.22);
}

#roles-list {
    overflow-y: auto;
    flex: 1;
}

.role-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 6px;
    transition: background 0.15s;
    font-size: 0.85rem;
}

.role-list-item:hover { background: rgba(255,255,255,0.05); }
.role-list-item.active { background: rgba(var(--theme-primary-rgb,240,192,64),0.15); }

.role-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-list-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #c9d1d9;
}

/* Colonne droite : éditeur */
.roles-editor-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

.roles-editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: #8b949e;
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
}

.roles-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #30363d;
    flex-shrink: 0;
}

.role-editor-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.role-name-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #e6edf3;
    padding: 7px 12px;
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.role-name-input:focus { border-color: var(--theme-primary, #f0c040); }
.role-name-input[readonly] { opacity: 0.6; cursor: default; }

.role-delete-btn {
    background: transparent;
    border: 1px solid #f8514940;
    color: #f85149;
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}
.role-delete-btn:hover { background: rgba(248,81,73,0.15); }

/* Permissions scrollables */
.perm-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    min-height: 0;
}

.perm-category { margin-bottom: 20px; }

.perm-category-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.68rem;
    color: #8b949e;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #21262d;
}

.perm-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.perm-toggle:hover { background: rgba(255,255,255,0.03); padding: 8px 6px; }

.perm-label {
    font-size: 0.85rem;
    color: #c9d1d9;
}

/* Toggle switch */
.toggle-switch { position: relative; display: inline-flex; align-items: center; }

.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
    display: block;
    width: 40px;
    height: 22px;
    background: #30363d;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #8b949e;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: rgba(var(--theme-primary-rgb,240,192,64),0.3); }
.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(18px);
    background: var(--theme-primary, #f0c040);
}
.toggle-switch input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

.roles-editor-footer {
    padding: 14px 20px;
    border-top: 1px solid #30363d;
    flex-shrink: 0;
}

/* Panel membres */
.membres-roles-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: calc(88vh - 130px);
}

.membre-role-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid #21262d;
    border-radius: 8px;
    gap: 12px;
}

.membre-role-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.membre-role-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: #0d1117;
    flex-shrink: 0;
}

.membre-role-pseudo {
    font-size: 0.9rem;
    color: #e6edf3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-crown-badge { font-size: 0.9rem; }

.membre-role-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    padding: 6px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    min-width: 140px;
    outline: none;
}

.membre-role-select.disabled-select { opacity: 0.5; cursor: not-allowed; }

/* Overlay de Drag & Drop */
#drop-zone-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: color-mix(in srgb, var(--theme-primary) 20%, transparent);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9999;
    border: 4px dashed var(--theme-primary);
    pointer-events: none;
}

.drop-zone-content {
    text-align: center;
    color: white;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 15px var(--theme-primary);
}

.drop-zone-content i {
    font-size: 4rem;
    margin-bottom: 20px;
}

#file-preview-banner {
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle, #30363d);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 10px;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-details {
    display: flex;
    flex-direction: column;
}

/* Limiter la taille des images dans le chat */
.message-content img {
    display: block;
    max-width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
    cursor: zoom-in;
    border: 1px solid var(--border-subtle, #30363d);
}

/* --- LE LIGHTBOX --- */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

/* ========================================== */
/* E2EE Onboarding modal                      */
/* ========================================== */

.e2ee-mots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
    padding: 15px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.e2ee-mot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.e2ee-mot-num {
    color: #8b949e;
    font-size: 0.75em;
    min-width: 18px;
    text-align: right;
}

.e2ee-mot-txt {
    color: var(--theme-primary);
    font-weight: bold;
}

.e2ee-verif-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.e2ee-verif-row .cyber-label {
    min-width: 80px;
    margin: 0;
}

.e2ee-verif-input {
    flex: 1;
    padding: 8px;
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.e2ee-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #30363d;
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    animation: e2ee-spin 1s linear infinite;
}

@keyframes e2ee-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .e2ee-mots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}