/* 🌟 Styles Modernes et Adaptatifs */
html, body {
    height: 100%; /* Assure que l'élément html et body couvrent toute la hauteur */
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Désactive le défilement horizontal global */
}

body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; 
    align-items: center;
    height: 100vh;
    flex-direction: column;
    position: relative;
    
   background: linear-gradient(200deg, #1a1d2e, #283046, #3a4d66, #525f75, #3a4d66, #283046);



}

body::before {
      filter: blur(6px);
    backdrop-filter: blur(5px);
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Superposition de deux motifs hexagonaux */
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='120' viewBox='0 0 104 120'%3E%3Cg fill='none' stroke='rgba(213, 224, 15,0.2)' stroke-width='2'%3E%3Cpath d='M52,1 L103,30 L103,90 L52,119 L1,90 L1,30 Z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='120' viewBox='0 0 104 120'%3E%3Cg fill='none' stroke='rgba(15, 224, 222,0.2)' stroke-width='2'%3E%3Cpath d='M52,1 L103,30 L103,90 L52,119 L1,90 L1,30 Z'/%3E%3C/g%3E%3C/svg%3E");

    /* Taille correcte des hexagones */
    background-size: 104px 120px;

    /* Première couche normale, deuxième décalée */
    background-position: 0 0, 52px 60px;

    /* Répétition du motif */
    background-repeat: repeat;

    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

#how-to-play {
    background: rgba(125, 162, 169, 0.60);
    padding: 1em;
    border-radius: 0.8em;
    box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
    width: 50%;
    max-width: 25vw;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
    color: white;
    order: 0; /* Pour être avant le conteneur principal */
    margin-left: -10em;
}


.adsense-container {
    display: none;
}
h1 {
    font-size: clamp(1rem, 1.5vw, 2rem);
    color: #f7f7f7;
    margin-top: -0.2em;
}
.attempts-container h3 {
    color: #f7f7f7;
}

footer {
  
    text-align: center;
    padding: 0.5em;
    font-size: clamp(0.8rem, 1vw, 1rem);
    position: relative;
    margin-top: auto; 
  background: rgba(125, 162, 169, 0.05);
  width: 100%;
  height: 2vh;
      display: flex;
    justify-content: center;  /* Centrer le texte horizontalement */
    align-items: center;  /* Centrer le texte verticalement */

}

/* 📦 Conteneur principal */
.container {
    background: rgba(125, 162, 169, 0.60);
    padding: 1.5em;
    border-radius: 0.8em;
    box-shadow: 0 0.3em 0.6em rgba(0, 0, 0, 0.15);
    width: 50%;
    max-width: 22vw;
    max-height: 85vh;
    text-align: center;
    //margin-right: 20%;
    margin-top: 2%;
    padding-bottom: 5em;
  order: 1;
  margin-left: 2em;
}

/* 🖼️ Conteneur de l'image et du voile */
.game-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    height: auto;
}

/* 🖼️ Image */
.game-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    border-radius: 0.5em;
    margin-bottom: 1em;
    transition: filter 0.3s ease-in-out;
}

/* Voile rouge sur l'image */
#red-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.1); /* Voile rouge semi-transparent */
    display: none; /* Masqué par défaut */
    z-index: 10;
}

/* 📩 Champ de réponse */
input {
    width: 80%;
    padding: 0.8em;
    font-size: 1rem;
    border: none;
    border-radius: 0.5em;
    outline: none;
    margin-bottom: 1em;
    text-align: center;
    background-color: rgba(247, 247, 247, 0.95);
    color: black;
    transition: background-color 0.3s ease;
    margin-top: 1em;
}

/* 🎯 Boutons avec animations adoucies */
button {
    background-color: #ffbd03;
    color: white;
  width: 50%;
    border: none;
    padding: 0.7em 1.4em;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 0.5em;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 1em;
    position: relative;
    overflow: hidden;
}

/* 🔆 Lueur très subtile */
button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1); /* Glow réduit */
}

/* 🪶 Rebond adouci au clic */
button:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

/* ✅ Message */
#message {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    font-weight: bold;
    margin-top: 1em;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f7f7f7;
}

/* 🏗️ Wrapper pour le layout */
.wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5em;
    width: 100%;
    flex-wrap: wrap;
    padding: 1.5em;
}

/* 📜 Liste des essais */
.attempts-container {
    background: rgba(125, 162, 169, 0.60);;
    padding: 1em;
    border-radius: 0.8em;
    box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.15);
    width: 50%;
    max-width: 15vw;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left;
  order: 2;
   margin-left: 2em;
}


/* Liste des essais */
#attempts {
    list-style: none;
    padding: 0;
}

#attempts li {
    background: rgba(125, 162, 169, 0.3);
    padding: 0.5em;
    margin: 0.3em 0;
    border-radius: 0.5em;
    color: white;
    font-size: 1rem;
    text-align: center;
}

/* 🌱 Styles Responsifs */
@media screen and (max-width: 1024px) {
  
      body {
        display: flex;
        flex-direction: column;
        height: 100vh; /* Utilise la hauteur totale de l'écran */
        margin: 0; /* Supprime les marges par défaut */
        padding: 0; /* Supprime les paddings par défaut */
        justify-content: space-between; /* Pousse la section Comment jouer en bas */
    }
            .container {
        display: block;  /* Forcer le conteneur à être un bloc */
        width: 80%;  /* Occupe 80% de la largeur de l'écran */
        max-width: 100%;  /* Assure que la largeur ne dépasse jamais 100% */
        box-sizing: border-box;  /* Inclure les bordures et les paddings dans la largeur */
        padding: 10px;
        margin: 10vh auto 0;  /* Centrer le conteneur horizontalement */
        justify-content: flex-start;
    }

        .attempts-container {
        width: 80%;  /* Utilise 80% de la largeur de l'écran */
        max-width: 100%;  /* Assure que la largeur ne dépasse jamais 100% */
        margin-top: 20px;  /* Un peu plus d'espace entre les conteneurs */
        margin-left: auto;  /* Centrer le conteneur horizontalement */
        margin-right: auto;  /* Centrer le conteneur horizontalement */
        box-sizing: border-box;  /* S'assurer que le padding est inclus dans la largeur totale */
        padding: 10px;
	order:2;
    }
}


@keyframes shake {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
    75% {
        transform: translateX(-5px);
    }
    100% {
        transform: translateX(5px);
    }
}

/* Application de l'animation sur l'image */
.shake {
    animation: shake 0.5s ease-in-out; /* Animation d'une demi-seconde */
}