/* THEMES */
/*
 * Les couleurs du site sont définies ici.
 */
 body{
    --back-color: rgb(253, 221, 173);
    --front-color: rgb(77, 3, 3);

    --back-color-alt: rgb(69, 45, 45);
    --front-color-alt: rgb(255, 187, 92);

    --back-color-other: rgb(182, 94, 39);
    --front-color-other: rgb(69, 45, 45);
}

img{
    width: auto;
    height: 100%;
}

a{
    color:inherit;
    text-decoration: inherit;
}

/* GLOBAL */
/*
 * Règles globales pour remplacer les règles
 * par défaut qui ne sont pas pratiques.
 */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body{
    height: 100%;
}

body{
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif
}


/* BODY ET SECTIONS */
/*
 * Divisions principales en sous sections supperposés.
 */
body{
    display: flex;
    flex-direction: column;
    background-color: var(--back-color);
}


/* HEADER */
/*
 * Header de la page avec le titre et les boutons relatif au compte
 */
header{
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    padding-bottom: 0.4em;
    z-index: 1;

    justify-content: space-around;
    align-content: center;

    background-color: var(--back-color-alt);
    color: var(--front-color-alt);
    
    box-shadow: black 0 0 0.5em;

    h1{
        display: flex;
        flex-direction: row;
        align-items: center;
        height: 1em;
        font-size: 2.5em;
        font-variant: small-caps;
        font-weight: bolder;

        img{
            height: 0.8em;
        }
    }

    .profile-image {
        width: 40px; /* Ajoutez la largeur souhaitée */
        height: 40px; /* Ajoutez la hauteur souhaitée */
        border-radius: 50%; /* Pour rendre l'image ronde, si nécessaire */
    }

}


/* BUTTON */
/*
 * Bouton à usage général.
 */
.button{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 8em;
    height: 2em;

    font-variant-caps: all-petite-caps;

    cursor: pointer;

    /* Hover shadow and color*/
    box-shadow: rgb(0,0,0,0.4) 0 0 0.2em;
    background-color: var(--back-color-alt);
    color: var(--front-color-alt);

    transition: box-shadow 0.2s, background-color 0.2s, color 0.2s, font-size 0.2s;
    &:hover{
        box-shadow: rgb(0,0,0,0.6) 0 0 0.5em;
        background-color: var(--back-color);
    }
}


/* NAV */
/*
 * Barre de navigation avec des boutons pour changer de fenêtre.
 */
nav{
    &>ul{
        height: 100%;
        width: 100%;

        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        justify-content: center;
        align-items: center;

        list-style: none;

        &>li{
            height: 3em;
            width: 9em;
            margin-left: 0.8em;
            margin-right: 0.8em;
            &>a{
                width: 100%;
                height: 100%;

                display: flex;
                justify-content: center;
                align-items: center;
    
                font-variant: small-caps;
                font-size: 1.3em;
                font-weight: bolder;
                
                cursor: pointer;

                /* Hover shadow and color*/
                box-shadow: rgb(0,0,0,0.4) 0 0 0.2em;
                background-color: var(--back-color-alt);
                color: var(--front-color-alt);

                transition:
                    box-shadow 0.2s,
                    background-color 0.2s,
                    color 0.2s,
                    font-size 0.2s,
                    height 0.2s;
                &:hover{
                    box-shadow: rgb(0,0,0,0.6) 0 0 0.5em;
                    background-color: var(--back-color);
                    height: 130%;
                }

                &.selected{
                    background-color: var(--back-color-other);
                    color: var(--front-color-other);
                    height: 130%;
                }
            }

        }
    }
}


/* MAIN */
/*
 * La fenêtre principale de l'application.
 */
main{
    padding-top: 3em;
    padding-bottom: 3em;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    align-items: center;
}


/* GAME */
/*
 * Une fenêtre de jeu.
 */
.game{
    position: absolute;
    background-color: yellow;
    height: 60vh;
    width: 80vh;
    transition: height 0.2s, width 0.2s;
    &:hover{
        top: 5vh;
        width: 126.7vh;
        height: 95vh;
    }
}

.connexion{
    position: absolute;
    top : 5%;
    background-color: white;
    height: 90vh;
    width: 130vh;
}

/* FOOTER */
/*
 * Footer de la page avec les informations sur l'application.
 */
footer{
    height: 4em;
    background-color: red;
}

/* ACHIEVEMENTS */
.achievements{
    background: linear-gradient(-95deg,rgb(255,255,255,0.5), rgb(255,255,255,0));
    border-right: white 0.3em solid;


    >h1{
        font-size: 3em;
        font-variant-caps: all-petite-caps;
    }

    >section{
        padding: 1em;
        width: min(80em, 90%);
        >h2{
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            &::after,&::before{
                content: "";
                display: block;
                flex-grow: 1;
                height: 0;
                margin: 0 0.5em;
                border: black solid 0.1em;
            }
            text-align: center;
            font-variant-caps: all-petite-caps;
            font-size: 2em;
        }
        >ul{
            display: flex;
            flex-direction: row;
            justify-content: center;
            flex-wrap: wrap;
            list-style: none;
            >li{
                &.unlocked{
                    >.progress::before{
                        background-color: yellow;
                    }
                    background-color: white;
                }
                margin: 1em;
                position: relative;
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: space-between;
                margin-top: 0.5em;
                box-shadow: 0 0.1em 0.2em black;
                height: 8em;
                width: 20em;
                >.progress{
                    position: absolute;
                    left: 8em;
                    bottom: 0;
                    width: 12em;
                    border-radius: 0;
                }
                >h3{
                    font-size: 1em;
                    text-align: center;
                    width: 12em;
                    position: absolute;
                    left: 8em;
                    text-shadow: 0.1em 0.1em 0 white, -0.1em -0.1em 0 white, -0.1em 0.1em 0 white, 0.1em -0.1em 0 white;
                }
                >img{
                    align-self: center;
                    height: 100%;
                    image-rendering: pixelated;
                    aspect-ratio: 1;
                }
                >p{
                    position: absolute;
                    width: 15em;
                    left: 10em;
                    top: 3em;
                    font-size: 0.8em;
                    text-align: center;
                    text-shadow: 0.1em 0.1em 0 white, -0.1em -0.1em 0 white, -0.1em 0.1em 0 white, 0.1em -0.1em 0 white;
                }
            }
        }
    }
}

@keyframes tang{
    0%{ transform: rotate(-30deg); }
    100%{ transform: rotate(30deg); }

}

.progress{
    position: relative;
    display: block;
    background: white;
    outline: 0.1em gray solid;
    border-radius: 0.3em;
    padding: 0.2em;
    text-align: center;
    &::before{
        content:"";
        left: 0;
        top: 0;
        height: 100%;
        border-radius: 0.3em;
        position: absolute;
        display: block;
        background-color: aquamarine;
        opacity: 0.6;
    }
    &[value="0"]::before{ width: 0%; }
    &[value="1"]::before{ width: 10%; }
    &[value="2"]::before{ width: 20%; }
    &[value="3"]::before{ width: 30%; }
    &[value="4"]::before{ width: 40%; }
    &[value="5"]::before{ width: 50%; }
    &[value="6"]::before{ width: 60%; }
    &[value="7"]::before{ width: 70%; }
    &[value="8"]::before{ width: 80%; }
    &[value="9"]::before{ width: 90%; }
    &[value="10"]::before{ width: 100%; }
}