* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;

}



body {
    font-family: 'Lato', sans-serif;
    /* background: linear-gradient(90deg, #f57425 0%,  #ffffff 25%,  #ffffff 50%,#21bfbb 80%); */
    background-color: #EFC1CB;
    max-width: 100vw;
}


/* texte */
a,
b,
i {
    font-family: inherit;
    font-size: inherit;
    color: inherit;

}

a.sans-style {
    text-decoration: none;
    color: inherit;
}






.square:hover {
    border: solid 1px black;
    border-radius: 0.5px;
    display: block;
}

#content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    max-width: 100vw;
    overflow: hidden;

}

.square {
    /* par défaut dézoomé */
    box-sizing: border-box;
    /* height: 10px;
    width: 10px; */

    display: block;
    flex: 1;

}

.square,
.square:hover {
    width: var(--grid-square-size);
    height: var(--grid-square-size);
    max-width: var(--grid-square-size);
    min-width: var(--grid-square-size);
    max-height: var(--grid-square-size);
    min-height: var(--grid-square-size);

}

#btn_div {
    /* width: 60px; */
    /* height: 350px; */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 4px;
    max-width: 100%;

    >#btn_div_interne {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 4px;
    }
}

.row {
    /* height: calc(calc(100vw - 200px) / var(--grid-lig)); */
    /* width: 500px; */
    display: flex;
    background-color: white;

    cursor: none;

}

.button {
    border: none;
    border-radius: 8px;

    color: white;
    min-width: 32px;
    height: 32px;
    cursor: pointer;
    opacity: 1;
    
    &#button_white {
        border: solid 2px rgba(189, 189, 189, 0.36);

    }
}

.button.selected {
    border: solid 3px rgb(77, 77, 77);
    &#button_white {
        border: solid 3px rgb(77, 77, 77);

    }
}



.playground {
    border-style: solid;
    /* border-color: black; */
    display: inline-block;
    margin: auto;
    background-color: #333;
    padding: 2px;
    /* padding-bottom: 20px; */
    border-radius: 4px 4px 8px 8px;
    margin: 10px;
    width: min-content;

}


#sidebar {
    /* width: 20%; */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100px;
    text-align: center;
    max-width: 200px;
    background-color: var(--theme-color);
    border: solid 1px #ccc;
    color: #91535f;
    padding: 6px;
    z-index: 10;

}

#main {
    flex: 1;
    width: 80%;
    min-height: 100vh;
    display: inline-block;
    text-align: center;
    overflow: auto;
    /* touch-action: manipulation; */
    margin-left: 100px;


}



div#toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: left;
    gap: 8px;

    position: relative;

    background-color: #faebee;
    border: solid 4px #faebee;
    color: white;
    /* padding: 8px; */
    border-radius: 8px;

    width: fit-content;

    font-weight: 400;

    >ion-icon {
        font-size: 24px;
        padding: 8px;
    }
}


div#toggle.view>#pointer,
div#toggle.pointer>#view {
    color: #de7f92;
    cursor: pointer;
}

div#toggle::before {
    content: "";
    display: block;
    width: 100%;
    height: 40px;
    background-color: #de7f92;
    border-radius: 8px;
    position: absolute;
    transition: all 0.4s ease;
    left: 0;
}

div#toggle.pointer::before {
    bottom: auto;
    top: 0;
}

div#toggle.view::before {
    top: auto;
    transform: translateY(24px);
}



#nbPlayer {

    margin: 16px 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: left;
    gap: 8px;

    background-color: #de7f92;
    color: white;
    padding: 8px;
    border-radius: 8px;

    width: fit-content;

    font-weight: 400;

    >ion-icon {
        min-width: 24px;
        font-size: 18px;
    }


}

.live-animation {
    /* clignote lentement infini */
    animation: blink 3s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    25% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
    }
}


#info {
    color: #de7f92;
    /* min-height: 100px; */
    text-align: center;
    background-color: #faebee;
    /* margin: 30px 10px; */
    margin-bottom: 0px;
    vertical-align: middle;
    border-radius: 8px;
    padding: 8px;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;

}

div#info.hidden {
    visibility: hidden;
}

#change {
    border-color: black;
    width: 100px;
    height: 50px;
    text-align: center;
    background-color: #21bfbb;
}


#main.zoom .playground {
    /* transform: scale(0.5); */
    /* transform-origin: 0 0; */
    /* transition-duration: 1s; */
    z-index: 1;
    position: relative;




}


#main.zoom .square:hover,
#main.zoom .square {
    /* max-width: calc(90vh / var(--grid)) !important;
    height: calc(90vh / var(--grid)) !important;
    max-height: calc(90vh / var(--grid)) !important;
    min-width: calc(90vh / var(--grid)) !important; */
    height: max(30px, calc(90vh / var(--grid))) !important;
    width: max(30px, calc(90vh / var(--grid))) !important;
    max-width: max(30px, calc(90vh / var(--grid))) !important;
    min-height: max(30px, calc(90vh / var(--grid))) !important;
    min-width: unset;
    max-height: unset;

}
div[style="background-color: black;"]:hover {
    border-color: rgba(255, 255, 255, 0.442);
}

#main.zoom .row {
    /* width: calc(calc(90vh / var(--grid)) * var(--grid-col)) !important;
    height: calc(90vh / var(--grid)) !important; */
    /* width: max(calc(30px * var(--grid-col)), calc(90vh / var(--grid))) !important; */
    height: max(30px, calc(90vh / var(--grid))) !important;
}


/* boutons de controle additionnels */

#additional-controls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 4px;

    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: row;
    gap: 8px;



}


/* boutons du menu en bas (zoom, leaderboard... */
#additional-controls>div {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background-color: #7a7a7a00;
    color: #de7f92;
    cursor: pointer;
    user-select: none;

    text-align: center;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    font-weight: 900;

    width: 40px;
    min-height: 40px;

    transition: all 0.2s ease;
}


#additional-controls>div.actif {
    background-color: #de7f92;
    color: #fff;
}

#additional-controls>div.actif:hover {
    background-color: #de7f92;
    color: #fff;
}


#additional-controls>div:hover {
    background-color: #c4c4c448;
}

#additional-controls>div:active {
    background-color: #de7f92;
    color: #fff;
}


/* description  */
#art-description {
    color: #FFF;
    font-weight: 900;
    text-align: center;
    padding: 6px;
    font-size: 16px;
}

#leaderboard {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
    text-align: center;
}

#leaderboard th, #leaderboard td {
    border: 1px solid #ccc;
    padding: 10px;
}

#leaderboard th {
    background-color: #f4f4f4;
    font-weight: bold;
}



/* PC UNIQUEMENT */
@media (min-width:700px) {
    .mobile-only {
        display: none;
    }

    .square,
    .square:hover {
        width: calc(var(--grid-square-size) - calc(200px / var(--grid)));
        height: calc(var(--grid-square-size) - calc(200px / var(--grid)));
        max-width: calc(var(--grid-square-size) - calc(200px / var(--grid)));
        min-width: calc(var(--grid-square-size) - calc(200px / var(--grid)));
        max-height: calc(var(--grid-square-size) - calc(200px / var(--grid)));
        min-height: calc(var(--grid-square-size) - calc(200px / var(--grid)));
    }
}

/* pour mobile */
@media (max-width: 700px) {


    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        /* width: 100vw; */
        max-width: unset;
        height: 100px;
        width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: solid 1px #ccc;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.332);

        display: flex;
        flex-direction: row;
    }

    body {
        padding: 0;
        padding-bottom: 50vh;
    }

    #main {
        margin-left: 0;
        margin-top: 200px;
        width: 100%;


    }

    /* TOGGLE MODE */
    div#toggle {
        flex-direction: row;
    }

    div#toggle::before {

        width: 40px;
        height: 100%;
        left: 0;
    }

    div#toggle.pointer::before {
        left: 0;
    }

    div#toggle.view::before {
        transform: translateX(48px);
    }






    /* BOUTONS DE COULEUR */
    .button {
        /* border: solid #111 3px; */
        border-radius: 6px;
        min-width: 40px;
        height: 40px;
        border: solid 2px rgba(189, 189, 189, 0.36);
    }

    div#btn_div {
        position: fixed;
        top: 0;

        left: 0;
        right: 0;

        width: 100vw;
        height: 100vh;

        z-index: 1000;

        border-radius: 0;
        background-color: #0000004a;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 8px;

        align-items: center;
        justify-content: center;

        >#btn_div_interne {
            background-color: #fff;
            border-radius: 8px;
            padding: 8px;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);

            max-width: min(90vw, 300px);
            margin: auto;

            >.menu-context {
                width: 100%;
                display: flex;
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                padding: 0 8px;
                padding-bottom: 4px;


                >p {
                    font-weight: 900;
                    font-size: 18px;
                    color: black
                }

                >ion-icon {
                    font-size: 24px;
                    padding: 8px;
                    cursor: pointer;
                    color: black;
                    border-radius: 6px;
                    transition: all 0.2s ease;

                    &:hover {
                        background-color: #cccccc59;
                    }

                    &active {
                        background-color: #de7f92;
                        color: white;
                    }
                }
            }

        }

        &.ferme {
            display: none;
        }





    }

    button#color-selector {
        border: solid 4px black;
        border-radius: 6px;
        height: 40px;
        width: 40px;
        cursor: pointer;

        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        overflow: hidden;


        >div {
            width: 50%;
            height: 50%;

        }

        /* 1st child div */
        >div:nth-child(1) {
            background-color: red;
        }

        /* 2nd child div */
        >div:nth-child(2) {
            background-color: orange;
        }

        /* 3rd child div */
        >div:nth-child(3) {
            background-color: yellow;
        }

        /* 4th child div */
        >div:nth-child(4) {
            background-color: rgb(48, 219, 48);
        }

    }


    /* INFORMATIONS DE PIXEL */

    div#info {
        position: absolute;
        top: 120%;
        max-width: -webkit-fill-available;
        /* min-width: min(90vw, 300px); */
        left: 20px;
        right: 20px;
    }





    #main.zoom .playground {
        /* transform: scale(0.5); */
        transform-origin: 0 0;
        transition-duration: 1s;

    }


    #main.zoom .square:hover,
    #main.zoom .square {
        height: max(30px, calc(90vh / var(--grid))) !important;
        width: max(30px, calc(90vh / var(--grid))) !important;
        max-width: max(30px, calc(90vh / var(--grid))) !important;
        min-height: max(30px, calc(90vh / var(--grid))) !important;
    }

    #main.zoom .row {
        width: max(calc(30px * var(--grid-col)), calc(90vh / var(--grid))) !important;
        height: max(30px, calc(90vh / var(--grid))) !important;
    }





    /* boutons de controle additionnels */

    #additional-controls {
        position: fixed;
        bottom: calc(16px + env(safe-area-inset-bottom));
        ;
        left: 0px;
        right: 0px;
        /* width: -webkit-fill-available; */
        padding: 4px;
        margin: 0 16px;

        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        gap: 8px;
    }
}

/* Custom Tile Tooltip */
[data-title]:hover:after {
    opacity: 1;
    transition: all 0.2s ease 0.5s;
    visibility: visible;
}

[data-title]:after {
    content: attr(data-title);
    background-color: #dfb1bb;
    color: #fff;
    position: absolute;
    padding: 1px 5px 2px 5px;
    top: -2em;
    transform: translateX(-50%);
    white-space: nowrap;
    box-shadow: 1px 1px 3px #aa868e;
    opacity: 0;
    z-index: 99999;
    visibility: hidden;
}

[data-title] {
    position: relative;
}