:root {
    --main-text-color: #252422;
    --main-text-color-bis: #403D39;
    --border-color: #CCC5B9;
    --bg-color: #FFFCF2;
    --main-CTA: #EB5E28;

    --vh: 100;

    --section-animation-duration: 0ms;
}

* {
    box-sizing: border-box;
    font-size: 16pt;
    color: var(--main-text-color);
    font-family: 'Inter', 'Roboto', 'sans-serif';
}

html, body {
    width: 100vw;
    padding: 0;
    margin: 0;
    font-size: 16pt;
    background-color: var(--bg-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: var(--main-text-color-bis);

    margin: 20px;
}

h2 {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: var(--main-text-color-bis);

    margin: 10px;
}

section {
    position: fixed;
    left: 101vw;

    padding: 10px;
    height: 100dvh;

    animation-duration: var(--section-animation-duration);
    animation-fill-mode: none;

    @media (max-width: 800px) {
        width: 100vw;
        animation-name: sectionDisappear;

        &.active {
            animation-fill-mode: both;
            animation-name: sectionAppear;
        }
    }

    @media (min-width: 801px) {
        width: 800px;
        animation-name: sectionDisappearPC;

        &.active {
            animation-fill-mode: both;
            animation-name: sectionAppearPC;
        }
    }

    & .rules {
        border: 1px var(--border-color) solid;
        border-radius: 5px;
        padding: 0 10px;
        margin-bottom: 20px;

        & ul {
            list-style: disc;
            margin-left: 20px;

            & li {
                margin-bottom: 10px;
            }
        }
    }

    & button:last-of-type {
        margin-bottom: 10px;
    }

}

@supports not (height: 100dvh) {
    section {
        height: calc(var(--vh) * 100);
    }
}

.scrollable {
    overflow-y: auto;
}

.exo {
    & input {
        border: 1px var(--border-color) solid;
        padding: 0 10px;
        min-width: 0;
        border-radius: 5px;
    }

    & button.next {
        display: none;
    }
}

#init {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;

    & img {
        max-width: 80vw;
    }
}

#accueil {
    display: grid;
    grid-template: auto 1fr auto auto / 1fr;
    grid-gap: 10px;
}

#exo1, #exo2, #exo3, #exo4 {
    display: grid;
    grid-template: auto 1fr auto / 1fr;
    grid-gap: 10px;
}

#exo1_2, #exo2_2, #exo3_2 {
    display: grid;
    grid-template: auto auto 1fr auto / 1fr;
    grid-gap: 10px;

    & form {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-row-gap: 20px;
    }
}

#exo4_2 {
    display: grid;
    grid-template: auto auto 1fr auto / 1fr;
    grid-gap: 10px;

    & form {
        display: grid;
        grid-template-columns: 1fr auto 1fr auto;
        grid-row-gap: 20px;

        text-align: center;
    }
}

aside {
    width: 100vw;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;

    backdrop-filter: blur(10px);

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

    padding: 10px;

    & div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;

        text-align:center;

        background-color: #fff;

        border: 2px var(--border-color) solid;
        border-radius: 10px;

        padding: 10px;
    }

    & #popupCancel {
        background-color: var(--main-CTA);
    }
}

p:has(.timer) {
    text-align: center;
}

button {
    border: 1px var(--border-color) solid;
    border-radius: 10px;
    background-color: var(--main-text-color-bis);
    color: var(--bg-color);
    padding: 10px 20px;

    &.mainCTA {
        background-color: var(--main-CTA);
        font-size: 1.25em;
        padding: 10px 20px;
    }

    &:disabled {
        background-color: var(--border-color);
    }
}

table {
    margin: auto;

    & th {
        border: 1px var(--border-color) solid;
        padding: 5px;
    }

    & td {
        border: 1px var(--border-color) solid;
        padding: 5px;
        text-align: center;
    }
}

table:not(:has(#statsHistory)) th, table:not(:has(#statsHistory)) td {
    &:nth-child(4) {
        border: 3px var(--main-text-color-bis) solid;
    }
}

#connexion {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    & form {
        display: flex;
        flex-direction: column;
        align-items: center;

        & * {
            margin-bottom: 30px;
        }
    }

    & label {
        text-align: center;

        & input {
            width: 80%;
            margin: auto;
            border: 1px var(--border-color) solid;
            border-radius: 10px;
        }
    }

    & form .error {
        color: red;
        font-size: 0.8rem;
    }
}

@keyframes sectionAppear {
    from {
        left: 101vw;
    }

    to {
        left: 0;
    }
}

@keyframes sectionAppearPC {
    from {
        left: 101vw;
    }

    to {
        left: calc(50vw - 400px);
    }
}

@keyframes sectionDisappear {
    from {
        left: 0;
    }

    to {
        left: -101vw;
    }
}

@keyframes sectionDisappearPC {
    from {
        left: calc(50vw - 400px);
    }

    to {
        left: -101vw;
    }
}

