html{
    font-family: 'Montserrat', sans-serif;
}

body {
    margin : 0;
    padding : 0;
    box-sizing: border-box;
}

:root {
  --marker-bg: #E64B2B;   /* couleur rouge-orangée */
  --marker-color: #fff;   /* couleur du chiffre */
}

.legend {
  counter-reset: item;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  margin-top:25px;
  padding: 0;
}

.legend li {
  counter-increment: item;
  position: relative;
  margin: 1rem 0;
  margin-bottom:25px;
  padding-left: 50px; /* espace pour le carré */
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
}

.legend li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--marker-bg);
  color: var(--marker-color);
  width: 35px;
  height: 35px;
  border-radius: 12px; /* coins arrondis */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
}

#game-container {
    position: relative;
    display: flex;
    /* row-reverse : #infoDisplay est premier dans le DOM (pour l'ordre de
       tabulation), mais doit rester affiché à droite, avec #imageDisplay
       (image + filtres) à gauche, comme avant. */
    flex-direction: row-reverse;

}
#imageDisplay {
    position: relative;
    width: 50%;
}
#background, .question-image, .filter-image {
    max-width: 100%;
    height: auto;
    max-height:95vh;
    
}
#infoDisplay {
    margin-left: 2%;
    margin-right:2%;
    position: relative;
    width : 50%;
}
#imageWrapper {
    max-width: 1200px;
    position: relative;
    height: auto;
}
#start-btn, #resultButton {
    padding : 0.75rem 1rem;
    background-color: #e64b2b;
    color : white;
    font-weight: bold;
    font-size : 1.2rem;
    font-family: "Montserrat", sans-serif;
    border-radius: 10px;
    outline: none;
    border : none;
    box-shadow: 2px 2px 3px darkgray;
    margin-top: 1rem;
    cursor: pointer;
    text-transform:uppercase;
    width:35%;
}

#start-btn:hover, #resultButton:hover {
    background-color: #b73c23;
    box-shadow: 2px 2px 5px darkgray;
    
}
.answer{
    padding : 0.75rem 1rem;
    background-color: #e64b2b;
    color : white;
    font-weight: bold;
    font-size : 1.2rem;
    font-family: "Montserrat", sans-serif;
    border-radius: 10px;
    outline: none;
    border : none;
    box-shadow: 2px 2px 3px darkgray;
    margin-top: 1rem;
    cursor: pointer;
    text-transform:uppercase;
    width: 100%;
    min-width: 220px;
    box-sizing: border-box;
    text-align: center;
}
.answer:hover{
    background-color: #b73c23;
    box-shadow: 2px 2px 5px darkgray;
    
}

.answer > p {
    font-weight: bold;
}

.click img{
    width:45px !important;
    height:45px !important;
    margin-right:25px !important;
}
.bravo-div{
    background-color: #2E7D32 !important; /* vert ajusté pour un contraste AA suffisant avec le texte blanc */
}
.bravo-div img{
    width:85px !important;
    height:98px !important;
    padding:2% !important;
}
.erreur{
    background-color: #EB001A !important;
}
.erreur img{
    width:55px !important;
    height:55px !important;
}

#resultText{
    line-height: 2rem;
}

#questionAnswers{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap : 1rem;
}
#imageFilters {
    display: flex;
    flex-wrap: wrap;
    gap : .5rem;
    z-index: 10000;
}
#filters {
    width: fit-content;
    position: absolute;
    display: flex;
    flex-direction: column;
    left : 1rem;
    bottom : .5rem;
    background-color: #ffffffaa;
    padding : .5rem;
    border-radius: 10px;
    box-shadow: 2px 2px 3px black;
    z-index: 10001;
    /* Réinitialise le style par défaut du navigateur pour <fieldset> */
    border: none;
    margin: 0;
    min-width: 0;
}
#imageFilters > label{
    font-size : 1.2rem;
}
/* #filterText est maintenant un <legend> (regroupement sémantique des cases
   à cocher de filtres) ; on reproduit l'apparence du <h3> précédent. */
#filterText {
    margin : 0;
    padding : .1rem;
    display: block;
    width: 100%;
    font-size: 1.17em;
    font-weight: bold;
}

.back-btn{
    text-decoration: none;
    color : white;
    font-weight: bold;
    font-size: 1.2rem; /* taille "grand texte" requise pour respecter le contraste AA (3:1) avec ce fond orange */
    background-color: #e64b2b;
    padding : .5rem 1rem;
    border-radius: 10px;
    display: inline-block;
}

.filter-control-group{
    padding : .3rem .2rem;
    border-radius: 5px;
}
.filter-label{
    padding-right : .5rem;
}
.icon {
    /* 17/11 : le cache WP Rocket ajoute width="128" height="128" aux images ; sans largeur automatique,
       l'icône s'étirait en 128 × 20 px. */
    width: auto;
    height: 20px;
}
.granit{
    background-color: #eac9d9;
}
.basaltes{
    background-color: #c6eeb3;
}
.rhyolites{
    background-color: #efefad;
}
.basaltes, .rhyolites, .granit {
    font-weight: bold;
    padding : .2rem .5rem;
    border-radius: 10px;
    color: black;
    border : 1px solid lightgrey;
    margin : .5rem .2rem;
}
.bravo{
    animation: bounceInRight 1s;
    font-size: 1.5rem;
}
.big-bravo{
    animation: bounceInRight 1s;
}

.avertissement{
    display:flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    background-color:#113041;
    padding:1%;
    margin-top: 15px;
}
.avertissement p{
    width:80%;
    color:white;
    font-weight:700;
    line-height: 1.5em;
}
.avertissement img{
    width:70px;
    height:60px;
    margin-right:15px;
}

#infoDisplay h3{
    font-size:24px;
    text-transform:uppercase;
    font-weight:700;
}

.answer-div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}
.answer-div span{
    width:10%;
}
.answer-div img{
    margin-right:20px;
    height:auto;
    width:60%;
}


/* Media querry */

@media (min-width:1600px) and (max-width:1800px){

}

@media (min-width:1300px) and (max-width:1599px){

}

@media (min-width:1180px) and (max-width:1299px){
.row-90{
width:90% !important;
}
}

@media (min-width:981px) and (max-width:1179px){
.row-90{
width:90% !important;
}
}

@media (max-width:980px){
    .row-90{
        width:90% !important;
        }
    /* column-reverse : même raison qu'en desktop, pour garder l'image et les
       filtres visuellement au-dessus du panneau d'informations/questions. */
    #game-container {
        flex-direction: column-reverse;
    }

    #imageDisplay {
        width: 100%;
    }

    #infoDisplay {
        width : 100%;
    }

}

@media (max-width:767px){
    #infoDisplay h3{
    font-size:20px;
}
    .avertissement{
        padding-top:3%;
        padding-bottom:3%;
    }
    #start-btn, #resultButton {
        width:90%;
        font-size:16px;
    }
    
    #infoDisplay p, #infoDisplay li{
        font-size:14px;
    }
    
    .legend li::before {
        width: 25px;
        height: 25px;
        font-size: 1rem;
    }
    .legend li{
        padding-left: 40px;
        font-size:14px;
    }
    .basaltes, .rhyolites, .granit{
        line-height: 2.1em;
    }
    
}
/* Fin media querry */

@keyframes bounceInRight {
    from,
    60%,
    75%,
    90%,
    to {
      animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
  
    from {
      opacity: 0;
      transform: translate3d(3000px, 0, 0) scaleX(3);
    }
  
    60% {
      opacity: 1;
      transform: translate3d(-25px, 0, 0) scaleX(1);
    }
  
    75% {
      transform: translate3d(10px, 0, 0) scaleX(0.98);
    }
  
    90% {
      transform: translate3d(-5px, 0, 0) scaleX(0.995);
    }
  
    to {
      transform: translate3d(0, 0, 0);
    }
  }
  
  .bounceInRight {
    animation-name: bounceInRight;
  }
/* Accessibilité clavier */
.answer-div {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.answer-div .answer {
    display: block;
    width: 60%;
    box-sizing: border-box;
}

.answer-div:hover .answer,
.answer-div:focus-visible .answer {
    background-color: #b73c23;
    box-shadow: 2px 2px 5px darkgray;
}

#start-btn:focus-visible,
#resultButton:focus-visible,
.answer-div:focus-visible .answer,
.filter-control:focus-visible + .filter-label,
.back-btn:focus-visible {
    outline: 4px solid #005fcc;
    outline-offset: 4px;
}

#resultText:focus {
    outline: none;
}

#questionText:focus,
#infosText:focus {
    outline: none;
}

/* ── Corrections de portée pour le plugin WordPress ─────────────────────── */
/* Les styles ci-dessus s'appliquent globalement mais sont suffisamment
   spécifiques (IDs et classes uniques) pour ne pas interférer avec le thème. */

/* Assure que la section du jeu prend toute la largeur du bloc Gutenberg */
.defi-geo-wrapper {
    width: 100%;
}

/* Cache le bouton résultat par défaut (géré par JS) */
#resultButton {
    display: none;
}

/* Accessibility: visually hidden but available to assistive tech */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibilite : bandeau d'avertissement (a11y-alt-offer) sur toute la largeur, au-dessus de la rangee image/info */
#game-container {
flex-wrap: wrap;
}
.a11y-alt-offer {
flex: 0 0 100%;
order: -1;
margin-bottom: 24px;
padding: 16px 20px;
background: #fff7e6;
border-left: 4px solid #ffaa00;
border-radius: 4px;
box-sizing: border-box;
}
.a11y-alt-offer .a11y-message {
margin: 0 0 10px;
}
.a11y-alt-offer p {
margin: 0 0 8px;
}
.a11y-alt-offer ul {
margin: 0;
padding-left: 20px;
}

/* Correction : eviter que #infoDisplay et #imageDisplay ne passent sur une 2e ligne
   maintenant que #game-container a flex-wrap:wrap (pour le bandeau a11y-alt-offer).
   flex-basis:0 retire leur largeur du calcul de retour a la ligne ; flex-grow:1
   redistribue l'espace pour retrouver un partage ~50/50 comme avant. */
#infoDisplay,
#imageDisplay {
flex: 1 1 0;
min-width: 0;
}
