/* ======================================= */
/* 🎨 STYLES GÉNÉRAUX */
/* ======================================= */

/* 🔹 Importation de polices personnalisées */
@import url('https://fonts.googleapis.com/css2?family=Bungee+Shade&family=Luckiest+Guy&display=swap');

/* 🔹 Définition des variables de couleurs */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #28a745;
    --alert-color: #dc3545;
    --bg-light: #f8f9fa;
    --bg-lighter: #ffffff;
}

/* 🔹 Style général du corps */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    background: linear-gradient(-45deg, #ffffff, #f8f9fa, #e9ecef, #ffffff);
    background-size: 400% 400%;
    animation: gradientAnimation 10s ease infinite;
}

/* 🔹 Animation du fond en dégradé */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🔹 Titres avec une police fun */
h1, h2 {
    font-family: 'Bungee Shade', cursive;
    color: var(--primary-color);
    text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
}

#totalScoreLabel {
    font-size: 20px;
}
/* ======================================= */
/* 🎭 BOUTONS */
/* ======================================= */

button {
    margin: 10px;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 2px solid #555;
    background-color: var(--secondary-color);
    color: white;
    cursor: pointer;
}

/* 🔹 Bouton de démarrage avec animation */
#startButton {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 12px 25px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    animation: pulse 1.5s infinite ease-in-out;
    transition: transform 0.2s ease-in-out, background-color 0.3s;
}

/* 🔹 Effets au survol et au clic */
#startButton:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}
#startButton:active {
    transform: scale(0.95);
}

/* 🔹 Animation de pulsation */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0px 0px 10px rgba(0, 123, 255, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0px 0px 20px rgba(0, 123, 255, 0.7); }
    100% { transform: scale(1); box-shadow: 0px 0px 10px rgba(0, 123, 255, 0.4); }
}

/* ======================================= */
/* 🏆 TABLEAU DES SCORES */
/* ======================================= */

#tableauScores {
    font-family: 'Luckiest Guy', cursive;
    position: fixed;
    right: 100px;
    top: 100px;
    width: 350px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    text-align: left;
}

/* 🔹 Titres du tableau */
#tableauScores h3 {
    text-align: center;
    color: #007bff;
    font-size: 18px;
    margin-bottom: 10px;
}

/* 🔹 Liste des défis */
#listeDefis {
    list-style-type: none;
    padding: 0;
    margin: 0;
}


/* 🔹 Style du score total */
#totalScore {
    font-family: 'Luckiest Guy', cursive;
    font-size: 20px;
    color: #d9534f;
    margin-left: 5px; /* Ajuste la valeur selon ton besoin */

}
li {
    display: flex;
    align-items: center;
    gap: 10px; /* Espacement entre le bouton et le texte */
}


/* ======================================= */
/* 🎯 MESSAGES ET FENÊTRES MODALES */
/* ======================================= */

/* 🔹 Fenêtre de victoire */
#victoryMessage {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 50%;
    background: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* 🔹 Apparition du message de victoire */
#victoryMessage.visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 🔹 Fenêtre d'explication */
.modal {
    display: none;
    position: fixed;
    top: 15%;
    left: 5%;
    width: 65%;
    max-width: 650px;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    text-align: center;
    font-family: 'Bungee', cursive;
    font-size: 20px;
}

/* 🔹 Apparition animée */
.modal.show, #qaMessage.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ======================================= */
/* 🏗️ LAYOUT PRINCIPAL - POSITIONNEMENT  */
/* ======================================= */
/* Ce conteneur permet d'aligner correctement :
   - 📍 La pyramide à gauche (#defis)
   - 🎯 La zone de question au centre (#qaMessage)
   - ✅ Un espacement optimal entre les deux (gap: 50px)
*/
.main-container {
    display: flex;
    justify-content: center; /* Centre le contenu horizontalement */
    align-items: center; /* Centre verticalement */
    gap: 50px; /* Espace entre la pyramide et la zone de question */
    width: 100%;
    height: 100vh;
    position: relative;
}

/* 🏗️ Positionnement de la pyramide à gauche */
#defis {
    width: 250px; /* Largeur fixe */
    position: absolute;
    left: 5%; /* Fixe la pyramide à gauche */
    top: 30%;
    transform: translateY(-50%); /* Centre verticalement */
}
.question-container {
    text-align: center;
    margin-top: 10px;
}

.question-text {
    font-size: 1.5em;
    margin-bottom: 10px;
    display: block;
}

.answer-input {
    padding: 8px;
    font-size: 1.2em;
    width: 100px;
    text-align: center;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 2px solid #ccc;
}

.validate-btn {
    padding: 8px 15px;
    font-size: 1em;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.validate-btn:hover {
    background-color: #218838;
}


/* 🎯 Zone de question centrée */
#qaMessage {
    display: none; /* Caché par défaut */
    position: fixed; /* Toujours à la même position */
    left: 30%; /* Centre horizontalement */
    top: 30%;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    width: 300px;
    z-index: 1000;
    text-align: center;
    font-family: 'Luckiest Guy', cursive;
    font-size: 20px;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* 🔥 Animation douce */

}

/* 🎬 Effet d'affichage progressif */
#qaMessage.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* 🌀 Animation d'apparition */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}


/* ======================================= */
/* 📦 CHAMPS DE SAISIE */
/* ======================================= */

input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 18px;
    margin: 5px;
    border-radius: 5px;
    border: 2px solid #007BFF;
    background-color: #D6E4FF;
    pointer-events: auto; /* ✅ Permettre la saisie */
}

/* ======================================= */
/* 🔹 STYLES SPÉCIFIQUES */
/* ======================================= */

/* Messages de feedback */
.feedback.good {
    color: #28a745;
}
.feedback.bad {
    color: #dc3545;
}

/* 🔹 Boutons plus grands et lisibles */
.tiny-button {
    font-size: 12px; /* ✅ Texte plus grand */
    padding: 4px 6px; /* ✅ Meilleur confort au clic */
    width: 24px; /* ✅ Ajustement de la largeur */
    height: 24px; /* ✅ Ajustement de la hauteur */
    line-height: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: #f44336; /* Rouge par défaut */
    color: white;
    border-radius: 5px; /* ✅ Coins arrondis */
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background-color 0.3s;
    animation: pulse 1.5s infinite ease-in-out;
}

/* 🔹 Effet au survol */
.tiny-button:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1); /* ✅ Légère mise en avant */
}

/* 🔹 Effet au clic */
.tiny-button:active {
    transform: scale(0.95);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.no-animation {
    animation: none !important;
}

.valid-button {
    background-color: #4CAF50 !important; /* Vert si validé */
    color: white !important;
}


/* ======================================= */
/* 🔥 STYLES D'ANIMATION */
/* ======================================= */

/* Animation pour les bonnes réponses */
.good-answer {
    animation: goodAnswer 0.5s ease-in-out;
}

@keyframes goodAnswer {
    0% { transform: scale(1); box-shadow: 0px 0px 5px rgba(40, 167, 69, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0px 0px 15px rgba(40, 167, 69, 1); }
    100% { transform: scale(1); box-shadow: 0px 0px 5px rgba(40, 167, 69, 0.5); }
}

/* ======================================= */
/* 🔥 STYLES PYRAMIDE */
/* ======================================= */
.score {
    font-family: 'Luckiest Guy', cursive;
    font-size: 20px;
    color: #d9534f;
    display: block; /* Assure que le score est sur une ligne séparée */
    margin-top: 15px; /* Ajoute un petit espace au-dessus */
}
.theme {
    font-family: 'Luckiest Guy', cursive;
    font-size: 20px;
    color: #d9534f;
    margin-bottom: 15px; /* Espace sous le texte */
    text-align: center; /* Centre le texte si besoin */
}

/* ======================================= */
/* 🏁 BOUTON FN DE JEU */
/* ======================================= */


#button1 {
    visibility: hidden; /* Caché au départ */
    display: none; /* Ne prend pas de place */
    position: fixed;
    bottom: 10px;   /* Distance par rapport au haut */
    right: 10px;  /* Distance par rapport à la gauche */
    padding: 10px;
    background-color: white;
    color: black;
    border: 5px solid black;
    border-radius: 5px black;
    cursor: pointer;
    animation: none;

}


#bilan {
    position: fixed; /* Toujours à la même position */
    left: 28%; /* Centre horizontalement */
    top: 30%;
    width: 30vw; /* 30% de la largeur de l’écran */
    height: auto;
    background-color: white; /* Ajout pour lisibilité */
    border: 2px solid black;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    display: none; /* Caché par défaut */
    z-index: 1000;
}


#infosEleve {
    display: none; /* Cache les champs par défaut */
    position: fixed;
    width: 300px; /* Largeur fixe de 300 pixels */
    top: calc(30% + 120px); /* 220px en dessous de #bilan */
    left: 30%; /* Centre horizontalement */
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#identifiant {
    width: 75%; /* Largeur spécifique */
    height: 30px; /* Hauteur spécifique */
    background-color: #f9f9f9; /* Couleur de fond */
}

#classe {
    width: 20%; /* Largeur spécifique */
    height: 30px; /* Hauteur spécifique */
    background-color: #eaeaea; /* Couleur de fond */
}
#button3 {
    display: none; /* Cache le bouton par défaut */
    position: fixed;
    top: calc(30% + 280px); /* 280px en dessous de #bilan */
    left: 50%; /* Centre horizontalement */
    transform: translateX(-50%); /* Ajuste le centrage */
    padding: 10px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.qaMessage {
    display: none; /* Caché par défaut */
}

.qaMessage.show {
    display: block; /* Affiché quand la classe "show" est ajoutée */
}

/* ======================================= */
/*     BOUTON SELECTION CEINTURE           */
/* ======================================= */


.ceinture-selector {
    text-align: left;
    margin: 20px 0 20px 50px; /* Décalage gauche */
    padding: 15px;
    background-color: #ffffff;
    border: 2px solid #007bff;
    border-radius: 10px;
    width: 40%; /* Plus étroit */
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.ceinture-selector label {
    font-size: 18px;
    color: #2c3e50;
    margin-right: 10px;
    font-family: 'Luckiest Guy', cursive;
}

.ceinture-selector select {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 5px;
    border: 2px solid #007bff;
    background-color: #D6E4FF;
    margin-right: 10px;
    cursor: pointer;
}

.ceinture-selector button {
    padding: 8px 15px;
    font-size: 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ceinture-selector button:hover {
    background-color: #218838;
}


* ======================================= */
/*     MOTIVATION           */
/* ======================================= */

#messageSousBouton {
    text-align: center;
    margin-top: 10px;
    color: #007bff;
    font-weight: bold;
    animation: fadeIn 1s ease-in-out;
}

/* Optionnel : Animation douce */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


#closePresentation:hover {
  background-color: #ec7063; /* Un peu plus foncé au survol */
  
  * ======================================= */
/*     FENETRE EXPLICATION                  */
/* ======================================= */
  .modalExp .modal-content {
  font-family: 'Rubik', sans-serif;
  font-size: 1.1em;
  line-height: 1.6;
  background-color: #fefefe;
  color: #1a1a1a;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  max-width: 600px;
  margin: auto;
  text-align: left;
}

.modalExp .modal-content ul {
  margin-left: 20px;
  padding-left: 20px;
  list-style-type: disc;
}

.modalExp .modal-content a {
  color: #2c7a7b;
  font-weight: bold;
  text-decoration: underline;
}

.modalExp .modal-content a:hover {
  color: #1e5e5f;
}

}