body {
    background-color: rgba(15, 23, 42, 0.95);
    background-image: radial-gradient(circle at top right, rgba(124, 58, 237, 0.1), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(103, 232, 249, 0.05), transparent 40%);
    background-attachment: fixed;
    color: #e2e8f0;
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    margin: 0;
}

.text-gradient {
    background: linear-gradient(90deg, #c084fc, #7c3aed, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 1.5rem;
    transition: all 0.4s ease;
}
.card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 20px rgba(124, 58, 237, 0.1);
}

.progress-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}
.progress-fill {
    background: linear-gradient(90deg, #7c3aed, #67e8f9);
    height: 100%;
    transition: width 1s ease-in-out;
    border-radius: 999px;
}

/* === CHAT UI === */
.chat-container {
    height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #7c3aed transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}
.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-thumb { background-color: #7c3aed; border-radius: 10px; }

.chat-bubble {
    background-color: #1e293b; /* Fallback sólido de color "surface" más visible */
    background-color: rgba(30, 41, 59, 0.9); /* Ligeramente transparente para profundidad */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Soporte iOS/Safari móvil */
    padding: 10px 14px;
    border-radius: 1rem;
    border-top-left-radius: 0;
    max-width: 85%;
    width: fit-content;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}
.chat-bubble.own-message {
    align-self: flex-end;
    border-top-left-radius: 1rem;
    border-top-right-radius: 0;
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}

/* Estilos Premium */
.chat-bubble.role-admin { border-left: 3px solid #eab308; box-shadow: 0 0 10px rgba(234, 179, 8, 0.1); }
.chat-bubble.role-premium { border-left: 3px solid #67e8f9; box-shadow: 0 0 10px rgba(103, 232, 249, 0.1); }

.chat-reply-ref {
    font-size: 0.75rem;
    color: #a78bfa;
    background: rgba(0,0,0,0.2);
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 2px solid #a78bfa;
    display: block;
    cursor: pointer;
}

.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}
.status-online { color: #22c55e; background: #22c55e; }
.status-offline { color: #ef4444; background: #ef4444; }
.status-checking { color: #f59e0b; background: #f59e0b; animation: pulse 1s infinite; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* === ENLACES Y TEXTOS === */
.chat-link { color: #c084fc; text-decoration: none; font-weight: 500; transition: all 0.3s; }
.chat-link:hover { text-shadow: 0 0 8px rgba(192, 132, 252, 0.6); text-decoration: underline; }

.chat-link-evo {
    /* Tu estilo original preservado */
    background: linear-gradient(90deg, #7c3aed, #67e8f9);
    -webkit-background-clip: text; 
    background-clip: text; 
    color: transparent;
    font-weight: 700; 
    text-decoration: none; 
    transition: filter 0.3s;

    /* Mejoras de seguridad para que el link no rompa el chat */
    display: inline; /* Para que fluya con el texto normal */
    word-break: break-all; /* Obligatorio: rompe el link si es más ancho que la burbuja */
}

.chat-link-evo:hover {
    /* Tu efecto de brillo original */
    filter: brightness(1.2); 
    text-shadow: 0 0 10px rgba(103, 232, 249, 0.4);
}

.reply-deleted { 
    color: #ef4444 !important; 
    border-left-color: #ef4444 !important; 
    font-style: italic; 
    background: rgba(239, 68, 68, 0.1) !important;
}

/* === ACORDEÓN DE REGLAS === */
.rules-content { 
    max-height: 0; 
    overflow: hidden; 
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transition: all 0.4s ease-out; 
}
#toggle-rules:checked ~ .rules-content { 
    max-height: 500px; 
    padding-bottom: 0.75rem;
    opacity: 1;
}
.rules-icon { transition: transform 0.4s; }
#toggle-rules:checked ~ label .rules-icon { transform: rotate(180deg); }
