:root {
    --primary: #3b82f6;
    --dark: #0a0f1d;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --insta: #e1306c;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
}

body { 
    background-color: var(--dark); 
    color: white; 
    min-height: 100vh; 
    overflow-x: hidden; 
}

/* --- ESTILOS PANTALLA DE CARGA (LOADER) --- */
#loader {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: #000000; /* Negro absoluto para ocultar el fondo */
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    z-index: 99999; /* Prioridad máxima sobre cualquier elemento */
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-content { 
    text-align: center; 
    width: 90%; 
    max-width: 500px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 10px;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
    margin-bottom: 10px;
}

.loader-subtitle {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    margin-bottom: 60px;
}

.progress-container {
    width: 100%; 
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px; 
    overflow: hidden;
}

.progress-bar {
    width: 0%; 
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    transition: width 2.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Crédito de Carlos Thomas Acosta centrado en el loader */
.loader-footer {
    margin-top: 40px;
    color: #334155; 
    font-size: 0.7rem;
    text-transform: uppercase; 
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}

.loader-hidden { 
    opacity: 0; 
    visibility: hidden; 
    pointer-events: none;
}

/* --- FONDO Y ESTRUCTURA WEB --- */
.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0a0f1d 100%);
    z-index: -1;
}

header {
    height: 140px; 
    display: flex; 
    justify-content: center;
    align-items: center; 
    position: relative;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(15px); 
    padding: 0 5%;
}

.main-title {
    font-size: 3rem; 
    font-weight: 900; 
    color: var(--primary);
    letter-spacing: 5px; 
    cursor: pointer;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3); 
    text-align: center;
}

/* Créditos laterales en escritorio */
.credits-left, .credits-right {
    position: absolute; 
    top: 20px; 
    font-size: 0.7rem;
    color: #64748b; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    text-align: center;
}

.credits-left { left: 5%; } 
.credits-right { right: 5%; }

.admin-access {
    position: absolute; 
    bottom: 15px; 
    right: 5%;
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 0.8rem;
}

#admin-btn {
    background: var(--glass); 
    border: 1px solid var(--border);
    color: white; 
    padding: 4px 12px; 
    border-radius: 15px;
    cursor: pointer; 
    transition: 0.3s;
}

#admin-btn:hover { background: var(--primary); }

/* --- GRILLA DE TARJETAS --- */
.container {
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px;
    padding: 60px 5%; 
    justify-content: center; 
    align-items: center;
}

.card-option {
    flex: 1; 
    min-width: 280px; 
    max-width: 450px; 
    height: 350px;
    background: var(--glass); 
    border: 1px solid var(--border);
    border-radius: 30px; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    text-align: center; 
    cursor: pointer;
    text-decoration: none; 
    color: inherit;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-option:hover { 
    transform: scale(1.05); 
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1); 
}

/* --- VISTAS DE DETALLE --- */
.detail-view { padding: 40px 5%; display: flex; justify-content: center; }

.glass-panel { 
    background: var(--glass); 
    width: 100%; 
    max-width: 900px;
    padding: 30px; 
    border-radius: 30px; 
    border: 1px solid var(--border);
    backdrop-filter: blur(20px); 
}

.balance-display { 
    text-align: center; 
    padding: 40px; 
    background: rgba(0,0,0,0.4);
    border-radius: 20px; 
    margin-bottom: 30px; 
    border: 1px solid var(--border); 
}

#money-display { 
    font-size: clamp(2.5rem, 8vw, 4rem); 
    color: #4ade80; 
    font-weight: 800; 
}

.admin-box { 
    background: rgba(255, 193, 7, 0.05); 
    border: 1px solid #ffc107;
    padding: 20px; 
    border-radius: 15px; 
    margin-bottom: 30px; 
}

.admin-only { display: none; }

input, textarea { 
    background: rgba(0,0,0,0.5); 
    border: 1px solid var(--border);
    color: white; 
    padding: 12px; 
    width: 100%; 
    margin-bottom: 12px;
    border-radius: 8px; 
    font-size: 1rem; 
}

.btn-save { 
    background: var(--primary); 
    color: white; 
    border: none;
    padding: 15px; 
    border-radius: 8px; 
    cursor: pointer;
    width: 100%; 
    font-weight: bold;
}

/* --- TABLAS --- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 15px; border-bottom: 1px solid var(--border); }

/* --- ADAPTACIÓN MÓVIL --- */
@media (max-width: 768px) {
    header { 
        height: auto; 
        flex-direction: column; 
        padding: 40px 20px; 
    }
    
    .main-title { 
        font-size: 2.2rem; 
        margin: 20px 0; 
    }
    
    /* Centrado de créditos en móvil */
    .credits-left, .credits-right { 
        position: static; 
        font-size: 0.65rem; 
        width: 100%; 
        margin-bottom: 10px;
    }
    
    .admin-access { 
        position: static; 
        justify-content: center; 
        width: 100%;
        margin-top: 10px;
    }
    
    .container { padding: 40px 5%; }
    
    .card-option { 
        min-width: 100%; 
        height: 280px; 
    }
    
    .glass-panel { padding: 20px; }

    /* Ajuste para que los inputs no hagan zoom en iPhone */
    input, textarea { font-size: 16px; } 
}
