/* Fuente moderna */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700;900&display=swap');

body { 
    font-family: 'Outfit', sans-serif; 
    background-color: #0f172a; 
}

/* --- UTILIDADES CRÍTICAS --- */
.hidden { 
    display: none !important; 
}

/* Efecto Cristal (Glassmorphism) */
.glass-panel {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Fondo animado */
.gradient-bg {
    background: radial-gradient(circle at 50% 50%, #312e81, #0f172a);
    animation: pulseBg 10s infinite alternate;
}

@keyframes pulseBg {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.5; transform: scale(1.1); }
}

/* Animaciones de Entrada */
.fade-in-down { animation: fadeInDown 0.6s ease-out forwards; }
.fade-in-up { animation: fadeInUp 0.6s ease-out forwards; }
.animate-pop { animation: popSuccess 0.3s ease-out; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.drop-shadow-glow { 
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.6); 
}

/* --- JUEGO 1: MEMORY (Efecto 3D Real) --- */
#container-memory {
    perspective: 1000px;
}

.memory-card {
    position: relative;
    height: 6rem; 
    cursor: pointer;
    background-color: transparent; 
    perspective: 1000px;
}

.memory-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform-style: preserve-3d;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.memory-card.flipped .memory-inner {
    transform: rotateY(180deg);
}

.memory-front, .memory-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    top: 0;
    left: 0;
}

.memory-back {
    background-color: #1e293b;
    border: 2px solid #334155;
    color: #475569;
    z-index: 2;
    transform: rotateY(0deg); 
}

.memory-front {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: 2px solid #60a5fa;
    color: white;
    transform: rotateY(180deg); 
}

/* --- JUEGO 2: SIMON --- */
#container-simon button { 
    border: none; 
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5); 
}

#container-simon button.active {
    opacity: 1 !important; 
    filter: brightness(1.5) contrast(1.2); 
    box-shadow: 0 0 30px currentColor, inset 0 0 10px rgba(255,255,255,0.5);
    transform: scale(0.95);
    z-index: 10;
}

/* --- JUEGO 3: CÓDIGO --- */
.keypad-btn {
    background: #1e293b; 
    border: 1px solid #334155; 
    color: white;
    font-size: 1.5rem; 
    padding: 1rem; 
    border-radius: 0.75rem;
    transition: all 0.1s; 
    font-family: monospace; 
    box-shadow: 0 4px 0 #0f172a;
}
.keypad-btn:active { 
    transform: translateY(4px); 
    box-shadow: none; 
}

/* --- JUEGO 4: MASTERMIND --- */
.mm-peg {
    width: 2rem; 
    height: 2rem; 
    border-radius: 50%; 
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.5), 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    cursor: pointer;
    flex-shrink: 0;
}
.mm-peg:active { transform: scale(0.9); }

/* Colores de fichas */
.bg-mm-0 { background-color: #ef4444; } /* Rojo */
.bg-mm-1 { background-color: #3b82f6; } /* Azul */
.bg-mm-2 { background-color: #22c55e; } /* Verde */
.bg-mm-3 { background-color: #eab308; } /* Amarillo */
.bg-mm-4 { background-color: #a855f7; } /* Morado */
.bg-mm-5 { background-color: #f97316; } /* Naranja */
.bg-mm-6 { background-color: #ec4899; } /* Rosa */
.bg-mm-7 { background-color: #06b6d4; } /* Cian */

/* Pines de feedback (Resultados) en LÍNEA */
.mm-feedback-grid { 
    display: flex; /* CAMBIO: Flex para línea horizontal */
    flex-wrap: wrap;
    gap: 4px; 
    align-self: center;
    justify-content: flex-end;
    min-width: 3rem;
}

.mm-pin { 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    background-color: #334155; 
}

.mm-pin.black { 
    background-color: #000; 
    border: 1px solid #475569; 
    box-shadow: 0 0 2px #000; 
}

.mm-pin.white { 
    background-color: #f8fafc; 
    border: 1px solid #94a3b8; 
    box-shadow: 0 0 2px #fff; 
}

.mm-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: rgba(0,0,0,0.2); 
    padding: 0.5rem 1rem; 
    border-radius: 0.5rem; 
    animation: fadeInUp 0.3s ease-out;
}

/* Feedback General */
.shake-anim { 
    animation: shake 0.4s; 
    border-color: #ef4444 !important; 
    color: #ef4444 !important; 
}

@keyframes shake { 
    0%, 100% { transform: translateX(0); } 
    25% { transform: translateX(-10px); } 
    75% { transform: translateX(10px); } 
}

@keyframes popSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #34d399; }
    100% { transform: scale(1); }
}

        .footer1 {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 20px 0;
            padding: 20px;
        }

        .navigation-images {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
        }

        .volver, .mostro-imagen {
            width: 100px;
            height: auto;
            transition: transform 0.3s ease;
        }

        .volver:hover, .mostro-imagen:hover {
            transform: scale(1.1);
        }


.pop-success { color: #34d399 !important; }