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

/* ======================================================= */
/* DISPOSITION RESPONSIVE FIRST - STYLES SPÉCIFIQUES      */
/* ======================================================= */

body {
    background-image: url('img_fond.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- Conteneur Simulation Responsive Grid --- */
#conteneur_simulation {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 15px;
    padding: 15px;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    flex-grow: 1;
    min-height: 0;
}

/* Colonne Gauche (Canvas + Contrôles) */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Colonne Droite (Bilan & Formules) */
.right-column {
    display: flex;
    flex-direction: column;
}

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

.canvas_container {
    position: relative;
    width: 100%;
    height: clamp(250px, 32vh, 360px); /* Hauteur fluide et généreuse sur grand écran */
    min-height: 230px;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(10, 15, 28, 0.85);
}

/* Fenêtres de contenu */
.fenetre-contenu, .fenetre {
    background: linear-gradient(145deg, rgba(15, 32, 58, 0.88), rgba(0, 10, 30, 0.94));
    border: 1px solid var(--border-gold);
    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: 14px;
}

/* Adapteur pour les petits écrans (Tablettes & Mobiles < 900px) */
@media screen and (max-width: 900px) {
    #conteneur_simulation {
        display: flex;
        flex-direction: column;
        padding: 10px;
        gap: 12px;
        overflow-y: auto;
    }

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

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

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

/* Hub Menu Cards (index.html) */
.hub-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 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: 25px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    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.25);
}

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

.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.2rem;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.hub-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 18px;
    flex-grow: 1;
}

.hub-card-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    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);
}

/* Quiz Options & Saisie Scientifique */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.quiz-opt-btn {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.quiz-opt-btn:hover:not(:disabled) {
    border-color: gold;
    background: rgba(52, 152, 219, 0.3);
}

.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 14px rgba(255, 215, 0, 0.5);
    transform: translateX(4px);
}

.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;
}

/* Custom Range Slider (Charte Graphique Or / Cyan) */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(0, 242, 254, 0.2);
    border-radius: 4px;
    outline: none;
    border: 1px solid rgba(0, 242, 254, 0.4);
    transition: all 0.2s ease;
    cursor: pointer;
    margin: 6px 0;
}

input[type=range]:hover {
    background: rgba(0, 242, 254, 0.35);
    border-color: gold;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    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, box-shadow 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 14px gold;
}

input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    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;
}

/* DROPDOWN DES MODES CHRONO (OUVERTURE AU CLIC) */
.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 #mode_chrono:disabled + .dropdown-menu,
.dropdown #mode_chrono.locked + .dropdown-menu {
    display: none !important;
}

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

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

.banner-link {
    color: gold;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 5px 10px;
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.banner-link:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ======================================= */
/* 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;
}

.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.1rem; 
    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.06); 
    box-shadow: 0 0 20px rgba(100, 255, 150, 0.6);
}

.premium-btn.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: #fff;
    border: 1px solid #64ff96;
}

.premium-btn.primary {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border: 1px solid #74b9ff;
}

/* ======================================================= */
/* NAVIGATION BANDEAU & BOUTON MAISON 🏠                   */
/* ======================================================= */
.banner-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.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;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    flex-shrink: 0;
}

.home-btn:hover {
    background: rgba(255, 215, 0, 0.25);
    border-color: gold;
    transform: scale(1.10);
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.6);
}

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

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

.step-nav-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.step-badge-current {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 180, 0, 0.15));
    border: 1.5px solid gold;
    color: gold;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
    white-space: nowrap;
}

/* ======================================================= */
/* EN-TÊTE DE LA FENÊTRE 2 (CONTRÔLES & QUESTIONS)        */
/* ======================================================= */
.ctrl-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.ctrl-badges-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-badge {
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid rgba(0, 242, 254, 0.45);
    color: #00f2fe;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.25);
    letter-spacing: 0.3px;
}

.score-badge {
    font-size: 0.86rem;
    font-weight: 800;
    color: gold;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

/* ======================================================= */
/* FOOTER & OUTILS DÉVELOPPEUR COMPACTS                    */
/* ======================================================= */
#footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(4, 10, 24, 0.92);
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    font-size: 0.80rem;
    color: #aaa;
    gap: 10px;
    flex-wrap: wrap;
}

.dev-tools-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 20, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 2px 6px;
}

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

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

.dev-btn.dev-cheat:hover {
    background: rgba(255, 118, 117, 0.2);
    border-color: #ff7675;
    color: #ff7675;
}

/* ======================================================= */
/* CARTE DE PROGRESSION TYPE JEU VIDÉO (INDEX.HTML)        */
/* ======================================================= */
body.hub-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.progression-map-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Bandeau de Statut Compact de la Quête (Progression & Badge XP) */
.quest-status-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1250px;
    background: linear-gradient(145deg, rgba(14, 28, 54, 0.95), rgba(6, 14, 30, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 10px;
    padding: 8px 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 215, 0, 0.1);
    flex-wrap: wrap;
    gap: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.global-xp-badge {
    background: rgba(100, 255, 150, 0.15);
    border: 1px solid #64ff96;
    color: #64ff96;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.86rem;
    font-weight: bold;
}

.rules-progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.rules-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #2ecc71, #00cec9);
    width: 20%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(100, 255, 150, 0.7);
}

/* Parcours de Quête (Pipeline / Flow de Cartes) */
.quest-flow-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 1280px;
    padding: 6px 0;
    box-sizing: border-box;
    flex-shrink: 0;
}

@media screen and (max-width: 1200px) {
    .quest-flow-container {
        flex-wrap: wrap;
        gap: 15px;
    }
}

.quest-node {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.quest-card {
    width: clamp(170px, 15vw, 210px);
    min-height: 240px;
    max-height: 310px;
    background: linear-gradient(150deg, rgba(16, 32, 60, 0.92), rgba(6, 15, 32, 0.96));
    border: 2px solid rgba(255, 215, 0, 0.35);
    border-radius: 14px;
    padding: 12px 10px;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

.quest-card:hover:not(.locked-card) {
    transform: translateY(-8px) scale(1.03);
    border-color: gold;
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.4), inset 0 0 15px rgba(255, 215, 0, 0.2);
}

.quest-card.active-card {
    border: 2px solid gold;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: activeCardPulse 2.5s infinite;
}

@keyframes activeCardPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.6); }
}

.quest-card.completed-card {
    border: 2px solid #64ff96;
    background: linear-gradient(150deg, rgba(14, 40, 30, 0.92), rgba(5, 20, 15, 0.96));
    box-shadow: 0 0 18px rgba(100, 255, 150, 0.3);
}

.quest-card.locked-card {
    background: linear-gradient(150deg, rgba(12, 18, 30, 0.85), rgba(5, 8, 16, 0.92));
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 0.52;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.quest-card-step-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: gold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

.quest-card.completed-card .quest-card-step-badge {
    color: #64ff96;
    background: rgba(100, 255, 150, 0.15);
    border-color: rgba(100, 255, 150, 0.35);
}

.quest-card.locked-card .quest-card-step-badge {
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.quest-card-icon-wrapper {
    margin: 10px 0 6px 0;
    text-align: center;
    font-size: 2.3rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

.quest-card.completed-card .quest-card-icon-wrapper {
    filter: drop-shadow(0 0 10px rgba(100, 255, 150, 0.5));
}

.quest-card.locked-card .quest-card-icon-wrapper {
    filter: grayscale(1) opacity(0.5);
}

.quest-card-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.25;
    text-align: center;
}

.quest-card-desc {
    font-size: 0.80rem;
    color: #CBD5E1;
    line-height: 1.35;
    text-align: center;
    margin-bottom: 12px;
}

.quest-card-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Flèches Connectrices Lumineuses */
.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    position: relative;
    user-select: none;
}

.flow-arrow-icon {
    font-size: 1.8rem;
    font-weight: 900;
    transition: all 0.3s ease;
}

.flow-arrow.unlocked-arrow .flow-arrow-icon {
    color: gold;
    text-shadow: 0 0 12px gold, 0 0 24px rgba(255, 215, 0, 0.8);
    animation: pulseArrow 1.8s infinite;
}

.flow-arrow.locked-arrow .flow-arrow-icon {
    color: rgba(255, 255, 255, 0.18);
    text-shadow: none;
}

@keyframes pulseArrow {
    0%, 100% { transform: translateX(0) scale(1); opacity: 0.8; }
    50% { transform: translateX(4px) scale(1.2); opacity: 1; filter: drop-shadow(0 0 10px #64ff96); }
}

@media screen and (max-width: 1200px) {
    .flow-arrow {
        transform: rotate(90deg);
        margin: 5px 0;
    }
}
