/* --- RESET & BASE --- */
* { box-sizing: border-box; outline: none; user-select: none; }
body { 
    margin: 0; 
    font-family: 'Roboto Condensed', sans-serif; 
    background: #050505; 
    color: white; 
    height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden;
}

/* IMAGEN DE FONDO DE LA PÁGINA (FUERA DEL CHAT) */
.page-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('../assets/bg_cyber.jpg') center/cover;
    filter: blur(8px) brightness(0.4); /* Desenfocado para que resalte la consola */
    z-index: -1;
}

/* --- LA CONSOLA AURA (EL CHAT EN SÍ) --- */
.aura-console {
    width: 95%;
    max-width: 1000px;
    height: 85vh; /* Altura fija */
    background: #000;
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8), 0 0 20px rgba(0, 243, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* HEADER SUPERIOR */
.console-header {
    height: 50px;
    background: #111;
    border-bottom: 2px solid #00f3ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.brand { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 2px; color: white; }
.blink { color: red; animation: blink 1s infinite; }

.hud-stats { display: flex; gap: 10px; }
.stat-pill { background: #222; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: bold; border: 1px solid #333; display: flex; align-items: center; gap: 5px; }
.stat-pill.gold { color: #ffd700; border-color: #ffd700; }
.stat-pill.blue { color: #00f3ff; border-color: #00f3ff; }
.shop-trigger { background: #ff0055; color: white; border: none; font-weight: bold; padding: 5px 15px; border-radius: 4px; cursor: pointer; font-family: 'Chakra Petch'; }
.shop-trigger:hover { background: #ff3377; }

/* CUERPO (CHAT + USUARIOS) */
.console-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* --- PANEL IZQUIERDO (CHAT) --- */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

.media-area {
    height: 120px;
    background: radial-gradient(circle, #222, #000);
    border-bottom: 1px solid #333;
    display: flex; align-items: center; justify-content: center;
    color: #444;
}

/* ÁREA DE MENSAJES */
.chat-area {
    flex: 1;
    background: url('../assets/bg_cyber.jpg') center/cover; /* Fondo interno nítido */
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.msg-bubble {
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
    text-shadow: 
        -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, /* Contorno negro */
        0 2px 5px rgba(0,0,0,0.8);
    animation: slideIn 0.2s ease;
}
.msg-bubble img { vertical-align: middle; border: 1px solid rgba(255,255,255,0.3); box-shadow: 0 2px 5px black; }

/* BARRA DE ESCRITURA (DOCK) */
.dock-bar {
    height: 60px;
    background: #111;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}
.dock-btn { background: #222; border: 1px solid #444; color: white; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; font-size: 18px; }
.dock-btn:hover { background: #333; border-color: #fff; }

.input-container { flex: 1; display: flex; background: #000; border: 1px solid #444; border-radius: 8px; padding: 2px; }
#msg-input { flex: 1; background: transparent; border: none; padding: 0 15px; color: white; font-family: 'Roboto Condensed'; font-size: 16px; }
.send-btn { background: #00f3ff; color: black; border: none; padding: 0 20px; font-weight: bold; cursor: pointer; border-radius: 6px; }

/* --- PANEL DERECHO (USUARIOS) - SOLUCIÓN A TU QUEJA --- */
.side-panel {
    width: 260px; /* Ancho fijo */
    background: #0e0e0e; /* FONDO OSCURO SÓLIDO */
    border-left: 2px solid #333;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: #1a1a1a;
    color: #888;
    font-size: 12px;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #333;
    letter-spacing: 1px;
}

.users-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

.user-row {
    display: flex;
    align-items: center;
    padding: 8px;
    background: #151515; /* Fondo para cada usuario */
    border: 1px solid #222;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: 0.2s;
    cursor: pointer;
}
.user-row:hover { background: #222; border-color: #555; }
.user-row .pawn-wrapper { margin-right: 8px; }
.user-row .username { font-weight: bold; font-size: 14px; color: #ccc; }

.panel-footer { padding: 10px; border-top: 1px solid #333; text-align: center; }
.toggle-btn { background: none; border: 1px solid #444; color: #666; padding: 5px 10px; cursor: pointer; font-size: 11px; }

/* --- ESTILOS VISUALES (EFECTOS) --- */
.normal-name { color: #bbb; }
.neon-blue { color: white; text-shadow: 0 0 5px #00f, 0 0 10px #00f; font-weight: bold; }
.neon-red { color: white; text-shadow: 0 0 5px #f00, 0 0 10px #f00; font-weight: bold; }
.neon-gold { color: #ffd700; text-shadow: 0 0 5px orange; font-weight: bold; animation: pulse 2s infinite; }
.neon-fire { color: #ffeb3b; text-shadow: 0 -2px 4px #ff0000; font-weight: 900; }
.neon-matrix { color: #0f0; background: black; padding: 0 4px; font-family: monospace; }

.aura-gold::after { content:''; position: absolute; top:-2px; left:-2px; right:-2px; bottom:-2px; border: 1px dashed gold; border-radius: 50%; animation: spin 3s linear infinite; }
.aura-fire::after { content:''; position: absolute; top:-2px; left:-2px; right:-2px; bottom:-2px; border: 2px solid red; box-shadow: 0 0 5px red; border-radius: 50%; animation: pulse 0.5s infinite; }

/* MODAL / OVERLAYS */
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 999; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #111; border: 1px solid #444; padding: 30px; border-radius: 8px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 0 40px rgba(0,243,255,0.1); }
.modal-box.shop-modal { max-width: 800px; height: 80vh; padding: 0; display: flex; flex-direction: column; border-color: #00f3ff; }

.modal-header { padding: 15px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; background: #151515; }
.modal-header h2 { margin: 0; color: #00f3ff; font-family: 'Chakra Petch'; }
.close-x { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }

.neon-title { font-family: 'Chakra Petch'; font-size: 32px; margin-bottom: 20px; color: #fff; text-shadow: 0 0 10px #00f3ff; }
.modal-box input { display: block; width: 100%; padding: 12px; margin-bottom: 10px; background: #222; border: 1px solid #444; color: white; text-align: center; }
.action-btn { width: 100%; padding: 12px; background: #00f3ff; font-weight: bold; border: none; cursor: pointer; }

/* SHOP GRID */
.tabs { display: flex; background: #111; border-bottom: 1px solid #333; }
.tab { flex: 1; padding: 15px; background: #222; border: none; color: #888; font-weight: bold; cursor: pointer; }
.tab.active { background: #00f3ff; color: black; }
.grid { padding: 20px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.product-card { background: #1a1a1a; border: 1px solid #333; padding: 15px; text-align: center; }
.product-card:hover { border-color: #00f3ff; }
.product-card button { width: 100%; padding: 8px; margin-top: 10px; background: linear-gradient(90deg, #ffd700, #b8860b); border: none; font-weight: bold; cursor: pointer; }

/* ANIMATIONS */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

/* RESPONSIVE PARA CELULAR */
@media (max-width: 768px) {
    .aura-console { width: 100%; height: 100%; border: none; border-radius: 0; }
    .side-panel { display: none; /* En celular ocultamos usuarios o usamos botón toggle */ }
    .console-header { padding: 0 10px; }
    .brand { font-size: 16px; }
}