/* ======================================================= */
/* 🤏 MINIJUEGO COMPACTO (Estilo Sticker Premium)          */
/* ======================================================= */

.contenedor-mini-galeria {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 12px; /* Un poquito más de aire para las sombras */
    width: 100%; 
    max-width: 260px; 
    margin: 15px auto;
    box-sizing: border-box;
    perspective: 1000px; /* Prepara para efectos 3D */
}

.card-minijuego {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 4px;
    cursor: pointer;
    position: relative;
    /* Sombra suave tipo elevación */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    aspect-ratio: 1 / 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Para que el indicador sobresalga bien */
}

/* Efecto Hover: Se levanta y brilla */
@media (hover: hover) {
    .card-minijuego:hover {
        transform: translateY(-4px) rotate(2deg);
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    }
}

.card-img-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* 🌟 EFECTO DE BRILLO (Glass Flash) */
.card-img-wrapper::after {
    content: "";
    position: absolute;
    top: -110%;
    left: -210%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.6s;
}

.card-minijuego:hover .card-img-wrapper::after {
    top: -20%;
    left: -30%;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}

.card-minijuego:hover img {
    transform: scale(1.1); /* Zoom suave al pasar el mouse */
}

/* INDICADOR DINÁMICO */
.indicador-tap {
    font-size: 0.8rem;
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
    border: 1.5px solid #fff;
    /* Animación de pulso infinita */
    animation: pulsoTap 2s infinite;
}

@keyframes pulsoTap {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,0,0,0.2); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(0,0,0,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* ESTADOS FINALES */
.card-minijuego.correcto {
    border: 3px solid #4CAF50 !important;
    background: #e8f5e9;
    transform: scale(1.08) !important;
    z-index: 10;
}

.card-minijuego.incorrecto {
    border: 2px solid #F44336 !important;
    filter: grayscale(1); /* Se pone gris al fallar */
    opacity: 0.5;
    transform: scale(0.95);
}


/* ======================================================= */
/* 🧩 MINIJUEGO: UNIR PAREJAS (Anchos Estandarizados)      */
/* ======================================================= */

/* 1. EL CONTENEDOR (Fuerza columnas idénticas) */
.contenedor-unir-parejas {
    display: grid !important;
    /* Usamos minmax(0, 1fr) para evitar que un texto largo ensanche una columna más que la otra */
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 12px;
    width: 100%;
    max-width: 450px; /* Limite para que no se vea gigante en PC */
    margin: 10px auto; 
    padding: 5px;
    box-sizing: border-box;
    align-items: center;
}

/* 2. EL BOTÓN (Ancho fijo y uniforme) */
.btn-unir {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border: 1px solid #e0e0e0; 
    border-bottom: 3px solid #e0e0e0; 
    border-radius: 12px;
    
    /* CONTROL DE ANCHO: Ocupa todo el ancho de su columna de forma estricta */
    width: 100%; 
    box-sizing: border-box; 
    
    padding: 10px 5px;
    min-height: 65px; 
    
    color: #37474f;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    
    /* EVITAR DESBORDE: Si el texto es muy largo, se mantiene dentro */
    overflow: hidden;
    word-wrap: break-word;
    
    user-select: none;
    outline: none;
    position: relative;
    top: 0;
}

/* El Emoji */
.btn-unir span.icono-btn {
    font-size: 1.4rem; 
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* --- ESTADOS --- */

.btn-unir.seleccionado {
    background: #fff8e1 !important;
    border-color: #ffb300 !important;
    border-bottom-color: #ff8f00 !important;
    color: #e65100 !important;
    transform: translateY(1px);
}

.btn-unir.emparejado {
    background: #e8f5e9 !important;
    border: 2px dashed #66bb6a !important;
    color: #2e7d32 !important;
    opacity: 0.8;
    pointer-events: none;
    box-shadow: none;
    transform: scale(0.98); 
}

.btn-unir.error {
    background: #ffebee !important;
    border-color: #ef5350 !important;
    border-bottom-color: #c62828 !important;
    color: #c62828 !important;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
  40%, 60% { transform: translate3d(2px, 0, 0); }
}

@media (max-width: 360px) {
    .btn-unir {
        min-height: 55px;
        font-size: 0.75rem;
    }
}


