body{
    width: 100%;
    margin: 0  ;
    background-color: rgb(0, 0, 0);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
/*portada encabezado de la pagina */
.portada-inicio {
    box-sizing: border-box;
    position: relative;
    width: 100%;
    background-image: url('imagenes/portada-inicio.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 400px; 
    padding-bottom: 30px;
    margin-top: 0;
    text-align: center;
    display: block;
    border-bottom: 2px solid;
    border-top: 2px solid;
    border-color: rgb(212, 198, 198) ;
    
    margin-top: 1px;
}

h1{
    color: rgb(255, 255, 255);
    font-size: 70px;
    padding:0 ;
    font-style: italic;
    background-color: rgba(15, 15, 15, 0.4);
    text-shadow: 4px 4px 7px rgba(240, 240, 240, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    
}
.portada-inicio  h2{
    color: aliceblue;
    font-family: sans-serif;
    font-style: oblique;
    font-weight: bold;
    background-color: rgba(1, 2, 2, 0.5);
    text-shadow: 4px 4px 7px rgba(240, 240, 240, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);

}


/*estructura de seccion de juegos destacados */
.juegos-destacados h2{
    box-sizing: border-box;
    color: aliceblue;
    padding: 10px ;
    background-color: rgb(92, 17, 110);
    margin-top: 0 ;
    margin-bottom: 0;
    text-align: center;
    width: 100%;
    text-shadow: 4px 1px 6px rgba(240, 240, 240, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
    border-bottom: 2px solid rgb(212, 198, 198) ;
    


}


/* Contenedor de la lista para poner los juegos en fila */
.juegos-inicio {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 200px));
    justify-content: center;
    gap: 32px;
    margin: 0;
    list-style: none; 
    background: linear-gradient(to bottom, rgba(86, 36, 152, 0.6), rgba(86, 36, 152, 0.3));
    padding: 36px 24px 48px;
}

/* Estilo individual para cada tarjeta de juego li */
.juegos-inicio li {
    min-width: 0;
    min-height: 320px;
}

/* Para asegurarnos de que las imágenes se adapten bien al espacio */
.juegos-inicio img {
    width: 100%;
    height: 200px;
    border-radius: 8px; 
    display:block;
    margin-top: 0%;
    object-fit: cover;
    box-shadow: -3px -10px 10px rgba(240, 240, 240, 0.9), 4px 6px 6px rgba(255, 255, 255, 0.7);
    
}
/* Botones de descarga: centrados y con estados interactivos */
.juegos-inicio li .boton-descarga {
    box-sizing: border-box;
    display: flex;
    width: 90%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin: 16px auto 0;
    padding: 10px 14px;
    border: 1px solid rgba(221, 190, 255, 0.8);
    border-radius: 12px;
    background: linear-gradient(135deg, #8b35d1, #57139c);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-align: center;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.juegos-inicio li .boton-descarga:hover {
    transform: translateY(-3px);
    border-color: #fff;
    box-shadow: 0 9px 20px rgba(144, 64, 220, 0.55);
}

.juegos-inicio li .boton-descarga:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.4);
}

.juegos-inicio li .boton-descarga:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -5px;
}

@media (prefers-reduced-motion: reduce) {
    .juegos-inicio li .boton-descarga {
        transition: none;
    }
}

.juegos-inicio li h3{
    text-align: center;
    color: #fff;
    text-shadow: 4px 1px 6px rgba(240, 240, 240, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}

.juegos-inicio li p.descripcion-tarjeta {
    min-height: 72px;
    margin: 10px 0 0;
    color: #eee4f5;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
}

.juegos-secundarios {
    grid-template-columns: repeat(4, minmax(0, 220px));
}

.juegos-inicio.juegos-secundarios {
    grid-template-columns: repeat(4, minmax(0, 220px));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 32px;
}

.juegos-secundarios li {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.juegos-secundarios li h3 {
    display: grid;
    min-height: 2.6em;
    place-items: center;
    margin: 18px 0 0;
    font-size: 1.05rem;
    line-height: 1.3;
    text-align: center;
}

.juegos-secundarios li p.descripcion-tarjeta {
    min-height: 78px;
}

.juegos-secundarios li .boton-descarga {
    margin: auto auto 0;
}

@media (max-width: 1040px) {
    .juegos-inicio.juegos-secundarios {
        grid-template-columns: repeat(2, minmax(0, 220px));
        gap: 32px;
    }
}

@media (max-width: 980px) {
    .juegos-inicio {
        grid-template-columns: repeat(2, minmax(0, 200px));
        gap: 28px;
    }

    .juegos-inicio.juegos-secundarios {
        grid-template-columns: repeat(2, minmax(0, 220px));
        gap: 32px;
    }
}

@media (max-width: 520px) {
    .juegos-inicio {
        grid-template-columns: minmax(0, 260px);
        padding: 24px 16px 36px;
    }

    .juegos-inicio.juegos-secundarios {
        grid-template-columns: minmax(0, 260px);
    }
}

.portada-inicio h1 strong{
    color: rgb(203, 18, 18);
    font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}

.mas-juegos h2{

    border-top: 2px solid;
    border-bottom: 2px solid;
    border-color: #c6c6c6;
}

/* Centra las tarjetas que ocupan una fila incompleta en "Otros juegos". */
@media (min-width: 1041px) {
    .juegos-secundarios li:last-child:nth-child(4n + 1) {
        grid-column: 2 / span 2;
        justify-self: center;
        max-width: 220px;
    }

    .juegos-secundarios li:nth-last-child(2):nth-child(4n + 1) {
        grid-column: 2;
    }

    .juegos-secundarios li:last-child:nth-child(4n + 2) {
        grid-column: 3;
    }
}

@media (min-width: 521px) and (max-width: 1040px) {
    .juegos-secundarios li:last-child:nth-child(2n + 1) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 220px;
    }
}
