/* ============================================================
   ENGLISH QUEST - Feuille de styles principale
   ============================================================
   Table des matières :
   1. Variables & Reset
   2. Body & Fond animé
   3. Page d'accueil
   4. Carte de progression (niveaux)
   5. Boîte de dialogue
   6. Zone exercices (Ritual, Matching, etc.)
   7. Animations
   8. Media queries (responsive)
   ============================================================ */

/* ============================================================
   1. VARIABLES & RESET
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Sour+Gummy:wght@400;700&display=swap');

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

/* ============================================================
   2. BODY & FOND ANIMÉ
   ============================================================ */
body {
    font-family: 'Sour Gummy', sans-serif;
    min-height: 100vh;
    background: #a8d5a2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

/* Image de fond avec flou */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('assets/background.png') center/cover no-repeat;
    filter: blur(2px);
    z-index: -1;
}

/* ============================================================
   ÉCRAN DE CHARGEMENT
   ============================================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #a8d5a2 0%, #81c784 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    width: 350px;
    height: 350px;
    margin-bottom: 50px;
    animation: logoPulse 1.5s ease-in-out infinite;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-logo.moving {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    animation: none;
}

.loading-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Barre de chargement */
.loading-bar-container {
    width: 320px;
    height: 24px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #fff;
    transition: opacity 0.3s ease;
}

.loading-bar-container.hidden {
    opacity: 0;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    border-radius: 12px;
    transition: width 0.1s ease;
}

.loading-text {
    margin-top: 20px;
    color: #fff;
    font-size: 1.4em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}

.loading-text.hidden {
    opacity: 0;
}

/* Logo fixe en haut après chargement */
.header-logo {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.header-logo.visible {
    opacity: 1;
    pointer-events: auto;
}

.header-logo img {
    height: 80px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

/* Conteneur des formes flottantes en arrière-plan */
.fond-anime {
    position: fixed;
    inset: 0; /* Raccourci pour top/right/bottom/left: 0 */
    overflow: hidden;
    z-index: 0;
}

/* Style de base des formes animées */
.forme {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: flotter 20s infinite ease-in-out;
}

/* Positionnement et couleur de chaque forme */
.forme:nth-child(1) { width: 300px; height: 300px; background: #ffd700; top: -100px; left: -100px; }
.forme:nth-child(2) { width: 200px; height: 200px; background: #00d4ff; bottom: -50px; right: 10%; animation-delay: 3s; }
.forme:nth-child(3) { width: 250px; height: 250px; background: #ff6b9d; top: 20%; right: -80px; animation-delay: 1.5s; }
.forme:nth-child(4) { width: 180px; height: 180px; background: #00ff88; bottom: 30%; left: 5%; animation-delay: 4s; }
.forme:nth-child(5) { width: 220px; height: 220px; background: #ffaa00; top: 50%; left: 50%; animation-delay: 2s; }

/* Conteneur principal de l'application */
.container {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 90%;
    max-width: 900px;
    padding: 20px;
}

/* ============================================================
   3. PAGE D'ACCUEIL
   ============================================================ */
.page-accueil {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: apparaitre 0.8s ease-out;
}

/* Titre principal "English Quest" */
.titre-principal {
    font-size: 3.5em;
    margin-bottom: 40px;
    color: #ff6b6b;
    text-shadow: 
        3px 3px 0px #fff,
        -3px -3px 0px #fff,
        3px -3px 0px #fff,
        -3px 3px 0px #fff,
        4px 4px 8px rgba(0, 0, 0, 0.3);
    animation: descendre 0.8s ease-out;
}

/* Formulaire de saisie du prénom */
.formulaire-prenom {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(139, 195, 74, 0.5);
    padding: 50px 40px;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: apparaitre 1s ease-out 0.3s both;
}

.formulaire-prenom label {
    display: block;
    font-size: 1.8em;
    color: #5d8a3e;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.formulaire-prenom input {
    width: 100%;
    padding: 20px;
    font-size: 1.5em;
    border: 3px solid #8bc34a;
    border-radius: 15px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.formulaire-prenom input:focus {
    border-color: #ff9a56;
    box-shadow: 0 0 20px rgba(255, 154, 86, 0.4);
}

/* Bouton "Play!" */
.bouton-commencer {
    margin-top: 30px;
    padding: 20px 60px;
    font-size: 1.8em;
    font-weight: bold;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
}

.bouton-commencer:hover:not(:disabled) {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.6);
}

.bouton-commencer:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   4. CARTE DE PROGRESSION (NIVEAUX)
   ============================================================ */
.carte-progression {
    display: none;
    min-height: 100vh;
    position: relative;
    padding: 40px 0;
    width: 100%;
}

/* Message de bienvenue en sticky */
.titre-bienvenue {
    color: #fff;
    font-size: 2.2em;
    margin-bottom: 60px;
    text-shadow: 
        2px 2px 0px #689f38,
        -1px -1px 0px #689f38,
        3px 3px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 110px;
    z-index: 10;
    background: linear-gradient(135deg, rgba(139, 195, 74, 0.9) 0%, rgba(104, 159, 56, 0.9) 100%);
    padding: 15px 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-inline: auto;
    max-width: fit-content;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* SVG pour dessiner les chemins entre niveaux */
.chemin-niveaux {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    height: 100%;
    pointer-events: none;
}

/* Conteneur des bulles de niveau */
.conteneur-niveaux {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 800px;
    padding: 20px 20px 100px;
    margin: 0 auto;
}

/* --- Style de base d'un niveau --- */
.niveau {
    position: absolute;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.4s ease;
}

/* Tailles selon le type de niveau */
.niveau-exercice { width: 175px; height: 175px; font-size: 1.5em; }
.niveau-cours    { width: 120px; height: 120px; font-size: 1.2em; }
.niveau-ritual,
.niveau-evaluation { width: 160px; height: 160px; font-size: 1.8em; }

/* Couleurs spécifiques */
.niveau-cours:not(.niveau-complete):not(.niveau-verrouille) {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%) !important;
}

.niveau-ritual {
    background: linear-gradient(135deg, #7ecbf5 0%, #42a5f5 100%);
    border: 5px solid #fff;
    box-shadow: 0 8px 30px rgba(66, 165, 245, 0.5);
}

.niveau-evaluation {
    background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
    border: 5px solid #fff;
    box-shadow: 0 8px 30px rgba(255, 152, 0, 0.5);
}

/* États des niveaux */
.niveau-actif {
    background: linear-gradient(135deg, #ffeb3b 0%, #ffc107 100%);
    animation: pulsation 2s infinite;
}

.niveau-complete {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%);
}

.niveau-verrouille {
    background: linear-gradient(135deg, #b0bec5 0%, #90a4ae 100%);
    cursor: not-allowed;
    opacity: 0.6;
}

.niveau:not(.niveau-verrouille):hover {
    transform: scale(1.15);
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.5);
}

/* Pulsations spécifiques pour ritual et évaluation actifs */
.niveau-ritual.niveau-actif  { animation: pulsation-ritual 2s infinite; }
.niveau-evaluation.niveau-actif { animation: pulsation-eval 2s infinite; }

/* Éléments internes des niveaux */
.numero-niveau { font-size: 3em; }
.niveau-cours .numero-niveau { font-size: 2em; }
.niveau-evaluation .numero-niveau,
.niveau-ritual .numero-niveau { font-size: 2.8em; }

.nom-niveau { 
    font-size: 1em; 
    margin-top: 5px;
    text-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.3),
        -1px -1px 0px rgba(0, 0, 0, 0.3),
        1px -1px 0px rgba(0, 0, 0, 0.3),
        -1px 1px 0px rgba(0, 0, 0, 0.3);
}

/* Icône de validation (check vert) */
.icone-complete {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 70px;
    height: 70px;
    background: #27ae60;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Icône cadenas */
.icone-verrouille {
    position: absolute;
    font-size: 3em;
}

/* ============================================================
   5. BOÎTE DE DIALOGUE
   ============================================================ */
.dialogue-container {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fonduEntree 0.3s ease-out;
}

/* Variante positionnée en bas-gauche (pour le chat + bulle) */
.dialogue-container.bottom-left {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 30px;
}

/* Wrapper contenant personnage + bulle */
.dialogue-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 90%;
    animation: monterDialogue 0.5s ease-out;
}

.dialogue-container.bottom-left .dialogue-wrapper {
    align-items: flex-end;
    gap: 14px;
}

/* Avatar du personnage (Monsieur Chat) */
.personnage-dialogue {
    width: 220px;
    height: 220px;
    background: white;
    border-radius: 20px;
    border: 5px solid #8bc34a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5em;
    flex-shrink: 0;
    overflow: hidden;
}

.dialogue-container.bottom-left .personnage-dialogue {
    width: 120px;
    height: 120px;
    border-radius: 16px;
}

.personnage-dialogue img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Boîte de dialogue principale */
.dialogue-box {
    position: relative;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 5px solid #8bc34a;
    border-radius: 25px;
    padding: 30px;
    padding-top: 60px;
    width: 100%;
    max-width: 820px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
}

/* Variante bottom-left avec triangle pointant vers le chat */
.dialogue-container.bottom-left .dialogue-box {
    max-width: 680px;
    padding: 20px 24px 20px 24px;
    padding-top: 28px;
    border-radius: 18px;
}

.dialogue-container.bottom-left .dialogue-box::before {
    content: '';
    position: absolute;
    left: -18px;
    bottom: 22px;
    border: 12px solid transparent;
    border-right: 18px solid #fff;
}

.dialogue-container.bottom-left .dialogue-box::after {
    content: '';
    position: absolute;
    left: -23px;
    bottom: 18px;
    border: 15px solid transparent;
    border-right: 23px solid #8bc34a;
    z-index: -1;
}

/* Bouton retour (←) */
.bouton-retour {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.bouton-retour:hover {
    transform: translateX(-3px);
    box-shadow: 0 5px 15px rgba(139, 195, 74, 0.4);
}

/* Contenu textuel de la bulle */
.contenu-dialogue { margin: 0; }

.nom-personnage {
    font-size: 1.5em;
    font-weight: bold;
    color: #689f38;
    margin-bottom: 15px;
}

.texte-dialogue {
    font-size: 1.2em;
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Bouton "Continuer" */
.bouton-continuer {
    float: right;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.bouton-continuer:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 154, 86, 0.4);
}

/* --- Speaker flottant (bulle en bas à gauche) --- */
.speaker-float {
    position: fixed;
    left: 26px;
    bottom: 26px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    z-index: 1500;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.speaker-float.show {
    opacity: 1;
    transform: translateY(0);
}

.speaker-float .personnage-dialogue {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    border-width: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.speaker-float .personnage-dialogue img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

/* Bouton toggle pour réduire/agrandir la bulle */
.bubble-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    font-size: 0.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.bubble-toggle:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(255, 154, 86, 0.5);
}

.speaker-float .bubble {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 4px solid #8bc34a;
    border-radius: 16px;
    padding: 12px 18px;
    max-width: 350px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

/* Bulle réduite */
.speaker-float .bubble.minimized {
    max-width: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    border-width: 0;
}

/* Curseur clignotant pour effet machine à écrire */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #8bc34a;
    margin-left: 2px;
    animation: cursorBlink 0.7s infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Bulle plus large pour la page d'accueil */
.speaker-float.speaker-accueil .bubble {
    max-width: 380px;
    padding: 15px 20px;
}

/* Image du koala avec espace pour les contours */
.speaker-float.speaker-accueil .personnage-dialogue img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.speaker-float .bubble::before {
    content: '';
    position: absolute;
    left: -14px;
    bottom: 12px;
    border: 8px solid transparent;
    border-right: 14px solid #fff;
}

.speaker-float .bubble::after {
    content: '';
    position: absolute;
    left: -18px;
    bottom: 10px;
    border: 10px solid transparent;
    border-right: 18px solid #8bc34a;
    z-index: -1;
}

.speaker-float .nom-personnage {
    font-size: 1.2em;
    margin-bottom: 6px;
}

.speaker-float .texte-dialogue {
    font-size: 1.05em;
    line-height: 1.4;
    margin-bottom: 0;
}

/* Masquer le chat gauche / speaker dans certains modes */
.dialogue-container.hide-left-chat .dialogue-wrapper .personnage-dialogue { display: none; }
.dialogue-box.hide-speaker .nom-personnage,
.dialogue-box.hide-speaker .texte-dialogue { display: none; }
.dialogue-box.hide-speaker { padding-top: 30px; }

/* --- Message central du Koala (après ritual) --- */
.koala-message-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 400ms ease;
}

.koala-message-overlay.show {
    opacity: 1;
}

.koala-message-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    animation: monterDialogue 0.5s ease-out;
}

.koala-message-box .personnage-dialogue {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    border: 5px solid #8bc34a;
    background: white;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.koala-message-box .personnage-dialogue img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.koala-message-box .bubble {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 5px solid #8bc34a;
    border-radius: 20px;
    padding: 25px 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.koala-message-box .nom-personnage {
    font-size: 1.6em;
    font-weight: bold;
    color: #8bc34a;
    margin-bottom: 15px;
}

.koala-message-box .texte-dialogue {
    font-size: 1.2em;
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 20px;
}

.koala-message-box .bouton-continuer {
    float: none;
    display: inline-block;
}

/* ============================================================
   6. ZONE EXERCICES
   ============================================================ */
.zone-exercice {
    position: relative;
    margin: 20px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    max-height: 65vh;
    min-height: 300px;
    overflow-y: auto;
}

/* Scrollbar personnalisée */
.zone-exercice::-webkit-scrollbar {
    width: 8px;
}

.zone-exercice::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.zone-exercice::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 4px;
}

.zone-exercice::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* --- RITUAL : sélection de la date --- */
.ritual-container {
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.ritual-titre {
    font-size: 1.8em;
    color: #8bc34a;
    font-weight: bold;
    margin-bottom: 20px;
}

.date-selecteurs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 20px 0;
}

.date-selecteurs select {
    padding: 10px 15px;
    font-size: 1.1em;
    font-family: inherit;
    border: 3px solid #8bc34a;
    border-radius: 10px;
    background: white;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-selecteurs select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.date-selecteurs select.correct   { border-color: #27ae60; background: #e6ffe6; }
.date-selecteurs select.incorrect { border-color: #e74c3c; background: #ffe6e6; }

.virgule {
    font-size: 1.5em;
    color: #2c3e50;
    font-weight: bold;
}

.bouton-valider-date {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.bouton-valider-date:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.message-date {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
}

/* --- RITUAL : sélection de la météo --- */
.meteo-container {
    margin-top: 20px;
    text-align: center;
}

.meteo-titre {
    font-size: 1.4em;
    color: #8bc34a;
    font-weight: bold;
    margin-bottom: 10px;
}

.meteo-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 20px;
    overflow-x: auto;
    padding: 20px 10px 15px;
}

.meteo-option {
    background: rgba(255, 255, 255, 0.08);
    padding: 8px;
    border-radius: 12px;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.meteo-option:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.meteo-option img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.meteo-label {
    margin-top: 8px;
    font-size: 0.95em;
    color: #2c3e50;
}

.meteo-option.selected {
    border: 3px solid #27ae60;
    box-shadow: 0 8px 30px rgba(39, 174, 96, 0.25);
    transform: translateY(-6px) scale(1.02);
}

.meteo-option:focus {
    outline: 3px dashed rgba(102, 126, 234, 0.5);
    outline-offset: 6px;
}

/* --- MATCHING EXERCISE (relier mot ↔ image) --- */
.match-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 10px;
}

.match-left,
.match-center,
.match-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Bloc mot */
.match-word {
    background: rgba(255, 255, 255, 0.12);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.15em;
    color: #2c3e50;
    min-width: 200px;
    text-align: center;
    cursor: pointer;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.match-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.2);
}

.match-word.selected {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.2);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.4);
    transform: scale(1.05);
}

.match-word .word-text { font-weight: 600; }

.match-word.matched {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    cursor: default;
    transform: scale(1.05);
}

/* Bloc image */
.match-image {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 12px;
    width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid transparent;
    position: relative;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.match-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.2);
}

.match-image.selected {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.15);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.4);
    transform: scale(1.05);
}

.match-image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.match-image.matched {
    border-color: #27ae60;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.18);
    transform: scale(1.05);
    cursor: default;
}

/* Feedback correct / incorrect */
.match-correct { animation: correctFlash 360ms ease; }
.match-wrong   { animation: wrongShake 420ms ease; }

.message-match {
    margin-top: 20px;
    text-align: center;
}

/* Points de connexion pour lignes SVG */
.connector-point {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(102, 126, 234, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: inline-block;
    cursor: pointer;
}

.connector-point.disabled { opacity: 0.4; cursor: default; }
.connector-point.selected {
    background: #f39c12;
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
    transform: scale(1.3);
}

.point-left  { margin-right: 10px; }
.point-right { margin-left: 10px; }

/* Lignes SVG de connexion */
.match-svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.match-line {
    stroke-width: 4px;
    stroke-linecap: round;
    fill: none;
    opacity: 0.95;
}

.match-line.correct { stroke: #27ae60; }
.match-line.wrong   { stroke: #e74c3c; stroke-dasharray: 6 6; }

/* --- EXERCICE 1.2 : Texte à trous --- */
.fill-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px;
}

.fill-phrase {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fill-english {
    font-size: 1.05em;
    color: #2c3e50;
    font-weight: 600;
}

.fill-french {
    font-size: 0.95em;
    color: #555;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.fill-gap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 32px;
    background: rgba(102, 126, 234, 0.15);
    border: 2px dashed #8bc34a;
    border-radius: 8px;
    margin: 0 3px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 0.95em;
    color: #8bc34a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fill-gap:empty::before {
    content: '___';
    color: #999;
}

.fill-gap.filled {
    background: rgba(102, 126, 234, 0.25);
    border-style: solid;
}

.fill-gap.correct {
    background: rgba(39, 174, 96, 0.25);
    border-color: #27ae60;
    color: #27ae60;
}

.fill-gap.wrong {
    background: rgba(231, 76, 60, 0.25);
    border-color: #e74c3c;
    color: #e74c3c;
    animation: wrongShake 420ms ease;
}

.fill-gap:hover:not(.correct) {
    background: rgba(102, 126, 234, 0.3);
}

/* Zone des étiquettes */
.fill-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.fill-label {
    padding: 8px 16px;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1em;
    cursor: grab;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    user-select: none;
}

.fill-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

.fill-label.selected {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

.fill-label.used {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.fill-label.used:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.fill-phrase.error {
    background: rgba(231, 76, 60, 0.15);
}

/* --- CONTENU DE LEÇON STYLISÉ --- */
.lesson-content {
    text-align: left;
    padding: 10px;
}

.lesson-content h3 {
    color: #8bc34a;
    font-size: 1.3em;
    margin-bottom: 15px;
    text-align: center;
}

.lesson-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #2c3e50;
}

.lesson-highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-left: 4px solid #8bc34a;
    padding: 12px 15px;
    border-radius: 0 10px 10px 0;
    margin: 15px 0;
}

.lesson-highlight strong {
    color: #8bc34a;
}

.lesson-example {
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-top: 15px;
    text-align: center;
}

.lesson-example .example-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.lesson-example .example-comparison {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.lesson-example .example-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
}

.lesson-example .example-item .country {
    font-size: 0.85em;
    opacity: 0.9;
}

.lesson-example .example-item .time {
    font-size: 1.4em;
    font-weight: bold;
}

.lesson-tip {
    background: rgba(46, 204, 113, 0.15);
    border-left: 4px solid #2ecc71;
    padding: 10px 15px;
    border-radius: 0 10px 10px 0;
    margin: 10px 0;
    font-size: 0.95em;
}

.lesson-tip::before {
    content: "💡 ";
}

/* --- EXERCICE 2.1 : AM/PM avec soleil et lune --- */
.ampm-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
}

.ampm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
}

.ampm-time {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c3e50;
    min-width: 80px;
    text-align: center;
}

.ampm-choices {
    display: flex;
    gap: 8px;
}

.ampm-choice {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 8px;
}

.ampm-choice img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.ampm-choice:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.5);
}

.ampm-choice:hover img {
    opacity: 0.8;
}

.ampm-choice.selected {
    border-color: #8bc34a;
    background: rgba(102, 126, 234, 0.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.4);
}

.ampm-choice.selected img {
    opacity: 1;
}

.ampm-choice.correct {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.2);
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.4);
}

.ampm-choice.correct img {
    opacity: 1;
}

.ampm-choice.wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    animation: wrongShake 420ms ease;
}

.ampm-row.error {
    background: rgba(231, 76, 60, 0.15);
}

.ampm-verify-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.ampm-verify-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

/* --- EXERCICE 1.3 : Drag & Drop Audio --- */
.audio-match-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
}

/* --- EXERCICE 2.2 : Audio AM/PM --- */
.audio-ampm-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px;
}

.audio-ampm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px 15px;
}

.audio-ampm-row .audio-btn {
    width: 45px;
    height: 45px;
    font-size: 1.1em;
}

.audio-ampm-choices {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.audio-ampm-choice {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid transparent;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    text-align: center;
}

.audio-ampm-choice:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.audio-ampm-choice.selected {
    border-color: #8bc34a;
    background: rgba(102, 126, 234, 0.25);
    color: #8bc34a;
}

.audio-ampm-choice.correct {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.25);
    color: #27ae60;
}

.audio-ampm-choice.wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.25);
    color: #e74c3c;
    animation: wrongShake 420ms ease;
}

.audio-ampm-row.validated .audio-ampm-choice:not(.correct) {
    opacity: 0.4;
    cursor: default;
}

.audio-ampm-row.error {
    background: rgba(231, 76, 60, 0.15);
}

/* --- EXERCICE 2.3 : Frise chronologique AM/PM --- */
.frise-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.frise-timeline {
    display: flex;
    height: 120px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.frise-side {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 10px;
    gap: 8px;
    min-height: 100px;
    transition: all 0.2s ease;
}

.frise-side-am {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    border-right: 4px solid #2c3e50;
}

.frise-side-pm {
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    border-left: 4px solid #2c3e50;
}

.frise-side.drag-over {
    transform: scale(1.02);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.frise-label {
    position: absolute;
    top: 5px;
    font-weight: bold;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.frise-side-am .frise-label,
.frise-label-am {
    left: 15px;
}

.frise-side-pm .frise-label,
.frise-label-pm {
    right: 15px;
}

/* Icônes soleil et lune sur la frise */
.frise-icon {
    position: absolute;
    bottom: 8px;
    font-size: 1.8em;
    opacity: 0.7;
}

.frise-icon-am {
    left: 15px;
}

.frise-icon-pm {
    right: 15px;
}

/* Étiquettes d'heures draggables */
.frise-hour {
    padding: 8px 14px;
    background: white;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1em;
    color: #2c3e50;
    cursor: grab;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    user-select: none;
    border: 2px solid transparent;
}

.frise-hour:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.frise-hour.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.frise-hour.correct {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.2);
}

.frise-hour.wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    animation: wrongShake 420ms ease;
}

/* Zone des heures à placer */
.frise-hours-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-height: 60px;
}

/* Séparateur central */
.frise-separator {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2c3e50;
    transform: translateX(-50%);
}

.frise-separator::before {
    content: '12h';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.audio-match-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 15px;
}

/* Bouton audio */
.audio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    border: none;
    color: white;
    font-size: 1.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.audio-btn.playing {
    animation: audioPulse 0.8s infinite;
}

@keyframes audioPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Zone de drop */
.drop-zone {
    flex: 1;
    height: 90px;
    min-height: 90px;
    border: 3px dashed rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #8bc34a;
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.02);
}

.drop-zone.correct {
    border-style: solid;
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.15);
}

.drop-zone.wrong {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    animation: wrongShake 420ms ease;
}

/* Zone des images draggables */
.drag-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-content: flex-start;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 120px;
}

.drag-image {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 12px;
    border: 3px solid #8bc34a;
    padding: 8px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.drag-image:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

.drag-image.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drag-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Image placée dans une drop zone */
.drop-zone .drag-image {
    margin: 5px;
    cursor: grab;
}

.drop-zone.correct .drag-image {
    border-color: #27ae60;
    cursor: default;
}

/* Classe utilitaire pour masquer */
.cache { display: none !important; }

/* --- NOTIFICATION ADMIN --- */
.admin-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #2ecc71;
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #2ecc71;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.admin-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.admin-notification button {
    background: transparent;
    border: none;
    color: #2ecc71;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.admin-notification button:hover {
    color: #fff;
}

/* Bouton skip pour admin */
.btn-skip-admin {
    position: absolute;
    top: 15px;
    right: 60px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-skip-admin:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* ============================================================
   7. ANIMATIONS (keyframes)
   ============================================================ */

/* Formes flottantes en arrière-plan */
@keyframes flotter {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -30px) scale(1.1); }
    66%      { transform: translate(-20px, 20px) scale(0.9); }
}

/* Apparition en fondu + scale */
@keyframes apparaitre {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* Titre qui descend */
@keyframes descendre {
    from { transform: translateY(-100px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Pulsation des niveaux actifs */
@keyframes pulsation {
    0%, 100% { transform: scale(1);    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4); }
    50%      { transform: scale(1.08); box-shadow: 0 8px 30px rgba(243, 156, 18, 0.7); }
}

@keyframes pulsation-ritual {
    0%, 100% { transform: scale(1);    box-shadow: 0 8px 30px rgba(66, 165, 245, 0.6); }
    50%      { transform: scale(1.08); box-shadow: 0 12px 40px rgba(66, 165, 245, 0.9), 0 0 50px #7ecbf5; }
}

@keyframes pulsation-eval {
    0%, 100% { transform: scale(1);    box-shadow: 0 8px 30px rgba(255, 152, 0, 0.6); }
    50%      { transform: scale(1.08); box-shadow: 0 12px 40px rgba(255, 152, 0, 0.9), 0 0 50px gold; }
}

/* Fondu d'entrée du dialogue */
@keyframes fonduEntree {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Dialogue qui monte */
@keyframes monterDialogue {
    from { transform: translateY(100px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Flash vert (bonne réponse matching) */
@keyframes correctFlash {
    0%   { box-shadow: 0 0 0 rgba(39, 174, 96, 0); }
    50%  { box-shadow: 0 0 20px rgba(39, 174, 96, 0.35); }
    100% { box-shadow: 0 0 0 rgba(39, 174, 96, 0); }
}

/* Shake rouge (mauvaise réponse) */
@keyframes wrongShake {
    0%   { transform: translateX(0);    border-color: #e74c3c; }
    20%  { transform: translateX(-8px); }
    40%  { transform: translateX(8px);  }
    60%  { transform: translateX(-6px); }
    80%  { transform: translateX(4px);  }
    100% { transform: translateX(0);    border-color: transparent; }
}

/* ============================================================
   8. MEDIA QUERIES (responsive)
   ============================================================ */

/* Tablettes et petits écrans */
@media (max-width: 900px) {
    .match-container {
        gap: 20px;
        flex-direction: column;
        align-items: center;
    }
    .match-word { min-width: 240px; }
    .match-left,
    .match-right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .titre-principal { font-size: 2.5em; }

    .personnage-dialogue {
        width: 150px;
        height: 150px;
        font-size: 4em;
    }

    .dialogue-wrapper { flex-direction: column; }

    .date-selecteurs { gap: 5px; }
    .date-selecteurs select {
        font-size: 1em;
        padding: 8px 10px;
    }

    .meteo-option {
        width: 80px;
        padding: 6px;
    }
    .meteo-option img {
        width: 48px;
        height: 48px;
    }
    .meteo-label { font-size: 0.85em; }
}

/* Très petits écrans (speaker float) */
@media (max-width: 600px) {
    .speaker-float {
        left: 12px;
        bottom: 12px;
    }
    .speaker-float .personnage-dialogue {
        width: 110px;
        height: 110px;
    }
    .speaker-float .bubble {
        max-width: 320px;
        padding: 12px 14px;
    }
    .speaker-float .nom-personnage { font-size: 1.4em; }
    .speaker-float .texte-dialogue { font-size: 1.05em; }
    
    /* Exercice 1.2 en une colonne sur mobile */
    .fill-container {
        grid-template-columns: 1fr;
    }
    
    /* Exercice 2.1 en une colonne sur mobile */
    .ampm-container {
        grid-template-columns: 1fr;
    }
    
    /* Exercice 1.3 en une colonne sur mobile */
    .audio-match-container {
        grid-template-columns: 1fr;
    }
    
    /* Exercice 2.2 en une colonne sur mobile */
    .audio-ampm-container {
        grid-template-columns: 1fr;
    }
}
