* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    font-size: 24px;
    line-height: 1.44;
    height: 100%;
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
}

nav {
    background-color: #FA3E54;
    padding-bottom: 0px;
    font-size: 0.85em;
}

#message {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8vh 6vw 6vh;
    background-color: rgba(189, 183, 132, 0.96);
}

#message.visible {
    display: flex;
}

#message-resultat {
    display: grid;
    place-items: center;
    flex: 1;
    width: 100%;
}

#message img {
    max-width: min(80vw, 70vh);
    max-height: 65vh;
}

#message-egalite {
    color: white;
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: bold;
    text-align: center;
}

#message button {
    border: 0;
    padding: 0.5em 1.5em;
    background-color: #FAC15C;
    color: #111;
    cursor: pointer;
    font: inherit;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: bold;
    transition: transform 200ms ease-in-out;
}

#message button:hover {
    transform: scale(1.5);
}

header img {
    display: block;
    width: 31.875%;
    height: auto;
    margin: 0 auto;
}

nav a {
    font-size: clamp(0.9rem, 2vw, 2.44rem);
    text-decoration: none;
    color: white;
    outline: #FAC15C;
    outline-width: 1em;
    font-family: "Zalando Sans", sans-serif;
}

#top {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    display: grid;
    justify-items: center;
}

#grille{
    position: relative;
    width: min(100%, 1256px);
    aspect-ratio: 1256 / 714;
    margin: 1rem auto 0;
}

.gate-image {
    display: block;
    width: 100%;
    height: 100%;
}

#cases {
    position: absolute;
    top: 38%;
    left: 33.4%;
    width: 33.2%;
    height: 57.2%;
    display: grid;
    grid-template-columns: 30.3% 30.5% 28.8%;
    grid-template-rows: 29.9% 30.9% 28.2%;
    column-gap: 5.2%;
    row-gap: 5.4%;
}

#win-animation {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}

#win-animation img {
    position: absolute;
    width: min(12vw, 12vh);
    height: min(12vw, 12vh);
    object-fit: contain;
    transform-origin: center;
    animation: shield-win 1500ms ease-in-out forwards;
}

#win-animation img.sword-animation {
    animation-name: sword-win;
    animation-duration: 1200ms;
    width: var(--slash-size);
    height: var(--slash-size);
}

#grille .case.win-case {
    animation: winning-case 1500ms ease-in-out;
}

@keyframes shield-win {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(-30deg) scale(0.65);
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--move-x), var(--move-y)) rotate(330deg) scale(1);
        opacity: 0;
    }
}

@keyframes winning-case {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.45);
    }
}


@keyframes sword-win {
    0% {
        content: url("../eppe-slashp1.png");
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--slash-angle)) scale(0.65);
    }
    30% {
        content: url("../eppe-slashp2.png");
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--slash-angle)) scale(0.8);
    }
    60% {
        content: url("../eppe-slashp3.png");
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--slash-angle)) scale(0.9);
    }
    90% {
        content: url("../eppe-slashp4.png");
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--slash-angle)) scale(1);
    }
    100% {
        content: url("../eppe-slashp4.png");
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--slash-angle)) scale(1);
    }
}

#grille .case {
    z-index: 3;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    background-size: auto 78%;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
    cursor: pointer;
}

#grille .case.place-animation {
    animation: icon-place 350ms ease-out;
}

@keyframes icon-place {
    0% {
        background-size: auto 78%;
    }
    35% {
        background-size: auto 96%;
    }
    100% {
        background-size: auto 78%;
    }
}

#grille .case::after {
    content: "";
    position: absolute;
    inset: 11%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    pointer-events: none;
}

#grille .case.eppes-turn:hover::after {
    background-image: url("../eppe7.png");
    opacity: 0.5;
}

#grille .case.bouclier-turn:hover::after {
    background-image: url("../bouclier.png");
    opacity: 0.5;
}

footer {
    width: 100%;
    margin-top: 1rem;
    background-color: #FA3E54;
    color: rgb(240 240 240 / 1);
    text-align: center;
    /* position: absolute 0; */
}

