* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0B121E;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: #E3E8F0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #151A23;
    border-bottom: 3px solid #1E6091;
    border-radius: 10px;
    margin: 10px;
    padding: 12px 20px;
}

header h1 {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 28px;
    color: white;
}

header h1 span {
    color: #FFCC00;
}

header h1 i {
    color: #64D9FF;
    font-size: 24px;
}

.titulo p {
    font-size: 13px;
    color: #AAB4C4;
    margin-top: 2px;
}

.marcadores {
    display: flex;
    gap: 15px;
}

.marcador {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #1A222F;
    border-radius: 10px;
    padding: 8px 14px;
}

.marcador i {
    font-size: 22px;
    color: #64D9FF;
}

.marcador small {
    display: block;
    font-size: 11px;
    color: #AAB4C4;
}

.marcador strong {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 18px;
    color: #FFCC00;
}

nav {
    display: flex;
    gap: 10px;
    background-color: #151A23;
    border-radius: 10px;
    margin: 10px;
    padding: 10px;
}

.filtro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #1A222F;
    color: #AAB4C4;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    transition: all ease-in-out 200ms;
}

.filtro:hover {
    color: white;
    border-color: #2379C9;
}

.filtro.activo {
    background-color: #FFCC00;
    color: #0B121E;
    font-weight: bold;
    border-color: #FFCC00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

main {
    padding: 10px 20px 20px;
}

main h2 {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 20px;
    color: white;
    margin: 10px 0 15px;
}

.contenedor {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.vacio {
    grid-column: 1 / -1;
    text-align: center;
    color: #AAB4C4;
    background-color: #151A23;
    border: 2px dashed #1E2D44;
    border-radius: 12px;
    padding: 40px 20px;
    line-height: 1.5;
    animation: entrar 0.4s ease-out;
}

.tarjeta {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #151A23;
    border: 2px solid #1E2D44;
    border-radius: 12px;
    overflow: hidden;
    transition: all ease-in-out 200ms;
    animation: entrar 0.4s ease-out backwards;
}

.tarjeta:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    border-color: #2379C9;
}

.tarjeta.resuelta {
    border-color: #2ECC71;
    background-color: #0F2D25;
}

.tarjeta.resuelta h3 {
    color: #86EFAC;
}

.marca {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 26px;
    color: #2ECC71;
    background-color: #0B121E;
    border-radius: 50%;
    z-index: 1;
}

.tarjeta.resuelta .marca {
    display: block;
}

.banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.categoria {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: white;
    background-color: rgba(11, 18, 30, 0.7);
    border-radius: 6px;
    padding: 3px 8px;
}

.banner-algoritmos {
    background: linear-gradient(135deg, #1E2D44, #2379C9);
}

.banner-web {
    background: linear-gradient(135deg, #0A5C73, #64D9FF);
}

.banner-datos {
    background: linear-gradient(135deg, #7A2E00, #FF6A00);
}

.contenido {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 15px;
}

.encabezado h3 {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 18px;
    color: white;
    margin-bottom: 8px;
}

.datos {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge {
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 20px;
    color: #0B121E;
}

.badge.facil {
    background-color: #2ECC71;
}

.badge.medio {
    background-color: #FFCC00;
}

.badge.dificil {
    background-color: #E5484D;
    color: white;
}

.puntaje {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    color: #FFCC00;
}

.descripcion {
    font-size: 13px;
    line-height: 1.5;
    color: #AAB4C4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    color: #64D9FF;
    background-color: #1A222F;
    border: 1px solid #1E6091;
    border-radius: 6px;
    padding: 3px 8px;
}

.acciones {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-resolver {
    flex: 1;
    background-color: #2379C9;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    transition: all ease-in-out 200ms;
}

.btn-resolver:hover {
    background-color: #1E6091;
    box-shadow: 0 4px 10px rgba(35, 121, 201, 0.5);
}

.btn-resolver.completado {
    background-color: #2ECC71;
    color: #0B121E;
    cursor: default;
    box-shadow: none;
    animation: pulso 600ms ease-in-out;
}

.btn-favorito {
    background-color: #1A222F;
    color: #AAB4C4;
    border: 2px solid #1E2D44;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 16px;
    transition: all ease-in-out 200ms;
}

.btn-favorito:hover {
    border-color: #FFCC00;
    color: white;
}

.btn-favorito.activo {
    background-color: #FFCC00;
    border-color: #FFCC00;
    color: #0B121E;
}

.carga {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0B121E;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px 20px;
}

.carga.ocultar {
    animation: desvanecer 0.5s forwards;
}

.carga-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    font-family: Consolas, 'Courier New', monospace;
    color: #64D9FF;
    text-align: center;
}

.carga-recarga {
    font-size: 60px;
    animation: girar 1s linear infinite;
}

.carga-tarjetas {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.esqueleto {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #151A23;
    border: 2px solid #1E2D44;
    border-radius: 12px;
    padding-bottom: 15px;
    overflow: hidden;
}

.esq-banner,
.esq-linea {
    background: linear-gradient(90deg, #1A222F 25%, #2A3A54 50%, #1A222F 75%);
    background-size: 200% 100%;
    animation: brillo 1.2s linear infinite;
}

.esq-banner {
    height: 120px;
}

.esq-linea {
    height: 14px;
    border-radius: 7px;
    margin: 0 15px;
}

.esq-linea.larga {
    width: 70%;
    height: 20px;
}

.esq-linea.corta {
    width: 30%;
}

@keyframes entrar {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    50% {
        transform: scale(1.1);
    }

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

@keyframes girar {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes brillo {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes desvanecer {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        visibility: hidden;
    }
}

@media (max-width: 1000px) {

    .contenedor,
    .carga-tarjetas {
        grid-template-columns: 1fr 1fr;
    }

    .esqueleto:nth-child(3) {
        display: none;
    }

    header h1 {
        font-size: 22px;
    }
}

@media (max-width: 600px) {

    body {
        padding-bottom: 80px;
    }

    header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .marcadores {
        width: 100%;
        gap: 10px;
    }

    .marcador {
        flex: 1;
        padding: 6px 10px;
    }

    main {
        padding: 10px;
    }

    .contenedor,
    .carga-tarjetas {
        grid-template-columns: 1fr;
    }

    .esqueleto:nth-child(2) {
        display: none;
    }

    nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        border-top: 3px solid #1E6091;
        justify-content: space-around;
        gap: 5px;
        padding: 8px;
        z-index: 50;
    }

    .filtro {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        font-size: 11px;
    }

    .filtro i {
        font-size: 18px;
    }
}

@media (min-width: 1500px) {
    .contenedor {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}
