body{
    color: rgb(22, 30, 60);
    background-color: rgb(239, 243, 250);
    margin: 0;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

#pantallaCarga{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgb(239, 243, 250);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 9999;
}

#pantallaCarga.oculta{
    opacity: 0;
    visibility: hidden;
}

.spinner{
    width: 50px;
    height: 50px;
    border: 5px rgb(213, 222, 240) solid;
    border-top: 5px rgb(37, 70, 255) solid;
    border-radius: 50%;
    animation: girar 1s linear infinite;
}

.textoCarga{
    margin: 0;
    color: rgb(84, 94, 128);
    text-align: center;
}

@keyframes girar{
    from{
        transform: rotate(0deg);
    }
    to{
        transform: rotate(360deg);
    }
}

header{
    border-bottom: 3px rgb(22, 30, 60) solid;
    background-color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 4px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header > p{
    font-size: 24px;
    font-weight: bold;
    color: rgb(37, 70, 255);
}

.stats{
    display: flex;
    gap: 10px;
}

.stats div{
    background-color: rgb(37, 70, 255);
    color: white;
    border: 2px rgb(22, 30, 60) solid;
    border-radius: 6px;
    padding: 6px 12px;
    text-align: center;
}

.stats p{
    font-size: 15px;
    font-weight: bold;
    margin: 0;
}

main{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5% 50px 5%;
}

main h1{
    margin: 28px 0 18px 0;
    font-size: 34px;
}

.divBarras{
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.filtros{
    display: flex;
    background-color: white;
    border: 2px rgb(22, 30, 60) solid;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.filtros button{
    color: rgb(22, 30, 60);
    background-color: transparent;
    border: none;
    border-radius: 5px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filtros button:hover{
    background-color: rgb(226, 233, 255);
}

.filtros button.activo{
    background-color: rgb(37, 70, 255);
    color: white;
    font-weight: bold;
}

#navMovil{
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: white;
    border-top: 3px rgb(22, 30, 60) solid;
    z-index: 20;
}

#navMovil button{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 2px;
    font-size: 11px;
    color: rgb(84, 94, 128);
    background-color: transparent;
    border: none;
    cursor: pointer;
}

.iconoNav{
    font-size: 18px;
    font-family: monospace;
}

#navMovil button.activo{
    color: rgb(37, 70, 255);
    font-weight: bold;
}

.desafios{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
    margin-top: 26px;
}

.vacio{
    color: rgb(84, 94, 128);
}

.cardDesafio{
    position: relative;
    background-color: transparent;
    border: 3px solid rgb(22, 30, 60);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    animation: aparecer 500ms;
    transition: transform 200ms;
}

.cardDesafio:hover{
    transform: translateY(-4px);
}

.cardDesafio.resuelto{
    background-color: transparent;
    border-color: rgb(14, 120, 70);
}

@keyframes aparecer{
    from{
        transform: scale(0.8);
    }
    to{
        transform: scale(1);
    }
}

.cardImagen{
    position: relative;
    flex: none;
    height: 80px;
    background-color: rgb(37, 70, 255);
    background-image: linear-gradient(135deg, rgb(37, 70, 255), rgb(120, 70, 255));
    border-bottom: 3px solid rgb(22, 30, 60);
    overflow: hidden;
}

.cardImagen img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.cardDesafio:hover{
    transform: scale(1.04);
}

.categoria{
    position: absolute;
    left: 10px;
    bottom: 10px;
    background-color: white;
    color: rgb(22, 30, 60);
    border: 2px solid rgb(22, 30, 60);
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: monospace;
    font-weight: bold;
}

.cardCuerpo{
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
}

.cardTitulo{
    display: contents;
}

.cardTitulo h2{
    margin: 0;
    font-size: 19px;
    font-family: monospace;
    line-height: 1.25;
}

.puntos{
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    background-color: rgb(22, 30, 60);
    border: 2px solid white;
    border-radius: 3px;
    padding: 3px 8px;
    color: white;
    font-weight: bold;
    font-family: monospace;
    font-size: 16px;
}

.dificultad{
    align-self: flex-start;
    margin-top: 8px;
    border-radius: 3px;
    padding: 1px 10px;
    font-size: 13px;
    font-weight: bold;
}

.facil{
    color: rgb(10, 100, 55);
    background-color: rgb(204, 246, 224);
    border: 2px rgb(10, 100, 55) solid;
}

.medio{
    color: rgb(125, 75, 0);
    background-color: rgb(255, 236, 190);
    border: 2px rgb(125, 75, 0) solid;
}

.dificil{
    color: rgb(170, 20, 40);
    background-color: rgb(255, 220, 225);
    border: 2px rgb(170, 20, 40) solid;
}

.descripcion{
    color: rgb(70, 80, 112);
    font-size: 14px;
    line-height: 1.4;
    margin: 8px 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags span{
    background-color: rgb(226, 233, 255);
    color: rgb(22, 30, 60);
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: monospace;
}

.cardBotones{
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.btnResolver{
    flex: 1;
    background-color: rgb(37, 70, 255);
    color: white;
    border: 2px solid rgb(22, 30, 60);
    border-radius: 4px;
    padding: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.4s, color 0.4s;
}

.btnResolver:hover{
    transform: scale(1.03);
}

.btnResolver:disabled{
    background-color: rgb(14, 120, 70);
    color: white;
    border-color: rgb(14, 120, 70);
    cursor: default;
    transform: none;
}

.btnResolver.completado{
    animation: pulso 0.5s;
}

@keyframes pulso{
    0%{
        transform: scale(1);
    }
    50%{
        transform: scale(1.1);
    }
    100%{
        transform: scale(1);
    }
}

.btnFavorito{
    background-color: white;
    color: rgb(22, 30, 60);
    border: 2px solid rgb(22, 30, 60);
    border-radius: 4px;
    padding: 0 12px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.btnFavorito:hover{
    transform: scale(1.08);
    background-color: rgb(226, 233, 255);
}

.btnFavorito.activo{
    color: rgb(205, 205, 39);
}

@media (max-width: 600px){
    body{
        padding-bottom: 70px;
    }

    header > p{
        font-size: 16px;
    }

    .stats p{
        font-size: 12px;
    }

    main h1{
        font-size: 26px;
    }

    #navCategoria{
        display: none;
    }

    #navMovil{
        display: flex;
    }

    .desafios{
        grid-template-columns: 1fr;
    }
}