/* Mundomio Colecciones Styles v4.2.0 - Ramiro Loizaga */

#mm-transition-curtain {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #fff;
    z-index: 9999999;
    pointer-events: none;
    animation: fadeOutCurtain 1s ease-in-out forwards;
    animation-delay: 0.1s;
}
@keyframes fadeOutCurtain {
    to { opacity: 0; visibility: hidden; }
}

#mm-biblioteca-wrapper {
    font-family: 'Fredoka', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px dashed #f8bbd0;
}

.mm-logo {
    max-width: 200px;
    height: auto;
    display: block;
}

.mm-saludo {
    color: #6a1b9a;
    font-size: 2.2rem;
    margin: 0;
    text-align: right;
    flex-grow: 1;
}

#mm-grid-colecciones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.mm-card-coleccion {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 3px solid #e1bee7;
}

.mm-card-coleccion:not(.bloqueado):hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border-color: #ff85a1;
}

.mm-card-coleccion.bloqueado {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(80%);
}

.mm-card-img-wrapper img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.mm-card-info {
    padding: 20px;
    text-align: center;
}

.mm-card-info h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5rem;
}

.mm-btn-jugar {
    background: linear-gradient(to bottom, #ffeb3b, #fbc02d);
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    color: #5d4037;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 0 #f9a825;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.mm-btn-jugar:hover {
    transform: scale(1.05);
}

#mm-player-container {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#mm-btn-volver {
    background: #ff85a1;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 0 #d81b60;
    transition: background 0.3s;
}

#mm-btn-volver:hover {
    background: #f06292;
}

/* ==========================================
   CONTENEDOR RESPONSIVO Y FULLSCREEN
========================================== */
#contenedor-responsivo-cd {
    width: 100%;
    max-width: 800px; /* Tamaño base en escritorio para no ocupar todo */
    aspect-ratio: 4 / 3; 
    margin: 0 auto; 
    position: relative;
    background: #000;
    border: 4px solid #6a1b9a;
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    box-sizing: border-box;
}

#instancia-ruffle {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
}

#instancia-ruffle ruffle-player {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* --- ESTILOS DE LOS BOTONES FULLSCREEN --- */
.mm-fs-control {
    position: absolute;
    z-index: 9999;
    font-family: 'Fredoka', sans-serif;
    font-weight: bold;
    border: 2px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.mm-fs-control:hover { transform: scale(1.05); }

#mm-btn-fs {
    bottom: 15px; right: 15px;
    background: #6a1b9a;
    color: #fff;
    padding: 8px 15px;
}

#mm-btn-fs-cerrar {
    display: none; /* Oculto en vista normal */
    top: 20px; right: 20px;
    background: #d81b60;
    color: #fff;
    padding: 10px 15px;
    font-size: 1.2rem;
}

/* --- ESTADOS CUANDO SE ACTIVA EL FULLSCREEN NATIVO --- */
#contenedor-responsivo-cd:fullscreen {
    max-width: 100vw;
    height: 100vh;
    border: none;
    border-radius: 0;
    background: #000;
}
#contenedor-responsivo-cd:fullscreen #mm-btn-fs { display: none; }
#contenedor-responsivo-cd:fullscreen #mm-btn-fs-cerrar { display: block; }

/* Prefijos Webkit para compatibilidad en Chrome/Safari */
#contenedor-responsivo-cd:-webkit-full-screen { max-width: 100vw; height: 100vh; border: none; border-radius: 0; background: #000; }
#contenedor-responsivo-cd:-webkit-full-screen #mm-btn-fs { display: none; }
#contenedor-responsivo-cd:-webkit-full-screen #mm-btn-fs-cerrar { display: block; }


@media (max-width: 900px) {
    #mm-grid-colecciones { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .mm-header { 
        flex-direction: column; 
        justify-content: center;
        text-align: center;
        gap: 15px;
    }
    .mm-saludo { 
        font-size: 1.8rem; 
        text-align: center;
    }
    .mm-logo {
        max-width: 150px;
    }
    #mm-grid-colecciones { grid-template-columns: 1fr; }
    #contenedor-responsivo-cd { border-width: 2px; border-radius: 10px; }
}