@import "variables.css";

/* Inter */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=Playfair+Display:wght@700&display=swap");
/* Give You Glory*/
@import url('https://fonts.googleapis.com/css2?family=Give+You+Glory&display=swap');
/* Anton */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Give+You+Glory&display=swap');

/*  Logo */
.logo-container {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    margin-top: 3vmin;
}

h1 {
    font-family: var(--font-glory);
    font-size: 45px;
    letter-spacing: -1px;
    color: var(--red_shade1);
    position: relative;
    z-index: 2;
    margin: 0;
    margin-left: -25px;
    margin-bottom: -65px;
}

h2 {
    font-family: var(--font-anton);
    color: var(--red_shade2);
    font-size: 100px;
    position: relative;
    z-index: 1;
    margin: 0;
}

/*  Grille */
#grille {
    width: 30vmin;
    height: 30vmin;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#grille .case {
    border: 1px solid var(--gray_yeux);
    display: grid;
    place-items: center;
    height: 10vmin;
    width: 10vmin;
}

#grille .case:hover {
    background: var(--red_shade1);
}

#grille .case img {
    width: 80%;
    height: 80%;
    max-width: 8vmin;
    max-height: 8vmin;
    object-fit: contain;
}

/*  Messages et boutons  */
#message {
    font-family: var(--font-glory);
    padding: 10px 20px;
    font-size: 25px;
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#replay {
    font-family: var(--font-anton);
    padding: 10px 20px;
    font-size: 18px;
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--red_shade1);
    color: var(--gray_yeux);
    padding: 1vmin 2vmin;
    border: 3px solid var(--red_shade2);
    border-radius: 90px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 3vmin;
}

#replay:hover {
    background: var(--red_shade2);
    color: var(--beige_white);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -52%);
}


/*  Avatars  */
#curseur-joueur {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

.container {
    position: relative;
    width: 400px;
    height: 280px;
}

.avatar {
    position: absolute;
    top: 0;
    width: 300px;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 100%;
}

.avatar.active {
    opacity: 1;
}

/* mobile  */
@media screen and (max-width: 767px) {
    .logo-container {
        margin-top: 2vmin;
    }

    h1 {
        font-size: 35px;
        margin-left: -20px;
        margin-bottom: -50px;
    }

    h2 {
        font-size: 80px;
    }

    #grille {
        width: 30vmin;
        height: 30vmin;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        position: absolute;
        top: 35%;
        left: 40%;
        transform: translate(-50%, -50%);
    }

    #grille .case {
        border: 1px solid var(--gray_yeux);
        display: grid;
        place-items: center;
        height: 17vmin;
        width: 17vmin;
    }

    #curseur-joueur {
        display: none;
    }

    .mobile-elements {
        position: absolute;
        top: calc(45% + 15vmin + 45px);
        left: 46%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 15px;
        z-index: 100;
    }

    .mobile-player {
        width: 250px;
        height: 250px;
        flex-shrink: 0;
    }

    .mobile-player img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .mobile-replay {
        font-family: var(--font-anton);
        background: var(--red_shade1);
        color: var(--gray_yeux);
        padding: 10px 20px;
        border: 3px solid var(--red_shade2);
        border-radius: 90px;
        font-size: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
        position: relative;
        top: -70px;
        left: -50px;
    }

    .mobile-replay:hover {
        background: var(--red_shade2);
        color: var(--beige_white);
        box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
    }

    #message {
        position: absolute;
        top: calc(40% + 20vmin + 35px + 80px + 20px);
        left: 75%;
        transform: translateX(-50%);
        text-align: center;
        font-size: 18px;
        width: 90%;
    }

    #replay {
        display: none;
    }

    /* Pions pour mobile */
    #lizo-pion,
    #croco-pion {
        display: block;
        width: 50px;
        height: 50px;
        position: absolute;
        top: calc(45% + 15vmin + 45px + 180px);
        z-index: 101;
    }

    #lizo-pion {
        left: calc(46% - 60px);
    }

    #croco-pion {
        left: calc(46% + 10px);
    }
}

/* DESKTOP  */
@media screen and (min-width: 768px) {
    .mobile-elements {
        display: none;
    }

    #grille {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    #curseur-joueur {
        position: static;
        transform: none;
    }

    .container {
        position: static;
        width: auto;
        height: auto;
    }

    #lizo,
    #croco {
        opacity: 1 !important;
        width: 200px;
        transition: transform 0.3s ease;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    #lizo {
        left: calc(50% - 24vmin - 220px);
    }

    #croco {
        right: calc(50% - 24vmin - 220px);
    }

    #lizo.active {
        transform: translateY(-50%) scale(1.2);
    }

    #croco.active {
        transform: translateY(-50%) scale(1.2);
    }

    /* Pions pour desktop */
    #lizo-pion,
    #croco-pion {
        opacity: 1 !important;
        width: 60px;
        position: absolute;
        top: calc(68% + 120px);
        transform: translateY(-50%);
    }

    #lizo-pion {
        left: calc(50% - 20vmin - 180px);
    }

    #croco-pion {
        right: calc(50% - 20vmin - 180px);
    }

    #lizo-gagnant,
    #croco-gagnant,
    .pointer {
        display: none;
    }

    #message {
        top: calc(50% + 20vmin);
    }

    #replay {
        top: calc(50% + 27vmin);
    }
}

/* Ligne gagnante */
#ligne-gagnante {
    position: absolute;
    background-color: var(--red_shade2);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#ligne-gagnante.show {
    opacity: 1;
}

/* mobile */
@media screen and (max-width: 767px) {
    #grille {
        width: 30vmin;
        height: 30vmin;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        position: absolute;
        top: 35%;
        left: 40%;
        transform: translate(-50%, -50%);
    }
}

/* desktop */
@media screen and (min-width: 768px) {
    #grille {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}