/* Shinobi Code — feuille de style.
   Nuit de Konoha (fond), parchemins (guide), bois laqué (barres), sceaux rouges. */
:root {
  --nuit: #0d1222;
  --nuit-2: #151c33;
  --nuit-3: #1f2847;
  --encre: #1c1526;
  --parchemin: #f5e9cb;
  --parchemin-2: #ead8ac;
  --parchemin-bord: #b9915a;
  --bois: #5a3a22;
  --bois-2: #3d2716;
  --orange: #f28c28;
  --orange-f: #c96a12;
  --rouge: #c0392b;
  --rouge-f: #8e2318;
  --chakra: #3ba7ff;
  --chakra-f: #1f6fc0;
  --feuille: #4f8f3a;
  --or: #e8b64c;
  --ok: #3f9b4b;
  --ko: #c0392b;
  --texte: #2a1d14;
  --texte-clair: #f3ecdf;
  --muet: #8a7a64;
  --rayon: 12px;
  --ombre: 0 10px 30px rgba(0, 0, 0, .35);
  --f-titre: "Shojumaru", "Trebuchet MS", sans-serif;
  --f-kanji: "Yuji Syuku", "Hiragino Mincho ProN", serif;
  --f-texte: "M PLUS Rounded 1c", "Nunito", system-ui, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #2a2f5c 0%, transparent 60%), var(--nuit);
  color: var(--texte-clair);
  font-family: var(--f-texte);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}
[hidden] { display: none !important; }
a { color: var(--chakra); }
code, pre, kbd { font-family: var(--f-code); }
.muet { color: var(--muet); }

/* ------------------------------------------------------------------ boutons */
.btn {
  font-family: var(--f-texte); font-weight: 800; font-size: 14px;
  border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  color: #fff; background: #4b5577; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .08s, filter .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.btn.ninja { box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25); text-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn.orange { background: linear-gradient(#f6a046, var(--orange-f)); }
.btn.bleu { background: linear-gradient(#57b5ff, var(--chakra-f)); }
.btn.rouge { background: linear-gradient(#df5545, var(--rouge-f)); }
.btn.vert { background: linear-gradient(#64b157, #2f7a33); }
.btn.gris { background: linear-gradient(#5d6688, #3c4463); }
.btn.petit { padding: 6px 10px; font-size: 13px; }
.btn-icone { background: transparent; border: 0; color: var(--texte-clair); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.btn-icone:hover { background: rgba(255, 255, 255, .1); }

/* ------------------------------------------------------------------ parchemin */
.parchemin {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .45), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(160, 110, 50, .14), transparent 45%),
    linear-gradient(var(--parchemin), var(--parchemin-2));
  color: var(--texte);
  border-radius: 6px;
  box-shadow: var(--ombre), inset 0 0 0 1px rgba(120, 80, 30, .25), inset 0 0 40px rgba(150, 100, 40, .18);
}

/* ================================================================== VILLAGE */
.vue-hub { position: fixed; inset: 0; display: flex; flex-direction: column; }
.hub-3d { position: absolute; inset: 0; }
.hub-3d canvas { display: block; }
.hub-voile { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 10, 22, .78) 0%, rgba(8, 10, 22, .35) 46%, rgba(8, 10, 22, .05) 70%, rgba(8, 10, 22, .55) 100%); }
.hub-entete { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 18px 28px 6px; pointer-events: none; }
.hub-entete > * { pointer-events: auto; }
.hub-logo { display: flex; align-items: center; gap: 14px; }
.hub-sceau { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--rouge); color: #fff3e0;
  font-family: var(--f-kanji); font-size: 36px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .12), 0 6px 18px rgba(0, 0, 0, .5); transform: rotate(-8deg); }
.hub-titre { font-family: var(--f-titre); font-size: 40px; line-height: 1; letter-spacing: 1px; color: #fff4dc;
  text-shadow: 0 3px 0 var(--orange-f), 0 6px 18px rgba(0, 0, 0, .6); }
.hub-titre em { font-style: normal; color: var(--orange); text-shadow: 0 3px 0 #6b2e05, 0 6px 18px rgba(0, 0, 0, .6); }
.hub-sous { color: #d8cdb7; font-weight: 700; letter-spacing: .5px; margin-top: 6px; }
.hub-rang { display: flex; align-items: center; gap: 12px; background: rgba(13, 18, 34, .75); border: 1px solid rgba(255, 255, 255, .12);
  padding: 8px 14px; border-radius: 14px; backdrop-filter: blur(6px); }
.hub-rang .kanji { font-family: var(--f-kanji); font-size: 30px; color: var(--or); width: 44px; height: 44px; display: grid; place-items: center;
  border: 2px solid var(--or); border-radius: 50%; }
.hub-rang .nom { font-family: var(--f-titre); font-size: 20px; }
.hub-rang .barre-rang { width: 160px; height: 8px; background: rgba(255, 255, 255, .12); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.hub-rang .barre-rang i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--or)); }
.hub-corps { position: relative; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; padding: 10px 28px 10px; min-height: 0; pointer-events: none; }
.hub-corps > * { pointer-events: auto; }
.tableau-missions { overflow: auto; padding-right: 6px; max-width: 900px; }
.tableau-titre { font-family: var(--f-titre); font-size: 22px; margin: 6px 0 12px; color: #fff4dc; display: flex; align-items: center; gap: 10px; }
.tableau-titre span { font-family: var(--f-kanji); color: var(--orange); font-size: 26px; }
.cartes-missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding-bottom: 12px; }
.carte-mission {
  position: relative; text-align: left; cursor: pointer; border: 0; padding: 14px 14px 12px 16px; border-radius: 10px; color: var(--texte);
  background: linear-gradient(var(--parchemin), var(--parchemin-2)); box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(120, 80, 30, .3);
  transition: transform .15s, box-shadow .15s; font-family: var(--f-texte); overflow: hidden;
}
.carte-mission::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c-rang, #888); }
.carte-mission:hover, .carte-mission.survol { transform: translateY(-3px) rotate(-.3deg); box-shadow: 0 12px 26px rgba(0, 0, 0, .55), 0 0 0 2px var(--c-rang); }
.carte-mission .cm-haut { display: flex; align-items: center; gap: 10px; }
.carte-mission .cm-kanji { font-family: var(--f-kanji); font-size: 30px; color: var(--rouge-f); width: 44px; text-align: center; line-height: 1; }
.carte-mission .cm-titre { font-family: var(--f-titre); font-size: 17px; line-height: 1.15; }
.carte-mission .cm-lieu { font-size: 12px; color: #6d5b45; font-weight: 700; }
.carte-mission .cm-resume { font-size: 13px; margin: 8px 0; color: #3b2c1f; }
.carte-mission .cm-notions { display: flex; flex-wrap: wrap; gap: 4px; }
.carte-mission .cm-notions span { font-size: 11px; font-weight: 800; background: rgba(90, 58, 34, .12); color: #5a3a22; padding: 2px 7px; border-radius: 99px; }
.carte-mission .cm-bas { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; font-weight: 800; color: #6d5b45; }
.carte-mission .cm-prog { flex: 1; height: 6px; background: rgba(90, 58, 34, .15); border-radius: 3px; margin: 0 10px; overflow: hidden; }
.carte-mission .cm-prog i { display: block; height: 100%; background: var(--ok); }
.carte-mission.finie .cm-tampon { position: absolute; right: 10px; top: 8px; font-family: var(--f-kanji); color: var(--rouge); font-size: 22px;
  border: 3px solid var(--rouge); border-radius: 6px; padding: 0 6px; transform: rotate(12deg); opacity: .85; }
.badge-rang { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; font-family: var(--f-titre); font-size: 20px; color: #fff;
  background: var(--c-rang, #777); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); flex: none; }
[data-rang="D"] { --c-rang: #8a8f99; } [data-rang="C"] { --c-rang: #3f9b4b; } [data-rang="B"] { --c-rang: #2f7fd0; }
[data-rang="A"] { --c-rang: #c0392b; } [data-rang="S"] { --c-rang: #d4a12a; }
.hub-cote { display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.hub-intro { padding: 16px 18px; }
.hub-intro h2 { font-family: var(--f-titre); margin: 0 0 6px; font-size: 20px; color: var(--rouge-f); }
.hub-intro ul { padding-left: 18px; margin: 8px 0; }
.hub-intro li { margin: 4px 0; font-size: 14px; }
.hub-boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mentions { position: relative; font-size: 11px; color: #9c94a8; padding: 6px 28px 10px; text-align: left; }
.statut-python { font-size: 13px; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: #d9d2c4; white-space: nowrap; }
.statut-python.pret { background: rgba(63, 155, 75, .25); color: #b9f0bf; }
.statut-python.erreur { background: rgba(192, 57, 43, .3); color: #ffc9c1; }
.hub-cote .statut-python { align-self: flex-start; }

/* ================================================================== MISSION */
.vue-mission { position: fixed; inset: 0; display: flex; flex-direction: column; }
.entete { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: linear-gradient(#1c2342, #121831);
  border-bottom: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); z-index: 3; }
.entete-mission { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-titre { font-family: var(--f-titre); font-size: 19px; line-height: 1.1; white-space: nowrap; }
.m-lieu { font-size: 12px; color: #b9b2c6; font-weight: 700; white-space: nowrap; }
.etapes { display: flex; gap: 4px; flex: 1; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.etapes button { border: 0; background: rgba(255, 255, 255, .06); color: #d7d0e4; font-family: var(--f-texte); font-weight: 800; font-size: 13px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.etapes button:hover { background: rgba(255, 255, 255, .12); }
.etapes button.actif { background: var(--orange); color: #1a1008; }
.etapes button.ok::after { content: "✓"; color: #7be08a; font-weight: 900; }
.etapes button.actif.ok::after { color: #1d5a25; }
.entete-droite { display: flex; align-items: center; gap: 8px; }

.app { flex: 1; display: flex; min-height: 0; padding: 10px; gap: 0; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.col-gauche { width: 46%; }
.col-droite { flex: 1; }
.separateur.v { width: 10px; cursor: col-resize; position: relative; flex: none; }
.separateur.v::after { content: ""; position: absolute; left: 4px; top: 40%; height: 20%; width: 2px; background: rgba(255, 255, 255, .15); border-radius: 2px; }
.separateur.h { height: 10px; cursor: row-resize; position: relative; flex: none; }
.separateur.h::after { content: ""; position: absolute; top: 4px; left: 40%; width: 20%; height: 2px; background: rgba(255, 255, 255, .15); border-radius: 2px; }

/* --------------------------------------------------------------- guide */
.guide { flex: 1 1 55%; min-height: 120px; overflow: auto; padding: 18px 22px 22px; position: relative; font-size: 14.5px; }
.guide h2 { font-family: var(--f-titre); color: var(--rouge-f); font-size: 22px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.guide h3 { font-family: var(--f-titre); font-size: 16.5px; margin: 18px 0 6px; color: #3b2516; }
.guide p { margin: 7px 0; }
.guide ul, .guide ol { padding-left: 22px; margin: 6px 0; }
.guide li { margin: 3px 0; }
.guide code { background: rgba(90, 58, 34, .12); padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #5b1f12; }
.guide pre { background: #1d1726; color: #f0e6d6; padding: 10px 12px; border-radius: 8px; overflow: auto; font-size: 12.8px; line-height: 1.45; margin: 8px 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.guide pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.guide table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.guide th, .guide td { border: 1px solid rgba(120, 80, 30, .35); padding: 3px 8px; text-align: center; }
.guide th { background: rgba(120, 80, 30, .12); }
.guide kbd { background: #fff; border: 1px solid #c8b48c; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
.guide .pts { font-family: var(--f-texte); font-size: 12px; background: var(--rouge); color: #fff; padding: 1px 7px; border-radius: 99px; vertical-align: middle; }
.guide .etape-pied { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 12px; border-top: 1px dashed rgba(120, 80, 30, .4); }
.dialogue { display: flex; gap: 12px; align-items: flex-start; background: rgba(255, 255, 255, .55); border-radius: 12px; padding: 10px 12px; margin: 10px 0;
  box-shadow: inset 0 0 0 1px rgba(120, 80, 30, .25); }
.dialogue .portrait { flex: none; width: 54px; height: 54px; border-radius: 50%; overflow: hidden; background: #2a3150; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0, 0, 0, .3); }
.dialogue .portrait img { width: 100%; height: 100%; display: block; }
.dialogue > div:last-child { flex: 1; }
.astuce { background: rgba(59, 167, 255, .12); border-left: 4px solid var(--chakra); padding: 6px 10px; border-radius: 0 8px 8px 0; }
.attention { background: rgba(192, 57, 43, .1); border-left: 4px solid var(--rouge); padding: 6px 10px; border-radius: 0 8px 8px 0; }
.todo { list-style: none; padding-left: 4px !important; }
.todo li { position: relative; padding-left: 26px; }
.todo li::before { content: "巻"; font-family: var(--f-kanji); position: absolute; left: 0; top: 0; color: var(--rouge); font-size: 16px; }
details.indice { background: rgba(232, 182, 76, .16); border-radius: 8px; padding: 4px 10px; margin: 6px 0; border: 1px solid rgba(180, 130, 40, .35); }
details.indice summary { cursor: pointer; font-weight: 800; color: #6b4a12; }
details.indice[open] { background: rgba(232, 182, 76, .24); }
details.fiche { background: rgba(255, 255, 255, .4); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
details.fiche summary { cursor: pointer; font-weight: 800; }
.schema { background: rgba(28, 21, 38, .06); border: 1px dashed rgba(120, 80, 30, .45); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.schema-titre { font-family: var(--f-titre); font-size: 14px; margin-bottom: 6px; color: #5a3a22; }
.quiz { background: rgba(255, 255, 255, .5); border-radius: 12px; padding: 10px 12px; margin: 12px 0; box-shadow: inset 0 0 0 2px rgba(59, 167, 255, .35); }
.quiz::before { content: "❓ Quiz"; font-family: var(--f-titre); font-size: 13px; color: var(--chakra-f); }
.quiz-choix { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.quiz-choix button { text-align: left; border: 0; background: #fff; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-family: var(--f-texte);
  font-size: 13.5px; color: var(--texte); box-shadow: 0 1px 0 rgba(0, 0, 0, .15), inset 0 0 0 1px rgba(120, 80, 30, .2); }
.quiz-choix button:hover:not(:disabled) { box-shadow: 0 1px 0 rgba(0, 0, 0, .15), inset 0 0 0 2px var(--chakra); }
.quiz-choix button.bon { background: #d9f2dc; box-shadow: inset 0 0 0 2px var(--ok); }
.quiz-choix button.faux { background: #f8d9d4; box-shadow: inset 0 0 0 2px var(--ko); text-decoration: line-through; }
.quiz-choix button:disabled { cursor: default; }
.quiz-expl { display: none; margin-top: 8px; font-size: 13.5px; background: rgba(63, 155, 75, .12); padding: 6px 10px; border-radius: 8px; }
.quiz.repondu .quiz-expl { display: block; }
.gestes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.geste { background: #fff; border-radius: 8px; padding: 8px; font-size: 12.5px; box-shadow: inset 0 0 0 1px rgba(120, 80, 30, .25); display: flex; flex-direction: column; gap: 4px; }
.geste b { font-family: var(--f-titre); font-weight: 400; }
.geste.g1 b { color: var(--chakra-f); } .geste.g2 b { color: var(--orange-f); } .geste.g3 b { color: var(--rouge-f); }

/* --------------------------------------------------------------- éditeur */
.panneau { background: #171b2e; border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px rgba(255, 255, 255, .06); overflow: hidden; display: flex; flex-direction: column; }
.editeur-boite { flex: 1 1 45%; min-height: 140px; }
.barre { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; gap: 8px;
  background: linear-gradient(#3d2716, #2b1b0f); border-bottom: 2px solid #1a0f07; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.fichier { font-family: var(--f-code); font-size: 13px; color: #f1dfc2; display: flex; align-items: center; gap: 6px; padding-left: 6px; }
.point { width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.point.sale { background: var(--orange); }
.boutons { display: flex; gap: 6px; }
.editeur { flex: 1; min-height: 0; }
.editeur .CodeMirror { height: 100%; font-family: var(--f-code); font-size: 13.5px; line-height: 1.5; background: #14172a; color: #e8e3f3; }
.CodeMirror-gutters { background: #11142a; border-right: 1px solid #23284a; }
.CodeMirror-linenumber { color: #4d557d; }
.CodeMirror-cursor { border-left: 2px solid var(--orange); }
.CodeMirror-activeline-background { background: rgba(255, 255, 255, .04); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: rgba(59, 167, 255, .25); }
.CodeMirror-matchingbracket { color: #fff !important; background: rgba(242, 140, 40, .35); }
.cm-s-default .cm-keyword { color: #ff8a5c; font-weight: 600; }
.cm-s-default .cm-def { color: #ffd166; }
.cm-s-default .cm-variable { color: #e8e3f3; }
.cm-s-default .cm-variable-2 { color: #9cd3ff; }
.cm-s-default .cm-builtin { color: #7fd6c2; }
.cm-s-default .cm-string { color: #b5e08a; }
.cm-s-default .cm-number { color: #f7a8ff; }
.cm-s-default .cm-comment { color: #7c7aa0; font-style: italic; }
.cm-s-default .cm-operator { color: #ffb0a0; }
.cm-s-default .cm-property { color: #9cd3ff; }
.cm-s-default .cm-meta { color: #f2c46d; }
.ligne-erreur { background: rgba(192, 57, 43, .25); }
.pied-editeur { font-size: 11px; color: #7e86ad; padding: 4px 10px; background: #11142a; border-top: 1px solid #23284a; }

/* --------------------------------------------------------------- scène + onglets */
.scene-boite { flex: 1; min-height: 0; }
.onglets { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.onglets button { border: 0; background: transparent; color: #e6d3b5; font-family: var(--f-texte); font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.onglets button:hover { background: rgba(255, 255, 255, .08); }
.onglets button.actif { background: rgba(242, 140, 40, .9); color: #1a1008; }
.score { font-size: 11px; background: rgba(0, 0, 0, .3); padding: 0 6px; border-radius: 99px; }
.score.tout { background: var(--ok); color: #fff; }
.pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; }
.onglets button.actif .pastille { background: #1a1008; }
.onglet-contenu { display: none; flex: 1; min-height: 0; position: relative; }
.onglet-contenu.actif { display: block; }
.onglet-contenu.defile { overflow: auto; padding: 14px 16px; }
.scene3d { position: absolute; inset: 0; background: #0b0f1d; }
.scene3d canvas { display: block; }
.chargement-scene { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-titre); color: #d8cdb7; pointer-events: none; font-size: 18px; }

/* HUD (au-dessus de la 3D) : éléments posés par les scènes */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-texte); }
.hud > * { pointer-events: auto; }
.hud .hud-bandeau { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: rgba(13, 18, 34, .82); border: 1px solid rgba(255, 255, 255, .14);
  padding: 6px 14px; border-radius: 12px; font-weight: 800; font-size: 14px; text-align: center; backdrop-filter: blur(4px); max-width: 90%; }
.hud .hud-coin { position: absolute; background: rgba(13, 18, 34, .82); border: 1px solid rgba(255, 255, 255, .14); padding: 8px 10px; border-radius: 12px;
  font-size: 13px; backdrop-filter: blur(4px); }
.hud .hg { left: 10px; top: 10px; } .hud .hd { right: 10px; top: 10px; } .hud .bg { left: 10px; bottom: 10px; } .hud .bd { right: 10px; bottom: 10px; }
.hud .hud-bas { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 96%; }
.hud .titre-hud { font-family: var(--f-titre); font-size: 13px; color: var(--or); margin-bottom: 4px; }
.hud .grand-titre { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--f-titre); font-size: 44px; color: #fff4dc; text-align: center;
  text-shadow: 0 4px 0 var(--orange-f), 0 10px 30px rgba(0, 0, 0, .7); pointer-events: none; animation: apparition .6s cubic-bezier(.2, 1.6, .4, 1); white-space: nowrap; }
.hud .grand-titre small { display: block; font-size: 18px; font-family: var(--f-texte); font-weight: 800; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); color: #ffe8c2; }
@keyframes apparition { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.jauge { width: 200px; height: 14px; background: rgba(0, 0, 0, .5); border-radius: 7px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); position: relative; }
.jauge i { display: block; height: 100%; transition: width .4s; }
.jauge span { position: absolute; inset: 0; font-size: 10px; font-weight: 900; text-align: center; line-height: 13px; text-shadow: 0 1px 2px #000; }
.puce { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .1); border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 800; }

/* --------------------------------------------------------------- tests */
.tests-entete { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tests-entete .gros { font-family: var(--f-titre); font-size: 20px; }
.groupe-tests { margin-bottom: 14px; }
.groupe-tests h4 { margin: 0 0 6px; font-family: var(--f-titre); font-weight: 400; font-size: 15px; color: var(--or); display: flex; gap: 8px; align-items: center; }
.test { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .04); margin-bottom: 4px; font-size: 13.5px; }
.test .ic { flex: none; width: 20px; text-align: center; font-weight: 900; }
.test.ok .ic { color: #7be08a; } .test.ko .ic { color: #ff8f80; } .test.encours .ic { color: var(--or); }
.test .msg { color: #ffcabf; font-size: 12.5px; margin-top: 2px; font-family: var(--f-code); white-space: pre-wrap; }
.test .ms { margin-left: auto; color: #7e86ad; font-size: 11px; flex: none; }
.erreur-boite { background: rgba(192, 57, 43, .15); border: 1px solid rgba(192, 57, 43, .5); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.erreur-boite .type { font-weight: 900; color: #ffb3a7; }
.erreur-boite .pile { font-family: var(--f-code); font-size: 12px; color: #f0d7d2; white-space: pre-wrap; margin-top: 4px; }
.erreur-boite .conseil { margin-top: 6px; color: #ffe6a8; font-size: 13px; }
.console { font-family: var(--f-code); font-size: 13px; white-space: pre-wrap; color: #dfe6ff; background: #0c0f1e; }
.console .ms { color: #7e86ad; }
.vide { color: #7e86ad; font-style: italic; }

/* --------------------------------------------------------------- arbre des appels */
.appels-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 8px 12px; min-width: 110px; }
.stat b { display: block; font-family: var(--f-titre); font-weight: 400; font-size: 22px; color: var(--orange); }
.stat span { font-size: 12px; color: #b9b2c6; font-weight: 700; }
.comparaison { margin: 10px 0 16px; }
.comparaison .ligne { display: grid; grid-template-columns: 210px 1fr 80px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; }
.comparaison .barre-c { height: 14px; background: rgba(255, 255, 255, .06); border-radius: 7px; overflow: hidden; }
.comparaison .barre-c i { display: block; height: 100%; background: linear-gradient(90deg, var(--chakra), #8fd3ff); }
.comparaison .ligne.toi .barre-c i { background: linear-gradient(90deg, var(--orange), var(--or)); }
.comparaison .ligne span:last-child { text-align: right; font-family: var(--f-code); }
.arbre-svg-boite { overflow: auto; background: #0e1224; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .06); max-height: 52vh; }
.arbre-svg-boite svg text { font-family: var(--f-code); font-size: 10px; fill: #d9d4e6; }
.arbre-noeud { cursor: default; }
.arbre-legende { font-size: 12px; color: #b9b2c6; margin: 6px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.arbre-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.module-src { font-family: var(--f-code); font-size: 12.5px; white-space: pre; background: #0c0f1e; padding: 12px; border-radius: 10px; overflow: auto; color: #e8e3f3; }

/* --------------------------------------------------------------- modale, toasts, célébration */
.voile { position: fixed; inset: 0; background: rgba(5, 6, 14, .7); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(3px); }
.carte-modale { padding: 18px 20px; max-width: 460px; width: calc(100% - 32px); }
.modale-boutons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: rgba(20, 24, 44, .95); border: 1px solid rgba(255, 255, 255, .15); color: var(--texte-clair); padding: 10px 14px; border-radius: 12px; font-weight: 700;
  box-shadow: var(--ombre); animation: toast .3s ease-out; max-width: 380px; font-size: 14px; }
.toast.ok { border-color: var(--ok); } .toast.ko { border-color: var(--ko); }
@keyframes toast { from { transform: translateY(12px); opacity: 0; } }
.celebration { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: radial-gradient(circle, rgba(242, 140, 40, .35), rgba(5, 6, 14, .85)); cursor: pointer; }
.celebration .cel-carte { text-align: center; animation: apparition2 .7s cubic-bezier(.2, 1.6, .4, 1); }
.celebration .cel-sceau { font-family: var(--f-kanji); font-size: 120px; color: var(--rouge); line-height: 1; text-shadow: 0 0 40px rgba(255, 120, 60, .6); }
.celebration .cel-titre { font-family: var(--f-titre); font-size: 46px; color: #fff4dc; text-shadow: 0 4px 0 var(--orange-f), 0 10px 30px rgba(0, 0, 0, .8); }
.celebration .cel-sous { font-size: 18px; font-weight: 800; color: #ffe8c2; margin-top: 6px; }
@keyframes apparition2 { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }

/* --------------------------------------------------------------- petits écrans */
@media (max-width: 1000px) {
  body { overflow: auto; }
  .hub-corps { grid-template-columns: 1fr; overflow: auto; }
  .app { flex-direction: column; overflow: auto; }
  .col-gauche { width: 100% !important; }
  .col-droite { min-height: 70vh; }
  .separateur { display: none; }
  .etapes { display: none; }
}
@media (max-width: 640px) {
  .hub-entete { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px 4px; }
  .hub-corps { padding: 8px 16px; }
  .hub-titre { font-size: 30px; }
  .m-lieu { display: none; }
}

/* ===================================================================== MONDE OUVERT (aventure) */
.vue-monde { position: fixed; inset: 0; background: #9cc7e8; }
.monde-3d { position: absolute; inset: 0; }
.monde-3d canvas { display: block; }
.monde-chargement { position: absolute; inset: 0; display: grid; place-items: center; font: 400 28px var(--f-titre); color: var(--parchemin); background: radial-gradient(circle, #23305a, #0d1222); z-index: 5; }
.monde-chargement[hidden] { display: none; }
.monde-tableau { position: absolute; right: 12px; bottom: 12px; z-index: 4; }
.monde-hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-texte); color: var(--texte-clair); z-index: 3; }
.monde-hud > * { pointer-events: auto; }
.monde-hud [hidden] { display: none !important; }
.mh-profil { position: absolute; left: 12px; top: 12px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: rgba(13, 18, 34, .78); border: 1px solid rgba(232, 182, 76, .5); border-radius: var(--rayon); box-shadow: var(--ombre); min-width: 250px; }
.mh-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #1a1208; font: 400 26px var(--f-kanji); }
.mh-nom { font: 400 18px var(--f-titre); color: var(--or); }
.mh-rang { font-size: 13px; }
.mh-xp { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .15); margin: 5px 0 3px; overflow: hidden; }
.mh-xp i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--or)); transition: width .4s; }
.mh-ryo { font-size: 12px; opacity: .85; }
.mh-mini { position: absolute; right: 12px; top: 12px; width: 180px; height: 180px; }
.mh-zone { position: absolute; left: 50%; top: 120px; transform: translateX(-50%); font: 400 26px var(--f-titre); color: #fff6e0; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); pointer-events: none; }
.mh-zone.flash { animation: mhZone 2.6s ease; }
@keyframes mhZone { 0% { opacity: 0; transform: translate(-50%, -10px) scale(1.1); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: .75; } }
.mh-prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 8px 16px; border-radius: 20px; background: rgba(13, 18, 34, .85); border: 1px solid var(--or); font-weight: 700; }
.mh-aide { position: absolute; left: 12px; bottom: 12px; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: rgba(13, 18, 34, .6); max-width: 60%; }
.mh-boutons { position: absolute; right: 12px; top: 200px; display: flex; flex-direction: column; gap: 6px; }
.mh-boutons button, .mh-choix button, .mh-panneau button { font: 700 13px var(--f-texte); padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(232, 182, 76, .6); background: rgba(13, 18, 34, .82); color: var(--texte-clair); cursor: pointer; }
.mh-boutons button:hover, .mh-choix button:hover, .mh-panneau button:hover:not(:disabled) { background: var(--orange-f); }
.mh-panneau button:disabled { opacity: .45; cursor: default; }
.mh-dialogue { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(760px, 94%); display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 14px; background: var(--parchemin); color: var(--texte); border: 3px solid var(--parchemin-bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.mh-portrait img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: #2a3150; }
.mh-texte { font-size: 16px; line-height: 1.45; align-self: center; }
.mh-choix { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.mh-choix button.principal { background: var(--orange); color: #1a1208; border-color: var(--orange-f); }
.mh-panneau { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 94%); max-height: 82%; overflow: auto; padding: 18px; background: var(--parchemin); color: var(--texte); border: 3px solid var(--parchemin-bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.mh-panneau h3 { font: 400 22px var(--f-titre); color: var(--rouge-f); margin: 0 0 10px; }
.mh-panneau canvas { width: 100%; height: auto; border-radius: 8px; cursor: pointer; }
.mh-panneau label { display: block; margin: 8px 0; font-weight: 700; }
.mh-panneau input, .mh-panneau select, .mh-panneau textarea { width: 100%; font: 14px var(--f-texte); padding: 6px; border-radius: 6px; border: 1px solid var(--parchemin-bord); background: #fffaf0; }
.mh-panneau .muet { color: var(--muet); font-size: 12px; }
.mh-q { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px dashed var(--parchemin-bord); }
.mh-q .k { font: 400 26px var(--f-kanji); color: var(--rouge-f); }
.mh-q.finie .k { color: var(--ok); }
.mh-q.verrou { opacity: .55; }
.mh-legende { font-size: 12px; color: var(--muet); margin-top: 6px; }
@media (max-width: 700px) { .mh-mini { width: 120px; height: 120px; } .mh-boutons { top: 140px; } .mh-aide { display: none; } .mh-profil { min-width: 0; } }

.mh-titre { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(13,18,34,.35), rgba(13,18,34,.85)); z-index: 6; }
.mh-titre-boite { text-align: center; padding: 28px 34px; background: rgba(13, 18, 34, .82); border: 2px solid var(--or); border-radius: 18px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 92%; }
.mh-titre-sceau { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #1a1208; font: 400 42px var(--f-kanji); }
.mh-titre h1 { margin: 0; font: 400 44px var(--f-titre); color: var(--parchemin); }
.mh-titre h1 em { color: var(--orange); font-style: normal; }
.mh-titre p { margin: 0; opacity: .85; }
.mh-titre-sauve { font-size: 14px; color: var(--or); }
.mh-titre button { font: 700 18px var(--f-texte); padding: 10px 26px; border-radius: 12px; border: 2px solid var(--orange-f); background: var(--orange); color: #1a1208; cursor: pointer; min-width: 260px; }
.mh-titre button.mh-nouvelle { background: transparent; color: var(--texte-clair); border-color: rgba(255,255,255,.3); font-size: 14px; }
.mh-titre a { color: var(--texte-clair); opacity: .75; font-size: 13px; }
