/* ==========================================================================
   MISSION SOLIDES - GABARIT EXACT SYGNEX KIDS (Collection Dizaines)
   Création : SYGNEX Production
   ========================================================================== */

/* 0. RÉINITIALISATION DU DOCUMENT IFRAME (Corrige les marges blanches et scrollbars) */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* Force le fond noir dans l'iframe */
    overflow: hidden; /* Supprime totalement les barres de défilement de l'iframe */
    font-family: 'Nunito', sans-serif;
}

/* 1. VARIABLES D'ENVIRONNEMENT (Charte SYGNEX Premium) */
#sygnex-solides-game {
    --sygnex-gold: #AD843E;
    --sygnex-gold-light: #C99A4A;
    --bg-main: #000000;
    --bg-panel: #0D0D0D; 
    --bg-card: #111111;
    --text-main: #FFFFFF;
    --text-muted: #777777;
    --border-dark: #252525;
    
    --success-color: #4CAF50;
    --error-color: #FF9800;

    color: var(--text-main);
    width: 100%;
    height: 100%; /* S'adapte à 100% de la hauteur de l'iframe sans forcer le scroll */
    overflow: hidden; /* Interdiction stricte de générer une barre de défilement interne */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 15px; /* Espace autour du panneau central */
    box-sizing: border-box;
}

#sygnex-solides-game * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

/* 2. LE PANNEAU CENTRAL (Le cœur de l'interface) */
#sygnex-solides-game .game-wrapper {
    width: 100%;
    max-width: 700px; /* Largeur maîtrisée comme Mission Dizaines */
    background-color: var(--bg-panel);
    border: 1px solid var(--sygnex-gold);
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* 3. EN-TÊTE DU JEU */
#sygnex-solides-game .game-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Sélecteur de langues compact */
#sygnex-solides-game .lang-group {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
}

#sygnex-solides-game .lang-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 3px;
    text-transform: uppercase;
    transition: all 0.2s;
}

#sygnex-solides-game .lang-btn:hover, 
#sygnex-solides-game .lang-btn.active {
    color: var(--sygnex-gold);
    border-color: var(--sygnex-gold);
}

/* Titres */
#sygnex-solides-game .brand-subtitle {
    color: var(--sygnex-gold);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

#sygnex-solides-game .main-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-main);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

#sygnex-solides-game .sub-title {
    font-size: 1rem;
    color: var(--sygnex-gold);
    font-weight: 400;
    margin-bottom: 30px;
}

/* 4. BARRE DE STATUT ET PROGRESSION */
#sygnex-solides-game .status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 0 5px;
}

#sygnex-solides-game .status-bar .center-item {
    flex: 1;
    text-align: center;
}

#sygnex-solides-game .btn-sound {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

#sygnex-solides-game .btn-sound:hover {
    color: var(--sygnex-gold);
    border-color: var(--sygnex-gold);
}

#sygnex-solides-game .progress-track {
    width: 100%;
    height: 4px;
    background-color: var(--border-dark);
    border-radius: 2px;
    position: relative;
}

#sygnex-solides-game #progress-fill {
    height: 100%;
    background-color: var(--sygnex-gold);
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

/* Séparateur design */
#sygnex-solides-game .header-separator {
    width: 100%;
    height: 1px;
    background-color: var(--sygnex-gold);
    margin: 30px 0;
    opacity: 0.5;
}

/* 5. GESTION DES ÉCRANS */
#sygnex-solides-game .screen {
    display: none;
    animation: fadeIn 0.4s ease;
}
#sygnex-solides-game .screen.active {
    display: block;
}

/* Bouton "Comment Jouer" */
#sygnex-solides-game .menu-actions-top {
    text-align: center;
    margin-bottom: 30px;
}

#sygnex-solides-game .btn-how-to {
    background: transparent;
    color: var(--sygnex-gold);
    border: 1px solid var(--sygnex-gold);
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
#sygnex-solides-game .btn-how-to:hover {
    background: rgba(173, 132, 62, 0.1);
}

/* 6. GRILLE DES NIVEAUX (Les 3 blocs) */
#sygnex-solides-game .levels-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

#sygnex-solides-game .level-card {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-dark);
    padding: 25px 15px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#sygnex-solides-game .level-card h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 900;
}

#sygnex-solides-game .level-card p {
    font-size: 0.75rem;
    color: var(--sygnex-gold);
    margin-bottom: 15px;
    text-transform: uppercase;
}

#sygnex-solides-game .level-card .stars,
#sygnex-solides-game .level-card .status-icon {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

#sygnex-solides-game .level-card.unlocked {
    border-color: var(--sygnex-gold);
    cursor: pointer;
}

#sygnex-solides-game .level-card.unlocked:hover {
    background-color: #1A1A1A;
}

#sygnex-solides-game .level-card.locked {
    border-color: var(--border-dark);
    opacity: 0.6;
    cursor: not-allowed;
}

#sygnex-solides-game .level-card.locked .status-icon {
    color: var(--sygnex-gold);
}

/* 7. BOUTON RESET (Tout en bas) */
#sygnex-solides-game .menu-actions-bottom {
    text-align: center;
    margin-top: 30px;
}

#sygnex-solides-game .btn-text {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

#sygnex-solides-game .btn-text:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* 8. ÉCRAN DE JEU EN COURS */
#sygnex-solides-game .play-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

#sygnex-solides-game .btn-pill {
    background: transparent;
    color: var(--sygnex-gold);
    border: 1px solid var(--sygnex-gold);
    padding: 4px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

#sygnex-solides-game .btn-pill.disabled {
    cursor: default;
    border-color: var(--border-dark);
    color: var(--text-muted);
}

/* Correction de l'alignement de la question */
#sygnex-solides-game .question-container {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    width: 100%;
}

#sygnex-solides-game .question-container h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

#sygnex-solides-game .btn-icon-small {
    background: transparent;
    border: none;
    color: var(--sygnex-gold);
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    padding: 5px;
}

/* Boîte principale d'interaction */
#sygnex-solides-game .game-area-box {
    border: 1px dashed var(--sygnex-gold);
    border-radius: 8px;
    padding: 30px;
    background: var(--bg-card);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#sygnex-solides-game .answers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

#sygnex-solides-game .answer-card {
    background: transparent;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 15px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-main);
    font-size: 3rem; 
    cursor: pointer;
    transition: all 0.2s;
}

#sygnex-solides-game .answer-card:hover {
    border-color: var(--sygnex-gold);
    background: rgba(173, 132, 62, 0.05);
}

#sygnex-solides-game .answer-card.correct {
    border-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
    animation: bounce 0.5s;
}

#sygnex-solides-game .answer-card.wrong {
    border-color: var(--error-color);
    background: rgba(255, 152, 0, 0.1);
    opacity: 0.5;
    animation: shake 0.4s;
}

/* Feedback (Bravo / Essaie encore) - Positionné en bas du cadre noir pour ne rien cacher */
#sygnex-solides-game .feedback {
    position: absolute;
    bottom: 20px; 
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 20px 40px;
    border-radius: 8px;
    border: 1px solid var(--sygnex-gold);
    font-size: 1.5rem;
    font-weight: 700;
    z-index: 100;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
    width: max-content;
}

#sygnex-solides-game .feedback.success { color: var(--success-color); border-color: var(--success-color); }
#sygnex-solides-game .feedback.error { color: var(--error-color); border-color: var(--error-color); }

/* 9. MODALES */
#sygnex-solides-game .modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#sygnex-solides-game .modal.hidden { display: none; }

#sygnex-solides-game .modal-content {
    background: var(--bg-panel);
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--sygnex-gold);
    color: var(--text-main);
}

/* Utilitaires */
.text-center { text-align: center; }

/* 10. ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 
    0%, 100% { transform: scale(1); } 
    50% { transform: scale(1.1); } 
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 11. RESPONSIVE (Tablettes & Mobiles) */
@media (max-width: 650px) {
    #sygnex-solides-game { padding: 15px 5px; }
    #sygnex-solides-game .game-wrapper { padding: 25px 15px; border-radius: 8px; border-left: none; border-right: none; }
    #sygnex-solides-game .levels-grid { flex-direction: column; align-items: center; }
    #sygnex-solides-game .level-card { width: 100%; max-width: 300px; margin-bottom: 10px; }
    #sygnex-solides-game .status-bar { flex-direction: column; gap: 8px; }
    #sygnex-solides-game .play-header { flex-direction: column; gap: 10px; align-items: center; }
}