body{
    background-color: #210558;
    color: #fefecc;
    font-family: Arial, sans-serif;
    padding: 15px;
}
h1{
    color: rgb(254, 239, 165);
}
h2{
    color: #ff8e99;
    margin-bottom: 10px;
}

.filtros button{
    background-color:rgb(164, 61, 164);
    border: 2px solid rgb(255, 0, 123);
    color: white;
    border-radius: 20px;
    padding: 7px 15px;
    margin: 0 5px 8px 0;
    font-size: 15px;
    cursor: pointer;
}

.filtros button:hover{
    border-color: #fff6aa;
}

.filtros .activo{
    background-color: rgb(100, 25, 100);
    font-weight: bold;
}

.filtros .facil{
    background-color: #3ddc84;
    color: #210558;
}

.filtros .medio{
    background-color: #ffd23f;
    color: #210558;
}

.filtros .dificil{
    background-color: #ff4d6d;
    color: #210558;
}

.filtros .facil.activo{
    background-color: #1f9e57;
}

.filtros .medio.activo{
    background-color: #c99a00;
}

.filtros .dificil.activo{
    background-color: #c4243f;
}


img{
    height: 120px;
    width: 250px;
}
nav {
    background: linear-gradient(to right, #490b87, #6426a3) ;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px;
    padding: 20px;


}

nav div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

nav h1,
nav p {
    margin: 0;
}

nav span{
    font-family: "Courier New", monospace;
    font-weight: bold;
    font-size: 20px;
    color: #fff6aa;
}

nav i{
    color: #fdcb88;
    font-size: 20px;
}

.links a{
    color: white;
    text-decoration: none;
    margin-left: 15px;
    font-size: 17px;
}

.links a:hover{
    color: #fdcb88;
}

#cargando{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #6426a3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
    transition: opacity 0.5s;
}

#cargando img{
    width: 300px;
    height: auto;
}

#cargando p{
    font-family: "Courier New", monospace;
    color: #fff6aa;
}

#cargando.oculto{
    opacity: 0;
    pointer-events: none;
}

.spinner{
    width: 50px;
    height: 50px;
    border: 6px solid #bb44ae;
    border-top-color: #fdcb88;
    border-radius: 50%;
    animation: girar 1s linear infinite;
}

#retos{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
}

.tarjeta{
    background-color: #3a1a75;
    border: 3px solid #3a1a75;
    border-radius: 15px;
    overflow: hidden;
    transition: 0.3s;
    animation: aparecer 0.5s;
}

.tarjeta:hover{
    transform: translateY(-5px);
    box-shadow: 0 8px 15px black;
}

.resuelta{
    border-color: #3ddc84;
}

.tarjeta img{
    width: 100%;
    height: auto;
    display: block;
}

.info{
    padding: 15px;
}

.tarjeta h3{
    color: #fff6aa;
    margin: 8px 0;
}

.nivel{
    display: inline-block;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: bold;
    color: #210558;
    margin: 0;
}

.facil{
    background-color: #3ddc84;
}

.medio{
    background-color: #ffd23f;
}

.dificil{
    background-color: #ff4d6d;
}

.pts{
    font-family: "Courier New", monospace;
    font-weight: bold;
    color: #fdcb88;
    margin: 8px 0;
}

.descripcion{
    font-size: 14px;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.etiquetas{
    margin-bottom: 10px;
}

.etiquetas span{
    display: inline-block;
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #ff8e99;
    border: 1px solid #ff8e99;
    border-radius: 5px;
    padding: 2px 6px;
    margin: 0 3px 5px 0;
}

.resolver{
    background-color: #f1618f;
    color: #fefecc;
    border: none;
    border-radius: 10px;
    padding: 9px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.resolver:hover{
    background-color: #bb44ae;
}

.completado{
    background-color: #3ddc84;
    color: #210558;
    animation: pulso 0.6s 2;
}

.completado:hover{
    background-color: #3ddc84;
}

.favorito{
    background: none;
    color: #fdcb88;
    border: 2px solid #fdcb88;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 14px;
    cursor: pointer;
}

.favorito.activo{
    background-color: #fdcb88;
    color: #210558;
}

.barra-movil{
    display: none;
}

@keyframes girar{
    from{
        transform: rotate(0deg);
    }
    to{
        transform: rotate(360deg);
    }
}

@keyframes aparecer{
    from{
        opacity: 0;
        transform: translateY(20px);
    }
    to{
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulso{
    0%{
        transform: scale(1);
    }
    50%{
        transform: scale(1.1);
    }
    100%{
        transform: scale(1);
    }
}

@media (max-width: 1000px){
    #retos{
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px){
    nav{
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }

    .navbar-logo{
        width: 140px;
        height: auto;
    }

    nav p{
        display: none;
    }

    .links{
        display: none;
    }

    body{
        padding-bottom: 80px;
    }

    .barra-movil{
        display: flex;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #490b87;
        padding: 10px 0;
        border-radius: 15px 15px 0 0;
        z-index: 5;
    }

    .barra-movil a{
        color: white;
        text-decoration: none;
        text-align: center;
        font-size: 12px;
    }

    .barra-movil i{
        font-size: 20px;
        color: #fdcb88;
    }

    .barra-movil p{
        margin: 4px 0 0 0;
    }

    #retos{
        grid-template-columns: 1fr;
    }
}
