@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Caprasimo&family=Pacifico&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root{
    --gold: #b19148;
    --pink: #a46d91;
    --dark_blue: #3c3e54;
    --red: #ac3d4e;
    --light_gray: #ececee;
    --gray: #777987;
    --maxw: 1000px;
    --light_red: #e6c5ca;
    --light_gold: #e8dec8;
    --light_pink: #f7f2f5;
    --highlight: #D2A7C3;
}



/* GENERAL */


*{
    font-family: 'Poppins', 'Comic sans ms'; list-style-type: none; box-sizing: border-box;
    color: var(--dark_blue);
}

::selection {
  background: var(--highlight);
}



html, body{
    margin: 0; padding: 0;
}

body{
    display: flex; flex-direction: column;
}



/* NAVBAR */


nav{
    position: sticky; top: 0;  left: 0; width: 100%; height: 80px;
    z-index: 1000; transition: .3s; background-color: var(--red);
    display: flex; flex-direction: row; align-items: center;
    justify-content: center;
}

nav.hide{
    transform: translateY(-100%);
}

nav.scrolled{
    height: 55px;
}

nav.scrolled::before{
    height: 55px; opacity: 25%;
}

#logo_nav{
    height: 100%; background-position: center;
}

#center_nav{
    max-width: var(--maxw); display: flex; width: 100%; flex-direction: row;
    justify-content: space-between; height: 100%; align-items: center;
}

nav ul{
    display: flex; flex-direction: row; margin: 0; height: 100%;
    padding: 0;
}

.elem_nav, .elem_nav_ext{
    padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 14px;
    text-transform: uppercase; background-color: transparent; position: relative; font-weight: bold;
    min-width: 100px; text-align: center; color: var(--light_gray); display: flex; align-items: center;
    justify-content: center; letter-spacing: 1px;
}

nav ul span{
    margin-right: 5px; color: inherit;
}

.elem_nav:hover,
.elem_nav_ext:hover{
    transform: translateY(-2px); transition: .3s ease;
}

.elem_nav::after,
.elem_nav_ext::after{
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; content: '';
    background-color: var(--pink); opacity: 0; transition: 0.15s opacity;
    z-index: -1;
}

.elem_nav:hover::after,
.elem_nav_ext:hover::after{
    opacity: 1;
}

.elem_nav:hover{
    color: var(--light_pink);
}

.elem_nav_ext:hover{
    color: var(--light_gold);
}

.elem_nav::after,
.elem_nav_ext::after{
    background-color: var(--gold);
}

.elem_nav_ext:hover::after{
    opacity: 1;
}




/* HEADER */

#lignes_titres{
    display: flex; flex-direction: column; align-items: left;
    justify-content: center; margin: 0 50px;
}

.fade {
    animation: fadeIn 1s ease forwards;
}

header{
    height: 55vh; width: 100vw; display: flex; position: relative;
    background-image: url("Images/BG_1.webp"); /* https://static.vecteezy.com/ti/photos-gratuite/p2/5085903-lieu-de-travail-moderne-bureau-fond-gratuit-photo.jpg */
    background-position: center; background-repeat: no-repeat;
    background-size: cover; align-items: center; justify-content: center;
    border-bottom: 10px solid var(--red);
}

header::before{
    position: absolute; content: ''; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, .5); z-index: 0; backdrop-filter: blur(3px);
}

#titres{
    display: flex; align-items: center; justify-content: space-between; flex-direction: row;
    opacity: 1; z-index: 1; margin-top: 25px; width: 100%; max-width: var(--maxw);
}

#logo_main{
    width: 150px; height: 150px; margin: 0 40px; backdrop-filter: blur(15px);
    background-color: rgba(255, 255, 255, .2); background-size: contain;
    background-image: url("Images/dé.png"); aspect-ratio: 1; border-radius: 20px;
     border: 1.5px solid rgba(255, 255, 255, .15);
    background-position: center; background-repeat: no-repeat;
    animation: animer ease-in-out infinite 2s;
}

#titres h1{
    font-size: 40px; font-family: "Pacifico", Cursive; font-weight: 400;
    color: var(--red); padding: 0; margin: 0; opacity: 0;
    text-shadow: 
        1px 2px 0 #111,
        2px 4px 0 #111,
        3px 6px 0 #111;
}

#lignes_titres p{
    width: 450px; min-width: 120px; font-size: 14px; color: var(--gold);
    animation-delay: .3s; font-style: italic; padding: 0; margin: 0; opacity: 0;
    text-shadow:
        0 0 10px #111,
        .5px 1px 0 #111,
        1px 2px 0 #111;
    font-weight: 400;
}

@keyframes animer{
    0%{
        transform: translateY(3px);
    }
    50%{
        transform: translateY(-3px);
    }
    100%{
        transform: translateY(3px);
    }
}



/* MAIN */

main{
    display: flex; flex-direction: column; align-items: center;
}

main h1{
    width: 100%; max-width: var(--maxw); margin: 0; padding: 75px 15px 0; font-size: 34px;
    font-family: "Caprasimo"; margin-top: 20px; color: var(--pink); z-index: 0;
}

#jeux{
    width: 100%; background-color: white; display: flex; flex-direction: column; align-items: center;
    justify-content: center;
}

/* Conteneur */
#genres {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-width: var(--maxw);
    margin: 20px auto;
    padding: 0 10px;
    list-style: none;
}

/* Élément individuel */
.elem_genre {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 10px 14px;
    border-radius: 8px;

    background-color: var(--light_gray);
    color: var(--dark_blue);

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Icône */
.elem_genre .material-symbols-outlined {
    font-size: 20px;
    color: var(--gray);
    transition: color 0.2s ease;
}

/* Hover */
.elem_genre:hover {
    background-color: var(--light_gold);
    /* border-color: var(--gold); */
    color: var(--dark_blue);
}

.elem_genre:hover .material-symbols-outlined {
    color: var(--gold);
}

/* Variante active (si tu veux ajouter une classe JS plus tard) */
.elem_genre.active {
    background-color: var(--red);
    color: white;
    /* border-color: var(--pink); */
}

.elem_genre.active .material-symbols-outlined {
    color: white;
}

#container_jeux{
    width: 100%; max-width: calc(var(--maxw) - 10px); padding: 0 5px 50px 5px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px 20px;
    align-items: stretch;
    justify-items: stretch;
}

.elem_jeu{
    display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start;
    background-color: white; min-height: 200px;
    overflow: hidden; opacity: 0; min-width: 0;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}


.pair{
    flex-direction: column;
}

.impair{
    flex-direction: column;
}

.elem_jeu aside{
    width: 100%; min-height: 150px; background-image: var(--img); background-position: center;
    background-size: cover; background-repeat: no-repeat;
    min-height: 160px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}


.text_jeu{
    width: 100%; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; margin: 15px 0 20px;
}

.titres_jeu{
    display: flex; flex-direction: column-reverse; justify-content: space-between;
    align-items: left; width: calc(100% - 30px);
}

/* .titres_jeu{
    display: flex; flex-direction: row; justify-content: space-between;
    align-items: center; width: calc(100% - 30px); 
} */

.titres_jeu h2{
    font-size: 28px; font-family: "Archivo Black"; letter-spacing: 0px; margin: 0;
    text-transform: uppercase; color: var(--red); padding: 0; font-weight: Bold;
    
}

.titres_jeu button{
    background-color: var(--gold); color: var(--light_gray); border: none; padding: 8px 16px;
    border-radius: 6px; font-size: 19px; text-transform: uppercase; font-weight: 400;
    letter-spacing: 1px; cursor: pointer; border: 2px solid var(--gold); display: flex;
    align-items: center; font-family: "Archivo Black"; justify-content: center;
    margin-bottom: 10px;
}

.titres_jeu button:hover{
    background-color: var(--light_gold); color: var(--gold); letter-spacing: 5px; transition: ease .3s letter-spacing;
}

.titres_jeu button:active{
    color: var(--pink); border-color: var(--pink); background-color: var(--light_red);
}

.titres_jeu button span{
    width: 0px; height: 24px; overflow: hidden; font-size: 24px; color: inherit; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin-left: 5px;
}

.titres_jeu button:hover span{
    width: 24px; transition: width .3s ease;
}

.description_jeu{
    width: calc(100% - 30px); text-align: justify; color: var(--dark_blue);
    font-size: 15px; line-height: 1.5;
}

.text_jeu ul{
    margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: nowrap;
    width: calc(100% - 30px); overflow-x: hidden;
}

.text_jeu li{
    padding: 5px 10px; color: var(--pink); text-wrap: nowrap; text-transform: uppercase;
    margin: 0 5px; font-weight: bold; cursor: pointer; font-size: 13px;
    display: flex; align-items: center; border-radius: 6px;
    background-color: var(--light_gray);
}

.text_jeu ul span{
    margin-right: 8px; color: inherit; text-decoration: none; font-size: 20px;
}

.text_jeu li:hover{
    transition: .3s;
}

#information{
    width: 100%; display: flex; align-items: center; padding: 20px 0 50px;
    justify-content: center;
}

#information p{
    width: 100%; max-width: var(--maxw); text-align: center;
    color: var(--red); font-size: 16px; font-weight: bold; letter-spacing: 2px; 
}


/* POP-UP */

#popup{
    position: fixed; width: 100%; height: 100%; background-color: rgba(15, 15, 21, .8);
    top: 0; left: 0; z-index: 1010; align-items: center; justify-content: center; display: none;
}

#popup section{
    width: 100%; max-width: var(--maxw); height: calc(100% - 60px); background-color: var(--light_gray);
    position: relative; overflow: auto;
}

#bouton_popup{
    position: fixed; bottom: 10px; right: 50%; width: 55px; height: 55px; font-size: 28px;
    display: flex; color: var(--light_gray); transform: translateX(50%); z-index: 10;
    align-items: center; justify-content: center; cursor: pointer; font-weight: bold; border: 4px solid var(--red);
    background-color: var(--red); border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, .5);
}

#bouton_popup:active{
    background-color: var(--light_gray); color: var(--red);
}

#bg{
    background-image: url("Images/play4.webp"); background-position: center; background-repeat: no-repeat; background-size: cover;
    width: 100%; height: 250px; border-bottom: 8px solid var(--red);
}

#texte_popup{
    width: calc(100% - 60px); margin: 20px 30px; transition: .3s; border-radius: 15px;
}

#texte_popup:hover{
    backdrop-filter: brightness(95%);
}

#texte_popup h1{
    text-transform: capitalize; font-size: 42px; margin: 0 15px;
}

#texte_popup h2{
    font-size: 18px; margin: 30px 15px 8px 15px; text-transform: uppercase; letter-spacing: 1px; font-family: 'archivo black';
    color: var(--pink);
}

.regles, .desc{
    margin: 5px 20px; text-align: justify; font-size: 16px;
}

#texte_popup p:last-child{
    padding-bottom: 30px; margin-bottom: 20px;
}


/* FOOTER */

footer{
    /* keep existing footer but allow positioned logo */
    position: relative;
    width: 100%; background: linear-gradient(180deg, rgba(60,62,84,1) 0%, rgba(44,44,64,1) 60%);
    padding: 50px 0 70px; border-top: 6px solid var(--red);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}

#liste_footer{
    width: 100%; max-width: var(--maxw); display: flex; flex-direction: row;
    align-items: right; justify-content: space-around; margin: 0 0 30px 0; padding: 0;
}

.elem_footer{
    flex: 1;
}

.elem_footer h3{
    text-align: center; margin: 0; padding: 0; color: white; font-size: 18px;
    color: var(--gold); letter-spacing: .6px; text-transform: uppercase;
}

.elem_footer ul{
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0; margin: 10px 0;

    li{
        padding: 0; margin: 0; color: var(--light_gray); margin: 2px 0; text-align: center;
        font-size: 14px;
    }

    li:hover{
        font-style: italic;
    }

    a{
        color: var(--light_gray);
    }
}

footer h5{
    color: rgba(255,255,255,0.82);
    font-size: 14px;
    font-weight: 500;
    margin: 12px 0 0;
    text-align: center;
    letter-spacing: .6px;
    opacity: 0.95;
}

/* nicer, less intrusive logo fixed in footer area */
#logo_tsp{
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 64px;
    height: 64px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.45);
    border-radius: 10px;
    opacity: 0.95;
    border: 2px solid rgba(255,255,255,0.06);
    background-color: rgba(255,255,255,0.02);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    object-fit: cover;
}

#logo_tsp:hover{
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 32px rgba(0,0,0,0.55);
    opacity: 1;
}



.no-scroll{
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* responsive tweaks (replaces previous responsive blocks) */
@media only screen and (max-width: 900px){
    /* header */
    #logo_main{ display: none; }
    #lignes_titres{ width: 100%; overflow: hidden; padding: 15px; }
    #lignes_titres h1{ width: 100%; font-size: 35px; line-height: calc(100% + 5px); margin-bottom: 20px; }
    #lignes_titres p{ width: 100%; font-size: 12px; }

    /* jeux grid: allow smaller minimum column so layout becomes 2 cols earlier */
    #container_jeux{
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
        padding: 0 12px 40px;
    }

    /* remove forced widths/margins from cards so grid controls layout */
    .elem_jeu{
        margin: 0;
        width: auto;
        min-width: 0;
    }

    .titres_jeu h2{ font-size: 24px; }

    /* footer */
    #liste_footer{ flex-direction: column; gap: 20px; align-items: stretch; }
    .elem_footer{ margin-bottom: 0; }
    footer h5 {
        font-size: 10px;
    };
}

/* smaller phones */
@media only screen and (max-width: 550px){
    /* make grid a single column and tighten paddings */
    #container_jeux{
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0 10px 30px;
    }

    /* cards should fully stretch inside the single-column grid */
    .elem_jeu{
        margin: 0;
        width: 100%;
        min-width: 0;
        flex-direction: column; /* ensure vertical stacking inside card */
    }

    .elem_jeu aside,
    .text_jeu{ width: 100%; }

    .description_jeu{ font-size: 14px; }

    .text_jeu ul{
        flex-wrap: wrap;
        justify-content: space-between;
        width: calc(100% - 30px);
    }

    .text_jeu li{
        padding: 5px 8px; margin: 0 5px 6px; font-size: 13px;
    }

    .text_jeu span{ margin-right: 5px; font-size: 18px; }

    .titres_jeu{
        width: calc(100% - 24px);
    }

    .titres_jeu button{
        padding: 6px 12px; font-size: 15px; border-radius: 6px;
    }

    /* popup adjustments */
    #texte_popup{ width: calc(100% - 20px); margin: 20px 10px; }
    #texte_popup h1{ font-size: 34px; }
    .regles, .desc{ font-size: 14px; }

    #genres{
        gap: 8px;
    }

    .elem_genre .material-symbols-outlined {
        display: none;
    }

    .elem_genre{
        font-size: 12px;
    }
}









/* LIENS DE NAVIGATION
   Les entrées du menu sont de vrais liens <a> (clic molette, clavier, etc.) */

html{
    scroll-behavior: smooth;
}

nav ul li{
    display: flex;
}

.elem_nav, .elem_nav_ext{
    text-decoration: none;
}

.logo_li a{
    display: flex; height: 100%;
}
