body.accueil {
    margin: 0;
    min-height: 100vh;
    background-image: url("img/accueil.webp");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bouton-commencer,
#replay {
    background-color: #f70000;
    color: white;
    font: bold 1.2rem Arial, sans-serif;
    padding: 14px 28px;
    border: 3px solid white;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
}

.bouton-commencer:hover,
#replay:hover {
    background-color: orange;
}


body.jeu {
    margin: 0;
    min-height: 100vh;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    background: linear-gradient(rgba(8, 12, 20, 0.72), rgba(8, 12, 20, 0.72)),
        url("img/accueil.png") center / cover fixed;
}

.page-jeu {
    min-height: 100vh;
    box-sizing: border-box;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-transform: uppercase;
}

#message {
    min-height: 1.5em;
    margin: 10px 0 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.terrain-jeu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 4vw, 65px);
}

.joueur {
    width: min(20vw, 270px);
    color: rgba(255, 255, 255, 0.65);
    transition: transform 250ms ease, filter 250ms ease, color 250ms ease;
}

.joueur p,
.joueur h2 {
    margin: 5px 0;
}

.joueur h2 {
    font-size: clamp(1.1rem, 2.4vw, 1.8rem);
}

.joueur img {
    display: block;
    width: 100%;
    height: auto;
}

.joueur.actif {
    color: white;
    filter: drop-shadow(0 0 7px #fff) drop-shadow(0 0 18px #ffcb05);
    transform: translateY(-18px);
}

.zone-grille {
    position: relative;
    width: min(48vw, 430px);
    aspect-ratio: 1;
    flex: 0 0 auto;
}

.grille-fond {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#grille {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.case {
    border: 0;
    background: transparent;
    color: white;
    font-size: clamp(2.2rem, 8vw, 5rem);
    font-weight: bold;
    cursor: pointer;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.illustration-case {
    width: 76%;
    height: 76%;
    object-fit: contain;
    pointer-events: none;
    animation: apparition-case 350ms ease-out both;
}

@keyframes apparition-case {
    from {
        opacity: 0;
        transform: translateX(-25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.case:hover:not(.occupee) {
    background-color: rgba(255, 255, 255, 0.12);
}

.case:focus-visible {
    outline: 3px solid #ffcb05;
    outline-offset: -5px;
}

nav {
    margin-top: 5px;
}


body.victoire {
    margin: 0;
    min-height: 100vh;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    background: linear-gradient(rgba(8, 12, 20, 0.68), rgba(8, 12, 20, 0.68)),
        url("img/accueil.png") center / cover fixed;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.page-victoire {
    position: relative;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    padding: 35px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: arrivee-du-haut 750ms cubic-bezier(.22, .9, .3, 1) both;
}

.page-victoire h1 {
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    text-shadow: 0 3px 8px black;
}

.page-victoire p {
    position: relative;
    z-index: 1;
    margin-top: 0;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    text-shadow: 0 2px 6px black;
}

.image-gagnant {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.actions-victoire {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: 90vw;
    transform: translate(-50%, -50%);
}

.actions-victoire {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.bouton-victoire {
    background-color: #f70000;
    color: white;
    border: 3px solid white;
    border-radius: 20px;
    padding: 14px 28px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 180ms ease, background-color 180ms ease;
}

.bouton-victoire:hover {
    background-color: orange;
    transform: scale(1.05);
}

.bouton-accueil {
    background-color: #25354d;
}

@keyframes arrivee-du-haut {
    from {
        opacity: 0;
        transform: translateY(-110vh);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 650px) {
    .page-jeu {
        padding: 18px 10px;
    }

    .terrain-jeu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px 20px;
    }

    .zone-grille {
        grid-column: 1 / -1;
        grid-row: 1;
        width: min(88vw, 400px);
    }

    .joueur {
        grid-row: 2;
        width: min(38vw, 180px);
        justify-self: center;
    }

    .joueur.actif {
        transform: translateY(-8px);
    }
}
