:root {
  --bg: #0b0f0e; --panel: #121816; --panel2: #1a221f; --line: #2c3833; --text: #e8e4d8; --dim: #9aa39c;
  --gold: #f2b91f; --gold-dim: #8a6d22; --red: #e8604a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }
.ed-tete { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ed-titre { margin: 0; font-size: 20px; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#app { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 290px 1fr 330px; }
#map { position: relative; background: #0d1210; }
.leaflet-container { background: #0d1210; font: inherit; }
.leaflet-control-attribution { display: none; }
#palette, #props { background: var(--panel); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
#palette { border-right: 1px solid var(--line); }
#props { border-left: 1px solid var(--line); }
.label { color: var(--gold); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-top: 6px; }
.sub { color: var(--dim); font-size: 12px; margin: 0; }
.champ { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); }
.champ input, .champ select, .champ textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: 13px system-ui; }
.champ textarea { min-height: 110px; resize: vertical; }
.champ.case { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.ligne { display: flex; gap: 8px; } .ligne .champ { flex: 1; }
.btn { background: var(--gold); color: #1a1405; border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid #5a2b24; }
.mini { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; align-self: flex-start; }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.types button { display: flex; align-items: center; gap: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 12.5px; text-align: left; }
.types button.on { border-color: var(--gold); background: rgba(242,185,31,.12); }
.types i, .liste i, .pin i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; font-style: normal; font-size: 12px; flex: none; }
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.liste li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.liste li:hover, .liste li.on { background: rgba(242,185,31,.1); }
.liste li b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste li small { color: var(--dim); }
.liste .vide { color: var(--dim); cursor: default; }
.curseur { position: absolute; z-index: 500; left: calc(290px + (100% - 620px) / 2); bottom: 10px; transform: translateX(-50%); pointer-events: none;
  background: rgba(11,15,14,.86); border: 1px solid var(--gold-dim); border-radius: 8px; padding: 4px 10px; font: 600 12.5px ui-monospace, Consolas, monospace; }
#propsCorps { display: flex; flex-direction: column; gap: 8px; }
#propsCorps h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.pin { transform: translate(-50%, -50%); position: absolute; display: flex; flex-direction: column; align-items: center; }
.pin i { width: 24px; height: 24px; border: 2px solid rgba(0,0,0,.55); box-shadow: 0 1px 3px rgba(0,0,0,.5); font-size: 13px; color: #fff; }
.pin.sel i { outline: 2px solid var(--gold); outline-offset: 2px; }
.pin span { margin-top: 2px; font: 600 11px system-ui; color: #1c1c1c; text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.verrou { position: fixed; inset: 0; z-index: 900; background: rgba(8,12,11,.86); display: flex; align-items: center; justify-content: center; }
.carte-verrou { max-width: 460px; background: var(--panel2); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 22px; text-align: center; }
.carte-verrou h2 { margin: 0 0 8px; color: var(--gold); }
dialog { background: var(--panel2); color: var(--text); border: 1px solid var(--gold-dim); border-radius: 12px; min-width: 380px; max-width: 560px; }
dialog::backdrop { background: rgba(0,0,0,.6); }
.dlg-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: var(--gold); color: #1a1405; font-weight: 700; padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 1000; }
#toast.on { opacity: 1; }
.leaflet-container.pose { cursor: crosshair; }
@media (max-width: 1000px) { #app { grid-template-columns: 1fr; grid-template-rows: 55vh auto auto; } .curseur { left: 50%; } }

/* calques d'affichage : noms des lieux et sommets cotés (repris de la carte interactive) */
.place { position: absolute; transform: translate(-50%, -50%) scale(var(--ps, 1)); white-space: nowrap; pointer-events: none; color: #222; font-family: system-ui, "Segoe UI", sans-serif;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.p-capital { font: 800 17px system-ui; letter-spacing: .02em; }
.p-town { font: 700 15px system-ui; }
.p-village { font: 600 12.5px system-ui; }
.p-local { font: 500 11px system-ui; color: #3a3a3a; }
.p-poi { font: italic 500 11px system-ui; color: #4a4036; }
.p-hill { font: 600 10px system-ui; color: #6a4a1e; letter-spacing: .08em; }
.p-island { font: italic 600 12px system-ui; color: #333; }
.p-water, .p-bay { font: italic 500 11.5px system-ui; color: #1f5f8b; }
.p-sea { font: italic 600 14px system-ui; color: #1f5f8b; letter-spacing: .15em; }
.p-region { font: 600 11px system-ui; color: #555; letter-spacing: .2em; text-transform: uppercase; }
.hill { font: 600 10px system-ui; color: #4a3a22; text-shadow: 0 0 2px #fff, 0 0 2px #fff; white-space: nowrap; transform: translate(-50%, -50%); position: absolute; }
.hill::before { content: "▲"; font-size: 8px; margin-right: 2px; }

/* bloc Calques */
.calques li { gap: 6px; }
.calques li.fixe { cursor: default; }
.calques li.fixe:hover { background: none; }
.calques li.perso.on { background: rgba(242,185,31,.14); box-shadow: inset 3px 0 0 var(--gold); }
.calques input { accent-color: var(--gold); margin: 0; }
.ico-btn { background: transparent; border: 0; color: var(--dim); cursor: pointer; padding: 0 3px; font-size: 13px; }
.ico-btn:hover { color: var(--gold); } .ico-btn.danger:hover { color: var(--red); }
.liste li.masque { opacity: .45; }

/* fenêtre façon jeu : bloc titre + bloc description (briefing, tâche) */
.fenetre-jeu { border: 1px solid #2c3a2e; border-radius: 6px; background: #1a231c; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.fj-bloc { background: #0f1411; border: 1px solid #34433a; border-radius: 6px; }
.fj-lib { color: var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px 0; }
.fj-barre { border-top: 1px solid #2c3a2e; padding-top: 6px; }
.tr-barre { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 2px; align-items: center; }
.tr-barre button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; min-width: 24px; height: 24px; padding: 0 5px; cursor: pointer; font-size: 12px; }
.tr-barre button:hover { border-color: var(--gold); }
.tr-barre .tr-coul { min-width: 18px; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid #000; }
.tr-barre input[type=color] { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.tr-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.tr-zone { min-height: 36px; padding: 8px 10px 10px; outline: none; color: #e9e6da; font: 14px/1.45 "Roboto", system-ui, sans-serif; }
.fj-titre .tr-zone { font-size: 17px; font-weight: 700; min-height: 64px; }
.fj-texte .tr-zone { min-height: 120px; }
.tr-zone h1 { font-size: 22px; margin: 4px 0; } .tr-zone h2 { font-size: 18px; margin: 4px 0; }
.tr-zone:empty::before { content: "…"; color: #5c665f; }

/* graduations des bords (2 chiffres = km, 3 chiffres = carré de 100 m) */
.edge { position: absolute; z-index: 500; pointer-events: none; font: 600 11px/1 ui-monospace, Consolas, monospace; }
.edge span { position: absolute; background: rgba(15,20,18,.85); color: var(--gold); padding: 2px 4px; border-radius: 3px; transform: translateX(-50%); white-space: nowrap; }
.edge span.km { background: rgba(242,185,31,.92); color: #1d2422; }
.edge-x { left: 0; right: 0; top: 6px; height: 16px; }
.edge-z { top: 0; bottom: 0; left: 6px; width: 40px; }
.edge-z span { transform: translateY(-50%); }

/* barre d'outils de dessin, en bas à droite de la carte */
/* colonne à droite de la carte : modules en haut, dessins en bas (hors du cadre Leaflet) */
.colonne { position: absolute; z-index: 600; top: 150px; bottom: 16px; right: 342px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.col-modules, .col-outils { display: flex; flex-direction: column; gap: 7px; pointer-events: auto; }
.col-modules button.mod { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-dim); background: rgba(18,24,22,.92); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.col-modules button.mod i { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font: 700 13px system-ui; font-style: normal; }
.col-modules button.mod:hover, .col-outils button:hover { border-color: var(--gold); }
.col-modules button.mod.on, .col-outils button.on { border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(242,185,31,.35), 0 2px 6px rgba(0,0,0,.45); }
@media (max-width: 1000px) { .colonne { right: 12px; bottom: auto; height: calc(55vh - 80px); } }
.col-outils button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-dim); background: rgba(18,24,22,.92); color: var(--gold);
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.45); padding: 0; }

.mesure { position: absolute; transform: translate(10px, -50%); white-space: nowrap; background: rgba(15,20,18,.9); color: var(--gold); border: 1px solid var(--gold-dim);
  border-radius: 5px; padding: 2px 6px; font: 700 12px ui-monospace, Consolas, monospace; }
.repere { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; color: var(--c); filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.repere svg { width: 28px; height: 28px; fill: rgba(0,0,0,.35); }
.repere.sel svg { stroke-width: 3; }
.repere span { order: -1; font: 700 11.5px system-ui; color: #1c1c1c; text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.dessin-txt { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; font: 700 12px system-ui; color: #1c1c1c;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff; border-bottom: 2px solid var(--c); }
.d-ico { display: inline-flex; }
.liste li.dessin i { background: none; }
.liste li.dessin i svg { width: 16px; height: 16px; }
.nuancier { display: flex; gap: 6px; flex-wrap: wrap; }
.nuancier button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(0,0,0,.6); cursor: pointer; padding: 0; }
.nuancier button.on { outline: 2px solid var(--gold); outline-offset: 2px; }.astuce { margin-top: 6px; font-style: italic; }

/* calques : titre + bouton « + », groupes repliables, glisser-déposer */
.label-ligne { display: flex; align-items: center; justify-content: space-between; }
.plus { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--gold-dim); background: transparent; color: var(--gold); font: 700 16px/1 system-ui; cursor: pointer; padding: 0; }
.plus:hover { background: var(--gold); color: #1a1405; }
.calques > li.groupe { display: block; padding: 0; cursor: default; }
.calques > li.groupe:hover { background: none; }
.g-tete { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.g-tete:hover { background: rgba(242,185,31,.08); }
.g-tete b { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-tete small { color: var(--dim); }
.groupe.on > .g-tete { background: rgba(242,185,31,.14); box-shadow: inset 3px 0 0 var(--gold); }
.groupe.sans > .g-tete b { font-style: italic; font-weight: 600; color: var(--dim); }
.groupe > .liste { margin: 2px 0 6px 14px; padding-left: 6px; border-left: 1px solid var(--line); }
.groupe > .liste li[draggable] { cursor: grab; }
.groupe.cible > .g-tete { outline: 2px dashed var(--gold); outline-offset: -2px; }
.liste li.glisse { opacity: .4; }
.fl { width: 16px; padding: 0; }
/* sous-blocs (actions d'un multi-actions, séquences et textes d'une cinématique) */
.sous-bloc { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.02); }
.sb-tete { display: flex; align-items: center; justify-content: space-between; color: var(--gold); font-size: 12px; }
.seq-cases { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text); }
.seq-cases label { display: flex; align-items: center; gap: 3px; }
/* VueCam : flèche d'orientation et poignée */
.pin .cam-fl { position: absolute; top: 12px; left: 50%; width: 0; height: 0; margin-left: 0; transform-origin: 0 0; pointer-events: none; }
.pin .cam-fl::before { content: ""; position: absolute; left: -7px; top: -34px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 14px solid #ffd54f;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.8)); }
.pin .cam-fl::after { content: ""; position: absolute; left: -1.5px; top: -22px; width: 3px; height: 10px; background: #ffd54f; }
.cam-poignee { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #ffd54f; border: 2px solid #1a1405; cursor: grab; box-shadow: 0 0 4px rgba(0,0,0,.6); }
/* colonne plus serrée : 11 modules + 4 outils */
.col-modules button.mod, .col-outils button { width: 36px !important; height: 36px !important; }
.col-modules button.mod i { width: 24px; height: 24px; font-size: 12px; }
.col-modules, .col-outils { gap: 5px; }
/* Notes de la mission (22/11/2026) : bouton sous le nom, champ libre dans le panneau de droite. */
.notes-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.notes-btn.actif { border-color: var(--gold); color: var(--gold); }
.notes-pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
#propsNotes { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
#propsNotes[hidden] { display: none; }
#propsNotes h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
#mNotes { flex: 1; min-height: 320px; width: 100%; box-sizing: border-box; resize: vertical; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 14px/1.55 system-ui, "Segoe UI", Roboto, sans-serif; }
#mNotes:focus { outline: none; border-color: var(--gold); }
#propsNotes h2 { font-size: 16px; }

/* Cinématique sur la carte (22/11/2026) : rôle des VueCam sous leur nom, pastille de séquence sur le trait départ → arrivée. */
.pin .cam-role { margin-top: 1px; font: 700 10px system-ui; color: #ad1457; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; white-space: nowrap; }
.seq-fl { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; pointer-events: none; }
.seq-fl b { position: absolute; inset: 0; display: block; }
.seq-fl b:after { content: ""; position: absolute; left: 24px; top: 5px; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent #ec407a; }
.seq-fl span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #ec407a; color: #fff; font: 700 12px system-ui; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* Le nom et le rôle passent au-dessus de la flèche d'orientation d'une VueCam (cap vers le bas). */
.pin span, .pin .cam-role { position: relative; z-index: 2; }

/* 23/11/2026 — mission du jeu importée (editeur.js : importerMission, propsSource) */
.pin.pin-imp i { width: 16px; height: 16px; font-size: 9px; border-width: 1px; }
.pin.pin-imp span { font-size: 10px; font-weight: 500; }
.imp-fige { background: var(--bg); border: 1px dashed var(--line); border-radius: 6px; padding: 6px 8px; color: var(--text); font-size: 12.5px; }
.imp-ligne { display: flex; align-items: center; gap: 10px; color: var(--text); }
.imp-alerte { background: rgba(232,96,74,.12); border: 1px solid var(--red); color: #f3b3a7; border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.imp-reglages { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
.imp-reglages[open] { padding-bottom: 10px; }
.imp-reglages summary { cursor: pointer; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.imp-reglages .imp-cat { color: var(--gold); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; margin-top: 8px; opacity: .85; }
.imp-reglages .imp-r { margin-top: 4px; }
.imp-reglages .imp-r.inc { opacity: .55; }
.imp-reglages div.imp-r { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; font-size: 12px; }
.imp-reglages div.imp-r span:first-child { color: var(--dim); overflow-wrap: anywhere; }

/* 24/11/2026 : sections repliables de la barre de gauche + contenu de la mission (listes) */
#palette details.sec { display: flex; flex-direction: column; gap: 8px; }
#palette details.sec > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
#palette details.sec > summary::-webkit-details-marker { display: none; }
#palette details.sec > summary::before { content: '▸'; font-size: 10px; transition: transform .15s; }
#palette details.sec[open] > summary::before { transform: rotate(90deg); }
#palette details.sec[open] > summary { margin-bottom: 4px; }
#palette details.sec > :not(summary) { margin-bottom: 6px; }
#palette details.sec[open] { display: flex; flex-direction: column; gap: 8px; }
.liste-ligne { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.liste-ligne b { color: var(--gold); }
.mini.croix { padding: 0 6px; line-height: 16px; }
/* 24/11/2026 : listes de la mission dépliables (noms en lecture seule ; dialogues et tactiques modifiables) */
.liste-elt > summary { list-style: none; cursor: pointer; }
.liste-elt > summary::-webkit-details-marker { display: none; }
.liste-elt > summary > span::before { content: '▸ '; font-size: 9px; color: var(--gold-dim); }
.liste-elt[open] > summary > span::before { content: '▾ '; }
.liste-noms { list-style: none; margin: 2px 0 4px 12px; padding: 0; max-height: 180px; overflow-y: auto; font-size: 12px; }
.liste-noms li { padding: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien-elt { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-align: left; font: inherit; text-decoration: underline dotted; }
.lien-elt:hover { color: var(--gold); }
.liste-elt > .mini { margin: 0 0 6px 12px; }
/* 24/11/2026 : atelier Dialogues / Tactiques, à la place de la carte */
.atelier { position: absolute; z-index: 1100; top: 0; bottom: 0; left: 290px; right: 330px; display: flex; flex-direction: column; background: var(--panel2); }
.atelier[hidden] { display: none; }
.atelier-barre { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--gold-dim); }
.atelier-barre .sp { flex: 1; }
.atelier iframe { flex: 1; width: 100%; border: 0; background: #0d1210; }
@media (max-width: 1000px) { .atelier { left: 0; right: 0; bottom: auto; height: 85vh; } }