/* Styles pour la page de liste des jeux (games.ejs) */

/* Conteneur principal de la page */
.games-list-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
    box-sizing: border-box;
}

/* Titre de la page */
.games-list-page h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2em;
    text-transform: uppercase;
    color: #333;
}

/* Grille contenant les cartes de jeu (par défaut pour PC) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 colonnes sur PC */
    gap: 25px;
}

/* Style de chaque carte de jeu (le lien <a>) */
.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    overflow: hidden; /* Important pour contenir l'image zoomée */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    /* --- CHANGEMENT : Coins arrondis réduits --- */
    border-radius: 4px;
    /* --- FIN CHANGEMENT --- */
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Conteneur de l'image dans la carte */
.game-card-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4; /* Ratio portrait par défaut (PC) */
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Important pour contenir l'image zoomée */
    /* --- CHANGEMENT : Coins arrondis réduits --- */
    /* L'arrondi est hérité du parent .game-card ou défini spécifiquement sur mobile */
}

/* Image de couverture du jeu (dans <picture>) */
.game-card-image-wrapper picture,
.game-card-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* --- AJOUT : Transition pour l'effet de survol --- */
    transition: transform 0.3s ease-in-out;
    /* --- FIN AJOUT --- */
}

/* --- AJOUT : Effet de survol sur l'image --- */
.game-card:hover .game-card-image-wrapper img {
    transform: scale(1.05); /* Zoom léger */
}
/* --- FIN AJOUT --- */


/* Conteneur des informations (titre, date) */
.game-card-info {
    background-color: #000000;
    color: #ffffff;
    padding: 12px 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

/* Titre du jeu dans la carte */
.game-card-info h3 {
    font-size: 0.95em;
    margin: 0 0 4px 0;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date de sortie dans la carte */
.game-card-info .release-date {
    font-size: 0.8em;
    margin: 0;
    color: #cccccc;
    white-space: nowrap;
}

/* Message si aucun jeu n'est disponible */
.no-games-message {
    text-align: center;
    padding: 50px 20px;
    color: #777;
    font-style: italic;
}

/* --- Media Queries pour la Responsivité --- */

/* Tablettes (ex: moins de 992px) - 3 colonnes */
@media (max-width: 991.98px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    .games-list-page h1 {
        font-size: 1.8em;
    }
}

/* Petites tablettes / Grands téléphones (ex: moins de 768px) */
/* Affichage liste verticale (1 colonne), image paysage */
@media (max-width: 767.98px) {
    .games-grid {
        display: grid;
        grid-template-columns: 1fr; /* Une seule colonne */
        gap: 20px;
    }

    /* La carte reste en display: block */

    .game-card-image-wrapper {
        aspect-ratio: 16 / 9; /* Ratio Paysage */
        /* --- CHANGEMENT : Coins arrondis réduits (haut seulement) --- */
        border-radius: 4px 4px 0 0;
    }
     /* Appliquer l'arrondi à l'image elle-même si elle déborde */
     .game-card-image-wrapper picture,
     .game-card-image-wrapper img {
         border-radius: 4px 4px 0 0;
     }

    .game-card-info {
        padding: 10px 15px;
        min-height: initial;
         /* --- CHANGEMENT : Coins arrondis réduits (bas seulement) --- */
         border-radius: 0 0 4px 4px;
    }

     .game-card-info h3,
     .game-card-info .release-date {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
     }
     .game-card-info h3 {
        font-size: 1em;
     }
     .game-card-info .release-date {
        font-size: 0.85em;
     }

    .games-list-page h1 {
        font-size: 1.6em;
        margin-bottom: 30px;
    }
}

/* Téléphones (ex: moins de 576px) - Ajustements fins */
@media (max-width: 575.98px) {
     .games-list-page {
        padding: 20px 10px;
    }
    .games-list-page h1 {
        font-size: 1.5em;
    }
     .game-card-info h3 {
        font-size: 0.95em;
    }
    .game-card-info .release-date {
        font-size: 0.8em;
    }
}
