/* --- ESTILOS GLOBALES Y DE FONDO --- */
:root {
    --shadow-deep: 0 10px 30px rgba(0, 0, 0, 0.5);
    --primary-color: #f59e0b; /* Naranja/Amarillo para Niños */
    --danger-color: #EF4444;
    --success-color: #28a745;
    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    color: #fff;
    overflow-y: auto;
    background-color: #111827;
    user-select: none;
}

.background-container {
    position: fixed;
    top: -5%; left: -5%; width: 110%; height: 110%;
    z-index: -1;
    background-size: cover;
    animation: ken-burns 30s infinite alternate;
}

@keyframes ken-burns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* --- MODAL DE CATEGORÍA TRANSPARENTE --- */
.category-modal-transparent {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.btn-close-modal-floating {
    position: absolute;
    top: -20px;
    right: -10px;
    background: rgba(0,0,0,0.5);
    border: 2px solid white;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 15;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.btn-close-modal-floating:hover {
    background: var(--danger-color);
    transform: scale(1.1);
}


.category-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.category-header h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.home-btn-styled {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-self: flex-start;
}

.home-btn-styled:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.home-btn-styled i { font-size: 1.2rem; }

.category-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .category-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.category-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1rem 0.5rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--glass-shadow);
    aspect-ratio: 1 / 1;
    max-width: 120px;
    margin: 0 auto;
    width: 100%;
}

.category-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.category-btn:active { transform: scale(0.95); }
.category-btn i {
    font-size: 2rem;
    filter: drop-shadow(0 3px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}
.category-btn:hover i { transform: scale(1.1) rotate(5deg); }

.category-btn[data-category="all"] { --btn-color: #ec4899; }
.category-btn[data-category="diversion"] { --btn-color: #f59e0b; }
.category-btn[data-category="reto"] { --btn-color: #ef4444; }
.category-btn[data-category="adivinanza"] { --btn-color: #3b82f6; }
.category-btn[data-category="imitacion"] { --btn-color: #8b5cf6; }
.category-btn[data-category="concurso"] { --btn-color: #10b981; }

.category-btn i {
    color: var(--btn-color, #fff);
    --fa-primary-color: var(--btn-color);
    --fa-secondary-color: #fff;
    --fa-secondary-opacity: 0.6;
}

/* --- ANIMACIÓN DE CARGA --- */
.loading-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); display: none; flex-direction: column; justify-content: center; align-items: center; z-index: 100; backdrop-filter: blur(8px); }
.shuffle-animation-container { position: relative; width: 70vw; max-width: 300px; aspect-ratio: 7 / 10; margin: 1rem auto; }
.card-shuffle { position: absolute; width: 100%; height: 100%; border-radius: 15px; box-shadow: var(--shadow-deep); background-size: cover; background-position: center; }
.loading-container .card-1 { animation: shuffle-1 2.5s ease-in-out; background-image: url('../images/niños/NiñosNew.webp'); }
.loading-container .card-2 { animation: shuffle-2 2.5s ease-in-out; background-image: url('../images/niños/NiñosNewTwo.webp'); }
.loading-container .card-3 { animation: shuffle-3 2.5s ease-in-out; background-image: url('../images/niños/NiñosNewTree.webp'); }
.shuffling-text { margin-top: 2rem; font-size: 1.5rem; color: #fff; letter-spacing: 1px; }
@keyframes shuffle-1 { 0%, 100% { transform: translate(0, 0) rotate(-8deg); } 25% { transform: translate(-40vw, -10vh) rotate(-25deg); } 50% { transform: translate(40vw, 10vh) rotate(25deg); } 75% { transform: translate(0, 0) rotate(0); } }
@keyframes shuffle-2 { 0%, 100% { transform: translate(0, 0) rotate(2deg); } 25% { transform: translate(35vw, -8vh) rotate(20deg); } 50% { transform: translate(-35vw, 8vh) rotate(-20deg); } 75% { transform: translate(0, 0) rotate(0); } }
@keyframes shuffle-3 { 0%, 100% { transform: translate(0, 0) rotate(10deg); } 25% { transform: translate(-30vw, 12vh) rotate(-15deg); } 50% { transform: translate(30vw, -12vh) rotate(15deg); } 75% { transform: translate(0, 0) rotate(0); } }

/* --- CONTENEDOR DEL JUEGO --- */
.game-container { display: none; flex-direction: column; justify-content: center; align-items: center; width: 100%; max-width: 400px; text-align: center; position: relative; padding-top: 3rem; }
.game-board { position: relative; width: 70vw; max-width: 300px; aspect-ratio: 7 / 10; margin: 0.5rem auto 1rem auto; perspective: 1500px; }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform 0.8s cubic-bezier(0.6, 0.02, 0.4, 1); transform-style: preserve-3d; }
.card-inner.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 20px; box-sizing: border-box; background-size: cover; background-position: center; box-shadow: var(--shadow-deep); }
.card-back { background-image: url('../images/niños/NiñosNew.webp'); }
.card-front { transform: rotateY(180deg); background-color: rgba(0, 0, 0, 0.3); }
.content-wrapper { background-color: rgba(0, 0, 0, 0.6); padding: 15px; border-radius: 10px; backdrop-filter: blur(4px); }
.card-icon { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 1rem; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.card-text { font-size: clamp(1rem, 4vw, 1.5rem); font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }
.top-right-icons { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 15px; z-index: 100; }
.btn-icon { font-size: 2.5rem; color: var(--primary-color); cursor: pointer; background: none; border: none; padding: 0; margin: 0; transition: transform 0.2s ease, color 0.3s; }
.btn-icon:hover { transform: scale(1.15); }

/* --- INDICADOR DE DEMO --- */
.timer-section { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background-color: rgba(0, 0, 0, 0.5); padding: 8px 16px; border-radius: 20px; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 10px; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.2); z-index: 5; white-space: nowrap; }
.timer-section .fa-duotone { font-size: 1.4em; color: var(--primary-color); }

/* --- BOTONES --- */
.section-buttons { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; margin-top: 1rem; width: 70vw; max-width: 300px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; padding: 10px 20px; border-radius: 50px; font-size: 0.95rem; font-weight: 600; cursor: pointer; color: #fff; transition: all 250ms ease; text-decoration: none; box-sizing: border-box; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(4px); box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.btn:disabled { cursor: not-allowed; opacity: 0.6; transform: none; }
.btn-success { background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.85), rgba(217, 119, 6, 0.85)); }
.btn-danger { background-image: linear-gradient(135deg, rgba(239, 68, 68, 0.85), rgba(185, 28, 28, 0.85)); }
.btn-primary { background-image: linear-gradient(135deg, #007bff, #0069d9); border: none; }
.btn-info { background-image: linear-gradient(135deg, #3b82f6, #2563eb); border: none; }

/* --- MODALES GENERALES --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: none; justify-content: center; align-items: center; z-index: 200; padding: 1rem; box-sizing: border-box; }
.modal-content { background: #1a1a1a; border: 1px solid #444; border-radius: 15px; padding: 2rem; width: 100%; max-width: 500px; text-align: center; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); max-height: 85vh; overflow-y: auto; box-sizing: border-box; }
.btn-close-modal { position: absolute; top: 10px; right: 15px; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; z-index: 10; }
.animate-fade-in { animation: fadeIn 0.8s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- ESTILOS PARA EL MODAL DE INSTRUCCIONES/TÉRMINOS --- */
#instructions-modal .modal-content h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.6rem;
    color: var(--primary-color);
}
#instructions-modal .modal-content h2 .fa-duotone {
    font-size: 1.2em;
}
.age-verification {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 1rem;
}
#age-checkbox {
    display: none; /* Ocultar el checkbox real */
}
#age-checkbox + label {
    position: relative;
    padding-left: 38px; /* Espacio para el círculo */
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 28px;
}
/* Círculo rojo (estado sin marcar) */
#age-checkbox + label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
/* Check verde (estado marcado) */
#age-checkbox:checked + label::before {
    background-color: var(--success-color);
    border-color: #fff;
    content: '\f00c';
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro";
    font-weight: 900;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* --- MODAL FIN DE DEMO (SIN MARCO) --- */
.demo-end-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.demo-end-content h2 {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.demo-end-content h2 .fa-duotone {
    font-size: 1em;
    --fa-primary-color: #ff5555;
    --fa-secondary-color: #ffffff;
    --fa-secondary-opacity: 0.8;
}
.demo-end-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.demo-end-content .btn-success {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}
.demo-end-content .btn-success i { font-size: 1.3em; }

@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-success { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
