@import url('../../../_SharedResources/theme_global.css');

/* ======================================================= */
/* CHARTE GRAPHIQUE & DISPOSITION RESPONSIVE (ZERO SCROLL) */
/* ======================================================= */

html, body {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Page d'accueil / Hub de quête : Défilement vertical naturel autorisé */
html:has(body.hub-body),
body.hub-body {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body {
    background-image: url('img_fond.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #e0e6ed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
}

/* --- Conteneur Simulation Responsive Grid --- */
#conteneur_simulation {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 14px;
    padding: 12px 16px;
    width: 100%;
    max-width: 1550px;
    margin: 0 auto;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Colonne Gauche (Canvas + Contrôles) */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* Colonne Droite (Cadre Unique Bilan & Formules) */
.right-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* --- Fenêtre Canvas Compacte --- */
#fenetre1 {
    min-height: 0 !important;
    height: auto;
    flex-shrink: 0;
}

.canvas_container {
    position: relative;
    width: 100%;
    height: clamp(240px, 31vh, 350px);
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(8, 12, 22, 0.92);
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* Fenêtres de contenu */
.fenetre-contenu, .fenetre {
    background: linear-gradient(145deg, rgba(15, 30, 56, 0.88), rgba(6, 12, 28, 0.95));
    border: 1px solid var(--border-gold, rgba(255, 215, 0, 0.3));
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(0, 0, 0, 0.3);
    padding: 12px 14px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

/* Bandeau Supérieur */
#banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: linear-gradient(180deg, rgba(10, 20, 42, 0.96) 0%, rgba(5, 10, 24, 0.92) 100%);
    border-bottom: 2px solid gold;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
    gap: 12px;
}

.banner-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#main_title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

#sub_title {
    font-size: 0.85rem;
    color: #ffd700;
    opacity: 0.9;
}

/* Conteneur des Boutons de Modes */
.modes-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mode-btn {
    background: rgba(20, 35, 65, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #eee;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mode-btn:hover:not(:disabled):not(.locked) {
    background: rgba(255, 215, 0, 0.25);
    border-color: gold;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(243, 156, 18, 0.45));
    border: 2px solid gold;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
}

.mode-btn.locked, .mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(20, 25, 35, 0.5);
    color: #888;
}

/* Navigation Droite Bandeau */
.banner-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(15, 30, 60, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.45);
    color: gold;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.home-btn:hover {
    background: rgba(255, 215, 0, 0.25);
    transform: scale(1.08);
}

.step-badge-current {
    font-size: 0.82rem;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 6px;
    color: gold;
    font-weight: bold;
}

.step-nav-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: 1px solid #64ff96;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 12px rgba(100, 255, 150, 0.4);
}

.step-nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 18px rgba(100, 255, 150, 0.7);
}

.step-prev-btn {
    padding: 6px 12px;
    background: rgba(15, 30, 60, 0.85);
    color: #cbd5e1;
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.step-prev-btn:hover {
    border-color: gold;
    color: #fff;
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
    transform: scale(1.05);
}

/* Jauge Chrono Gamifiée */
#chrono_bar_container {
    position: relative;
    width: 100%;
    height: 32px;
    background: rgba(10, 15, 28, 0.95);
    border-bottom: 1px solid gold;
    overflow: hidden;
    display: flex;
    align-items: center;
}

#chrono_bar_fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
    opacity: 0.45;
    transition: width 0.1s linear;
}

#chrono_bar_content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 20px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Badges & Titres de fenêtres */
.fenetre_titre_wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.fenetre_titre {
    font-size: 1.02rem;
    font-weight: 700;
    color: gold;
    letter-spacing: 0.3px;
}

.ctrl-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    gap: 8px;
    flex-wrap: nowrap;
}

.ctrl-title-wrapper .fenetre_titre {
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ctrl-badges-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.mode-badge {
    font-size: 0.78rem;
    background: rgba(52, 152, 219, 0.22);
    color: #74b9ff;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(52, 152, 219, 0.45);
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.score-badge {
    font-size: 0.80rem;
    background: rgba(255, 215, 0, 0.18);
    color: gold;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid gold;
    font-weight: 800;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.25);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

/* Zone Se Tester & Chrono (Zéro Scroll compact) */
#fenetre-controles {
    padding: 8px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

#fenetre-controles::-webkit-scrollbar {
    width: 5px;
}
#fenetre-controles::-webkit-scrollbar-track {
    background: transparent;
}
#fenetre-controles::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}
#fenetre-controles::-webkit-scrollbar-thumb:hover {
    background: gold;
}

#question_box {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: rgba(8, 18, 38, 0.85);
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    margin-bottom: 4px;
    line-height: 1.32;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.quiz-opt-btn {
    background: rgba(18, 34, 60, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e6ed;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    line-height: 1.25;
}

.quiz-opt-btn:hover:not(:disabled) {
    border-color: gold;
    background: rgba(52, 152, 219, 0.25);
    transform: translateX(3px);
}

.quiz-opt-btn.selected {
    background: rgba(52, 152, 219, 0.4) !important;
    border: 2px solid gold !important;
    color: #ffffff !important;
    font-weight: bold;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.quiz-opt-btn.correct {
    background: rgba(39, 174, 96, 0.4) !important;
    border-color: #27ae60 !important;
    color: #fff !important;
    font-weight: bold;
}

.quiz-opt-btn.wrong {
    background: rgba(192, 57, 43, 0.4) !important;
    border-color: #c0392b !important;
    color: #fff !important;
}

#btn_valider, #btn_suivant {
    padding: 7px 12px !important;
    font-size: 0.90rem !important;
}

/* Champs de saisie */
.control_element {
    background: rgba(10, 20, 40, 0.9);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: gold;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
}

.control_element:focus {
    border-color: gold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.control_row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Boutons d'action */
.step-button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.premium-btn.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: 1px solid #64ff96;
    box-shadow: 0 0 14px rgba(46, 204, 113, 0.35);
}

.premium-btn.success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

.premium-btn.primary {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border: 1px solid #74b9ff;
    box-shadow: 0 0 14px rgba(52, 152, 219, 0.35);
}

.premium-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
}

/* Feedback message */
#feedback_msg {
    text-align: center;
    font-weight: 600;
    min-height: 22px;
    margin-top: 6px;
    font-size: 0.88rem;
    line-height: 1.35;
    padding: 4px 8px;
    border-radius: 6px;
}

#feedback_msg.success {
    background: rgba(39, 174, 96, 0.2);
    border: 1px solid rgba(100, 255, 150, 0.4);
    color: #64ff96;
}

#feedback_msg.error {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid rgba(255, 118, 117, 0.4);
    color: #ff7675;
}

/* Cadre Unique Droite : Bilan & Formules */
#fenetre-informations {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

#info_content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

#fenetre-controles {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.bilan-box {
    background: rgba(8, 18, 36, 0.85);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 8px;
    font-size: 0.86rem;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.bilan-box.active-phase-item {
    background: rgba(255, 215, 0, 0.12);
    border: 2px solid gold;
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
}

.bilan-box.completed-phase-item {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.5);
    color: #e0f2e9;
}

.bilan-box-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: gold;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bilan-box-title .status-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.tag-active {
    background: rgba(255, 215, 0, 0.3);
    color: gold;
    border: 1px solid gold;
}

.tag-done {
    background: rgba(39, 174, 96, 0.3);
    color: #64ff96;
    border: 1px solid #27ae60;
}

/* Boutons de Filtres Optiques (Étape 2) */
.filter-btn-c { color: #00ffff !important; border-color: rgba(0, 255, 255, 0.5) !important; }
.filter-btn-c:hover, .filter-btn-c.active { background: rgba(0, 255, 255, 0.25) !important; border-color: #00ffff !important; box-shadow: 0 0 10px rgba(0, 255, 255, 0.5); }

.filter-btn-m { color: #ff33cc !important; border-color: rgba(255, 51, 204, 0.5) !important; }
.filter-btn-m:hover, .filter-btn-m.active { background: rgba(255, 51, 204, 0.25) !important; border-color: #ff33cc !important; box-shadow: 0 0 10px rgba(255, 51, 204, 0.5); }

.filter-btn-y { color: #ffff00 !important; border-color: rgba(255, 255, 0, 0.5) !important; }
.filter-btn-y:hover, .filter-btn-y.active { background: rgba(255, 255, 0, 0.25) !important; border-color: #ffff00 !important; box-shadow: 0 0 10px rgba(255, 255, 0, 0.5); }

.filter-btn-r { color: #ff4757 !important; border-color: rgba(255, 71, 87, 0.5) !important; }
.filter-btn-r:hover, .filter-btn-r.active { background: rgba(255, 71, 87, 0.25) !important; border-color: #ff4757 !important; box-shadow: 0 0 10px rgba(255, 71, 87, 0.5); }

.filter-btn-g { color: #2ed573 !important; border-color: rgba(46, 213, 115, 0.5) !important; }
.filter-btn-g:hover, .filter-btn-g.active { background: rgba(46, 213, 115, 0.25) !important; border-color: #2ed573 !important; box-shadow: 0 0 10px rgba(46, 213, 115, 0.5); }

.filter-btn-b { color: #1e90ff !important; border-color: rgba(30, 144, 255, 0.5) !important; }
.filter-btn-b:hover, .filter-btn-b.active { background: rgba(30, 144, 255, 0.25) !important; border-color: #1e90ff !important; box-shadow: 0 0 10px rgba(30, 144, 255, 0.5); }

/* Sliders RVB Personnalisés */
.slider-red::-webkit-slider-thumb {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.8);
}
.slider-green::-webkit-slider-thumb {
    background: linear-gradient(135deg, #2ed573, #7bed9f);
    box-shadow: 0 0 10px rgba(46, 213, 115, 0.8);
}
.slider-blue::-webkit-slider-thumb {
    background: linear-gradient(135deg, #1e90ff, #70a1ff);
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.8);
}

/* Sliders standard */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 4px 0;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #f39c12);
    border: 2px solid #ffffff;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    cursor: pointer;
    transition: transform 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Bouton d'action dans la barre d'en-tête du Canvas */
.btn-canvas-action {
    background: rgba(15, 25, 48, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.45);
    color: gold;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-canvas-action:hover {
    background: rgba(255, 215, 0, 0.22);
    border-color: gold;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

/* Effet Magnétique & Lueur sur Valeurs Cibles Remarquables */
input[type=range].slider-key-snap {
    background: rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.65);
}

input[type=range].slider-key-snap::-webkit-slider-thumb {
    transform: scale(1.4) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 16px #ffd700, 0 0 8px #ffffff, 0 0 26px rgba(255, 215, 0, 0.95) !important;
    animation: pulse-thumb-gold 1.1s infinite alternate ease-in-out;
}

input[type=range].slider-key-snap::-moz-range-thumb {
    transform: scale(1.4) !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 16px #ffd700, 0 0 8px #ffffff, 0 0 26px rgba(255, 215, 0, 0.95) !important;
    animation: pulse-thumb-gold 1.1s infinite alternate ease-in-out;
}

@keyframes pulse-thumb-gold {
    0% {
        box-shadow: 0 0 10px #ffd700, 0 0 4px #ffffff;
    }
    100% {
        box-shadow: 0 0 22px #ffd700, 0 0 12px #ffffff, 0 0 32px rgba(255, 215, 0, 0.95);
    }
}

.value-key-glow {
    color: gold !important;
    font-weight: 900 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8), 0 0 16px rgba(255, 215, 0, 0.5);
    display: inline-block;
    animation: pulse-val-text 1.1s infinite alternate ease-in-out;
}

@keyframes pulse-val-text {
    0% { transform: scale(1); }
    100% { transform: scale(1.06); text-shadow: 0 0 12px gold, 0 0 20px #ffffff; }
}

/* Dropdown Menu Chrono */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 220px;
    padding: 6px 0;
    margin-top: 6px;
    background: rgba(10, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid gold;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dropdown-menu.show {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
}

.dropdown-item {
    background: transparent;
    color: #eee;
    border: none;
    padding: 9px 14px;
    text-align: left;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.dropdown-item:hover {
    background: rgba(255, 215, 0, 0.2);
    color: gold;
    padding-left: 18px;
}

/* Overlay WOW Célébration */
.wow-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(5, 12, 25, 0.92); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 99999; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.4s ease; 
    backdrop-filter: blur(8px); 
}

.wow-overlay.show { 
    opacity: 1; 
    pointer-events: auto; 
}

#wow_content { 
    text-align: center; 
    transform: scale(0.75); 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    background: linear-gradient(145deg, rgba(15, 30, 60, 0.95), rgba(8, 16, 32, 0.98)); 
    padding: 28px 36px; 
    border-radius: 20px; 
    border: 2px solid gold; 
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 10px 40px rgba(0, 0, 0, 0.9); 
    max-width: 580px; 
    width: 90%; 
    box-sizing: border-box;
}

.wow-overlay.show #wow_content { 
    transform: scale(1); 
}

.wow-title { 
    font-size: 2.1rem; 
    margin-bottom: 10px; 
    font-weight: bold;
    color: gold;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.wow-subtitle { 
    font-size: 1rem; 
    color: #EAEAEA; 
    margin-bottom: 22px; 
    line-height: 1.5; 
}

.wow-btn { 
    padding: 11px 26px; 
    font-size: 1.05rem; 
    font-weight: bold; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
}

.wow-btn:hover { 
    transform: scale(1.05); 
    box-shadow: 0 0 20px rgba(100, 255, 150, 0.6);
}

/* Hub Cards (index.html) */
.hub-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

.hub-card {
    background: linear-gradient(145deg, rgba(15, 32, 58, 0.9), rgba(0, 10, 30, 0.95));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.hub-card:hover:not(.locked-card) {
    transform: translateY(-6px);
    border-color: gold;
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.35);
}

.hub-card.locked-card {
    opacity: 0.55;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    filter: grayscale(0.5);
}

.hub-card-step {
    font-size: 0.8rem;
    font-weight: bold;
    color: gold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.hub-card-title {
    font-size: 1.25rem;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.hub-card-desc {
    font-size: 0.88rem;
    color: #b0bec5;
    line-height: 1.45;
    margin-bottom: 18px;
    flex-grow: 1;
}

.hub-card-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: bold;
    display: inline-block;
    align-self: center;
}

.status-unlocked {
    background: rgba(39, 174, 96, 0.25);
    color: #64ff96;
    border: 1px solid rgba(100, 255, 150, 0.4);
}

.status-locked {
    background: rgba(231, 76, 60, 0.2);
    color: #ff7675;
    border: 1px solid rgba(255, 118, 117, 0.4);
}

/* Pied de page standardisé */
#footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    background: rgba(5, 10, 20, 0.95);
    border-top: 1px solid rgba(255, 215, 0, 0.25);
    font-size: 0.8rem;
    color: #8899a6;
    flex-shrink: 0;
}

.dev-tools-footer {
    display: flex;
    gap: 6px;
}

.dev-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dev-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    color: gold;
    border-color: gold;
}

.dev-cheat {
    color: #e67e22;
    border-color: rgba(230, 126, 34, 0.4);
}

/* Adaptations écrans < 900px */
@media screen and (max-width: 900px) {
    html, body {
        height: auto;
        max-height: none;
        overflow-y: auto;
    }

    body {
        min-height: 100vh;
    }

    #conteneur_simulation {
        display: flex;
        flex-direction: column;
        padding: 8px;
        gap: 10px;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .left-column, .right-column {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    #fenetre-informations {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    #info_content {
        max-height: 400px;
        overflow-y: auto;
    }

    .canvas_container {
        height: 200px;
        min-height: 180px;
    }

    .banner-left #main_title {
        font-size: 1.05rem;
    }

    .banner-left #sub_title {
        font-size: 0.78rem;
    }

    #footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    #conteneur_simulation.bilan-hidden .left-column {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
    }

    #conteneur_simulation.bilan-hidden #fenetre1,
    #conteneur_simulation.bilan-hidden #fenetre-controles {
        height: auto !important;
        max-height: none !important;
    }

    #conteneur_simulation.bilan-hidden #fenetre1 .canvas_container {
        height: 220px !important;
        max-height: 220px !important;
    }
}

/* ======================================================= */
/* ======================================================= */
/* BILAN RÉTRACTABLE & MODE 2 COLONNES CÔTE À CÔTE         */
/* (Canvas à gauche, Contrôles & Questions à droite)       */
/* ======================================================= */
#conteneur_simulation.bilan-hidden {
    grid-template-columns: 1fr !important;
}

#conteneur_simulation.bilan-hidden .right-column {
    display: none !important;
}

#conteneur_simulation.bilan-hidden .left-column {
    display: grid !important;
    grid-template-columns: 1.15fr 1fr !important;
    gap: 14px !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#conteneur_simulation.bilan-hidden #fenetre1 {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

#conteneur_simulation.bilan-hidden #fenetre1 .canvas_container {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0 !important;
}

#conteneur_simulation.bilan-hidden #fenetre-controles {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
}

/* Bouton standardisé masquer/afficher le bilan (Design System Clemente) */
.btn-toggle-eye {
    background: rgba(20, 35, 60, 0.85);
    border: 1px solid var(--border-gold, rgba(255, 215, 0, 0.4));
    color: var(--gold, #ffd700);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    touch-action: manipulation;
}

.btn-toggle-eye:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: gold;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

/* Badge de phase standardisé dans l'en-tête des contrôles */
.phase-badge {
    font-size: 0.78rem;
    background: rgba(255, 215, 0, 0.2);
    color: gold;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 215, 0, 0.45);
    font-weight: 700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.2);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

/* Bouton pli/dépli du panneau droit */
.btn-collapse-panel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: gold;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-collapse-panel:hover {
    background: rgba(255, 215, 0, 0.25);
    border-color: gold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ======================================================= */
/* TOAST & ANIMATION DE DÉCOUVERTE DE COULEUR              */
/* ======================================================= */
.color-discovery-toast {
    position: fixed;
    bottom: 45px;
    right: 25px;
    background: linear-gradient(135deg, rgba(15, 30, 60, 0.95), rgba(8, 16, 32, 0.98));
    border: 2px solid gold;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 10000;
    pointer-events: none;
    transform: translateY(120px) scale(0.9);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(12px);
    max-width: 360px;
}

.color-discovery-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ======================================================= */
/* MODALE & GRILLE DES TROPHÉES DE COULEURS                */
/* ======================================================= */
.color-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 15px;
}

.color-modal-overlay.show {
    display: flex;
    animation: fadeIn 0.25s ease forwards;
}

.color-modal-content {
    background: linear-gradient(145deg, rgba(16, 32, 64, 0.98), rgba(8, 16, 32, 0.99));
    border: 2px solid gold;
    border-radius: 16px;
    max-width: 860px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 215, 0, 0.35);
}

.color-modal-top {
    flex-shrink: 0;
    padding: 16px 22px 12px 22px;
    background: rgba(12, 24, 48, 0.98);
    border-bottom: 1px solid rgba(255, 215, 0, 0.35);
    backdrop-filter: blur(10px);
}

.color-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.color-modal-title {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    font-weight: 800;
    color: gold;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.color-modal-subtitle {
    font-size: 0.84rem;
    color: #cbd5e1;
    line-height: 1.35;
}

.color-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.color-modal-close:hover {
    color: #ff7675;
    border-color: #ff7675;
    background: rgba(255, 118, 117, 0.2);
    transform: scale(1.05);
}

.color-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.4) transparent;
}

.color-modal-body::-webkit-scrollbar {
    width: 6px;
}

.color-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.color-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.35);
    border-radius: 4px;
}

.color-modal-body::-webkit-scrollbar-thumb:hover {
    background: gold;
}

.color-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.color-trophy-card {
    background: rgba(10, 20, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.25s ease;
}

.color-trophy-card.unlocked {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(145deg, rgba(20, 38, 72, 0.8), rgba(10, 20, 42, 0.9));
}

.color-trophy-card.unlocked:hover {
    transform: translateY(-3px);
    border-color: gold;
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.35);
}

.color-trophy-card.locked {
    opacity: 0.88;
    background: rgba(12, 18, 32, 0.85);
    border: 1px dashed rgba(255, 215, 0, 0.35);
}

.trophy-color-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-bottom: 8px;
}

.locked-dot {
    background: #333;
    border: 1px dashed #666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
}

.trophy-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: gold;
    margin-bottom: 3px;
}

.trophy-rgb {
    font-size: 0.74rem;
    color: #64ff96;
    font-family: monospace;
    margin-bottom: 4px;
}

.trophy-hint {
    font-size: 0.72rem;
    color: #aaa;
    line-height: 1.3;
}

/* ======================================================= */
/* TIROIR & VARIATEURS DE DENSITÉ CMJ (MODE LIBRE ÉTAPE 2)  */
/* ======================================================= */

.drawer-cmy {
    background: rgba(10, 18, 36, 0.88);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.cmy-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cmy-slider-label {
    width: 155px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.cmy-slider {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.15);
}

.cmy-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s;
}

.cmy-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-cyan::-webkit-slider-thumb {
    background: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.slider-magenta::-webkit-slider-thumb {
    background: #ff1ec8;
    box-shadow: 0 0 10px rgba(255, 30, 200, 0.8);
}

.slider-yellow::-webkit-slider-thumb {
    background: #fff01e;
    box-shadow: 0 0 10px rgba(255, 240, 30, 0.8);
}

.cmy-val-badge {
    width: 44px;
    text-align: right;
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: bold;
    color: #fff;
}

.preset-pills-container {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2px;
}

.preset-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.73rem;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-pill:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: gold;
    color: gold;
    transform: translateY(-1px);
}

/* ======================================================= */
/* MODAL POPUP & OVERLAY CELEBRATION (EFFET WOW)           */
/* ======================================================= */

.wow-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(5, 12, 25, 0.92); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 99999; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.4s ease; 
    backdrop-filter: blur(8px); 
}

.wow-overlay.show { 
    opacity: 1; 
    pointer-events: auto; 
}

#wow_content { 
    text-align: center; 
    transform: scale(0.75); 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    background: linear-gradient(145deg, rgba(15, 30, 60, 0.95), rgba(8, 16, 32, 0.98)); 
    padding: 30px 40px; 
    border-radius: 20px; 
    border: 2px solid gold; 
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 10px 40px rgba(0, 0, 0, 0.9); 
    max-width: 620px; 
    width: 90%; 
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.wow-overlay.show #wow_content { 
    transform: scale(1); 
}

.wow-title { 
    font-size: 2.2rem; 
    margin-bottom: 12px; 
    font-weight: bold;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.wow-subtitle { 
    font-size: 1.05rem; 
    color: #EAEAEA; 
    margin-bottom: 24px; 
    line-height: 1.5; 
}

.wow-btn { 
    -webkit-appearance: none; 
    appearance: none; 
    padding: 12px 28px; 
    font-size: 1.05rem; 
    font-weight: bold; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wow-btn:hover { 
    transform: scale(1.06); 
    box-shadow: 0 0 20px rgba(100, 255, 150, 0.6);
}

.wow-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: confettiFall 2.5s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

@keyframes wowPulse {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Boutons de presets d'image & galerie (Étape 3) */
.image-preset-btn {
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: bold;
    border-radius: 6px;
    background: rgba(15, 25, 48, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-preset-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: gold;
    color: #fff;
    transform: translateY(-1px);
}

.image-preset-btn.active {
    background: rgba(255, 215, 0, 0.35) !important;
    border-color: gold !important;
    color: gold !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}


