@font-face {
    font-family: 'CustomFont';
    src: url('img/customfont.ttf') format('truetype');
}

@font-face {
    font-family: 'CustomFont2';
    src: url('img/customfont2.ttf') format('truetype');
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    margin: 0;
    background-image: url('img/background.webp');
    background-size: cover;
    background-position: center;
}

h1 {
    font-family: 'CustomFont', sans-serif; /* Applique la police personnalisée */
    font-size: 3em;
    margin-top: 20px;
    text-align: center;
    background: linear-gradient(to bottom, #ffe6e9, #e283ff); /* Applique le dégradé */
    -webkit-background-clip: text; /* Nécessaire pour utiliser le dégradé sur le texte */
    color: transparent; /* Rend le texte transparent pour laisser le dégradé apparaître */
    -webkit-text-stroke: 1px white; /* Applique un contour blanc de 7px */
    transform: scale(1.25); /* Zoom à 125% sur le texte */
}

.buttons {
    position: absolute;
    top: 10px;
    right: 10px;
}

.buttons button {
    font-size: 1.2em;
    padding: 10px;
    margin: 5px;
    cursor: pointer;
}

.start-button {
    background-color: #f151bc; /* Couleur bleue */
    color: white; /* Texte en blanc */
    border: none;
    border-radius: 2px; /* Coins arrondis */
    padding: 15px 30px; /* Plus grand que les boutons précédents */
    font-size: 1.5em; /* Texte plus grand */
    cursor: pointer;
    display: block; /* Pour centrer le bouton */
    margin: 0 auto; /* Centrer le bouton horizontalement */
    transition: background-color 0.3s ease; /* Effet de transition */
}

.start-button:hover {
    background-color: #ff378a; /* Couleur bleu plus foncée au survol */
}

.back-button {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2em;
    padding: 10px;
    cursor: pointer;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    display: block;
    border-radius: 10px;
}
.popup-gif {
    width: 600px; /* Ajuste la taille selon ce que tu préfères */
    height: auto;
    margin-bottom: 20px; /* Espace entre le gif et le texte */
}

.timer {
    font-family: 'CustomFont2', sans-serif; /* Applique la police */
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 3em;
    font-weight: bold;
    background: rgba(0, 0, 0, 0); /* Fond semi-transparent */
    color: rgb(255, 92, 132);
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
}

.grid {
    display: grid;
    gap: 10px;
    justify-content: center;
    width: 90vw;
    max-width: 600px;
    max-height: 80vh;
    margin-top: 75px; /* Ajuste l'espace par rapport au titre */
    grid-template-columns: repeat(4, 1fr); /* Default à 4x4 */
    grid-template-rows: repeat(4, 1fr); /* Default à 4x4 */
    transform: scale(1.25); /* Zoom à 125% sur la grille */
    box-sizing: border-box;
}

.card {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-image: url('img/imgcov.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    cursor: pointer;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

.flipped img {
    display: block;
}

.flipped {
    background-image: none;
}

#victoryPopup {
    display: none;
}

/* Media Query pour les petits écrans (mobile) */

@media (max-width: 600px) {

    .grid {
        transform: scale(1); /* Enlève le zoom sur la grille */
        margin-top: 30px; /* Ajoute un peu d'espace en haut */
    }

    .top-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 90%;
        margin-top: 10px;
    }

    #timer {
        font-size: 1.5em; /* Agrandir légèrement le timer */
    }

    .buttons {
        display: flex;
        gap: 10px;
    }

    .cute-button {
        font-size: 1em;
        padding: 8px 12px;
    }

    h1 {
        font-size: 2em; /* Réduit la taille du texte */
        text-align: center;
        white-space: normal; /* Permet le retour à la ligne si nécessaire */
        word-wrap: break-word; /* Ajoute le retour à la ligne automatique */
        margin-top: 80px;
        width: 80%
    }
}

@media (max-width: 600px) {
    .popup {
        width: 90%; /* Ajuste la largeur pour s'adapter à l'écran */
        max-width: 350px; /* Empêche qu'elle devienne trop large */
        padding: 15px;
        text-align: center;
    }

    .popup img {
        width: 100%; /* Adapte la taille du GIF à la largeur de la pop-up */
        max-width: 300px; /* Empêche qu'il soit trop grand */
        height: auto;
    }

    .popup p {
        font-size: 1.2em; /* Augmente la taille du texte */
        margin-bottom: 10px;
    }

    .popup button {
        font-size: 1em;
        padding: 10px 15px;
        width: 80%;
    }
}


#victoryTime {
    font-family: 'CustomFont2', sans-serif; /* Applique la police */
    font-size: 2em; /* Agrandit le texte */
    text-align: center; /* Centre le texte */
    margin-top: 10px; /* Ajoute de l'espace en haut */
    display: block; /* S'assure que le texte est bien positionné */
    color: #303030; /* Change la couleur du texte si besoin */
}

#Text-font {
    font-family: 'CustomFont2', sans-serif; /* Applique la police */
    font-size: 2em; /* Agrandit le texte */
    text-align: center; /* Centre le texte */
    margin-top: 10px; /* Ajoute de l'espace en haut */
    display: block; /* S'assure que le texte est bien positionné */
    color: #ffffff; /* Change la couleur du texte si besoin */
}

.cute-button {
    background-color: #f8a2bf; /* Couleur bleue */
    color: white; /* Texte en blanc */
    border: none;
    border-radius: 2px; /* Coins arrondis */
    padding: 15px 30px; /* Plus grand que les boutons précédents */
    font-size: 1.5em; /* Texte plus grand */
    cursor: pointer;
    margin: 0 auto; /* Centrer le bouton horizontalement */
    transition: background-color 0.3s ease; /* Effet de transition */
}

.cute-button:hover {
    background-color: #ff589d; /* Couleur bleu plus foncée au survol */
}
