:root {
    --primary: #f39c12; 
    --bg: #0b0d0f;
    --text: #ffffff;
    --accent: #2ecc71;
}

body {
    margin: 0; padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    padding: 60px 20px;
    box-sizing: border-box;
    transition: box-shadow 0.5s ease;
}

/* Efectos de Pulso y Shake */
@keyframes vault-pulse {
    0% { box-shadow: inset 0 0 0px rgba(243, 156, 18, 0); }
    50% { box-shadow: inset 0 0 60px rgba(243, 156, 18, 0.15); }
    100% { box-shadow: inset 0 0 0px rgba(243, 156, 18, 0); }
}
.pulse-active { animation: vault-pulse 0.8s ease-out; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
}
.shake-active { animation: shake 0.2s ease-in-out; }

.container { text-align: center; z-index: 2; max-width: 900px; width: 100%; }

h1 {
    letter-spacing: 12px;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    animation: flicker 4s infinite;
}

.vault-value {
    font-size: clamp(3.5rem, 12vw, 6.5rem);
    color: var(--primary);
    font-weight: bold;
    text-shadow: 0 0 30px rgba(243, 156, 18, 0.4);
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
}

/* Nodos de Carga */
.node-status { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.node { width: 6px; height: 6px; background: #1a1c1e; border-radius: 1px; transition: all 0.4s ease; }
.node.active { background: var(--primary); box-shadow: 0 0 10px var(--primary); }

.hero-text { font-size: 1.2rem; line-height: 1.6; color: #888; margin-bottom: 30px; }

.opening-estimate { margin-bottom: 40px; font-size: 0.85rem; color: #555; letter-spacing: 2px; text-transform: uppercase; }
.eta-timer { color: var(--primary); font-weight: bold; border: 1px solid #333; padding: 6px 15px; border-radius: 4px; background: rgba(243, 156, 18, 0.05); margin-left: 10px; display: inline-block; }

.user-count { margin: 20px 0; font-size: 0.9rem; color: #666; letter-spacing: 1px; }
.user-count b { color: var(--primary); background: rgba(243, 156, 18, 0.1); padding: 2px 8px; border-radius: 4px; display: inline-block; }

.live-indicator { display: inline-block; width: 8px; height: 8px; background-color: var(--accent); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 8px var(--accent); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.2); } }

.live-feed { margin: 20px 0; font-size: 0.75rem; color: var(--accent); height: 20px; font-family: monospace; text-transform: uppercase; }

.email-form { margin: 30px 0; display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
input[type="email"] { padding: 18px 25px; border: 1px solid #333; background: #1a1c1e; color: white; border-radius: 5px; width: 350px; font-size: 1rem; outline: none; }
input[type="email"]:focus { border-color: var(--primary); }

/* Botón con Escáner */
button { 
    padding: 18px 35px; background: var(--primary); border: none; color: white; font-weight: bold; border-radius: 5px; 
    cursor: pointer; transition: 0.3s; text-transform: uppercase; font-size: 1rem; position: relative; overflow: hidden; 
}
button:hover { background: #e67e22; transform: scale(1.05); }

.scanner-line { 
    position: absolute; 
    top: 0; 
    left: -100%; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); 
    z-index: 5;
}
button.scanning .scanner-line { animation: scan 1.5s infinite linear; }
@keyframes scan { 0% { left: -100%; } 100% { left: 100%; } }

/* Progress Bar */
.progress-container { width: 100%; max-width: 400px; background: #1a1c1e; height: 4px; margin: 20px auto; border-radius: 10px; overflow: hidden; }
.progress-bar { width: 14%; height: 100%; background: var(--primary); box-shadow: 0 0 10px var(--primary); animation: load 10s infinite alternate; }
@keyframes load { 0% { width: 12%; } 100% { width: 15%; } }

.features { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 30px; 
    margin-top: 80px; 
    margin-bottom: 50px; 
    text-align: left;
    width: 100%;
}
@media (max-width: 768px) { .features { grid-template-columns: 1fr; } }

.feature-box { 
    background: rgba(26, 28, 30, 0.4); 
    padding: 30px; 
    border-radius: 12px; 
    border: 1px solid #222; 
    transition: 0.3s;
    height: auto; 
    min-height: 200px; 
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.feature-box p { margin: 0; line-height: 1.5; }
.feature-box:hover { border-color: var(--primary); background: rgba(243, 156, 18, 0.05); }
.feature-box h3 { color: var(--primary); font-size: 1.1rem; margin: 0 0 15px 0; text-transform: uppercase; }
.icon { font-size: 2rem; margin-bottom: 20px; display: block; }

.warning { margin-top: 80px; color: #ff4757; font-size: 0.8rem; opacity: 0.5; letter-spacing: 3px; text-transform: uppercase; }
#binary-stream { margin-top: 40px; font-size: 0.6rem; color: #1a1c1e; font-family: monospace; word-break: break-all; }

@keyframes flicker { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: 0.5; } }
body::before { content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(#1a1c1e 1px, transparent 1px); background-size: 40px 40px; opacity: 0.3; z-index: 1; pointer-events: none; }

.system-status { font-size: 0.65rem; color: #444; letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.status-divider { margin: 0 10px; opacity: 0.3; }
#ping-value { transition: color 0.3s ease; }
.high-ping { color: #ff4757 !important; }     

.button-scanner-wrapper { position: relative; display: inline-block; padding: 10px; }
.corner { position: absolute; width: 15px; height: 15px; border-color: var(--primary); border-style: solid; opacity: 0; transition: all 0.3s ease; pointer-events: none; }
.top-left { top: 0; left: 0; border-width: 2px 0 0 2px; }
.top-right { top: 0; right: 0; border-width: 2px 2px 0 0; }
.bottom-left { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.bottom-right { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.button-scanner-wrapper:hover .corner { opacity: 1; transform: scale(0.8); }
.button-scanner-wrapper:hover .top-left { top: 5px; left: 5px; }
.button-scanner-wrapper:hover .top-right { top: 5px; right: 5px; }
.button-scanner-wrapper:hover .bottom-left { bottom: 5px; left: 5px; }
.button-scanner-wrapper:hover .bottom-right { bottom: 5px; right: 5px; }

.button-scanner-wrapper:has(.scanning) .corner { display: none; }       

.risk-section { width: 100%; max-width: 300px; margin: 10px auto 25px auto; }
.risk-label { display: flex; justify-content: space-between; font-size: 0.6rem; color: #555; letter-spacing: 1px; margin-bottom: 5px; }
.risk-meter-container { width: 100%; height: 6px; background: #1a1c1e; border-radius: 10px; overflow: hidden; border: 1px solid #222; }
.risk-bar { width: 72%; height: 100%; background: linear-gradient(90deg, var(--primary), #ff4757); box-shadow: 0 0 10px rgba(243, 156, 18, 0.3); transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.critical-risk { animation: pulse-red 0.5s infinite alternate; }

@keyframes pulse-red { from { box-shadow: 0 0 5px #ff4757; } to { box-shadow: 0 0 15px #ff4757; } }    

/* Estilos para la Tabla de Clasificación */
.leaderboard-section {
    margin-top: 20px; /* Reducido para pegarlo al formulario */
    width: 100%;
    background: rgba(26, 28, 30, 0.4);
    border-radius: 12px;
    border: 1px solid var(--primary); /* Resaltado para visibilidad */
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.9rem; }
.leaderboard-table th { color: #444; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 2px; padding: 10px; border-bottom: 1px solid #222; }
.leaderboard-table td { padding: 15px 10px; border-bottom: 1px solid #1a1c1e; text-align: center; }
.rank-number { color: var(--primary); font-weight: bold; }
.guardian-name { font-family: monospace; color: #ccc; }
.power-val { color: var(--accent); }
.top-rank { background: rgba(243, 156, 18, 0.05); box-shadow: inset 0 0 15px rgba(243, 156, 18, 0.05); }   

/* Colores de Rango */
.rank-architect { color: #bb86fc !important; text-shadow: 0 0 10px rgba(187, 134, 252, 0.5); } /* Violeta */
.rank-encryptor { color: #03dac6 !important; text-shadow: 0 0 10px rgba(3, 218, 198, 0.5); } /* Turquesa */
.rank-guardian  { color: #2ecc71 !important; } /* Verde */
.rank-initiate  { color: #888888 !important; } /* Gris */

/* Estilo de la etiqueta de rango */
.rank-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
    border: 1px solid currentColor;
    border-radius: 3px;
    margin-left: 10px;
    letter-spacing: 1px;
    vertical-align: middle;
}      

/* Rewards System Styling */
.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
    visibility: visible !important;
    opacity: 1 !important;
}

.reward-card {
    background: rgba(243, 156, 18, 0.03);
    border: 1px dashed #333;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
}

.reward-card:hover {
    border-color: var(--primary);
    background: rgba(243, 156, 18, 0.08);
    transform: translateY(-2px);
}

.reward-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.reward-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    color: #888;
    line-height: 1.6;
}

.reward-card ul li::before {
    content: "> ";
    color: var(--primary);
}      

/* Upgrade Terminal Overlay */
#upgrade-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}

.terminal-window {
    width: 90%;
    max-width: 500px;
    background: #0b0d0f;
    border: 1px solid var(--accent);
    padding: 25px;
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.2);
    position: relative;
}

.booster-item {
    border: 1px solid #222;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    cursor: pointer;
}

.booster-item:hover {
    border-color: var(--accent);
    background: rgba(46, 204, 113, 0.05);
}

.booster-info h4 { margin: 0; color: var(--accent); font-size: 0.9rem; }
.booster-info p { margin: 5px 0 0 0; font-size: 0.7rem; color: #666; }

.cost-tag {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.8rem;
    border: 1px solid var(--primary);
    padding: 4px 8px;
}

.close-terminal {
    position: absolute;
    top: 10px; right: 10px;
    color: #444;
    cursor: pointer;
    font-size: 0.8rem;
}

.feature-box {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-box:hover {
    background: rgba(46, 204, 113, 0.05); /* Subtle green glow */
    border: 1px solid var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

/* Contenedor Principal con desenfoque de fondo */
.vault-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

/* La Caja del Terminal */
.vault-modal-content {
    background: #050505;
    border: 1px solid #2ecc71;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.2), inset 0 0 10px rgba(46, 204, 113, 0.1);
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
}

/* Efecto de líneas de escaneo (Scanlines) */
.vault-modal-content::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
}

/* Encabezado Estilo Consola */
.vault-modal-header {
    padding: 12px 20px;
    background: rgba(46, 204, 113, 0.1);
    border-bottom: 1px solid #2ecc71;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#vaultModalTitle {
    color: #2ecc71;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 0 5px #2ecc71;
}

/* Botón Cerrar */
.close-vault-modal {
    color: #2ecc71;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: 0.3s;
}

.close-vault-modal:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

/* Cuerpo del Mensaje */
.vault-modal-body {
    padding: 25px;
    color: #2ecc71; /* Texto verde terminal */
    font-size: 0.95rem;
    min-height: 150px;
}

/* Estilo para las listas dentro del modal */
#vaultModalBody ul {
    list-style: none;
    padding-left: 0;
    margin-top: 15px;
}

#vaultModalBody li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

#vaultModalBody li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: #fff;
}

/* Footer con parpadeo */
.vault-modal-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(46, 204, 113, 0.2);
    font-size: 0.75rem;
    color: rgba(46, 204, 113, 0.6);
}

.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% { opacity: 0; }
}

.close-vault-modal {
    color: #2ecc71;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* 1. Ancho del scrollbar */
#chat-window::-webkit-scrollbar {
    width: 6px;
}

/* 2. El fondo del scrollbar (Track) */
#chat-window::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-left: 1px solid #111;
}

/* 3. La barra que se mueve (Handle) */
#chat-window::-webkit-scrollbar-thumb {
    background: #2ecc71; /* El verde neón */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); /* Brillo */
}

/* 4. Efecto al pasar el mouse por encima */
#chat-window::-webkit-scrollbar-thumb:hover {
    background: #27ae60;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.8);
}

/* Para Firefox */
#chat-window {
    scrollbar-width: thin;
    scrollbar-color: #2ecc71 rgba(0, 0, 0, 0.2);
}

@keyframes vault-scan {
    0% { top: -2%; }
    100% { top: 102%; }
}
/* Aseguramos que el input no brille blanco al clickear */
#modal-group-name:focus {
    border-color: #2ecc71 !important;
    box-shadow: 0 0 10px rgba(46,204,113,0.2);
}

@keyframes scan {
    0% { transform: translateY(-70px); }
    100% { transform: translateY(70px); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(255, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}

/* Estilos Responsivos para Pantallas Pequeñas */
@media (max-width: 768px) {
    /* 1. Hide the sidebar entirely */
    #group-sidebar {
        display: none !important;
    }

    /* 2. Remove the border and force the chat window to be 100% width */
    #chat-window {
        width: 100% !important;
        flex: none !important; /* Disables the flex-grow logic */
        border-left: none !important;
    }

    /* 3. Optional: Make the container taller on mobile for better visibility */
    .terminal-chat-container div[style*="height: 400px"] {
        height: 500px !important; 
    }
    
    /* 4. Ensure the input area doesn't get cut off */
    .chat-input-area {
        padding: 15px !important;
    }
}
