
:root{
  --navy:#1B2A4A; --gold:#C8A84B; --gold2:#E8C86A;
  --bg:#0F1825; --bg2:#162035; --bg3:#1E2D45; --bg4:#243554;
  --text:#D0DCF0; --muted:#7A90B8; --green:#2ECC71; --red:#E74C3C; --orange:#E67E22; --purple:#9B59B6;
  --border:rgba(200,168,75,.22); --border2:rgba(200,168,75,.55);
  --radius:14px; --sans:Arial,system-ui,sans-serif; --mono:"Consolas","Courier New",monospace;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:var(--sans)}
a{color:inherit}
.app-header{position:sticky;top:0;z-index:30;background:rgba(22,32,53,.96);backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.header-inner{max-width:1280px;margin:0 auto;padding:14px 20px;display:flex;gap:16px;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none}
.brand-icon{width:38px;height:38px;border-radius:12px;background:var(--gold);color:var(--navy);font-weight:900;display:grid;place-items:center}
.brand-title{font-weight:900;color:var(--gold);letter-spacing:.06em;text-transform:uppercase;font-size:14px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}
.nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.nav a,.pill,.btn{border:1px solid var(--border2);background:rgba(200,168,75,.08);color:var(--gold);border-radius:999px;padding:9px 13px;text-decoration:none;font-weight:800;font-size:13px;cursor:pointer}
.nav a:hover,.btn:hover{background:rgba(200,168,75,.17)}
.nav a.active,.btn.primary{background:var(--gold);color:var(--navy)}
.container{max-width:1280px;margin:0 auto;padding:24px 20px 50px}
.hero{background:linear-gradient(135deg,var(--bg2),var(--bg3));border:1px solid var(--border);border-radius:24px;padding:28px;margin-bottom:20px;box-shadow:0 20px 70px rgba(0,0,0,.22)}
.hero h1{font-size:34px;margin:0 0 10px;color:#fff}
.hero p{margin:0;color:var(--muted);line-height:1.65;max-width:980px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.card,.panel,.exercise{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:18px;margin-bottom:16px}
.card{display:block;text-decoration:none;transition:.18s}
.card:hover{transform:translateY(-2px);border-color:var(--border2)}
.card h2,.panel h2,.exercise h2{margin:0 0 8px;color:var(--gold)}
.card p,.panel p,.exercise p{line-height:1.6;color:var(--text)}
.small{font-size:12px;color:var(--muted)}
.kpi{display:flex;align-items:center;gap:12px}
.kpi-icon{font-size:28px;background:var(--bg3);border:1px solid var(--border);border-radius:14px;width:54px;height:54px;display:grid;place-items:center}
.kpi strong{display:block;font-size:22px;color:white}
.progress{height:12px;border-radius:99px;background:var(--bg);border:1px solid var(--border);overflow:hidden;margin:10px 0}
.progress > span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--gold),var(--green));transition:.4s}
.breadcrumb{color:var(--muted);font-size:13px;margin-bottom:14px}
.breadcrumb a{color:var(--gold);text-decoration:none}
.module-layout{display:grid;grid-template-columns:280px 1fr;gap:18px}
.sidebar{position:sticky;top:84px;align-self:start;background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius);padding:14px;max-height:calc(100vh - 110px);overflow:auto}
.level-tabs,.mode-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.tab{border:1px solid var(--border2);background:var(--bg2);color:var(--gold);border-radius:999px;padding:9px 14px;font-weight:900;cursor:pointer}
.tab.active{background:var(--gold);color:var(--navy)}
.level-list{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.level-list button{background:var(--bg3);border:1px solid var(--border);color:var(--text);border-radius:10px;padding:9px;text-align:left;cursor:pointer}
.level-list button.active{border-color:var(--gold);color:var(--gold)}
.badge{display:inline-block;border-radius:7px;padding:4px 8px;font-size:11px;font-weight:900;margin-right:6px;text-transform:uppercase}
.facile{background:rgba(46,204,113,.15);color:var(--green)}
.intermediaire{background:rgba(230,126,34,.15);color:var(--orange)}
.avance{background:rgba(231,76,60,.15);color:var(--red)}
.expert{background:rgba(155,89,182,.15);color:#C39BD3}
textarea,input[type=text]{width:100%;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:12px;padding:12px;font-family:var(--mono);font-size:14px;margin:10px 0;outline:none}
textarea{min-height:90px;resize:vertical}
textarea:focus,input:focus{border-color:var(--gold)}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.answer,.hint,.result-box{display:none;border-radius:12px;padding:12px;margin-top:12px;border:1px solid var(--border)}
.answer{background:rgba(46,204,113,.07);border-color:rgba(46,204,113,.25)}
.hint{background:rgba(200,168,75,.07)}
.answer.show,.hint.show,.result-box.show{display:block}
.result-ok{color:var(--green);font-weight:900}.result-ko{color:var(--red);font-weight:900}.result-warn{color:var(--orange);font-weight:900}
pre{white-space:pre-wrap;font-family:var(--mono);line-height:1.55;color:#CFE8D4}
.table{width:100%;border-collapse:collapse;margin:10px 0;background:var(--bg)}
.table th,.table td{border:1px solid rgba(200,168,75,.16);padding:8px;text-align:left;vertical-align:top}
.table th{color:var(--gold);background:var(--bg3)}
.badges{display:flex;flex-wrap:wrap;gap:10px}
.reward{background:var(--bg3);border:1px solid var(--border);border-radius:14px;padding:12px;min-width:180px}
.reward.unlocked{border-color:var(--green);box-shadow:0 0 0 1px rgba(46,204,113,.15)}
.reward .ico{font-size:24px}
.exam-box{display:grid;grid-template-columns:1fr 220px;gap:16px}
.timer{font-size:28px;font-weight:900;color:var(--gold);text-align:center}
.footer{text-align:center;color:var(--muted);padding:32px}
.hidden{display:none!important}
@media(max-width:900px){
 .header-inner{align-items:flex-start;flex-direction:column}
 .module-layout,.exam-box{grid-template-columns:1fr}
 .sidebar{position:static;max-height:none}
 .hero h1{font-size:26px}
}

.hint::before{content:"💡 Indice pédagogique";display:block;color:var(--gold);font-weight:900;margin-bottom:6px}
.answer::before{content:"🔑";margin-right:6px}
