/* Variables essentielles */
:root {
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --line-height-normal: 1.5;
    --space-16: 16px;

    /* Thème de couleurs volcaniques */
    --color-volcano-red: #ff4d4d;
    --color-volcano-orange: #ff8c42;
    --color-dark-text: #2c3e50;
    --color-light-text: #f0f0f0;
    --color-dark-bg: rgba(25, 25, 40, 0.85); /* Fond plus opaque */
}

/* Reset de base */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-image: url('images/fond de page.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--color-light-text);
    font-family: var(--font-family-base);
    line-height: var(--line-height-normal);
    -webkit-overflow-scrolling: touch;
}

/* Titres */
.main-title, h2, h3 {
    color: var(--color-volcano-orange);
    font-weight: bold;
    text-align: center;
}

/* Structure principale */
#app-container { min-height: 100%; width: 100%; }
.page { display: none; width: 100%; min-height: 100vh; height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; box-sizing: border-box; }
.page.active { display: block; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--space-16); box-sizing: border-box; }

/* Conteneur spécifique pour l'écran d'accueil - permettre le scroll comme le puzzle */
#home-page {
    overflow-y: auto !important;
    max-height: 100vh;
    box-sizing: border-box;
}

#home-page .container {
    overflow-y: auto;
    max-height: calc(100vh - 20px);
    padding-bottom: 50px; /* Espace en bas pour permettre le scroll complet */
}

/* Conteneur spécifique pour le jeu de bulles */
#bubble-game-page .container {
    padding: 8px var(--space-16);
    margin-top: -20px;
}

/* Styles pour les statistiques du jeu Taquin */
.taquin-stats {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.stat-card {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    border-radius: 20px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 140px;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
    border: 2px solid rgba(255, 140, 66, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-card.pulse::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.4);
    border-color: #fff;
}

.moves-card {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.time-card {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.stat-icon {
    font-size: 2.2em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: gentle-bounce 2s ease-in-out infinite;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.85em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Monaco', 'Consolas', monospace;
    transition: all 0.3s ease;
}

.stat-value.updated {
    transform: scale(1.2);
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.6);
}

/* Animations */
@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3); }
    50% { box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6), 0 0 20px rgba(255, 107, 53, 0.4); }
    100% { box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3); }
}

.stat-card.animate-update {
    animation: pulse-glow 0.6s ease-in-out;
}

/* Responsive design pour les stats */
@media (max-width: 480px) {
    .taquin-stats {
        gap: 10px;
    }
    
    .stat-card {
        min-width: 120px;
        padding: 12px 16px;
    }
    
    .stat-icon {
        font-size: 1.8em;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .stat-label {
        font-size: 0.75em;
    }
}

/* Grille d'activités améliorée pour la visibilité */
.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
    margin-bottom: 40px;
}

.activity-card {
    background: var(--color-dark-bg);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    color: #FFFFFF; /* Texte blanc pur */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--color-volcano-orange);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.activity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 25px var(--color-volcano-orange);
}

.activity-card h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.activity-card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

a.activity-card {
    text-decoration: none; /* Supprime le soulignement des liens */
    color: inherit; /* Hérite la couleur du texte du parent */
}

/* Styles pour les icônes des cartes d'activité */
.activity-icon {
    font-size: 4rem; /* Agrandir les icônes */
    margin-bottom: 15px; /* Espacement sous l'icône */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px; /* Pour s'assurer que le centrage vertical fonctionne bien */
}

/* Styles pour la mascotte (emoji et texte) */
.mascot {
    display: flex;
    flex-direction: column; /* Pour empiler l'emoji et le texte */
    align-items: center; /* Centrer horizontalement */
    margin-top: 20px; /* Espacement au-dessus de la mascotte */
}

.mascot-character {
    font-size: 5rem; /* Agrandir l'emoji */
    margin-bottom: 10px; /* Espacement sous l'emoji */
    background-color: rgba(255, 255, 255, 0.4); /* Couleur de fond plus claire */
    border-radius: 50%; /* Forme de cercle */
    width: 150px; /* Taille du cercle plus grande */
    height: 150px; /* Taille du cercle plus grande */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px double black; /* Double bordure noire */
}

.mascot-text {
    font-size: 2rem; /* Agrandir le texte "Bonjour SIMON" */
    font-weight: bold;
    color: white; /* Changer la couleur en blanc */
}

/* Styles du Memory */
.memory-content {
    text-align: center;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr)); /* 4 colonnes, taille ajustée */
    gap: 25px;
    padding: 15px;
    justify-content: center;
    max-width: 800px;
    margin: 20px auto;
    background-image: url('images/volcan ile.png'); /* Nouvelle image de fond */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--color-dark-bg); /* Masque l'image au début */
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 66, 0.5);
    transition: background-color 1s ease-in-out; /* Transition pour révéler l'image */
}

.memory-grid.revealed {
    background-color: transparent; /* Révèle l'image */
}

.memory-card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform-style: preserve-3d;
    transition: transform 0.6s;
    background-color: transparent; /* Les cartes elles-mêmes sont transparentes */
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border-radius: 8px;
    border: 2px solid transparent; /* Bordure par défaut */
}

.card-front {
    background: linear-gradient(45deg, var(--color-volcano-orange), var(--color-volcano-red));
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    border-color: var(--color-volcano-red);
}

.card-back {
    background-color: #f0f0f0; /* Fond clair pour l'icône */
    color: var(--color-dark-text);
    transform: rotateY(180deg);
    border-color: #ccc;
    font-size: 4.5rem; /* Icônes encore plus grandes */
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    pointer-events: none; /* Désactive les clics une fois trouvée */
}

.memory-card.matched .card-front, .memory-card.matched .card-back {
    border-color: #2ecc71; /* Vert pour les paires trouvées */
    box-shadow: 0 0 15px #2ecc71; /* Lueur verte */
    animation: pulse-green 1s forwards; /* Animation pour les paires trouvées */
}

.memory-card.mismatched {
    animation: shake 0.5s; /* Animation pour les erreurs */
}

.memory-card.mismatched .card-front, .memory-card.mismatched .card-back {
    border-color: #e74c3c; /* Rouge pour les erreurs */
    box-shadow: 0 0 15px #e74c3c; /* Lueur rouge */
}

@keyframes pulse-green {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Styles pour le message de fin de Memory */
.memory-completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1); /* Commence petit */
    background: rgba(44, 62, 80, 0.95); /* Fond sombre semi-transparent */
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 0 30px rgba(255, 140, 66, 0.8); /* Grande lueur orange */
    animation: zoom-in 0.5s forwards; /* Animation d'apparition */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.memory-completion-message h2 {
    color: var(--color-volcano-orange);
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 140, 66, 0.7);
}

.memory-completion-message p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.completion-image {
    max-width: 100%;
    max-height: 60vh; /* Limite la hauteur de l'image */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    object-fit: contain; /* Assure que l'image est contenue sans être coupée */
}

/* Animations */
@keyframes zoom-in {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.memory-completion-message.zoom-out {
    animation: zoom-out 0.5s forwards; /* Animation de disparition */
}

@keyframes zoom-out {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
}

/* Media Queries pour la responsivité du Memory */
@media (max-width: 768px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 colonnes pour les tablettes */
    }
}

@media (max-width: 480px) {
    .memory-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes pour les smartphones */
        gap: 10px;
        padding: 10px;
    }

    .card-front, .card-back {
        font-size: 2rem; /* Taille de police ajustée pour les petites cartes */
    }
}

/* Styles du Quiz */
#quiz-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}
.quiz-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--color-dark-bg);
    border-radius: 12px;
}

.quiz-answer {
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-light-text);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.quiz-question {
    text-align: center;
    display: none;
}

.quiz-progress {
    display: none;
}

.quiz-result {
    display: none;
    text-align: center;
    padding: 30px;
}

.quiz-result #restart-quiz-btn {
    margin-top: 40px !important;
}

#quiz-selection {
    display: block;
}

.quiz-answer {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 140, 66, 0.05));
    color: white;
    border: 2px solid rgba(255, 107, 53, 0.3);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.quiz-answer:hover {
    transform: scale(1.02);
    border-color: var(--color-volcano-orange);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 140, 66, 0.1));
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* Styles des boutons améliorés */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn--primary {
    background: var(--color-volcano-orange);
    color: white;
}

.btn--primary:hover {
    background: var(--color-volcano-red);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 100, 80, 0.4);
}

.btn--secondary {
    background: transparent;
    color: var(--color-volcano-orange);
    border: 2px solid var(--color-volcano-orange);
}

.btn--secondary:hover {
    background: var(--color-volcano-orange);
    color: white;
    box-shadow: 0 0 15px var(--color-volcano-orange);
}

/* Styles pour le diagramme du volcan */
.volcano-diagram {
    position: relative;
    display: block;
    margin: 20px auto; /* Centre l'image et ajoute de l'espace */
    max-width: 800px; /* Limite la largeur pour un meilleur affichage */
}

.volcano-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.instructions {
    text-align: center;
    margin: 20px auto;
    padding: 15px;
    max-width: 600px;
    background-color: rgba(240, 240, 240, 0.9);
    color: var(--color-dark-text);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cta-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Styles pour les entrées des types de volcans */
.volcano-type-entry {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid var(--color-volcano-orange);
}

.volcano-type-entry h4 {
    color: var(--color-volcano-red);
    margin: 0 0 8px 0;
}

.volcano-type-entry p {
    margin: 0 0 4px 0;
}

.volcano-type-entry small {
    color: var(--color-light-text);
    opacity: 0.8;
}

#part-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    background: var(--color-dark-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    color: white;
    /* On le cache s'il est vide */
    display: none;
}

#part-info:not(:empty) {
    display: block;
}

/* Styles des hotspots */
.hotspot {
    position: absolute;
}

.hotspot[data-part="crater"] {
    top: 26.11%;
    left: 53.50%;
}

.hotspot[data-part="chimney"] {
    top: 45%;
    left: 53.11%;
}

.hotspot[data-part="magma"] {
    top: 86.5%;
    left: 54.45%;
}

.hotspot[data-part="lava"] {
    top: 32.95%;
    left: 62.086%;
}

.hotspot-dot {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--color-volcano-orange);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: pulse 2s infinite;
}

.hotspot-dot:hover { transform: scale(1.2); box-shadow: 0 0 15px var(--color-volcano-orange); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(255, 140, 66, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0); } }

/* Styles pour le jeu du volcanologue */
#volcanologue-game-page { background: #2c3e50; }
#game-container { background: #34495e; border: 4px solid #ecf0f1; }
#player { background: #ffd700; box-shadow: 0 0 10px #ffd700; }
.lava-rock { background: #e74c3c; box-shadow: 0 0 10px #e74c3c; }
.gas-cloud { background: #95a5a6; opacity: 0.8; box-shadow: 0 0 10px #95a5a6; }
.crystal { background: #3498db; box-shadow: 0 0 15px #3498db; animation: pulse 1.5s infinite; }
.volcano-path { background: #7f8c8d; }

#feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#feedback-overlay.hidden {
    display: none !important;
}

#feedback-box {
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.9), rgba(255, 107, 53, 0.8));
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    transform: scale(0.9);
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    max-width: 250px;
    min-width: 200px;
}

#feedback-overlay:not(.hidden) #feedback-box {
    transform: scale(1);
}

#feedback-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

#feedback-text {
    font-size: 1.1rem;
    margin-top: 8px;
    color: white;
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}


.hidden {
    display: none;
}

/* Styles pour le jeu des bulles */
#bubble-game-page {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-image: url('images/fond de page.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#bubblesContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bubble {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.2) 60%, rgba(255,255,255,0) 100%);
}

.bubble.red {
    background-color: rgba(255, 0, 0, 0.6);
}

.bubble.orange {
    background-color: rgba(255, 165, 0, 0.6);
}

.bubble:hover {
    transform: scale(1.1);
}

.bubble-shine {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 20%;
    height: 20%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.bubble-eyes {
    position: absolute;
    top: 30%;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.bubble-eye {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: relative;
}

.bubble-pupil {
    width: 6px;
    height: 6px;
    background: black;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

.bubble-smile {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

#game-interface {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 10px;
}

.game-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #ff6347;
    backdrop-filter: blur(10px);
    color: white;
    max-width: 90vw;
    max-height: 90vh;
    box-sizing: border-box;
}

.hidden {
    display: none;
}

/* STYLES POUR LE JEU DES BULLES */
.bubble-game-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    height: calc(100vh - 80px);
    max-height: 690px;
    padding: var(--space-16);
    border-radius: 15px;
    overflow: hidden;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95));
    border: 3px solid var(--color-volcano-orange);
    border-radius: 20px;
    margin-bottom: var(--space-16);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.game-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
}

.stat:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 107, 53, 0.6);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-volcano-orange);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

.stat-value.updated {
    animation: scoreUpdate 0.6s ease;
}

@keyframes scoreUpdate {
    0% { transform: scale(1); color: var(--color-volcano-orange); }
    50% { transform: scale(1.2); color: #FFD700; }
    100% { transform: scale(1); color: var(--color-volcano-orange); }
}

.game-area {
    position: relative;
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid #ff6347;
    border-radius: 15px;
    overflow: hidden;
    min-height: 420px;
    max-height: 520px;
    backdrop-filter: blur(2px);
}

.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.volcano {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 80px;
    z-index: 1;
}

.volcano-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #2c1810, #8B4513);
    border-radius: 50% 50% 0 0;
    position: relative;
    border: 2px solid #1a0f08;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
}

.volcano-crater {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    background: #4a0000;
    border-radius: 50%;
    border: 2px solid #1a0f08;
    box-shadow: inset 0 0 10px rgba(255, 69, 0, 0.8);
}

.volcano-crater-inner {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 12px;
    background: radial-gradient(circle, #FF4500, #8B0000);
    border-radius: 50%;
    animation: lavaGlow 2s ease-in-out infinite alternate;
}

@keyframes lavaGlow {
    0% { box-shadow: 0 0 10px #FF4500; }
    100% { box-shadow: 0 0 20px #FF6347, 0 0 30px #FF4500; }
}

#bubble-game-page .game-screen {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1000 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    transform: none !important;
}

#bubble-game-page .game-screen.hidden {
    display: none !important;
}

#bubble-game-page .screen-content {
    text-align: center !important;
    padding: 32px !important;
    background: rgba(0, 0, 0, 0.9) !important;
    border: 3px solid #ff6347 !important;
    border-radius: 15px !important;
    box-shadow: 0 0 30px rgba(255, 99, 71, 0.8) !important;
    max-width: 500px !important;
    width: 90% !important;
    backdrop-filter: blur(10px) !important;
    margin: auto !important;
    position: relative !important;
    z-index: 1001 !important;
}

#bubble-game-page .screen-content h3 {
    color: #ff6347 !important;
    margin-bottom: var(--space-16) !important;
    font-size: 24px !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

#bubble-game-page .screen-text {
    color: #ffffff !important;
    margin-bottom: 12px !important;
    font-size: 18px !important;
    line-height: 1.4 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

#bubble-game-page .screen-instruction {
    color: #ff6347 !important;
    font-style: italic !important;
    margin-bottom: 24px !important;
    font-size: 16px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

#bubble-game-page .highlight-score {
    color: #ff6347 !important;
    font-weight: bold !important;
    font-size: 1.2em !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

/* Boutons spécifiques au jeu de bulles */
#bubble-game-page .btn {
    position: relative !important;
    display: inline-block !important;
    padding: 14px 28px !important;
    border: none !important;
    border-radius: 50px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    background: #ff6347 !important;
    color: white !important;
    margin-top: 20px !important;
    z-index: 1002 !important;
}

#bubble-game-page .btn:hover {
    background: #ff4500 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(255, 100, 80, 0.4) !important;
}

/* Notification de niveau */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #ff6347;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    z-index: 2000;
    color: white;
    box-shadow: 0 0 50px rgba(255, 99, 71, 0.8);
    animation: levelUpAppear 0.5s ease-out;
}

.level-up-notification h2 {
    color: #ff6347;
    font-size: 2.5rem;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.level-up-notification p {
    font-size: 1.2rem;
    margin: 0;
    color: #ffffff;
}

.level-up-notification.fade-out {
    animation: levelUpFadeOut 0.5s ease-in forwards;
}

@keyframes levelUpAppear {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes levelUpFadeOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

/* Bulles améliorées */
.bubble {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    z-index: 5;
    transition: transform 0.2s ease, opacity 0.15s ease;
    animation: bubbleFloat 0.5s ease-out;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes bubbleFloat {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.bubble:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}

.bubble:active,
.bubble:focus {
    transform: scale(0.85);
    filter: brightness(1.3);
}

/* Animation pour les bulles qui éclatent */
.bubble.popping {
    animation: bubblePop 0.3s ease-out forwards;
}

@keyframes bubblePop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.bubble.red {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 99, 71, 0.9));
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.8);
    border: 2px solid rgba(255, 69, 0, 0.6);
}

.bubble.orange {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 165, 0, 0.9));
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.8);
    border: 2px solid rgba(255, 140, 0, 0.6);
}

.bubble-shine {
    position: absolute;
    top: 15%;
    left: 25%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    filter: blur(2px);
}

.bubble-eyes {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.bubble-eye {
    width: 8px;
    height: 8px;
    background: black;
    border-radius: 50%;
    position: relative;
}

.bubble-pupil {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
}

.bubble-smile {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    border-bottom: 2px solid black;
    border-radius: 0 0 20px 20px;
}

/* Responsive pour mobiles */
@media (max-width: 768px) {
    .bubble-game-content {
        height: calc(100vh - 60px) !important;
        max-height: 590px !important;
        padding: 10px !important;
    }
    
    .game-area {
        min-height: 360px !important;
        max-height: 460px !important;
    }
    
    .game-stats {
        gap: 16px;
        padding: 14px 18px;
        flex-wrap: wrap;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .bubble {
        width: 45px;
        height: 45px;
        touch-action: manipulation;
    }
    
    .volcano {
        width: 100px;
        height: 50px;
    }
    
    #bubble-game-page .screen-content {
        padding: 20px !important;
        width: 95% !important;
        max-width: 350px !important;
    }
    
    #bubble-game-page .screen-content h3 {
        font-size: 20px !important;
    }
    
    #bubble-game-page .screen-text {
        font-size: 16px !important;
    }
    
    #bubble-game-page .screen-instruction {
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .bubble-game-content {
        height: calc(100vh - 40px) !important;
        max-height: 540px !important;
        padding: 8px !important;
    }
    
    .game-area {
        min-height: 320px !important;
        max-height: 420px !important;
    }
    
    .game-stats {
        gap: 8px;
        padding: 12px 16px;
        flex-direction: row;
        justify-content: space-around;
    }
    
    .stat {
        padding: 6px 8px;
    }
    
    .stat {
        min-width: 60px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .bubble {
        width: 40px;
        height: 40px;
    }
    
    .volcano {
        width: 80px;
        height: 40px;
    }
}

/* STYLES POUR LE TAQUIN */
.taquin-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.selection-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    background: var(--color-dark-bg);
    border-radius: 15px;
    padding: 30px;
    border: 2px solid var(--color-volcano-orange);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.puzzle-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.puzzle-preview img {
    max-width: 250px;
    height: auto;
    border-radius: 12px;
    border: 3px solid var(--color-volcano-orange);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.difficulty-section {
    text-align: center;
    width: 100%;
}

.difficulty-section h3 {
    color: var(--color-volcano-orange);
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 12px 20px;
    border: 2px solid var(--color-volcano-orange);
    background: transparent;
    color: var(--color-volcano-orange);
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: var(--color-volcano-orange);
    color: white;
    transform: scale(1.05);
}

.difficulty-btn.active {
    background: var(--color-volcano-orange);
    color: white;
    box-shadow: 0 0 15px rgba(255, 140, 66, 0.5);
}

.taquin-cta-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.taquin-cta-container .btn {
    font-size: 1.2rem;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}

/* Écran de victoire du taquin */
.win-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--color-dark-bg);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid var(--color-volcano-orange);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    color: white;
    z-index: 1000;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
}

.win-screen.hidden {
    display: none;
}

.win-screen h2 {
    color: var(--color-volcano-orange);
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.win-screen p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.win-stats {
    margin: 15px 0;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 140, 66, 0.3);
    width: 100%;
}

.win-stats p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: white;
}

.win-screen .taquin-cta-container .btn {
    font-size: 1rem;
    padding: 12px 24px;
}

/* Responsive pour le taquin */
@media (max-width: 768px) {
    .puzzle-preview img {
        max-width: 200px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-btn {
        width: 200px;
    }
    
    .selection-screen {
        padding: 20px;
        gap: 20px;
    }
    
    .win-screen {
        max-width: 350px;
        padding: 20px;
    }
    
    .win-screen h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .puzzle-preview img {
        max-width: 150px;
    }
    
    .taquin-content {
        padding: 10px;
    }
    
    .selection-screen {
        padding: 15px;
    }
    
    .difficulty-section h3 {
        font-size: 1.2rem;
    }
    
    .win-screen {
        max-width: 300px;
        padding: 15px;
    }
    
    .win-screen h2 {
        font-size: 1.4rem;
    }
    
    .win-screen p {
        font-size: 0.9rem;
    }
    
    .win-stats {
        padding: 12px;
    }
}

/* STYLES POUR LE JEU TAQUIN */
#taquin-puzzle-container {
    position: relative;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.2);
    border: 3px solid var(--color-volcano-orange);
    border-radius: 10px;
    overflow: hidden;
}

.puzzle-piece {
    position: absolute;
    border: 2px solid rgba(255, 140, 66, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

.puzzle-piece:hover {
    border-color: var(--color-volcano-orange);
    box-shadow: 0 0 10px rgba(255, 140, 66, 0.6);
    transform: scale(1.02);
}

.puzzle-piece:active {
    transform: scale(0.98);
}

/* Styles pour l'écran de jeu du taquin */
.taquin-game-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('images/fond de page.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header du jeu taquin responsive */
.taquin-game-screen .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* Container du puzzle responsive */
#taquin-puzzle-container {
    position: relative;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.2);
    border: 3px solid var(--color-volcano-orange);
    border-radius: 10px;
    overflow: hidden;
    max-width: 90vw;
    max-height: 60vh;
    flex-shrink: 0;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Pièces du puzzle optimisées pour le tactile */
.puzzle-piece {
    position: absolute;
    border: 2px solid rgba(255, 140, 66, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    background-repeat: no-repeat;
    box-sizing: border-box;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.puzzle-piece:hover {
    border-color: var(--color-volcano-orange);
    box-shadow: 0 0 10px rgba(255, 140, 66, 0.6);
    transform: scale(1.02);
}

.puzzle-piece:active {
    transform: scale(0.98);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* Contrôles du jeu responsive */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 10px;
}

.control-btn {
    background: linear-gradient(135deg, var(--color-volcano-red), var(--color-volcano-orange));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.6);
}

/* RESPONSIVE DESIGN POUR DIFFÉRENTES TAILLES D'ÉCRANS */

/* Smartphones en portrait (320px - 480px) */
@media (max-width: 480px) and (orientation: portrait) {
    .taquin-game-screen {
        padding: 10px;
    }
    
    .taquin-game-screen .game-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
        padding: 8px;
    }
    
    .taquin-stats {
        justify-content: center;
        gap: 8px;
    }
    
    #taquin-puzzle-container {
        width: min(85vw, 85vh);
        height: min(85vw, 85vh);
        margin: 10px auto;
        max-height: 50vh;
    }
    
    .control-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .puzzle-piece {
        border-width: 1px;
    }
}

/* Smartphones en paysage (480px - 768px) */
@media (max-width: 768px) and (orientation: landscape) {
    .taquin-game-screen {
        padding: 8px;
    }
    
    .taquin-game-screen .game-header {
        margin-bottom: 10px;
        padding: 6px;
    }
    
    #taquin-puzzle-container {
        width: min(60vw, 70vh);
        height: min(60vw, 70vh);
        margin: 8px auto;
        max-height: 65vh;
    }
    
    .taquin-stats {
        gap: 12px;
    }
    
    .stat-card {
        padding: 10px 15px;
        min-width: 110px;
    }
    
    .stat-icon {
        font-size: 1.8em;
    }
    
    .control-btn {
        padding: 8px 14px;
        font-size: 14px;
        min-width: 90px;
    }
}

/* Tablettes en portrait (768px - 1024px) */
@media (min-width: 481px) and (max-width: 1024px) and (orientation: portrait) {
    #taquin-puzzle-container {
        width: min(70vw, 60vh);
        height: min(70vw, 60vh);
        margin: 15px auto;
        max-height: 55vh;
    }
    
    .taquin-stats {
        gap: 18px;
    }
    
    .stat-card {
        padding: 14px 18px;
        min-width: 130px;
    }
    
    .control-btn {
        padding: 14px 24px;
        font-size: 16px;
        min-width: 140px;
    }
}

/* Tablettes en paysage (768px - 1024px) */
@media (min-width: 481px) and (max-width: 1024px) and (orientation: landscape) {
    .taquin-game-screen {
        padding: 15px;
    }
    
    #taquin-puzzle-container {
        width: min(50vw, 70vh);
        height: min(50vw, 70vh);
        margin: 15px auto;
        max-height: 65vh;
    }
    
    .taquin-stats {
        gap: 20px;
    }
    
    .stat-card {
        padding: 16px 22px;
        min-width: 150px;
    }
    
    .control-btn {
        padding: 16px 28px;
        font-size: 18px;
        min-width: 160px;
    }
}

/* Grands écrans et desktop (1024px+) */
@media (min-width: 1025px) {
    #taquin-puzzle-container {
        width: min(500px, 50vh);
        height: min(500px, 50vh);
        margin: 20px auto;
        max-height: 60vh;
    }
    
    .taquin-stats {
        gap: 25px;
    }
    
    .stat-card {
        padding: 18px 25px;
        min-width: 160px;
    }
    
    .control-btn {
        padding: 18px 32px;
        font-size: 18px;
        min-width: 180px;
    }
}

/* Optimisations pour écrans très petits */
@media (max-width: 320px) {
    .taquin-game-screen {
        padding: 5px;
    }
    
    #taquin-puzzle-container {
        width: 95vw;
        height: 95vw;
        max-height: 45vh;
        margin: 5px auto;
    }
    
    .stat-card {
        padding: 8px 12px;
        min-width: 90px;
        gap: 8px;
    }
    
    .stat-icon {
        font-size: 1.5em;
    }
    
    .stat-value {
        font-size: 1.4em;
    }
    
    .stat-label {
        font-size: 0.7em;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 80px;
    }
}

.taquin-game-screen.hidden {
    display: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: var(--color-dark-bg);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--color-volcano-orange);
}

.game-info {
    display: flex;
    gap: 20px;
    color: white;
    font-weight: 600;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.control-btn {
    padding: 10px 20px;
    background: var(--color-volcano-orange);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--color-volcano-red);
    transform: scale(1.05);
}

.back-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--color-volcano-orange);
    border: 2px solid var(--color-volcano-orange);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--color-volcano-orange);
    color: white;
}

/* Responsive pour le jeu taquin */
@media (max-width: 768px) {
    .taquin-game-screen {
        padding: 15px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-info {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 200px;
    }
}

/* Styles pour le jeu du volcanologue */
.volcanologue-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.game-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.game-board-volcanologue {
    position: relative;
    width: min(75vw, 800px);
    height: min(70vh, 600px);
    background: linear-gradient(180deg, #87CEEB 0%, #8B4513 30%, #FF4500 100%);
    border-radius: 15px;
    border: 3px solid var(--color-volcano-orange);
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    flex: 1;
    /* Assurer que le plateau est visible sur tablette */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 400px;
}

.player-volcanologue {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid #FFA500;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.finish-line {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 40px;
    background: #32CD32;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid #228B22;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.obstacle {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    z-index: 5;
    animation: pulse 2s infinite;
}

.obstacle.lava-rock {
    background: #FF6347;
    border-color: #FF4500;
}

.obstacle.gas-cloud {
    background: #D3D3D3;
    border-color: #A9A9A9;
}

.obstacle.crystal {
    background: #E6E6FA;
    border-color: #9370DB;
    animation: sparkle 1.5s infinite;
}

.volcano-path {
    position: absolute;
    width: 80px;
    height: 30px;
    background: #8B4513;
    border-radius: 15px;
    border: 2px solid #654321;
    z-index: 3;
}

.message-volcanologue {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--color-volcano-orange);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-dark-bg);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid var(--color-volcano-orange);
    max-width: 500px;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95));
    padding: 20px;
    border-radius: 15px;
    border: 3px solid var(--color-volcano-orange);
    min-width: 160px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.controls-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-volcano-orange);
    text-align: center;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 120px;
}

.controls-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.controls .control-btn:nth-child(1) {
    /* Bouton UP */
}

.controls .control-btn:nth-child(2),
.controls .control-btn:nth-child(3) {
    /* Boutons LEFT et RIGHT dans la même rangée */
}

.controls .control-btn:nth-child(4) {
    /* Bouton DOWN */
}

.controls .control-btn {
    width: 50px;
    height: 50px;
    border-radius: 0;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--color-volcano-orange), var(--color-volcano-red));
    border: 2px solid #FFF;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.2);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.controls .control-btn:hover {
    background: linear-gradient(145deg, var(--color-volcano-red), #d63031);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.2);
}

.controls .control-btn:active {
    background: linear-gradient(145deg, #d63031, var(--color-volcano-red));
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.2);
}

.restart-btn {
    margin-top: 15px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 25px;
}

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

@keyframes sparkle {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Overlay de victoire */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
}

.victory-overlay.hidden {
    display: none;
}

.victory-content {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 3px solid #FF6B35;
    animation: bounceIn 0.8s ease-out;
    max-width: 400px;
    margin: 20px;
}

.victory-trophy {
    font-size: 80px;
    animation: trophyBounce 2s infinite;
    margin-bottom: 20px;
    display: block;
}

.victory-title {
    color: #2c3e50;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.victory-message {
    color: #2c3e50;
    font-size: 18px;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.victory-stars {
    font-size: 40px;
    margin: 20px 0;
    animation: sparkleStars 1.5s infinite;
}

.victory-btn {
    font-size: 18px;
    padding: 15px 30px;
    margin-top: 20px;
    border-radius: 30px;
    border: none;
    background: var(--color-volcano-red);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.victory-btn:hover {
    background: #d63031;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% { 
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1) translateY(0);
    }
    100% { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes trophyBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    40% {
        transform: translateY(-20px) rotate(5deg);
    }
    60% {
        transform: translateY(-10px) rotate(-5deg);
    }
}

@keyframes sparkleStars {
    0%, 100% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Responsive pour le jeu du volcanologue */
/* Tablettes - améliorations spécifiques pour iPad et tablettes Android */
@media (min-width: 768px) and (max-width: 1024px) {
    .game-board-volcanologue {
        width: min(85vw, 750px);
        height: min(65vh, 550px);
        min-height: 450px !important;
        /* Force l'affichage même avec d'autres styles */
        display: block !important;
        position: relative !important;
    }
    
    .volcanologue-content {
        padding: 10px;
    }
    
    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .controls-panel {
        width: 100%;
        max-width: 400px;
    }
    
    .player-volcanologue {
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
    
    .obstacle, .crystal, .lava-rock, .gas-cloud {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }
    
    .volcano-path {
        width: 85px;
        height: 65px;
    }
}

@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .game-board-volcanologue {
        width: min(90vw, 700px);
        height: min(60vh, 500px);
    }
    
    .controls-panel {
        width: auto;
        min-width: auto;
    }
    
    .controls {
        width: 108px;
        gap: 8px;
    }
    
    .controls-row {
        gap: 8px;
    }
    
    .controls .control-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .game-board-volcanologue {
        width: 95vw;
        height: 50vh;
    }
    
    .player-volcanologue,
    .obstacle {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .finish-line {
        width: 50px;
        height: 35px;
        font-size: 18px;
    }
    
    .message-volcanologue {
        font-size: 16px;
        padding: 10px;
    }
    
    .controls-panel {
        padding: 20px;
    }
    
    .controls {
        width: 94px;
        gap: 6px;
    }
    
    .controls-row {
        gap: 6px;
    }
    
    .controls .control-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .controls-title {
        font-size: 16px;
    }
}
