/* Animación */

.showItem {
    animation: swing 1s .5s both ease, slideOutDown 1s ease 1.5s 1 normal forwards;
    transform-origin: top center;
}

@keyframes swing {
    20% {
        -webkit-transform: rotate3d(0, 0, 1, 15deg);
        transform: rotate3d(0, 0, 1, 15deg);
    }

    40% {
        -webkit-transform: rotate3d(0, 0, 1, -10deg);
        transform: rotate3d(0, 0, 1, -10deg);
    }

    60% {
        -webkit-transform: rotate3d(0, 0, 1, 5deg);
        transform: rotate3d(0, 0, 1, 5deg);
    }

    80% {
        -webkit-transform: rotate3d(0, 0, 1, -5deg);
        transform: rotate3d(0, 0, 1, -5deg);
    }

    100% {
        -webkit-transform: rotate3d(0, 0, 1, 0deg);
        transform: rotate3d(0, 0, 1, 0deg);
    }
}

@keyframes slideOutDown {
    0% {
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }

    100% {
        visibility: hidden;
        -webkit-transform: translateY(200%);
        transform: translateY(200%);
    }
}

@keyframes shutter {

    0% {
        transform: scale(1);
        transform-origin: bottom;
        opacity: 1;
        display: block;
    }

    100% {
        transform: scale(1.2);
        transform-origin: bottom;
        opacity: 0;
        display: none;
    }
}

@keyframes zoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}


@keyframes bounceIn {

    0%,
    20%,
    40%,
    60%,
    80%,
    100% {
        -webkit-animation-timing-function: cubic-bezier(.215, .61, .355, 1);
        animation-timing-function: cubic-bezier(.215, .61, .355, 1);
    }

    0% {
        -webkit-transform: scale3d(.3, .3, .3);
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }

    20% {
        -webkit-transform: scale3d(1.1, 1.1, 1.1);
        transform: scale3d(1.1, 1.1, 1.1);
    }

    40% {
        -webkit-transform: scale3d(.9, .9, .9);
        transform: scale3d(.9, .9, .9);
    }

    60% {
        -webkit-transform: scale3d(1.03, 1.03, 1.03);
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }

    80% {
        -webkit-transform: scale3d(.97, .97, .97);
        transform: scale3d(.97, .97, .97);
    }

    100% {
        -webkit-transform: scaleX(1);
        opacity: 1;
        transform: scaleX(1);
    }
}




/*=== MODALES ===*/

body {
    font-size: 20px;
}

@media (max-width: 767px) {
    body {
        font-size: 18px;
    }
}

.modal_fade {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 20px;
    z-index: 10000;
}

@keyframes zoomModal {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.modal_fade .content_modal,
.modalMensaje .edModal__contenedor .modal-content {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    border-radius: 10px;
    position: relative;

    padding: 30px 75px;
    text-align: center;
    border: 7px solid #ED921F;
    background-color: #E6CE76;
}

@media (max-width: 565px) {

    .modal_fade .content_modal,
    .modalMensaje .edModal__contenedor .modal-content {
        padding: 30px 20px;
        background-size: 60px, 60px, 40%, 40%, cover;
        background-position: bottom -20px left -30px, bottom -20px right -30px, top left, top 70px right, center;
    }
}

.modal_fade .content_modal::before,
.modalMensaje .edModal__contenedor .modal-content::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 48%;
    transform: translate(-50%, 6px);
    background-image: url();
    background-repeat: no-repeat;
    background-size: contain;
    width: 95px;
    height: 47px;
    filter: drop-shadow(1px 1px 2px hsla(0, 0%, 0%, .2));
}


/* Modal intro */

.modal_fade.modalIntro {
    display: none;
    padding-top: 120px;
    animation: zoomModal 0.5s ease-in-out;
    padding-bottom: 120px;
}

.modal_fade.modalIntro.modal--activo {
    display: flex;
}

.modal_fade.modalIntro.modal--activo .content_modal {}

.modal_fade.modalIntro .content_modal {
    background-color: var(--color2);
    background-image: url(../img/estrellas.png), radial-gradient(ellipse at center, #3E7000, #254200);
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
    border: 5px solid #75D300;
    border-radius: 30px;
    padding: 10px 30px 60px;
    max-width: 800px;
    position: relative;
}

@media (max-width: 767px) {
    .modal_fade.modalIntro .content_modal {
        max-width: 400px;
        padding: 0 15px 30px;
    }
}

.tituloIntro {
    width: 325px;
    margin-left: auto;
    margin-right: auto;
    margin-top: -115px;
    margin-bottom: 17px;
}

@media (max-width: 576px) {
    .tituloIntro {
        width: 250px;
    }
}

.textoIntro {
    color: white;
}

.ayudasIntro {
    display: flex;
    gap: 50px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

@media (max-width: 576px) {
    .ayudasIntro {
        gap: 20px;
    }
}

.tituloBadge {
    /* Rojo intenso */
    color: white;
    padding: 10px 40px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    /* Efecto 3D */
}

.iconoTitulo {
    width: auto;
}

.instruccionesIntro {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--color1);
    border-radius: 20px;
    padding: 10px 15px;
    width: max-content;
    color: white;
    font-weight: bold;
    gap: 15px;
}

.instruccionesIntro img {
    height: 80px;
}

.pistasIntro {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--color1);
    border-radius: 20px;
    padding: 10px 15px;
    width: max-content;
    color: white;
    font-weight: bold;
    gap: 15px;
    font-size: 22px;
}

@media (max-width: 576px) {
    .pistasIntro {
        font-size: 20px;
    }
}

.pistasIntro img {
    height: 80px;
}

/* .modal_fade.modalIntro .content_modal img {
    animation: bounceIn 1.5s backwards;
} */

.modal_fade .modal__footer {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767px) {
    .modal_fade .modal__footer {
        flex-direction: column;
        gap: 20px;
    }
}

/* modal de personaje */

.modalPersonaje__content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.modalPersonaje__imagen {
    max-width: 150px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.modalPersonaje__frase {
    font-size: 24px;
    font-weight: bold;
    font-family: var(--fuenteTitulos);
    line-height: 1.4;
    color: #3e7000;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .modalPersonaje__content {
        flex-direction: column;
        text-align: center;
    }

    .modalPersonaje__imagen {
        max-width: 100px;
    }
}


/* Modal Final */

.modal_fade.modalFinal {
    display: none;
    padding: 80px 20px 80px 20px;
    animation: zoomModal 0.8s backwards;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .modal_fade.modalFinal {
        padding: 20px 15px;
    }
}

.modal_fade.modalFinal.modal--activo {
    display: flex;
    flex-direction: column;
    /* uno debajo del otro */
    align-items: center;
    /* centrados horizontalmente */
    justify-content: flex-start;
    /* alineado al inicio para móvil */
}

@media (min-width: 768px) {
    .modal_fade.modalFinal.modal--activo {
        justify-content: center;
    }
}

.modal_fade.modalFinal .content_modal {
    background-color: var(--color2);
    background-image: url(../img/bg-redi.png), radial-gradient(ellipse at center, #3e7000, #254200);
    background-size: cover;
    background-position: top;
    background-repeat: repeat;
    border: 5px solid #75d300;
    border-radius: 30px;
    padding: 30px;
    max-width: 1000px;
    width: 100%;
    position: relative;
    height: auto;
}

@media (max-width: 767px) {
    .modal_fade.modalFinal .content_modal {
        max-width: 95%;
        padding: 20px 15px;
        margin: 0;
        border-radius: 20px;
    }
}

.tituloFinal {
    width: 350px;
    margin-left: auto;
    margin-right: auto;
    margin-top: -50px;
    margin-bottom: 30px;
}

.textoFinal {
    color: white;
    font-size: 22px;
    font-weight: bold;
}

.final__logo {
    width: 130px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.modalFinal__columnas {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px 30px;
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    align-items: center;
    margin: 10px;
    background-image: url(../img/estrellas.png);
    background-size: cover;
}

@media (max-width: 992px) {
    .modalFinal__columnas {
        grid-template-columns: 1fr;
        padding: 5px;
    }
}

.modalFinal__imagenTradicion {
    max-width: 300px;
    width: 100%;
    border-radius: 20px;
    margin-left: auto;
    margin-right: auto;
}

.modalFinal__titulo {
    font-weight: bold;
    font-size: 24px;
    color: #254200;
}

.modalFinal__palabra {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.modalFinal__letra {
    width: 100%;
    min-width: 20px;
    max-width: 35px;
    min-height: 20px;
    height: 35px;
    text-align: center;
    border-radius: 5px;
    background-color: var(--color4);
    border: 2px dashed var(--color3);
    box-shadow: 0 0 0 1px var(--color3);
    color: white;
    font-weight: bold;
    font-size: 24px;
}

@media (max-width: 1200px) {

    .modalFinal__palabra {
        gap: 5px;
    }

    .modalFinal__letra {
        font-size: 25px;
    }
}





/* Modal Ayudas */

.modal_fade.modalAyuda1 {
    display: none;
    padding-top: 80px;
    animation: zoomModal .8s backwards;
    padding-bottom: 100px;
}

.modal_fade.modalAyuda2 {
    display: none;
    padding-top: 100px;
    animation: zoomModal .8s backwards;
}

.modal_fade.modalAyuda1.modal--activo {
    display: flex;
}

.modal_fade.modalAyuda2.modal--activo {
    display: flex;
}

/* Instrucciones */

.modal_fade.modalAyuda1 .content_modal {
    background-color: var(--color8);
    background-image: url(../img/bg-modal.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 5px solid #75D300;
    border-radius: 30px;
    padding: 0 30px 30px;
    max-width: 1000px;
    position: relative;
}

@media (max-width: 450px) {
    .modal_fade.modalAyuda1 .content_modal {
        max-width: 400px;
    }
}

.tituloAyudas {
    background-image: url(../img/linea-modal.png), radial-gradient(ellipse at center, #CA1D1C, #691212);
    background-size: auto 30px, cover;
    background-position: top, center;
    background-repeat: repeat;
    background-blend-mode: normal;
    border: 5px solid #75D300;
    border-radius: 2rem;
    padding: 10px 30px 10px 90px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-top: -45px;
    margin-bottom: 30px;
    font-size: 35px;
    font-weight: bold;
    font-family: var(--fuenteTitulos);
    color: white;
    position: relative;
}



@media (max-width: 992px) {
    .tituloAyudas {
        font-size: 30px;
        line-height: 1;
    }
}

.tituloAyudas img {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
}

.ejemploInstruccion {
    margin-bottom: 10px;
    max-width: 90%;
}

.nivelItems__bonus {
    display: inline-flex;
    /* width: 70px; */
    height: 35px;
    /* background-color: #e0e0e0; */
    /* padding: 4px; */
    /* border-radius: 5px; */
    /* border: 2px dashed #ffc648; */
}

.nivelItems__bonus img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.titulo--bonus {
    color: #3e2723;
}

.nivelItems {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    margin-bottom: 20px;
}

.nivelItems__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nivelItems__titulo {
    font-weight: bold;
    font-family: var(--fuenteTitulos);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.titulo--bueno {
    color: #3e2723;
}

.titulo--malo {
    color: #3e2723;
}

.subtitulo--bueno {
    color: #3e2723;
    font-size: 1.4rem;
}

.instruccionesPersonaje {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 20px;
}

@media (max-width: 767px) {
    .instruccionesPersonaje {
        grid-template-columns: 1fr;
        gap: 0px;
    }
}

.instruccionesPersonaje__img {
    display: flex;
    flex-direction: column;
}

#modal-personaje-titulo {
    font-weight: bold;
    font-size: 1.3rem;
    margin-bottom: 10px;
    text-align: center;
    background-color: #75d300;
    border-radius: 2rem;
    color: var(--color7);
    position: relative;
    padding: 10px 18px;
    /* espacio para que la "burbuja" quede proporcionada */
}

/* triángulo centrado tipo nube de mensaje */
#modal-personaje-titulo::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -12px;
    /* separa el triángulo del elemento principal */
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #75d300;
    /* color igual que el fondo para simular cola */
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

/* Badges de puntaje pequeños */
.puntaje {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    color: white;
}

.badge-success {
    background-color: #4caf50;
}

/* Verde */
.badge-danger {
    background-color: #f44336;
}

/* Rojo */

.separador-vertical {
    width: 2px;
    background-color: #e0e0e0;
    height: 100px;
    /* Altura aproximada */
    margin: 0 15px;
}

.nivelItems__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
}

.nivelItems__item {
    width: 70px;
    text-align: center;
}

.nivelItems__item img {
    width: auto;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.1));
}

@media (max-width: 576px) {
    .nivelItems {
        flex-direction: column;
    }
}

/* --- Responsive para móviles --- */
@media (max-width: 600px) {
    .nivelItems {
        flex-direction: column;
        gap: 20px;
    }

    .separador-vertical {
        width: 100%;
        height: 1px;
        margin: 10px 0;
    }

    .tituloBadge {
        font-size: 1.2rem;
        padding: 8px 30px;
    }
}

.contenidoInstrucciones {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.instruccion {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.instruccion img {
    height: 40px;
}

.instruccion .bombi {
    border-radius: 10px;
    border: 2px dashed var(--color4);
    box-shadow: 0 0 0 1px var(--color4);
    background-color: var(--color3);
    height: 60px;
}

.textoInstruccion {
    color: #5d4037;
    /* Café oscuro para mejor lectura */
    line-height: 1.5;
    text-align: left;
    margin-bottom: 25px;
}

.controles-title {
    text-align: center;
}

.textoInstruccion strong {
    color: #d84315;
    /* Naranja/Rojo quemado para destacar teclas */
}

@media (max-width: 576px) {
    .textoInstruccion {
        font-size: 20px;
    }
}

.textoInstruccion .column2 {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.textoInstruccion .column2 img {
    width: 200px;
}



/* Ayudas */

.modal_fade.modalAyuda2 .content_modal {
    background-color: white;
    background-image: url(../img/bg-modal.png);
    background-size: auto 120%;
    background-position: top;
    background-repeat: repeat;
    border: 5px solid #75D300;
    border-radius: 30px;
    padding: 0 40px 30px;
    max-width: 580px;
    position: relative;
}

@media (max-width: 767px) {
    .modal_fade.modalAyuda2 .content_modal {
        max-width: 400px;
        padding: 0 15px 30px;
    }
}

.contenidoAyudas {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-left: auto;
    margin-right: auto;
}

.ayuda {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.ayuda img {
    width: 40px;
}


/* Modal final compatir */

.modal__botonesCompartir {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

@media (max-width: 992px) {
    .modal__botonesCompartir {
        justify-content: center;
    }
}


@keyframes fadeOutNegro {
    0% {
        background-color: rgba(0, 0, 0, 0);
    }

    100% {
        background-color: rgba(0, 0, 0, .7);
    }
}


.modal__botonesCompartir img {
    width: 35px;
    margin: 0 10px;
    animation: compartir 1s infinite;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, .15));
}

@media (max-width: 767px) {
    .modal__botonesCompartir img {
        width: 30px;
        margin: 5px 7px;
    }
}

.modal__botonesCompartir a:hover img {
    transform: scale(1);
}

.modal__botonesCompartir .btnCopy {
    background-color: transparent;
    padding: 0;
    position: relative;
}


.modal__compartir {
    margin-right: 20px;
    color: #254200;
    font-size: 22px;
}

@media (max-width: 767px) {
    .modal__compartir {
        margin-right: 15px;
        color: #254200;
        font-size: 20px;
    }
}



/*=== MODAL MENSAJE ===*/
.fade {
    opacity: 0;
    transition: opacity 0.25s linear;
}

.collapsing {
    transition: height 0.45s ease;
}

.modalMensaje .edModal__contenedor {
    min-height: 90%;
    max-width: 1200px;
    width: 96%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    margin-top: 30px;
}

.modalMensaje .modal-content {
    padding: 20px 30px;
    text-align: center;
    border: 7px solid #bf8800;
    background-color: hsl(46, 40%, 80%);
}

.modalMensaje .modal__columnas {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    flex-direction: row;
}

@media (max-width: 767px) {
    .modalMensaje .modal__columnas {
        flex-direction: column;
    }
}

.modalMensaje .modal__column {
    width: 100%;
    font-size: 18px;
    padding: 10px 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 767px) {

    .modalMensaje .modal__column {
        width: 100%;
        padding: 0 5px 15px;
    }
}

.modalMensaje .modal-content .modal__texto {
    color: #DF8C37;
    font-size: 30px;
    padding: 10px 0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}

@media (max-width: 767px) {

    .modal-content .modal__texto {
        font-size: 18px;
        padding: 10px;
    }
}





.modal__enlace {
    margin: 10px auto 20px;
}

.modal__enlace a {
    display: inline-flex;
    color: #d4901c;
    text-decoration: none;
    border: 2px solid #ffc648;
    border-radius: 2rem;
    padding: 6px 15px;
    transform: scale(1) translateY(0);
    transition: transform .5s;
    background: rgb(255 255 255 / 0.5);
}

.modal__enlace a:hover {
    transform: scale(1.03) translateY(-2px);
}

.btn-sonido {
    height: 20px;
}

.modalFinal__info {
    padding: 20px;
}

/* Botón de reiniciar dentro del modal final */
.modalFinal .footer__reiniciar {
    margin: 20px auto;
    display: block;
    position: relative;
}

@media (max-width: 767px) {
    .modalFinal .footer__reiniciar {
        margin: 15px auto 10px;
        font-size: 18px;
        padding: 10px 20px;
    }
}

/* Nivel Ganado (texto + imagen circular) */
.nivelGanado__row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.nivelGanado__texto {
    flex: 1 1 auto;
}

.nivelGanado__imagen {
    flex: 0 0 auto;
}

.nivelGanado__imagen img {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Escalado progresivo de la imagen circular */
@media (max-width: 1200px) {
    .nivelGanado__imagen img {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 992px) {
    .nivelGanado__imagen img {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 767px) {
    .nivelGanado__row {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .nivelGanado__texto {
        width: 100%;
    }

    .nivelGanado__imagen img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 576px) {
    .nivelGanado__imagen img {
        width: 110px;
        height: 110px;
    }
}

@media (max-width: 400px) {
    .nivelGanado__imagen img {
        width: 90px;
        height: 90px;
    }
}

.nivelItems__infoResumen {
    text-align: center;
}