/* =========================================
   LAYOUT.CSS - Grid y Vistas
   ========================================= */

/* Control de vistas (SPA rudimentario) */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.view-hidden { display: none !important; }
.view-active { display: flex !important; }

/* -- PANTALLA DE INICIO -- */
#screen-home {
    justify-content: center;
    align-items: center;
    gap: 4rem;
    background-image: radial-gradient(circle at center, #AEE4FF 0%, var(--bg-main) 100%);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 85%;
    max-width: 400px;
}

/* -- PANTALLA DE JUEGO -- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    padding: 1rem;
}

.math-problem {
    font-size: 6rem;
    color: var(--text-light);
    text-shadow: 4px 4px 0 var(--text-dark), 0 10px 20px rgba(0,0,0,0.3);
    text-align: center;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    height: 45vh; /* Ocupa la mitad inferior ideal para pulgares */
}

/* -- PANTALLA DE GALERÍA -- */
#screen-album { background-color: var(--bg-album); }
.album-header { background-color: rgba(0, 0, 0, 0.3); color: var(--text-light); }
.spacer { width: 80px; }

.album-container {
    flex: 1;
    overflow-y: auto; /* Scroll dentro del álbum */
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1.5rem;
}

/* Grid del Álbum: Responsivo */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
    align-content: start;
    padding-bottom: 3rem;
}

/* Cromo (Carta) */
.card {
    background-color: #FFFFFF;
    border-radius: 15px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 0 rgba(0,0,0,0.3), 0 15px 20px rgba(0,0,0,0.4);
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid var(--text-dark);
}

.card-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-dark);
    text-transform: uppercase;
    text-align: center;
}

/* Efecto carta bloqueada */
.card.locked {
    background-color: #D3D3D3;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1), 0 10px 15px rgba(0,0,0,0.2);
}

.card.locked img { filter: grayscale(100%) brightness(50%); }
.card.locked .card-name { color: #666666; }

/* =========================================================================
   MODAL DE RECOMPENSAS
   ========================================================================= */
.modal-hidden { display: none !important; }
.modal-active {
    display: flex !important;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    background-color: var(--bg-main);
    padding: 2rem;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 0 rgba(0,0,0,0.5), 0 20px 30px rgba(0,0,0,0.5);
    border: 8px solid var(--color-accent);
    text-align: center;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content img {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    border: 4px solid var(--text-dark);
}

.modal-title { font-size: 3rem; color: var(--color-accent); text-shadow: 2px 2px 0 var(--text-dark); margin-bottom: -10px; }
.modal-subtitle { font-size: 2rem; color: var(--text-light); text-shadow: 2px 2px 0 var(--text-dark); }

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