/* ============================================================
   theme-mission.css — Ambiance « Mission spatiale » MathsPrime
   À charger APRÈS stylesexos.css et styleheaderexo.css.
   Ne s'active que sur <body class="theme-mission"> :
   les pages qui n'ont pas la classe gardent l'ancien style.
   ============================================================ */

body.theme-mission {
    /* On redéfinit la palette de stylesexos.css : tous les composants
       existants (popups, inputs, tableaux…) basculent en mode sombre. */
    --bg:         #0a1130;
    --card:       #101940;
    --blue:       #22b8e6;
    --blue-dk:    #0b6a8e;
    --green:      #2fdc7a;
    --green-dk:   #16934f;
    --orange:     #ff9f2e;
    --orange-dk:  #e07b10;
    --yellow:     #f5c842;
    --yellow-dk:  #b8901a;
    --text:       #e6ecff;
    --text-muted: #8b97c7;
    --text-head:  #ffffff;
    --border:     #2a3a78;

    /* Couleurs propres au thème */
    --space:  #050816;
    --neon:   #22d3ee;
    --gold:   #f5c842;
    --hot:    #ff4d6d;
    --ok:     #3ef08a;
    --panel:  rgba(13, 20, 52, .88);
    --hud-font: 'Orbitron', 'Nunito', sans-serif;

    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(ellipse 70% 50% at 15% 0%,   rgba(70, 60, 200, .35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 45% at 95% 100%, rgba(160, 40, 160, .28) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 85% 15%,  rgba(34, 211, 238, .12) 0%, transparent 60%),
        var(--space);
    background-attachment: fixed;
}

/* ---------- Champ d'étoiles (2 couches en parallaxe) ---------- */
body.theme-mission::before,
body.theme-mission::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-repeat: repeat;
}
body.theme-mission::before {
    background-image:
        radial-gradient(1px 1px at 20px 30px,   #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 120px 90px,  rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 210px 160px, #9be7ff 50%, transparent 51%),
        radial-gradient(1px 1px at 300px 40px,  #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 260px 230px, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(2px 2px at 60px 210px,  #ffe9a8 50%, transparent 51%);
    background-size: 340px 260px;
    animation: mpStarDrift 140s linear infinite;
}
body.theme-mission::after {
    opacity: .55;
    background-image:
        radial-gradient(1px 1px at 80px 60px,   #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 400px 300px, #c9b8ff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 250px 120px, #fff 50%, transparent 51%);
    background-size: 520px 400px;
    animation: mpStarDrift2 260s linear infinite;
}
@keyframes mpStarDrift  { to { background-position: 0 1040px; } }
@keyframes mpStarDrift2 { to { background-position: 0 1200px; } }

/* ---------- Header ---------- */
body.theme-mission .site-header {
    background: rgba(5, 8, 22, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(34, 211, 238, .22);
}
body.theme-mission .site-header::before {
    background: linear-gradient(90deg, transparent, rgba(34,211,238,.6), transparent);
    height: 1px;
}
body.theme-mission .brand-soft-name { color: #fff; }
body.theme-mission .eval-toggle-label {
    color: var(--text);
    font-family: var(--hud-font);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
body.theme-mission .eval-toggle { background: #1d2860; box-shadow: inset 0 0 0 1px rgba(34,211,238,.3); }
body.theme-mission .eval-toggle.active { background: var(--hot); box-shadow: 0 0 14px rgba(255,77,109,.6); }

/* ---------- Briefing de mission (au-dessus de la console) ---------- */
.mission-briefing {
    max-width: 600px;
    width: 90%;
    margin: 28px auto -14px;
    text-align: left;
    animation: mpFadeUp .6s ease both;
}
.mission-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--hud-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
    color: var(--neon);
    background: rgba(34, 211, 238, .08);
    border: 1px solid rgba(34, 211, 238, .3);
    padding: 5px 12px;
    border-radius: 999px;
}
.blink-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
    animation: mpBlink 1.4s ease-in-out infinite;
}
@keyframes mpBlink { 50% { opacity: .25; } }
.mission-title {
    font-family: var(--hud-font);
    font-weight: 900;
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    color: #fff;
    margin: 12px 0 6px;
    letter-spacing: .02em;
    line-height: 1.15;
}
.mission-title span {
    background: linear-gradient(90deg, var(--gold), #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 12px rgba(245, 200, 66, .35));
}
.mission-objective {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-muted);
}
.mission-objective i { color: var(--hot); margin-right: 6px; }
@keyframes mpFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Console d'exercice ---------- */
body.theme-mission .exercise-box {
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, rgba(22, 32, 78, .94), rgba(9, 14, 38, .96));
    border: 1px solid rgba(34, 211, 238, .35);
    border-radius: 18px;
    box-shadow:
        inset 0 0 0 1px rgba(34, 211, 238, .06),
        0 0 40px rgba(34, 211, 238, .12),
        0 24px 60px rgba(0, 0, 0, .55);
    color: var(--text);
    overflow: hidden;
    transition: border-color .3s ease, box-shadow .3s ease;
}
/* Équerres de visée dans les coins */
body.theme-mission .exercise-box::before,
body.theme-mission .exercise-box::after {
    content: '';
    position: absolute;
    width: 22px; height: 22px;
    pointer-events: none;
    border: 2px solid var(--neon);
    opacity: .8;
}
body.theme-mission .exercise-box::before { left: 8px;  bottom: 8px; border-right: 0; border-top: 0;    border-radius: 0 0 0 6px; }
body.theme-mission .exercise-box::after  { right: 8px; bottom: 8px; border-left: 0;  border-top: 0;    border-radius: 0 0 6px 0; }

/* Barre de titre de la console */
.console-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: -24px -20px 18px;
    padding: 10px 18px;
    background: linear-gradient(90deg, rgba(34,211,238,.16), rgba(34,211,238,.03));
    border-bottom: 1px solid rgba(34, 211, 238, .25);
    font-family: var(--hud-font);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    color: var(--neon);
    text-transform: uppercase;
}
.console-bar .console-dots { display: inline-flex; gap: 5px; margin-right: 8px; vertical-align: middle; }
.console-bar .console-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.console-bar .console-dots i:nth-child(1) { background: var(--hot); }
.console-bar .console-dots i:nth-child(2) { background: var(--gold); }
.console-bar .console-dots i:nth-child(3) { background: var(--ok); }
#mission-target {
    color: var(--gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bandeau mode éval → « Épreuve officielle » */
body.theme-mission .eval-mode-banner {
    margin: -18px -20px 18px;
    border-radius: 0;
    background: repeating-linear-gradient(-45deg, #c9183e 0 14px, #e02a50 14px 28px);
    font-family: var(--hud-font);
    font-size: 12px;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
body.theme-mission .exercise-box:has(.eval-mode-banner.active) {
    border-color: rgba(255, 77, 109, .55);
    box-shadow: inset 0 0 0 1px rgba(255,77,109,.08), 0 0 40px rgba(255,77,109,.18), 0 24px 60px rgba(0,0,0,.55);
}

/* Indice (identité remarquable…) */
body.theme-mission #identite-remarquable:not(:empty) {
    display: inline-block;
    color: var(--neon) !important;
    background: rgba(34, 211, 238, .07);
    border: 1px dashed rgba(34, 211, 238, .4);
    border-radius: 10px;
    padding: 6px 12px;
}

/* Énoncé = transmission entrante */
body.theme-mission :is(#question, .mission-enonce) {
    display: block;
    color: #fff;
    text-shadow: 0 0 18px rgba(34, 211, 238, .25);
    margin: 6px 0 18px;
}
body.theme-mission :is(#question, .mission-enonce)::before {
    content: '▸ TRANSMISSION ENTRANTE';
    display: block;
    font-family: var(--hud-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3em;
    color: var(--text-muted);
    text-shadow: none;
    margin-bottom: 10px;
}
body.theme-mission :is(#question, .mission-enonce).incoming { animation: mpIncoming .55s ease-out both; }
@keyframes mpIncoming {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); filter: blur(3px); }
    60%  { opacity: 1; filter: blur(0); }
    70%  { opacity: .6; }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* Champ de réponse = terminal */
body.theme-mission :is(#reponse, #userAnswer) {
    width: min(100%, 300px);
    padding: 13px 16px;
    font-size: 18px;
    text-align: center;
    background: #060b22;
    color: #d6fbff;
    caret-color: var(--neon);
    border: 1.5px solid rgba(34, 211, 238, .4);
    border-radius: 12px;
    box-shadow: inset 0 0 18px rgba(34, 211, 238, .08);
    transition: border-color .2s, box-shadow .2s;
}
body.theme-mission :is(#reponse, #userAnswer)::placeholder { color: #4d5c95; }
body.theme-mission :is(#reponse, #userAnswer):focus {
    border-color: var(--neon);
    box-shadow: inset 0 0 18px rgba(34,211,238,.12), 0 0 0 4px rgba(34,211,238,.15), 0 0 22px rgba(34,211,238,.3);
}

body.theme-mission #latex-preview:empty { display: none; }
body.theme-mission #latex-preview {
    display: inline-block;
    min-width: 120px;
    padding: 6px 16px;
    color: var(--neon);
    border: 1px dashed rgba(34, 211, 238, .3);
    border-radius: 10px;
    background: rgba(34, 211, 238, .04);
}

/* Touches de symboles = clavier de bord */
body.theme-mission .symbol-button {
    background: #17214d;
    color: #cfe8ff;
    border: 1px solid rgba(34, 211, 238, .25);
    border-radius: 10px;
    box-shadow: 0 3px 0 #070c26;
    font-weight: 900;
}
body.theme-mission .symbol-button:hover {
    background: #1e2c66;
    border-color: var(--neon);
    box-shadow: 0 5px 0 #070c26, 0 0 12px rgba(34,211,238,.35);
}
body.theme-mission .symbol-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #070c26; }

/* Bouton principal : VALIDER */
body.theme-mission .btn-fire {
    font-family: var(--hud-font);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 12px 26px;
    color: #0B1A4A;
    background: linear-gradient(180deg, #ffd85a, #f5a623);
    box-shadow: 0 4px 0 #a86a0a, 0 0 22px rgba(245, 200, 66, .35);
}
body.theme-mission .btn-fire:hover { box-shadow: 0 6px 0 #a86a0a, 0 0 30px rgba(245, 200, 66, .55); }
body.theme-mission .btn-fire:active { transform: translateY(3px); box-shadow: 0 1px 0 #a86a0a; }
body.theme-mission .btn-fire i { margin-right: 6px; }

/* Bouton secondaire : CIBLE SUIVANTE */
body.theme-mission :is(#btn-nouveau, .btn-nouveau) {
    font-family: var(--hud-font);
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 12px 18px;
    background: transparent;
    color: var(--neon);
    border: 1.5px solid rgba(34, 211, 238, .55);
    box-shadow: 0 0 0 transparent;
}
body.theme-mission :is(#btn-nouveau, .btn-nouveau):hover { background: rgba(34,211,238,.1); box-shadow: 0 0 16px rgba(34,211,238,.35); }

body.theme-mission .help-button,
body.theme-mission .settings-button {
    background: #17214d;
    color: var(--gold);
    border: 1px solid rgba(245, 200, 66, .35);
    box-shadow: 0 4px 0 #070c26;
}
body.theme-mission .settings-button { color: var(--text-muted); border-color: rgba(139,151,199,.35); }
body.theme-mission .help-button:hover,
body.theme-mission .settings-button:hover { box-shadow: 0 6px 0 #070c26, 0 0 14px rgba(245,200,66,.3); }

/* Retour feedback (emoji) */
body.theme-mission #feedback { filter: drop-shadow(0 0 12px rgba(255,255,255,.35)); }

/* Correction = rapport de mission */
body.theme-mission #solution:not(:empty) {
    margin-top: 16px;
    padding: 14px 16px;
    font-size: 18px;
    color: var(--text);
    background: rgba(255, 159, 46, .07);
    border: 1px solid rgba(255, 159, 46, .35);
    border-left: 4px solid var(--orange);
    border-radius: 12px;
    animation: mpFadeUp .4s ease both;
}
body.theme-mission #solution:not(:empty)::before {
    content: '⚠ RAPPORT D\'ANALYSE';
    display: block;
    font-family: var(--hud-font);
    font-size: 10px;
    letter-spacing: .3em;
    color: var(--orange);
    margin-bottom: 8px;
}
body.theme-mission .correction-lock {
    background: rgba(255,255,255,.04);
    border: 2px dashed rgba(139,151,199,.4);
    color: var(--text);
}

/* ---------- Jauge de progression segmentée ---------- */
.hud-label {
    margin: 22px auto 0;
    font-family: var(--hud-font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .28em;
    color: var(--text-muted);
    text-transform: uppercase;
}
body.theme-mission .progress-container {
    position: relative;
    max-width: 360px;
    height: 16px;
    margin-top: 8px;
    background: #070c26;
    border: 1px solid rgba(34, 211, 238, .3);
    border-radius: 6px;
}
body.theme-mission .progress-container::after {
    /* découpe la barre en 10 cellules */
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 3px), #070c26 calc(10% - 3px) 10%);
}
body.theme-mission .progress-bar,
body.theme-mission .progress-bar.red,
body.theme-mission .progress-bar.orange,
body.theme-mission .progress-bar.green {
    border-radius: 0;
    background: linear-gradient(90deg, var(--neon), var(--ok));
    box-shadow: 0 0 14px rgba(62, 240, 138, .6);
}

/* ---------- HUD XP / Gold ---------- */
body.theme-mission .xp-display {
    background: rgba(5, 8, 22, .6);
    border: 1px solid rgba(245, 200, 66, .4);
    box-shadow: 0 0 20px rgba(245, 200, 66, .1), inset 0 0 20px rgba(245, 200, 66, .05);
    font-family: var(--hud-font);
    font-size: 14px;
    letter-spacing: .04em;
}
body.theme-mission .xp-display i { color: var(--gold); }
body.theme-mission .streak-info { color: var(--text-muted); font-family: 'Nunito', sans-serif; }
body.theme-mission .xp-warning { background: rgba(255,159,46,.1); color: #ffc27a; }

/* ---------- Popups (Codex / Réglages) ---------- */
body.theme-mission .overlay { background: rgba(2, 4, 14, .7); backdrop-filter: blur(3px); }
body.theme-mission .popup {
    background: linear-gradient(180deg, #121c48, #0a1130);
    border: 1px solid rgba(34, 211, 238, .4);
    box-shadow: 0 0 40px rgba(34, 211, 238, .2), 0 20px 50px rgba(0,0,0,.6);
    color: var(--text);
}
body.theme-mission .popup strong { color: var(--gold); }
.codex-head {
    font-family: var(--hud-font);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .25em;
    color: var(--neon);
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(34, 211, 238, .25);
}
.codex-head i { margin-right: 8px; }
body.theme-mission .setting-row { background: rgba(255,255,255,.03); }
body.theme-mission .setting-switch { background: #1d2860; }
body.theme-mission .setting-switch.on { background: var(--green); }

/* ---------- Bouton retour ---------- */
body.theme-mission .button-retour {
    background: transparent;
    color: var(--neon);
    border: 1.5px solid rgba(34, 211, 238, .5);
    box-shadow: 0 0 14px rgba(34, 211, 238, .2);
}
body.theme-mission .button-retour:hover { box-shadow: 0 0 22px rgba(34, 211, 238, .45); }

/* ============================================================
   Effets déclenchés par mission-fx.js
   ============================================================ */
body.theme-mission .exercise-box.fx-success {
    border-color: var(--ok);
    box-shadow: inset 0 0 40px rgba(62,240,138,.12), 0 0 50px rgba(62,240,138,.35), 0 24px 60px rgba(0,0,0,.55);
}
body.theme-mission .exercise-box.fx-fail {
    border-color: var(--hot);
    box-shadow: inset 0 0 40px rgba(255,77,109,.12), 0 0 50px rgba(255,77,109,.3), 0 24px 60px rgba(0,0,0,.55);
    animation: mpShake .45s ease;
}
@keyframes mpShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

.mission-toast {
    position: absolute;
    left: 50%;
    top: 4px;          /* s'affiche par-dessus la barre de console */
    z-index: 5;
    transform: translate(-50%, -10px);
    opacity: 0;
    pointer-events: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-family: var(--hud-font);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
    white-space: nowrap;
    text-transform: uppercase;
    transition: opacity .25s ease, transform .25s ease;
}
.mission-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mission-toast.ok   { background: #0c2a2a; color: var(--ok);  border: 1px solid var(--ok);  box-shadow: 0 0 20px rgba(62,240,138,.4); }
.mission-toast.ko   { background: #2e1024; color: #ff8aa0;   border: 1px solid var(--hot); box-shadow: 0 0 20px rgba(255,77,109,.35); }
.mission-toast.gold { background: #2c2512; color: var(--gold); border: 1px solid var(--gold); box-shadow: 0 0 24px rgba(245,200,66,.5); }

.fx-particle {
    position: absolute;
    z-index: 4;
    width: 6px; height: 6px;
    border-radius: 50%;
    pointer-events: none;
    background: var(--c);
    box-shadow: 0 0 8px var(--c);
    animation: mpBurst .8s ease-out forwards;
}
@keyframes mpBurst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .mission-briefing { margin-top: 18px; }
    .console-bar { font-size: 9px; letter-spacing: .1em; padding: 9px 12px; }
    body.theme-mission .btn-fire { padding: 11px 18px; font-size: 13px; }
    .mission-toast { font-size: 10px; }
}

/* ---------- Accessibilité : moins d'animations si demandé ---------- */
@media (prefers-reduced-motion: reduce) {
    body.theme-mission::before,
    body.theme-mission::after,
    .blink-dot,
    body.theme-mission :is(#question, .mission-enonce).incoming,
    body.theme-mission .exercise-box.fx-fail { animation: none !important; }
}

/* ============================================================
   LISIBILITÉ — réglages ajoutés avant mise en ligne
   (l'ambiance ne change pas : on agrandit et on éclaircit
   uniquement ce que l'élève doit lire ou toucher)
   ============================================================ */
body.theme-mission { --text-muted: #AEBAE8; }          /* libellés secondaires plus lisibles */
body.theme-mission { background-color: #050816; }       /* fond continu sur les pages longues */
body.theme-mission .console-bar > span:first-child { white-space: nowrap; flex-shrink: 0; }

/* Énoncé et saisie plus grands */
body.theme-mission :is(#question, .mission-enonce) { font-size: 24px; }
body.theme-mission :is(#reponse, #userAnswer)  { font-size: 20px; color: #fff; }
body.theme-mission #latex-preview { font-size: 20px; color: #fff; }
body.theme-mission #identite-remarquable:not(:empty) { font-size: 15px !important; }

/* Petits libellés HUD : un cran plus grands */
body.theme-mission :is(#question, .mission-enonce)::before,
body.theme-mission .hud-label,
body.theme-mission #solution:not(:empty)::before { font-size: 11px; letter-spacing: .2em; }
body.theme-mission .console-bar { font-size: 12px; }

/* Clavier : touches plus grandes, symboles blancs bien contrastés */
body.theme-mission .symbol-button {
    min-width: 54px;
    height: 48px;
    padding: 0 12px;
    margin: 4px;
    background: #22306A;
    color: #FFFFFF;
    border: 1.5px solid rgba(34, 211, 238, .5);
    font-size: 19px;
    font-weight: 800;
}

/* Correction : la réponse de verifier_calcul_litteral.php arrive déjà
   dans son propre encadré jaune → on le fond dans le « rapport d'analyse » */
body.theme-mission #solution:not(:empty) { font-size: 18px; line-height: 1.8; text-align: left; }
body.theme-mission #solution > div[style] {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--text) !important;
    font-size: inherit !important;
    line-height: 1.8 !important;
}
body.theme-mission #solution > div[style] > strong:first-child { color: var(--orange); }
body.theme-mission #solution:has(> div[style])::before { content: none; }   /* un seul titre : celui du serveur */

@media (max-width: 480px) {
    body.theme-mission :is(#question, .mission-enonce) { font-size: 21px; }
    body.theme-mission .symbol-button { min-width: 48px; height: 46px; font-size: 17px; margin: 3px; }
    body.theme-mission .console-bar { font-size: 10px; }
    body.theme-mission .console-bar > span:first-child { font-size: 0; }   /* téléphone : seulement les voyants */
}

/* ============================================================
   PAGES D'EXERCICES — contenus variés
   Chaque chapitre a son énoncé, ses champs et ses aides, souvent
   écrits pour un fond clair. Ces règles les rendent lisibles
   dans le thème sans toucher à la logique des pages.
   ============================================================ */

/* --- Tous les champs de saisie de la console --- */
body.theme-mission .exercise-box input:not([type="checkbox"]):not([type="radio"]),
body.theme-mission .exercise-box select,
body.theme-mission .exercise-box textarea {
    background: #060b22;
    color: #fff;
    caret-color: var(--neon);
    border: 1.5px solid rgba(34, 211, 238, .45);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    box-shadow: inset 0 0 14px rgba(34, 211, 238, .08);
}
body.theme-mission .exercise-box input::placeholder,
body.theme-mission .exercise-box textarea::placeholder { color: #6b7ab0; font-weight: 700; }
body.theme-mission .exercise-box input:focus,
body.theme-mission .exercise-box select:focus,
body.theme-mission .exercise-box textarea:focus {
    border-color: var(--neon);
    box-shadow: inset 0 0 14px rgba(34,211,238,.12), 0 0 0 4px rgba(34,211,238,.15), 0 0 20px rgba(34,211,238,.3);
}
body.theme-mission .exercise-box select option { background: #0e1638; color: #fff; }
body.theme-mission .exercise-box .error-message { color: #ff8aa0; font-size: 15px; }

/* --- Énoncés : petits textes et couleurs écrites pour un fond clair --- */
body.theme-mission .mission-enonce [style*="color"] { color: var(--text-muted) !important; }
body.theme-mission .consigne-text { color: #fff; }
body.theme-mission .unite-hint { color: var(--text-muted); font-size: 14px; font-weight: 700; }

/* --- Cases à cocher en étiquettes (divisibilité…) --- */
body.theme-mission .diviseur-label {
    background: #17214d; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .4); border-radius: 12px;
}
body.theme-mission .diviseur-label:hover { background: #1e2c66; border-color: var(--neon); }
body.theme-mission .diviseur-label.checked {
    background: rgba(62, 240, 138, .16); color: #b9ffd4;
    border-color: var(--ok); box-shadow: 0 0 14px rgba(62, 240, 138, .35);
}

/* --- Correction : feuille claire (les corrections du serveur y restent lisibles) --- */
body.theme-mission #solution:not(:empty) {
    color: #0F2350;
    background: #F4F8FF;
    border: 0;
    border-left: 5px solid var(--orange);
    box-shadow: 0 0 24px rgba(255, 159, 46, .18);
    font-weight: 700;
}
body.theme-mission #solution:not(:empty)::before { color: #b45309; }
body.theme-mission #solution > div[style] { color: #0F2350 !important; }
body.theme-mission #solution > div[style] > strong:first-child { color: #b45309; }
body.theme-mission #solution .correction-lock { color: #0F2350; background: #EAF2FF; border-color: #9fb3dd; }
body.theme-mission #solution:has(> .correction-lock)::before { content: none; }

/* --- Aide (codex) et réglages : panneaux clairs, faciles à lire --- */
body.theme-mission .popup {
    background: #fff;
    color: #0F2350;
    border: 2px solid rgba(34, 211, 238, .55);
    box-shadow: 0 0 40px rgba(34, 211, 238, .25), 0 20px 50px rgba(0,0,0,.6);
    font-weight: 600;
}
body.theme-mission .popup strong { color: #123A9C; }
body.theme-mission .popup .close-button { color: #5A6B92; z-index: 2; }
body.theme-mission .popup .close-button:hover { color: var(--hot); }
body.theme-mission .codex-head {
    margin: -24px -24px 16px; padding: 13px 48px 13px 20px;
    background: linear-gradient(90deg, #0e1638, #17214d);
    border-bottom: 2px solid var(--neon);
    color: var(--neon);
}
body.theme-mission #settingsPopup h3 { color: #0F2350; }
body.theme-mission .setting-row { background: #EAF2FF; border-color: #C9D8F5; color: #0F2350; }
body.theme-mission .setting-row .setting-label small,
body.theme-mission .setting-note { color: #5A6B92; }
body.theme-mission .setting-switch { background: #C9D8F5; }
body.theme-mission .setting-switch.on { background: var(--green-dk); }

/* La cible garde sa casse : en maths, k et K ne sont pas la même chose */
body.theme-mission #mission-target { text-transform: none; letter-spacing: .06em; }
/* Aperçu de la réponse : taille fixe, même sur les pages qui agrandissent MathJax */
body.theme-mission #latex-preview mjx-container { font-size: 22px !important; }

/* --- QCM : boutons de choix (Vrai/Faux, expressions, un segment / une longueur…) --- */
body.theme-mission .choice-button {
    background: #17214d; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .4); border-radius: 12px;
    box-shadow: none; text-align: center;
}
body.theme-mission .choice-button:hover { background: #1e2c66; border-color: var(--neon); transform: translateY(-2px); box-shadow: 0 0 14px rgba(34,211,238,.25); }
body.theme-mission .choice-button.selected {
    background: rgba(62, 240, 138, .16); color: #b9ffd4;
    border-color: var(--ok); box-shadow: 0 0 14px rgba(62, 240, 138, .35); transform: none;
}
body.theme-mission #choiceCheckbox { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
body.theme-mission #choiceCheckbox .choice-button { width: auto; min-width: 160px; margin: 6px 0; }

/* --- Listes déroulantes : flèche claire --- */
body.theme-mission .exercise-box select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2322d3ee' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

/* --- Programme de calcul : séquence de commandes --- */
body.theme-mission .program-box {
    background: rgba(6, 11, 34, .7); border: 1.5px solid rgba(34, 211, 238, .4);
    box-shadow: inset 0 0 18px rgba(34, 211, 238, .08);
}
body.theme-mission .program-box strong {
    color: var(--neon); font-family: 'Orbitron', sans-serif; font-size: 12px;
    letter-spacing: .14em; text-transform: uppercase;
}
body.theme-mission .program-step {
    background: #17214d; color: #fff; border: 1px solid rgba(34, 211, 238, .25); box-shadow: none;
}
body.theme-mission .program-step::before { color: var(--gold, #f5c842); }

/* --- Figures dessinées (canvas) : écran d'affichage clair, les tracés restent lisibles --- */
body.theme-mission .exercise-box canvas {
    background: #F4F8FF; border-radius: 14px;
    box-shadow: 0 0 0 1.5px rgba(34, 211, 238, .45), 0 0 22px rgba(34, 211, 238, .2);
    max-width: 100%;
}
body.theme-mission #preview mjx-container { font-size: 22px !important; }

/* --- Correction écrite dans #feedback (pages dérivées, équations différentielles…) --- */
body.theme-mission #feedback.fb-rapport {
    filter: none;
    margin: 16px 0 0; padding: 14px 16px;
    font-size: 18px; line-height: 1.8; font-weight: 700; text-align: left;
    color: #0F2350; background: #F4F8FF;
    border-left: 5px solid var(--orange); border-radius: 12px;
    box-shadow: 0 0 24px rgba(255, 159, 46, .18);
    animation: mpFadeUp .4s ease both;
}
body.theme-mission #feedback.fb-rapport::before {
    content: '⚠ RAPPORT D\'ANALYSE'; display: block;
    font-family: var(--hud-font); font-size: 11px; letter-spacing: .2em;
    color: #b45309; margin-bottom: 8px;
}
body.theme-mission #feedback.fb-rapport:has(> .correction-lock)::before { content: none; }
body.theme-mission #feedback.fb-rapport [style*="color"]:not([style*="background"]) { filter: none; }
body.theme-mission #feedback .correction-lock { color: #0F2350; background: #EAF2FF; border-color: #9fb3dd; }

/* --- QCM à boutons (produit / quotient…) --- */
body.theme-mission .qcm-option,
body.theme-mission .qcm-option * { color: #fff; }
body.theme-mission .qcm-option {
    background: #17214d; border: 1.5px solid rgba(34, 211, 238, .4); box-shadow: none;
}
body.theme-mission .qcm-option mjx-container { color: #fff !important; }
body.theme-mission .qcm-option:hover:not(:disabled) { background: #1e2c66; border-color: var(--neon); box-shadow: 0 0 14px rgba(34,211,238,.25); }
body.theme-mission .qcm-option.correct { background: rgba(62, 240, 138, .16); border-color: var(--ok); box-shadow: 0 0 14px rgba(62,240,138,.35); }
body.theme-mission .qcm-option.wrong   { background: rgba(255, 92, 122, .16); border-color: #ff5c7a; box-shadow: 0 0 14px rgba(255,92,122,.35); }

/* --- Graphiques SVG (courbes, tangentes) : écran clair encadré --- */
body.theme-mission #graph-zone svg { box-shadow: 0 0 0 1.5px rgba(34, 211, 238, .45), 0 0 22px rgba(34, 211, 238, .2); }

/* --- Deux réponses côte à côte (x₁, x₂) --- */
body.theme-mission #rep1, body.theme-mission #rep2 { display: inline-block; width: min(200px, 42%); margin: 6px; }

/* --- Touches de clavier écrites sans la classe symbol-button (e^(), cos(), −, /…) --- */
body.theme-mission .exercise-box :is(.symbol-buttons > button:not(.help-button):not(.settings-button), button.minus, button.math-btn) {
    min-width: 54px; height: 48px; padding: 0 12px; margin: 4px;
    background: #22306A; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .5); border-radius: 10px;
    box-shadow: 0 3px 0 #070c26;
    font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
    text-transform: none; letter-spacing: 0;
}
body.theme-mission .exercise-box :is(.symbol-buttons > button:not(.help-button):not(.settings-button), button.minus, button.math-btn):hover {
    background: #2a3a7e; border-color: var(--neon);
    box-shadow: 0 5px 0 #070c26, 0 0 12px rgba(34,211,238,.35); transform: translateY(-1px);
}
body.theme-mission .exercise-box :is(.symbol-buttons > button:not(.help-button):not(.settings-button), button.minus, button.math-btn):active {
    transform: translateY(2px); box-shadow: 0 1px 0 #070c26;
}

/* --- Équations : type d'équation et énoncé de problème --- */
body.theme-mission .equation-type {
    color: var(--neon); font-family: var(--hud-font); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
body.theme-mission .equation-type * { color: inherit !important; }
body.theme-mission .probleme-box {
    background: rgba(6, 11, 34, .7); color: #fff;
    border: 1px solid rgba(34, 211, 238, .3); border-left: 4px solid var(--gold, #f5c842);
    box-shadow: inset 0 0 18px rgba(34, 211, 238, .06);
}
body.theme-mission .probleme-box [style*="color"] { color: var(--neon) !important; }

/* --- Deux champs nommés (valeurs interdites…) --- */
body.theme-mission .dual-field label { color: var(--text-muted); font-family: var(--hud-font); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
body.theme-mission .dual-sep { color: var(--text-muted); }
body.theme-mission .dual-hint { color: var(--text-muted); }

/* --- Rangée de boutons : touches de saisie au style du clavier de bord --- */
body.theme-mission .exercise-box .buttons > button:is(.fraction, .exp, .ln, .interval, .minusinf, .plusinf, .union),
body.theme-mission .exercise-box .symbol-buttons > button:is(.bracket-open, .bracket-close, .semicolon) {
    min-width: 54px; height: 48px; padding: 0 12px; margin: 4px;
    background: #22306A; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .5); border-radius: 10px;
    box-shadow: 0 3px 0 #070c26;
    font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800; text-transform: none; letter-spacing: 0;
}
body.theme-mission .exercise-box .buttons > button:is(.fraction, .exp, .ln, .interval, .minusinf, .plusinf, .union):hover {
    background: #2a3a7e; border-color: var(--neon); box-shadow: 0 5px 0 #070c26, 0 0 12px rgba(34,211,238,.35);
}
body.theme-mission .mathjax-button mjx-container { color: #fff !important; }

/* --- Géométrie lycée : contexte, données, saisie de coefficients et de vecteurs --- */
body.theme-mission .contexte-box {
    background: rgba(6, 11, 34, .7); color: #fff;
    border: 1px solid rgba(34, 211, 238, .3); border-left: 4px solid var(--neon);
}
body.theme-mission .donnees-box {
    background: rgba(6, 11, 34, .7); border: 1px solid rgba(34, 211, 238, .35);
    box-shadow: inset 0 0 18px rgba(34, 211, 238, .06);
}
body.theme-mission .donnees-box .stat-item { color: #fff; border-bottom-color: rgba(34, 211, 238, .18); }
body.theme-mission .donnees-box .stat-label {
    color: var(--neon); font-family: var(--hud-font); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
body.theme-mission #input-format-info { color: var(--text-muted) !important; }
body.theme-mission .input-equation span { color: #fff; font-weight: 800; }
body.theme-mission :is(.input-equation, .input-vecteur) input { width: 70px; text-align: center; padding: 8px; }
body.theme-mission .mission-enonce small[style] { color: var(--text-muted) !important; }
/* Boutons OUI / NON : la page colore le choix en ligne → on traduit ce choix dans le thème */
body.theme-mission :is(#btn-oui, #btn-non) {
    background: #17214d !important; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .4); box-shadow: none; width: 110px !important;
}
body.theme-mission :is(#btn-oui, #btn-non)[style*="52, 152, 219"],
body.theme-mission :is(#btn-oui, #btn-non)[style*="3498db"] {
    background: rgba(62, 240, 138, .16) !important; color: #b9ffd4;
    border-color: var(--ok); box-shadow: 0 0 14px rgba(62, 240, 138, .35);
}

/* --- Nombres décimaux : consigne de l'axe et aperçu --- */
body.theme-mission #axe-consigne { color: #fff; }
body.theme-mission #user-latex { color: #fff; }
body.theme-mission #axe-container svg {
    background: rgba(6, 11, 34, .6); border: 1px solid rgba(34, 211, 238, .35); border-radius: 12px;
}
body.theme-mission #axe-container .cross { stroke: var(--gold, #f5c842); }
body.theme-mission .input-equation { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 10px 0; }
body.theme-mission .input-equation input { display: inline-block; margin: 0; }
body.theme-mission .input-vecteur { display: inline-flex; flex-direction: column; gap: 6px; padding: 4px 10px;
    border-left: 2px solid var(--neon); border-right: 2px solid var(--neon); border-radius: 14px; }
body.theme-mission .input-vecteur input { margin: 0; }
@media (max-width: 480px) {
    body.theme-mission .input-equation { gap: 5px; }
    body.theme-mission .input-equation input { width: 54px; padding: 6px; }
}

/* --- Touches d'insertion isolées (/, −…) placées à côté des boutons d'action --- */
body.theme-mission .exercise-box > button[onclick^="inserer"] {
    min-width: 54px; height: 48px; padding: 0 12px; margin: 4px;
    background: #22306A; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .5); border-radius: 10px;
    box-shadow: 0 3px 0 #070c26; font-size: 19px; font-weight: 800;
}
body.theme-mission .exercise-box > button[onclick^="inserer"]:hover { background: #2a3a7e; border-color: var(--neon); }
/* Corrections construites étape par étape dans la page */
body.theme-mission #solution .step { color: #0F2350; margin: 4px 0; }
/* Aide des relatifs : les formules au milieu d'une phrase restent sur la ligne */
body.theme-mission #helpPopup .help-rule-ex mjx-container { display: inline-block !important; vertical-align: middle; }

/* --- Probabilités : contexte (3e), tableau à double entrée et arbre (lycée) --- */
body.theme-mission .context-box {
    background: rgba(6, 11, 34, .7); color: #fff;
    border: 1px solid rgba(34, 211, 238, .3); border-left: 4px solid var(--neon);
}
body.theme-mission .contexte-box p[style] { color: #dbe6ff !important; }
body.theme-mission .tableau-container table { background: rgba(6, 11, 34, .75); }
body.theme-mission .tableau-container :is(th, td) { border: 1.5px solid rgba(34, 211, 238, .45); color: #fff; }
body.theme-mission .tableau-container th {
    background: rgba(34, 211, 238, .12); color: var(--gold);
}
body.theme-mission .tableau-container td strong { color: var(--neon); }
body.theme-mission .arbre-container {
    background: rgba(6, 11, 34, .75); border: 1px solid rgba(34, 211, 238, .35); box-shadow: none; color: #fff;
}
body.theme-mission .arbre-container > div > div[style*="font-weight"] { color: var(--gold); font-family: var(--hud-font); letter-spacing: .06em; }
body.theme-mission .arbre-ligne { background: var(--neon); box-shadow: 0 0 6px rgba(34, 211, 238, .5); }
body.theme-mission .arbre-proba {
    background: #0B1A4A; color: var(--gold); border: 1.5px solid var(--gold);
}
body.theme-mission .arbre-evenement {
    background: #17214d; color: #fff; border: 1.5px solid rgba(34, 211, 238, .5); box-shadow: 0 3px 0 #070c26;
}

/* --- Puissances : énoncé, consigne et titres du codex --- */
body.theme-mission #power-exercice { color: #fff; font-size: 30px; }
@media (max-width: 600px) { body.theme-mission #power-exercice { font-size: 26px; } }
body.theme-mission #power-exercice > div[style] { color: var(--text-muted) !important; }
body.theme-mission #helpPopup .help-section-title { color: #123A9C; border-bottom-color: var(--gold); }
body.theme-mission .arbre-ligne { width: 44px; }
body.theme-mission .tableau-container { justify-content: safe center; }
@media (max-width: 600px) {
    body.theme-mission .arbre-container { padding: 10px; }
    body.theme-mission .arbre-ligne { width: 14px; }
    body.theme-mission .arbre-node { gap: 6px; }
    body.theme-mission .arbre-container > div { padding: 8px !important; }
    body.theme-mission .arbre-proba { padding: 3px 7px; font-size: 12px; }
    body.theme-mission .arbre-evenement { padding: 6px 10px; font-size: 14px; }
    body.theme-mission .tableau-container :is(th, td) { padding: 8px 10px; min-width: 0; font-size: 14px; }
}
body.theme-mission #btn-10exp { vertical-align: top; align-items: center; justify-content: center; }

/* --- Statistiques : tableau de données, contexte d'évolution, diagrammes --- */
body.theme-mission .table-wrapper table { background: rgba(6, 11, 34, .75); }
body.theme-mission .table-wrapper :is(th, td) { border: 1.5px solid rgba(34, 211, 238, .45); color: #fff; }
body.theme-mission .table-wrapper th { background: rgba(34, 211, 238, .12); color: var(--gold); }
body.theme-mission .table-wrapper { justify-content: safe center; }
body.theme-mission .contexte-evo[style] {
    background: rgba(6, 11, 34, .7) !important; color: #fff;
    border: 1px solid rgba(34, 211, 238, .3) !important; border-left: 4px solid var(--neon) !important;
}
body.theme-mission #diagramme:not(.visible) { box-shadow: none; }
body.theme-mission #legende { color: #dbe6ff; }
body.theme-mission .exercise-box > h2 {
    margin: 4px 0 10px; color: var(--neon); font-family: var(--hud-font);
    font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
}
/* La correction posée dans un encadré clair en ligne : l'encadré devient la feuille du rapport */
body.theme-mission #feedback.fb-rapport > div[style*="background"] {
    background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
}

/* --- Suites : touches d'opérations, champs nommés --- */
body.theme-mission .exercise-box .buttons > button.op {
    min-width: 54px; height: 48px; padding: 0 12px; margin: 4px;
    background: #22306A; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .5); border-radius: 10px;
    box-shadow: 0 3px 0 #070c26;
    font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800; text-transform: none; letter-spacing: 0;
}
body.theme-mission .exercise-box .buttons > button.op:hover { background: #2a3a7e; border-color: var(--neon); }
body.theme-mission :is(.input-group, .select-container) label { color: #fff; font-weight: 800; }
/* Diagrammes statistiques : écran clair, proportions du dessin conservées (sans étirement) */
body.theme-mission #diagramme { background: #F4F8FF; }
body.theme-mission #diagramme.visible { width: min(100%, 440px); height: auto; }
body.theme-mission #diagramme.visible[width="600"] { width: min(100%, 600px); }
@media (max-width: 600px) {
    body.theme-mission .table-wrapper :is(th, td) { padding: 7px 9px; font-size: 14px; }
}

/* --- Figures SVG des exercices (triangle, cercle trigonométrique, transformations) : écran clair --- */
body.theme-mission .exercise-box :is(#triangle, #trigCircle, .tf-svg) {
    background: #F4F8FF; border-radius: 14px; max-width: 100%; height: auto;
    box-shadow: 0 0 0 1.5px rgba(34, 211, 238, .45), 0 0 22px rgba(34, 211, 238, .2);
}
body.theme-mission #circleHint { color: var(--text-muted) !important; }
body.theme-mission .emoji-feedback { font-size: 26px; text-align: center; min-height: 0; }
/* Correction posée dans un encadré clair en ligne, dans #solution */
body.theme-mission #solution > div[style*="fff8e1"] {
    background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important;
}

/* --- Choix QCM en boutons (.qcm-btn) : touches de console --- */
body.theme-mission .exercise-box .qcm-btn {
    background: #17214d; color: #fff;
    border: 1.5px solid rgba(34, 211, 238, .4); border-radius: 12px; box-shadow: none;
    font-family: 'Nunito', sans-serif; font-weight: 800; text-transform: none; letter-spacing: 0;
}
body.theme-mission .exercise-box .qcm-btn:hover:not(:disabled) { background: #22306A; border-color: var(--neon); }
body.theme-mission .exercise-box .qcm-btn.selected { background: #0e3a5c; border-color: var(--neon); box-shadow: 0 0 0 2px rgba(34, 211, 238, .35); }
body.theme-mission .exercise-box .qcm-btn.correct { background: #0f4d33; border-color: #3ef08a; }
body.theme-mission .exercise-box .qcm-btn.wrong { background: #5a1a2a; border-color: #ff6b81; }
body.theme-mission .exercise-box .qcm-btn mjx-container { color: #fff !important; }

/* --- Fonctions 3e : tableau de valeurs envoyé par le serveur --- */
body.theme-mission #tableau table { margin: 10px auto; border-collapse: collapse; background: rgba(6, 11, 34, .75); }
body.theme-mission #tableau :is(th, td) { border: 1.5px solid rgba(34, 211, 238, .45) !important; color: #fff !important; padding: 8px 14px; background: transparent !important; }
body.theme-mission #tableau tr > :first-child { background: rgba(34, 211, 238, .12) !important; color: var(--gold) !important; }
/* --- Pythagore / Thalès : textes du raisonnement --- */
body.theme-mission #raisonnement p[style] { color: var(--text-muted) !important; font-family: var(--hud-font); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
body.theme-mission .fallback-message { color: #ff8aa0; }

/* --- Brevet (DNB) : badge de thème et touches ajoutées par la page --- */
body.theme-mission .theme-badge {
    background: rgba(242, 193, 46, .12) !important; color: var(--gold) !important;
    border: 1.5px solid rgba(242, 193, 46, .55) !important;
    font-family: var(--hud-font); letter-spacing: .12em;
}
body.theme-mission #exercice-text span[style*="border-radius"] {
    background: rgba(34, 211, 238, .12) !important; color: var(--neon) !important; border: 1px solid rgba(34, 211, 238, .5) !important;
}
body.theme-mission #exercice-text :is(em, span)[style*="color"] { color: var(--text-muted) !important; }
body.theme-mission #input-error-dnb { color: #ff8a8a !important; }

/* --- Solides (vocabulaire) : consigne, badge et figure sur écran clair --- */
body.theme-mission .consigne-text { color: #c9d3ff !important; font-size: 1.05rem !important; }
body.theme-mission .badge-exo {
    background: rgba(34, 211, 238, .12) !important; color: var(--neon) !important;
    border: 1px solid rgba(34, 211, 238, .5); font-family: var(--hud-font); letter-spacing: .12em; text-transform: uppercase;
}
body.theme-mission #solide-svg { background: #f4f7ff; border-radius: 12px; padding: 8px; box-sizing: content-box; box-shadow: 0 0 0 1px rgba(34, 211, 238, .35); }
body.theme-mission #userSelect { background-color: #16224f !important; color: #fff !important; border-color: rgba(34, 211, 238, .5) !important; }
/* Convergence : libellés des champs */
body.theme-mission .exercise-box label[for] { color: var(--text-muted) !important; font-family: var(--hud-font); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }

/* --- Touches d'insertion (−, /, π, +∞…) des pages limites, convergence, Brevet : clavier de bord --- */
body.theme-mission .exercise-box :is(.infinity-buttons > button:not(.help-button), #inputs button[type="button"], #symbol-buttons > button, #reponse-container .symbol-button) {
    min-width: 54px !important; height: 48px !important; padding: 0 12px !important; margin: 4px !important;
    background: #22306A !important; color: #fff !important;
    border: 1.5px solid rgba(34, 211, 238, .5) !important; border-radius: 10px !important;
    box-shadow: 0 3px 0 #070c26 !important;
    font-family: 'Nunito', sans-serif !important; font-size: 17px !important; font-weight: 800 !important;
    text-transform: none !important; letter-spacing: 0 !important; transform: none;
}
body.theme-mission .exercise-box :is(.infinity-buttons > button:not(.help-button), #inputs button[type="button"], #symbol-buttons > button, #reponse-container .symbol-button):hover {
    background: #2a3a7e !important; border-color: var(--neon) !important;
    box-shadow: 0 5px 0 #070c26, 0 0 12px rgba(34,211,238,.35) !important; transform: translateY(-1px);
}
body.theme-mission .exercise-box :is(.infinity-buttons > button:not(.help-button), #inputs button[type="button"], #symbol-buttons > button, #reponse-container .symbol-button):active {
    transform: translateY(2px); box-shadow: 0 1px 0 #070c26 !important;
}
/* Statistiques lycée : OUI / NON choisi (la page colore le bouton choisi en bleu) */
body.theme-mission #reponse-container .symbol-button[style*="52, 152, 219"],
body.theme-mission #reponse-container .symbol-button[style*="3498db"] {
    background: rgba(242, 193, 46, .18) !important; border-color: var(--gold) !important; color: var(--gold) !important;
    box-shadow: 0 0 14px rgba(242, 193, 46, .35) !important;
}
body.theme-mission #reponse-container .input-double { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
body.theme-mission #reponse-container .input-double > span { color: var(--gold); font-size: 26px; font-weight: 900; }
body.theme-mission #reponse-container .input-double input { width: min(140px, 32vw) !important; }
body.theme-mission #input-format-info { color: var(--text-muted) !important; }
body.theme-mission .donnees-box { background: rgba(6, 11, 34, .7); border: 1px solid rgba(34, 211, 238, .3); border-radius: 12px; padding: 10px 16px; margin: 10px auto; max-width: 520px; }
body.theme-mission .donnees-box .stat-item { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed rgba(34, 211, 238, .18); }
body.theme-mission .donnees-box .stat-item:last-child { border-bottom: 0; }
body.theme-mission .donnees-box .stat-label { color: var(--text-muted); }
body.theme-mission .donnees-box .stat-value { color: var(--gold); font-weight: 800; }

/* ---------- Modal résultat (série de 10 / fin d'évaluation) : rapport de mission ---------- */
body.theme-mission .result-modal-overlay { background: rgba(2, 4, 14, .78); }
body.theme-mission .result-modal {
    border: 1px solid rgba(34, 211, 238, .45); border-radius: 22px;
    box-shadow: 0 0 40px rgba(34, 211, 238, .18), 0 24px 60px rgba(0, 0, 0, .6);
}
body.theme-mission .result-modal-header { border-bottom: 1px solid rgba(34, 211, 238, .3); }
body.theme-mission .result-modal-icon { filter: drop-shadow(0 0 16px rgba(245, 200, 66, .45)); }
body.theme-mission .result-modal-title { font-family: 'Orbitron', 'Nunito', sans-serif; font-size: 1.25rem; letter-spacing: .03em; text-shadow: 0 0 18px rgba(34, 211, 238, .35); }
body.theme-mission .result-modal-body {
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #121c48, #0a1030);
}
body.theme-mission .result-modal-score {
    font-family: 'Orbitron', 'Nunito', sans-serif;
    background: linear-gradient(180deg, #ffe58a, #f5c842 55%, #e0a91c);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 14px rgba(245, 200, 66, .4));
}
body.theme-mission .result-modal-score-label { color: #aebae8; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
body.theme-mission .result-modal-stars .star-off { opacity: .18; filter: grayscale(1); }
body.theme-mission .result-modal-xp.xp-gained {
    background: rgba(62, 240, 138, .12); color: #3ef08a;
    border: 1px solid rgba(62, 240, 138, .55); box-shadow: 0 0 16px rgba(62, 240, 138, .25);
}
body.theme-mission .result-modal-xp.xp-warn {
    background: rgba(245, 200, 66, .1); color: #f5c842; border: 1px solid rgba(245, 200, 66, .55);
}
body.theme-mission .result-modal-close-btn {
    font-family: 'Orbitron', 'Nunito', sans-serif; letter-spacing: .1em; text-transform: uppercase; font-size: .95rem;
    background: linear-gradient(180deg, #ffd85a, #f5a623); color: #0B1A4A;
    box-shadow: 0 5px 0 #a86a0a, 0 0 22px rgba(245, 200, 66, .3);
}
body.theme-mission .result-modal-close-btn:hover { box-shadow: 0 7px 0 #a86a0a, 0 0 30px rgba(245, 200, 66, .55); }

/* --- HUD XP de l'élève non connecté : libellé unique pour toutes les pages ---
   Le texte écrit dans chaque page (« Inactif avec la version gratuite »…) est masqué
   et remplacé ici : pour changer ce libellé partout, il suffit de modifier la ligne « content ». */
/* Repli si le script ne tourne pas : simple libellé */
body.theme-mission .inactive-label:not(.mp-visiteur) { font-size: 0; }
body.theme-mission .inactive-label:not(.mp-visiteur)::after { content: 'Non sauvegardé si non connecté'; font-size: 13px; }
/* Visiteur : étiquette or + lien pour garder ses gains (texte posé par theme-fx.js) */
body.theme-mission .inactive-label.mp-visiteur { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
body.theme-mission .mp-non-sauve {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    font-family: var(--hud-font); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gold); background: rgba(245, 200, 66, .1); border: 1px solid rgba(245, 200, 66, .5);
}
body.theme-mission .mp-garder { font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800; color: var(--neon); text-decoration: underline; letter-spacing: 0; }
body.theme-mission .mp-garder:hover { color: #fff; }
body.theme-mission .xp-display.mp-gain { animation: mpGain .5s ease; }
@keyframes mpGain { 40% { box-shadow: 0 0 26px rgba(245, 200, 66, .45), inset 0 0 20px rgba(245, 200, 66, .1); } }

/* --- « Correction réservée aux abonnés » : carte claire, texte bleu marine, partout
   (quel que soit l'encadré où la page l'affiche : #solution, #feedback, autre…) --- */
body.theme-mission .correction-lock {
    background: #EAF2FF !important; color: #0F2350 !important;
    border: 2px dashed #9fb3dd !important; border-radius: 12px;
    text-shadow: none; filter: none;
}
body.theme-mission .correction-lock :is(p, strong, span, b, em) { color: #0F2350 !important; text-shadow: none; }
body.theme-mission .correction-lock strong { color: #123A9C !important; }
body.theme-mission .correction-lock button.lock-btn {
    background: linear-gradient(180deg, #ffd85a, #f5a623) !important; color: #0B1A4A !important;
    box-shadow: 0 3px 0 #a86a0a; font-weight: 900;
}

/* ============================================================
   POPUP « OFFRES » (programme Fondamentaux) : carte de mission
   Les pages gardent leur HTML : seul l'habillage change.
   ============================================================ */
body.theme-mission .offer-popup { background: rgba(2, 4, 14, .82); backdrop-filter: blur(6px); }
body.theme-mission .offer-popup-inner { max-width: 560px; }
body.theme-mission .premium-offer-card {
    position: relative; border-radius: 20px; overflow: hidden;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px),
        linear-gradient(180deg, #16205a, #0a1030);
    border: 1.5px solid rgba(245, 200, 66, .6);
    box-shadow: 0 0 50px rgba(245, 200, 66, .18), 0 0 30px rgba(34, 211, 238, .12), 0 30px 70px rgba(0, 0, 0, .65);
    animation: mpOfferIn .35s cubic-bezier(.34, 1.4, .64, 1) both;
}
@keyframes mpOfferIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* En-tête : accès à la flotte */
body.theme-mission .offer-header {
    position: relative; padding: 30px 20px 22px; backdrop-filter: none;
    background:
        radial-gradient(ellipse 70% 120% at 50% 0%, rgba(245, 200, 66, .22), transparent 70%),
        linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(34, 211, 238, .03));
    border-bottom: 1px solid rgba(245, 200, 66, .35);
}
body.theme-mission .offer-header::before {
    content: '🚀 Accès complet'; display: inline-block; margin-bottom: 10px; padding: 5px 12px;
    font-family: var(--hud-font); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
    color: var(--neon); background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .35); border-radius: 999px;
}
body.theme-mission .offer-title {
    font-family: var(--hud-font); font-weight: 900; font-size: 22px; letter-spacing: .1em; text-shadow: none;
    background: linear-gradient(90deg, #ffe58a, #f5c842 60%, #ffb347);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 14px rgba(245, 200, 66, .4));
}

/* Corps */
body.theme-mission .offer-body { background: transparent; padding: 22px 20px 24px; }
body.theme-mission .benefit-compact {
    background: rgba(5, 8, 22, .55); border: 1px solid rgba(34, 211, 238, .25); border-radius: 10px;
    color: #fff; font-weight: 700;
}
body.theme-mission .benefit-compact-icon { filter: drop-shadow(0 0 8px rgba(34, 211, 238, .45)); }

/* Tarifs : mensuel en néon, annuel en or (mis en avant) */
body.theme-mission .pricing-section > div[style] {
    position: relative; border-radius: 14px !important; padding: 16px 14px !important;
    background: rgba(5, 8, 22, .6) !important;
    border: 1.5px solid rgba(34, 211, 238, .45) !important;
}
body.theme-mission .pricing-section > div[style]:nth-of-type(2) {
    margin-top: 22px !important;
    border: 2px solid var(--gold) !important;
    background: linear-gradient(180deg, rgba(245, 200, 66, .12), rgba(5, 8, 22, .6)) !important;
    box-shadow: 0 0 26px rgba(245, 200, 66, .2);
}
body.theme-mission .pricing-section > div[style]:nth-of-type(2)::before {
    content: '★ Le plus choisi'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    font-family: var(--hud-font); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
    color: #0B1A4A; background: var(--gold); padding: 3px 12px; border-radius: 999px;
}
body.theme-mission .new-price-tag { font-family: var(--hud-font); color: #fff; text-shadow: 0 0 16px rgba(34, 211, 238, .45); }
body.theme-mission .pricing-section > div[style]:nth-of-type(2) .new-price-tag { color: var(--gold); text-shadow: 0 0 16px rgba(245, 200, 66, .45); }
body.theme-mission .pricing-section span[style] { color: var(--text-muted) !important; }
body.theme-mission .price-duration { color: var(--ok); font-weight: 800; }
body.theme-mission .discount-badge {
    background: rgba(62, 240, 138, .14); color: var(--ok); border: 1px solid rgba(62, 240, 138, .55);
    font-family: var(--hud-font); font-size: 11px; letter-spacing: .08em;
}

/* Bouton : or, texte bleu marine */
body.theme-mission .btn-secondary-action {
    font-family: var(--hud-font); font-weight: 900; font-size: 15px; letter-spacing: .1em; text-transform: uppercase;
    background: linear-gradient(180deg, #ffd85a, #f5a623); color: #0B1A4A;
    border-radius: 12px; box-shadow: 0 5px 0 #a86a0a, 0 0 24px rgba(245, 200, 66, .35);
}
body.theme-mission .btn-secondary-action:hover { color: #0B1A4A; box-shadow: 0 7px 0 #a86a0a, 0 0 32px rgba(245, 200, 66, .55); }

/* Fermer : anneau néon */
body.theme-mission .offer-popup-close {
    top: 30px; right: 10px; width: 36px; height: 36px; font-size: 22px;
    background: rgba(5, 8, 22, .8); color: var(--text-muted);
    border: 1.5px solid rgba(34, 211, 238, .5); box-shadow: 0 0 12px rgba(34, 211, 238, .25);
}
body.theme-mission .offer-popup-close:hover { color: #fff; background: rgba(255, 77, 109, .85); border-color: var(--hot); }

@media (max-width: 480px) {
    body.theme-mission .offer-title { font-size: 17px; letter-spacing: .06em; }
    body.theme-mission .offer-header { padding: 26px 50px 18px 16px; }
    body.theme-mission .offer-body { padding: 18px 14px 20px; }
}
body.theme-mission .pricing-section > div[style]:nth-of-type(2) .new-price-tag[style] { color: var(--gold) !important; }
body.theme-mission .benefit-compact { text-align: left; }

/* Encadrés de prix repérés par leur couleur d'origine (fonctionne aussi hors .pricing-section, ex. Brevet) */
body.theme-mission .offer-body div[style*="#2980b9"],
body.theme-mission .offer-body div[style*="#27ae60"] {
    position: relative; border-radius: 14px !important; padding: 16px 14px !important;
    background: rgba(5, 8, 22, .6) !important; border: 1.5px solid rgba(34, 211, 238, .45) !important;
}
body.theme-mission .offer-body div[style*="#27ae60"] {
    margin-top: 22px !important; border: 2px solid var(--gold) !important;
    background: linear-gradient(180deg, rgba(245, 200, 66, .12), rgba(5, 8, 22, .6)) !important;
    box-shadow: 0 0 26px rgba(245, 200, 66, .2);
}
body.theme-mission .offer-body div[style*="#27ae60"]::before {
    content: '★ Le plus choisi'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    font-family: var(--hud-font); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
    color: #0B1A4A; background: var(--gold); padding: 3px 12px; border-radius: 999px;
}
body.theme-mission .offer-body div[style*="#27ae60"] .new-price-tag { color: var(--gold) !important; text-shadow: 0 0 16px rgba(245, 200, 66, .45); }
body.theme-mission .offer-body span[style*="color"]:not(.new-price-tag) { color: var(--text-muted) !important; }
