/* « Lucarne vs le monde » : l'habillage. Deux mondes qui s'opposent :
   le Refuge (bois chaud, braise, mousse, or, coins ronds, tout respire) et Ferronnie (acier, rouille, éclair,
   angles vifs, aplats froids, rien ne bouge sauf par à-coups). */
:root {
  --nuit: #14100c; --nuit2: #1d1611; --bois1: #2a1f17; --bois2: #382a1e; --bois3: #4a3726; --bord: #6b4f33;
  --or: #f2c261; --or2: #d9a441; --braise: #ff8a3d; --braise2: #e25a1c; --mousse: #8fbf55; --mousse2: #4f7a35;
  --parchemin: #f6ead4; --texte2: #cdb999; --texte3: #a08c70; --rouge: #ff8f7d;
  --fer0: #0d1216; --fer1: #161d23; --fer2: #222b32; --fer3: #3b4750; --acier: #8f9aa3; --acier2: #c5cfd6; --eclair: #cfeaff; --rouille: #a4532b;
  --titre: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", sans-serif;
  --haut-sur: env(safe-area-inset-top, 0px); --bas-sur: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #0a0806; color: var(--parchemin); font: 15px/1.4 var(--corps);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
small { font-size: .8em; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
#app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; background: var(--nuit); overflow: hidden; }
#ecran { height: 100%; }
.ico { width: 1.3em; height: 1.3em; flex: none; display: inline-block; vertical-align: -.28em; }
.ico.gros { width: 40px; height: 40px; }
b, output, time { font-variant-numeric: tabular-nums; }

/* ---------- chargement */
.chargement { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center;
  background: radial-gradient(60% 40% at 50% 45%, rgba(255,138,61,.22), transparent 70%), var(--nuit); color: var(--texte2); }
.coeur-charge { color: var(--braise); filter: drop-shadow(0 0 18px rgba(255,138,61,.7)); animation: battement 1.5s infinite; }
.coeur-charge .ico { width: 72px; height: 72px; }
.coeur-charge.eteint { color: var(--acier); filter: none; animation: none; }

/* ---------- ossature du jeu */
.jeu { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.haut { padding: calc(var(--haut-sur) + 8px) 8px 8px; position: relative; z-index: 5;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.09) 0 1px, transparent 1px 46px), linear-gradient(180deg, #45321f, #2c2016);
  border-bottom: 1px solid #7a5a35; box-shadow: 0 2px 0 #1a120c, 0 8px 16px rgba(0,0,0,.45); }
.haut-ligne { display: flex; align-items: center; gap: 8px; }
.profil { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.profil-niv { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font: 700 15px var(--titre); color: #2a1a08;
  background: radial-gradient(circle at 35% 30%, #ffe6a8, var(--or2)); border-radius: 50%; border: 2px solid #7a5a22; box-shadow: 0 0 0 2px rgba(242,194,97,.25); }
.profil-nom { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.profil-nom b { font: 700 15px var(--titre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profil-nom small { color: var(--texte2); }
.saison-puce { display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; background: var(--fer1); border: 1px solid var(--fer3); border-radius: 3px; color: var(--eclair); line-height: 1.1; }
.saison-puce .sceau { width: 26px; height: 26px; }
.saison-puce span { display: flex; flex-direction: column; }
.saison-puce small { color: var(--acier); text-transform: uppercase; letter-spacing: .12em; font-size: 9.5px; }
.saison-puce time { font-size: 12px; font-weight: 600; }
.rond { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.32); border: 1px solid var(--bord); color: var(--parchemin); transition: transform .06s; }
.rond:active { transform: scale(.9); }
.rond .ico { width: 20px; height: 20px; }
.ressources { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.res { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 4px; align-items: center; padding: 3px 5px 3px 3px; background: rgba(0,0,0,.36); border-radius: 9px; border: 1px solid rgba(242,194,97,.14); line-height: 1.05; }
.res .ico { width: 20px; height: 20px; grid-row: span 2; }
.res b { font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.res small { font-size: 9px; color: var(--mousse); white-space: nowrap; overflow: hidden; }
.res.pleine b { color: var(--braise); }
.res.eteinte { opacity: .45; }
.res:active { transform: scale(.95); }

.vue { position: relative; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  background: radial-gradient(120% 50% at 50% 0, rgba(255,138,61,.08), transparent 60%), var(--nuit); }
.vue::-webkit-scrollbar { display: none; }
.vue.entre > * { animation: entrer .22s ease-out; }
.vue-siege { background: linear-gradient(180deg, #10161a, #12100e 70%); }
.page { padding: 12px 12px 24px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }

.onglets { display: grid; grid-template-columns: repeat(6, 1fr); padding: 4px 4px calc(4px + var(--bas-sur)); position: relative; z-index: 5;
  background: linear-gradient(180deg, #33261a, #1f1711); border-top: 1px solid #7a5a35; box-shadow: 0 -6px 14px rgba(0,0,0,.4); }
.onglets button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0 4px; font-size: 10.5px; color: var(--texte3); border-radius: 12px; transition: color .15s, transform .06s; }
.onglets button:active { transform: translateY(2px) scale(.96); }
.onglet-ico { position: relative; width: 44px; height: 30px; display: grid; place-items: center; border-radius: 12px; transition: background .2s, transform .2s; }
.onglet-ico .ico { width: 24px; height: 24px; }
.onglets .actif { color: var(--or); font-weight: 700; }
.onglets .actif .onglet-ico { background: radial-gradient(circle at 50% 80%, rgba(255,138,61,.5), rgba(255,138,61,.08) 70%); transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(242,194,97,.4); }
.onglets .froid.actif { color: var(--eclair); }
.onglets .froid.actif .onglet-ico { background: var(--fer2); border-radius: 3px; box-shadow: 0 0 0 1px var(--acier); }
.point { position: absolute; top: -3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px; background: var(--braise); color: #2a1206; font: 700 10.5px/1 var(--corps); font-style: normal; box-shadow: 0 0 0 2px #2a1f17; }
.segments .point { position: static; display: inline-grid; margin-left: 6px; box-shadow: none; min-width: 16px; height: 16px; vertical-align: 1px; }
.segments .point:empty { min-width: 8px; width: 8px; height: 8px; padding: 0; }

/* ---------- briques */
/* carte forgée : rivets aux coins, arête dorée en haut ; la froide (Ferronnie) garde son fer nu */
.carte { position: relative; background: var(--rivets), linear-gradient(180deg, var(--bois2), var(--bois1)); border: 1px solid rgba(242,194,97,.24); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,235,190,.1), inset 0 0 0 2px rgba(0,0,0,.18), 0 5px 14px rgba(0,0,0,.35); }
.carte::before { content: ""; position: absolute; left: 14%; right: 14%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,210,122,.75), transparent); pointer-events: none; }
.carte h3, .feuille h3 { display: flex; align-items: center; gap: 8px; font: 700 16px var(--titre); color: var(--or); }
.carte h3 small { margin-left: auto; color: var(--texte2); font: 400 12px var(--corps); }
.carte h4, .feuille h4 { font: 700 14.5px var(--corps); }
.carte.chantier { border-color: rgba(255,138,61,.55); }
.carte.chantier::before { background: linear-gradient(90deg, transparent, var(--braise), transparent); }
.carte.froide, .froide .carte { background: var(--fer1); border: 1px solid var(--fer3); border-radius: 3px; box-shadow: none; color: var(--acier2); }
.carte.froide::before, .froide .carte::before { content: none; }
.carte.froide h3, .froide .carte h3 { color: var(--eclair); font-family: var(--corps); letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.carte.victoire { border-color: var(--mousse); }
.carte.victoire::before { background: linear-gradient(90deg, transparent, #c8ef8a, transparent); }
.titre { display: flex; align-items: center; gap: 10px; font: 700 17px var(--titre); color: var(--or); margin-top: 6px; }
.titre::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(242,194,97,.5), transparent); order: 1; }
.titre small { order: 2; color: var(--texte2); font: 600 12px var(--corps); }
.note { font-size: 13px; color: var(--texte2); }
.note.centre { text-align: center; }
.frein, .ok, .fer-note, .bravo { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; }
.frein { color: var(--rouge); }
.ok { color: var(--mousse); }
.fer-note { color: var(--acier2); background: var(--fer1); border: 1px solid var(--fer3); border-radius: 3px; padding: 9px 10px; }
.bravo { color: #1c2a10; background: linear-gradient(180deg, #b9e07a, #7fae4c); border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.grand { font-size: 18px; font-weight: 700; }
.grand small { font-weight: 400; color: var(--texte2); }
.rouge { color: var(--rouge); }
.ligne { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.ligne > span:first-of-type { flex: 1; color: var(--texte2); }
.ligne b small { font-weight: 400; color: var(--texte2); }
.rangee { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rangee-fin { display: flex; gap: 6px; margin-left: auto; }
.vide { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; text-align: center; color: var(--texte3); }
.vide .ico { width: 34px; height: 34px; opacity: .6; }
.temps { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--texte2); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 700; font-size: 15px; white-space: nowrap; position: relative;
  transition: transform .06s, box-shadow .06s, filter .15s; }
.btn .ico { width: 20px; height: 20px; }
.btn { overflow: hidden; isolation: isolate; }
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,250,230,.55) 50%, transparent 65%); opacity: 0; transform: translateX(-120%); }
.btn.braise::after, .btn.or::after, .btn.mousse::after { opacity: .9; }
@media (hover: hover) { .btn:hover:not(:disabled)::after { transform: translateX(120%); transition: transform .6s ease-out; } }
.btn:active:not(:disabled)::after { transform: translateX(120%); transition: transform .35s ease-out; }
.btn.fer::after { background: linear-gradient(105deg, transparent 40%, rgba(170,210,255,.35) 50%, transparent 60%); }
.btn.fer:active:not(:disabled)::after, .btn.plat:active:not(:disabled)::after { opacity: 1; }
.btn.braise { color: #2a1206; background: linear-gradient(180deg, #ffb066, #f0702a); box-shadow: 0 4px 0 #9c3c0e, inset 0 1px 0 rgba(255,255,255,.45), 0 8px 14px rgba(226,90,28,.25); }
.btn.or { color: #33230a; background: linear-gradient(180deg, #fbdc92, #dba843); box-shadow: 0 4px 0 #8b6620, inset 0 1px 0 rgba(255,255,255,.5); }
.btn.mousse { color: #14230a; background: linear-gradient(180deg, #aedb72, #6c9c43); box-shadow: 0 4px 0 #3b5a24, inset 0 1px 0 rgba(255,255,255,.4); }
.btn.fer { color: var(--eclair); background: var(--fer2); border: 1px solid var(--acier); border-radius: 3px; box-shadow: 0 3px 0 var(--fer0); letter-spacing: .04em; }
.btn.plat { color: var(--parchemin); background: rgba(0,0,0,.25); border: 1px solid var(--bord); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent, inset 0 2px 4px rgba(0,0,0,.25); }
.btn:disabled { filter: saturate(.25) brightness(.75); opacity: .6; }
.btn.petit { min-height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
.btn.large { width: 100%; }
.btn.rondbtn { width: 42px; min-height: 42px; padding: 0; border-radius: 50%; flex: none; }
body.occupe .btn { pointer-events: none; }

.barre { height: 11px; border-radius: 6px; background: rgba(0,0,0,.5); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); overflow: hidden; }
.barre i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--braise2), var(--braise) 60%, #ffd27a); transition: width .5s linear; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.barre.or i { background: linear-gradient(90deg, #c08a2a, var(--or)); }
.barre.mousse i { background: linear-gradient(90deg, var(--mousse2), var(--mousse)); }
.barre.fer { border-radius: 0; background: #2b1712; }
.barre.fer i { border-radius: 0; background: linear-gradient(180deg, #aab6bf, #59646d); box-shadow: none; }
.barre.fine { height: 6px; }

.segments { display: flex; padding: 3px; gap: 3px; background: rgba(0,0,0,.4); border-radius: 13px; border: 1px solid rgba(255,255,255,.05); }
.segments button { flex: 1; min-height: 38px; padding: 0 6px; border-radius: 10px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--texte2); transition: background .15s, color .15s; }
.segments .actif { background: linear-gradient(180deg, var(--bois3), #3a2a1c); color: var(--or); box-shadow: inset 0 1px 0 rgba(255,235,190,.15), 0 2px 4px rgba(0,0,0,.4); }
.page-siege > .segments .actif { background: var(--fer2); color: var(--eclair); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--acier); }
.page-siege > .segments { border-radius: 4px; }

.pastilles { display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pastille { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border-radius: 999px; background: rgba(0,0,0,.4); font-size: 13px; white-space: nowrap; }
.pastille .ico { width: 19px; height: 19px; }
.pastille.manque b { color: var(--rouge); }
.pastille small { color: var(--texte2); }
.pastille.discret { background: none; color: var(--texte2); padding-left: 2px; }

.curseur { display: flex; align-items: center; gap: 8px; }
.curseur .pas { width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(0,0,0,.35); border: 1px solid var(--bord); text-align: center; font-size: 20px; line-height: 1; }
.curseur .pas:active { transform: scale(.88); }
.curseur output { min-width: 46px; text-align: right; font-weight: 700; font-size: 16px; }
.curseur input[type=range] { flex: 1; min-width: 0; height: 34px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.curseur input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--braise) var(--p, 0%), rgba(0,0,0,.55) var(--p, 0%)); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.curseur input[type=range]::-moz-range-track { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--braise) var(--p, 0%), rgba(0,0,0,.55) var(--p, 0%)); }
.curseur input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1c9, var(--or2)); border: 2px solid #7a5a22; box-shadow: 0 2px 5px rgba(0,0,0,.5); }
.curseur input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--or); border: 2px solid #7a5a22; }

.bascule { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 13px; background: rgba(0,0,0,.3); border: 1px solid var(--bord); }
.bascule > span { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.bascule small { color: var(--texte2); }
.bascule > .ico { width: 26px; height: 26px; }
.interrupteur { width: 46px; height: 26px; border-radius: 13px; background: rgba(0,0,0,.55); border: 1px solid var(--bord); position: relative; flex: none; transition: background .15s; }
.interrupteur::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--texte3); transition: transform .15s, background .15s; }
.bascule.oui { border-color: var(--or2); }
.bascule.oui .interrupteur { background: rgba(242,194,97,.3); }
.bascule.oui .interrupteur::after { transform: translateX(20px); background: var(--or); }
.bascule:disabled { opacity: .55; }

/* ---------- messages brefs */
#toasts { position: absolute; top: calc(var(--haut-sur) + 70px); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 10px 14px; border-radius: 14px; background: #3d2c1d; border: 1px solid var(--or2); box-shadow: 0 8px 22px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity .25s, transform .25s; font-weight: 600; }
.toast.la { opacity: 1; transform: none; }
.toast.erreur { border-color: var(--rouge); color: #ffd9d2; }
.toast.gain { border-color: var(--mousse); }
.toast.fer { background: var(--fer1); border: 1px solid var(--acier); border-radius: 2px; color: var(--eclair); font-weight: 500; letter-spacing: .03em; align-items: flex-start; }
.toast.fer .sceau { width: 34px; height: 34px; flex: none; }
.toast.fer b { display: block; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--acier); }

/* ---------- panneaux du bas */
#feuilles { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
#feuilles.ouverte { pointer-events: auto; }
.voile { position: absolute; inset: 0; background: rgba(6,4,3,.66); opacity: 0; transition: opacity .22s; }
.ouverte .voile { opacity: 1; }
.feuille { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; display: flex; flex-direction: column; border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #3a2b1e, #231a13 180px); border-top: 1px solid #8a6a40; box-shadow: 0 -10px 30px rgba(0,0,0,.6);
  transform: translateY(104%); transition: transform .26s cubic-bezier(.2,.9,.25,1); }
.ouverte .feuille { transform: none; }
.poignee { height: 22px; flex: none; width: 100%; position: relative; }
.poignee::after { content: ""; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(246,234,212,.3); }
.feuille .fermer { position: absolute; top: 12px; right: 12px; z-index: 2; }
.feuille-contenu { overflow-y: auto; padding: 0 14px calc(18px + var(--bas-sur)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.feuille-contenu::-webkit-scrollbar { display: none; }
.feuille-tete { display: flex; gap: 12px; align-items: center; padding: 0 44px 12px 0; }
.feuille-art { width: 88px; height: 88px; flex: none; display: grid; place-items: center; }
.feuille-art .art { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.art-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: rgba(0,0,0,.35); border: 1px solid var(--bord); }
.art-ico .ico { width: 40px; height: 40px; }
.feuille-titres h2 { font: 700 21px/1.15 var(--titre); color: var(--or); }
.feuille-titres p { font-size: 13px; color: var(--texte2); margin-top: 3px; }
.feuille-titres .niveau { color: var(--parchemin); font-weight: 700; }
.feuille-corps { display: flex; flex-direction: column; gap: 12px; }
.feuille-pied { position: sticky; bottom: calc(-18px - var(--bas-sur)); margin: 12px -14px calc(-18px - var(--bas-sur)); padding: 12px 14px calc(14px + var(--bas-sur)); background: linear-gradient(180deg, rgba(35,26,19,0), #231a13 26%); }
.calcul { display: flex; flex-direction: column; gap: 10px; }
.feuille.froide { background: var(--fer1); border-radius: 4px 4px 0 0; border-top: 1px solid var(--acier); }
.feuille.froide .feuille-titres h2 { color: var(--eclair); font-family: var(--corps); letter-spacing: .08em; text-transform: uppercase; font-size: 17px; }
.sceau.grand { width: 64px; height: 64px; }

/* ---------- le Refuge */
.vue-refuge { overflow: hidden; }
.camp-defile { position: absolute; inset: 0; overflow: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; cursor: grab; }
.camp-defile::-webkit-scrollbar { display: none; }
.camp-monde { position: relative; }
.camp-decor { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.camp-couche { position: absolute; inset: 0; }
.bat { position: absolute; width: 112px; transform: translate(-50%, -58%); display: flex; flex-direction: column; align-items: center; cursor: pointer; animation: poser .3s ease-out; }
.bat-art { display: block; width: 112px; height: 112px; transition: transform .1s; filter: drop-shadow(0 7px 5px rgba(0,0,0,.42)); }
.bat-art .art { width: 100%; height: 100%; display: block; overflow: visible; }
.bat:active .bat-art { transform: scale(.93) translateY(3px); }
.bat.coeur { width: 168px; }
.bat.coeur .bat-art { width: 168px; height: 168px; }
.bat-nom { margin-top: -14px; max-width: 136px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 2px; border-radius: 999px; background: rgba(20,16,12,.88); border: 1px solid var(--bord); font-size: 11.5px; font-weight: 600; white-space: nowrap; position: relative; }
.bat-nom > span { overflow: hidden; text-overflow: ellipsis; }
.bat-nom .niv { width: 19px; height: 19px; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe6a8, var(--or2)); color: #2a1a08; font-size: 11px; }
.bat-nom.libre { padding: 3px 11px; color: var(--or); border-color: var(--or2); border-style: dashed; }
.bat-nom.fer { padding: 3px 9px 3px 6px; border-radius: 2px; background: rgba(13,18,22,.9); border-color: var(--fer3); color: var(--acier2); font-weight: 500; }
.bat-nom.fer .ico { width: 13px; height: 13px; }
.bat.fige .bat-art { filter: none; opacity: .9; }
.bat.vide .bat-art { filter: none; }
.bat.travaux .bat-art .art { animation: travaux .9s ease-in-out infinite; }
.bulle { position: absolute; top: -4px; left: 50%; width: 42px; height: 42px; margin-left: -21px; display: grid; place-items: center; border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%; z-index: 2;
  background: radial-gradient(circle at 35% 28%, #fffaf0, #f3dfb6); border: 2px solid var(--or2); box-shadow: 0 4px 8px rgba(0,0,0,.45); animation: flotter 2.2s ease-in-out infinite; }
.bulle::after { content: ""; position: absolute; bottom: -7px; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--or2); border-bottom: 0; }
.bulle .ico { width: 24px; height: 24px; }
.bulle.pleine { border-color: var(--braise); box-shadow: 0 0 0 4px rgba(255,138,61,.35), 0 4px 8px rgba(0,0,0,.45); animation-duration: 1s; }
.bulle:active { transform: scale(.85); }
.bat.coeur .bulle { top: 18px; }
.bat-chantier { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 4px; width: 92px; padding: 3px 6px 4px; border-radius: 9px; background: rgba(20,16,12,.92); border: 1px solid var(--braise); font-size: 11px; font-weight: 700; z-index: 1; }
.bat-chantier .ico { width: 13px; height: 13px; color: var(--braise); }
.bat-chantier .barre { width: 100%; height: 4px; }
.bat-chantier.doux { border-color: var(--bord); width: auto; white-space: nowrap; flex-wrap: nowrap; top: 12px; }
.camp-flottants { position: absolute; inset: 0; pointer-events: none; z-index: 2000; }
.flot { position: absolute; display: flex; flex-direction: column; gap: 6px; }
.flot > * { pointer-events: auto; }
.flot.bas-gauche { left: 8px; bottom: 10px; align-items: flex-start; }
.flot.bas-droit { right: 8px; bottom: 10px; }
.flot.haut-droit { right: 8px; top: 8px; }
.flot.haut-centre { left: 8px; top: 8px; right: 130px; }
.jeton { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px 0 8px; border-radius: 999px; background: rgba(20,16,12,.92); border: 1px solid var(--braise); font-size: 12px; font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.4); max-width: 230px; }
.jeton > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jeton .ico { width: 16px; height: 16px; color: var(--braise); }
.jeton time { color: var(--or); white-space: nowrap; }
.jeton.libre { border: 1px dashed var(--mousse); color: var(--mousse); }
.jeton.libre .ico { color: var(--mousse); }
.jeton:active, .vers-siege:active, .btn-rond:active { transform: scale(.94); }
.btn-rond { display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 16px 0 12px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: #33230a; background: linear-gradient(180deg, #fbdc92, #dba843); box-shadow: 0 4px 0 #8b6620, 0 8px 16px rgba(0,0,0,.45); animation: appel 2.4s ease-in-out infinite; }
.btn-rond .ico { width: 24px; height: 24px; }
.vers-siege { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px 0 8px; background: rgba(13,18,22,.92); border: 1px solid var(--acier); border-radius: 2px; color: var(--eclair); font-size: 12px; letter-spacing: .04em; }
.vers-siege .ico { width: 16px; height: 16px; }
.alerte-fer { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--fer1); border: 1px solid var(--eclair); border-radius: 2px; color: var(--eclair); font-size: 12.5px; font-weight: 600; animation: clignoter 2.6s steps(1) infinite; }
.alerte-fer.large { width: 100%; }

/* dessins vivants (Refuge) et mécaniques (Ferronnie) */
.art-coeur, .art-halo, .art-tourne, .art-flamme, .art-flotte, .art-fanion { transform-box: fill-box; transform-origin: center; }
.art-coeur { animation: battement 1.6s infinite; }
.art-halo { animation: halo 1.6s infinite; }
.art-tourne { animation: tourner 5s linear infinite; }
.art-flamme { transform-origin: 50% 100%; animation: flamme 1.1s ease-in-out infinite alternate; }
.art-lueur { animation: lueur 2.4s ease-in-out infinite; }
.art-flotte { animation: flotter 3s ease-in-out infinite; }
.art-etincelle { animation: etincelle 2.6s ease-out infinite; }
.art-etincelle.e2 { animation-delay: .9s; } .art-etincelle.e3 { animation-delay: 1.7s; }
.art-fumee { animation: fumee 4s ease-out infinite; } .art-fumee.e2 { animation-delay: 2s; }
.art-fanion { transform-origin: 0 50%; animation: fanion 2.8s ease-in-out infinite; }
.eclair { opacity: 0; animation: eclair 7s steps(1) infinite; } .eclair.e2 { animation-delay: 3.3s; }
.cit-rouage { animation: tourner 30s steps(20) infinite; }
.cit-actif { animation: tension 2.2s steps(2) infinite; }
.cit-lueur { animation: tension 3.1s steps(3) infinite; }
.cit-fissure { filter: drop-shadow(0 0 3px #ffd27a); animation: lueur 2.4s ease-in-out infinite; }
.cit-eteint { opacity: .35; } .cit-eteint * { animation: none !important; }
.cit-chiffre { font: 700 19px var(--titre); fill: #56646f; }
.cit-chiffre.actif { fill: #f1f8ff; } .cit-chiffre.tombe { fill: #7fae4c; }
.cit-pv { font: 600 11.5px var(--corps); fill: #cfeaff; letter-spacing: .06em; }
@keyframes battement { 0%, 46%, 100% { transform: scale(1); } 10% { transform: scale(1.14); } 22% { transform: scale(1); } 32% { transform: scale(1.08); } }
@keyframes halo { 0%, 46%, 100% { opacity: .55; transform: scale(.94); } 10% { opacity: 1; transform: scale(1.06); } 32% { opacity: .85; transform: scale(1); } }
@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes flamme { from { transform: scale(1, 1) skewX(-2deg); } to { transform: scale(.94, 1.1) skewX(3deg); } }
@keyframes lueur { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes flotter { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes etincelle { 0% { opacity: 0; transform: translateY(8px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
@keyframes fumee { 0% { opacity: 0; transform: translateY(6px) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px) scale(1.4); } }
@keyframes fanion { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(-7deg); } }
@keyframes eclair { 0%, 5%, 100% { opacity: 0; } 1% { opacity: 1; } 2% { opacity: 0; } 3% { opacity: .85; } }
@keyframes tension { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes clignoter { 0%, 100% { border-color: var(--eclair); } 50% { border-color: var(--fer3); } }
@keyframes travaux { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes poser { from { opacity: 0; transform: translate(-50%, -62%) scale(.9); } }
@keyframes entrer { from { opacity: 0; transform: translateY(8px); } }
@keyframes appel { 0%, 100% { box-shadow: 0 4px 0 #8b6620, 0 8px 16px rgba(0,0,0,.45), 0 0 0 0 rgba(242,194,97,.5); } 50% { box-shadow: 0 4px 0 #8b6620, 0 8px 16px rgba(0,0,0,.45), 0 0 0 9px rgba(242,194,97,0); } }
@keyframes monter { 0% { transform: translateY(0) translateX(0); opacity: 0; } 15% { opacity: .9; } 100% { transform: translateY(-70vh) translateX(24px); opacity: 0; } }

/* ---------- panneaux des bâtiments */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 9px; background: rgba(0,0,0,.3); line-height: 1.2; }
.stat small { color: var(--texte2); font-size: 11px; }
.troupes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.troupe { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 11px; background: rgba(0,0,0,.3); text-align: center; line-height: 1.2; }
.troupe .ico { width: 28px; height: 28px; }
.troupe small { color: var(--texte2); font-size: 11px; }
.arbre { display: flex; flex-direction: column; gap: 8px; position: relative; padding-left: 4px; }
.arbre::before { content: ""; position: absolute; left: 25px; top: 20px; bottom: 20px; width: 2px; background: linear-gradient(180deg, var(--or2), rgba(217,164,65,.1)); }
.noeud { display: flex; align-items: center; gap: 10px; position: relative; }
.noeud-niv { width: 44px; height: 44px; flex: none; display: flex; align-items: baseline; justify-content: center; padding-top: 11px; border-radius: 50%; background: var(--bois1); border: 2px solid var(--or2); font-size: 15px; }
.noeud-niv small { color: var(--texte2); font-size: 10px; }
.noeud-corps { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 12px; background: rgba(0,0,0,.28); display: flex; flex-direction: column; gap: 5px; }
.noeud-corps p { font-size: 12.5px; color: var(--texte2); }
.noeud.fini .noeud-niv { background: var(--or2); color: #2a1a08; } .noeud.fini .noeud-niv small { color: #5a3f10; }
.noeud.ferme { opacity: .7; } .noeud.ferme .noeud-niv { border-color: var(--bord); }
.noeud.ici .noeud-niv { border-color: var(--braise); box-shadow: 0 0 0 4px rgba(255,138,61,.25); }
.piece, .objet-ligne, .choix-bat, .choix-troupe { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 13px; background: rgba(0,0,0,.26); }
.piece > div, .objet-ligne > div, .choix-bat > div, .choix-troupe-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.piece p, .objet-ligne p, .choix-bat p { font-size: 12.5px; color: var(--texte2); }
.choix-bat .art { width: 72px; height: 72px; flex: none; }
.choix-troupe h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.choix-troupe h4 small { color: var(--texte2); font-weight: 400; }
.pieces-vides { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.pieces-vides span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: rgba(0,0,0,.3); opacity: .6; }
.vignettes { display: flex; flex-wrap: wrap; gap: 8px; }
.vignette { width: 76px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 11px; color: var(--texte2); }
.vignette .art { width: 60px; height: 60px; }
.ferronnie-cite { margin-top: 4px; padding: 11px 13px; background: var(--fer1); border-left: 2px solid var(--acier); color: var(--acier2); font-size: 13px; letter-spacing: .03em; line-height: 1.5; }
.ferronnie-cite cite { display: block; margin-top: 5px; font-style: normal; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--acier); }

/* ---------- le siège */
.scene-citadelle { position: relative; border: 1px solid var(--fer3); border-radius: 3px; overflow: hidden; background: #0d1216; }
.citadelle { display: block; width: 100%; height: auto; }
.scene-titre { position: absolute; top: 10px; left: 12px; display: flex; flex-direction: column; line-height: 1.2; }
.scene-titre small { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--acier); }
.scene-titre b { font: 700 18px var(--titre); color: var(--eclair); }
.scene-fin { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; background: rgba(13,18,22,.85); border: 1px solid var(--fer3); border-radius: 2px; color: var(--eclair); font-size: 12px; font-weight: 600; }
.scene-fin .ico { width: 14px; height: 14px; }
.grave { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; padding: 5px 16px 6px; white-space: nowrap;
  background: linear-gradient(180deg, #4a3226, #33221a); border: 1px solid var(--rouille); border-radius: 2px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); line-height: 1.2; }
.grave small { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #c79a80; }
.grave b { font: 700 16px var(--titre); letter-spacing: .08em; color: #f1c9ac; text-shadow: 0 -1px 0 #1a0f0a, 0 1px 0 rgba(255,220,190,.25); }
.grave.large { position: static; transform: none; padding: 12px 16px; white-space: normal; text-align: center; gap: 3px; }
.grave.large b { font-size: 22px; }
.plaque-fer { position: relative; padding: 14px 14px 12px 64px; background: linear-gradient(180deg, #252f37, #1a2228); border: 1px solid var(--acier); border-radius: 2px;
  background-image: radial-gradient(circle at 6px 6px, #8f9aa3 1.6px, transparent 2px), radial-gradient(circle at calc(100% - 6px) 6px, #8f9aa3 1.6px, transparent 2px), radial-gradient(circle at 6px calc(100% - 6px), #8f9aa3 1.6px, transparent 2px), radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), #8f9aa3 1.6px, transparent 2px), linear-gradient(180deg, #252f37, #1a2228); }
.plaque-fer .sceau { position: absolute; left: 13px; top: 14px; width: 40px; height: 40px; }
.plaque-fer blockquote { color: #eef7ff; font-size: 15.5px; line-height: 1.5; letter-spacing: .035em; user-select: text; -webkit-user-select: text; }
.plaque-fer figcaption { margin-top: 8px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--acier); }
.defenses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.defense { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 5px; background: var(--fer0); border: 1px solid var(--fer3); text-align: center; line-height: 1.2; }
.defense > .ico { width: 30px; height: 30px; }
.defense h4 { font-size: 12px; color: var(--eclair); }
.defense small { font-size: 11px; color: var(--acier); }
.defense .barre { width: 100%; }
.defense .contre { display: inline-flex; align-items: center; gap: 3px; color: var(--rouge); font-size: 10.5px; }
.defense .contre .ico { width: 14px; height: 14px; }
.defense.absente, .defense.detruite { opacity: .5; }
.piege { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: rgba(164,83,43,.2); border: 1px solid var(--rouille); color: #f3c5ab; font-size: 13px; }
.piege span { flex: 1; }
.piege.chape { background: rgba(127,200,255,.08); border-color: var(--eclair); color: var(--eclair); }
.sentinelle { display: flex; gap: 12px; align-items: center; }
.sentinelle .portrait { width: 104px; flex: none; }
.sentinelle > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sentinelle p { font-size: 13px; }
.sentinelle-carte { border-color: var(--eclair) !important; }
.journal { display: flex; flex-direction: column; gap: 7px; }
.evt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; }
.evt > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.evt p { font-size: 13.5px; }
.evt small { font-size: 11px; color: var(--texte3); }
.evt.fer { background: var(--fer1); border: 1px solid var(--fer3); border-left: 2px solid var(--acier); color: var(--acier2); }
.evt.fer .sceau { width: 30px; height: 30px; flex: none; }
.evt.fer blockquote { color: #eef7ff; letter-spacing: .03em; padding-left: 9px; border-left: 1px solid var(--fer3); user-select: text; -webkit-user-select: text; }
.evt.fer small { letter-spacing: .12em; text-transform: uppercase; font-size: 10px; color: var(--acier); }
.evt.vie { background: linear-gradient(180deg, rgba(143,191,85,.16), rgba(143,191,85,.06)); border: 1px solid rgba(143,191,85,.4); border-radius: 13px; }
.evt.vie > .ico { width: 24px; height: 24px; color: var(--braise); margin-top: 1px; }
.evt.neutre { background: rgba(0,0,0,.25); border-radius: 13px; color: var(--texte2); }
.evt.neutre > .ico { width: 20px; height: 20px; margin-top: 1px; }
.marche { display: flex; flex-direction: column; gap: 9px; padding: 12px; border-radius: 15px; background: linear-gradient(180deg, var(--bois2), var(--bois1)); border: 1px solid rgba(242,194,97,.2); }
.marche-tete, .marche-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.marche-quoi { display: inline-flex; align-items: center; gap: 7px; }
.avec-heros { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 999px; background: rgba(242,194,97,.18); color: var(--or); font-size: 11.5px; font-style: normal; font-weight: 600; }
.avec-heros .ico { width: 14px; height: 14px; }
.piste { display: flex; align-items: center; gap: 8px; }
.piste .bout { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.35); color: var(--or); flex: none; }
.piste .bout.fer { border-radius: 2px; background: var(--fer1); color: var(--eclair); border: 1px solid var(--fer3); }
.piste .bout .ico { width: 17px; height: 17px; }
.rail { flex: 1; height: 4px; position: relative; margin: 0 12px; background: repeating-linear-gradient(90deg, rgba(246,234,212,.35) 0 6px, transparent 6px 12px); }
.rail i { position: absolute; top: -12px; left: 0; width: 28px; height: 28px; margin-left: -14px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe6a8, var(--or2)); border: 2px solid #7a5a22; transition: left .5s linear; box-shadow: 0 2px 5px rgba(0,0,0,.5); }
.rail i .ico { width: 17px; height: 17px; }
.rapport-ligne { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 13px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.05); }
.rapport-ligne > span:first-of-type { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rapport-ligne small { color: var(--texte3); }
.rapport-ligne > .ico:last-child { width: 15px; height: 15px; color: var(--texte3); }
.rapport-ligne.issue { opacity: .75; }
.rapport-ligne:active { transform: scale(.98); }
.rapport-bloc { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 13px; background: rgba(0,0,0,.26); }
.rapport-bloc h4 { font-size: 13px; color: var(--texte2); font-weight: 600; }
.rapport-bloc.pertes { border-left: 3px solid var(--rouge); } .rapport-bloc.blesses { border-left: 3px solid var(--mousse); }
.action-collante { position: sticky; bottom: 0; padding: 14px 12px 12px; background: linear-gradient(180deg, transparent, rgba(16,13,10,.96) 40%); z-index: 3; }
.espace-action { height: 4px; }

/* ---------- héros, sac */
.heros-scene { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.portrait { display: block; width: 190px; height: auto; }
.heros-scene.envoute .portrait { filter: grayscale(.8) brightness(.8); }
.heros-nom { display: flex; align-items: center; gap: 10px; margin-top: -18px; padding: 7px 18px 7px 7px; border-radius: 999px; background: rgba(20,16,12,.92); border: 1px solid var(--or2); position: relative; }
.heros-nom h2 { font: 700 19px/1.1 var(--titre); }
.heros-nom small { color: var(--texte2); }
.niveau-ecu { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font: 700 18px var(--titre); color: #2a1a08; background: radial-gradient(circle at 35% 30%, #ffe6a8, var(--or2)); border: 2px solid #7a5a22; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 6px; border-radius: 999px; background: rgba(242,194,97,.16); border: 1px solid var(--or2); font-size: 12px; color: var(--or); }
.badge .ico { width: 14px; height: 14px; color: var(--braise); }
.grille-objets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.objet { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px 12px; border-radius: 16px; text-align: center; background: linear-gradient(180deg, var(--bois2), var(--bois1)); border: 1px solid rgba(242,194,97,.2); }
.objet .ico.gros { width: 52px; height: 52px; }
.objet p { font-size: 12px; color: var(--texte2); flex: 1; }
.objet .compte { position: absolute; top: 8px; right: 10px; padding: 1px 8px; border-radius: 999px; background: rgba(0,0,0,.45); color: var(--or); font-size: 13px; }

/* ---------- missions, récit */
.ration { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: linear-gradient(120deg, #4a3520, #2a1f17); border: 1px solid var(--or2); }
.ration > div { flex: 1; min-width: 0; }
.ration h3 { font: 700 16px var(--titre); color: var(--or); }
.ration p { font-size: 13px; color: var(--texte2); }
.ration-art .ico { width: 50px; height: 50px; display: block; }
.ration.prete { box-shadow: 0 0 0 0 rgba(242,194,97,.5); animation: appel 2.4s ease-in-out infinite; }
.ration.prete .ration-art { animation: flotter 1.6s ease-in-out infinite; }
.mission { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 15px; background: linear-gradient(180deg, var(--bois2), var(--bois1)); border: 1px solid rgba(242,194,97,.16); }
.mission-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mission-corps p { font-size: 12.5px; color: var(--texte2); }
.mission-corps small { color: var(--texte2); }
.mission.finie { border-color: var(--or); }
.mission.prise { opacity: .55; }
.mission .fait { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(143,191,85,.2); color: var(--mousse); }
.recit-bandeau { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 5px 12px 5px 8px; position: relative; z-index: 4;
  background: linear-gradient(90deg, #2f4a26, #2a1f17 75%); border-bottom: 1px solid rgba(143,191,85,.45); }
.recit-pas { width: 32px; height: 32px; flex: none; display: flex; align-items: baseline; justify-content: center; padding-top: 7px; border-radius: 50%; background: rgba(0,0,0,.4); border: 1px solid var(--mousse); font-weight: 700; font-size: 13px; }
.recit-pas small { font-size: 8.5px; color: var(--texte2); font-weight: 400; }
.recit-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.recit-texte small { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mousse); }
.recit-texte b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recit-progres { font-size: 12px; color: var(--texte2); font-weight: 600; }
.recit-bandeau > .ico { width: 15px; height: 15px; color: var(--texte2); }
.recit-cadeau .ico { width: 30px; height: 30px; animation: flotter 1.2s ease-in-out infinite; }
.recit-bandeau.prete { background: linear-gradient(90deg, #6b4a16, #3a2a16 75%); border-bottom-color: var(--or); }
.recit-bandeau.prete .recit-pas { border-color: var(--or); }
.recit-bandeau.prete .recit-texte small { color: var(--or); }
.chemin { display: flex; gap: 3px; padding: 2px 0; }
.chemin i { flex: 1; height: 6px; border-radius: 3px; background: rgba(0,0,0,.45); }
.chemin .fait { background: var(--mousse2); } .chemin .ici { background: var(--or); box-shadow: 0 0 8px rgba(242,194,97,.7); }
.recit-prose { font: 400 15.5px/1.6 var(--titre); color: var(--parchemin); user-select: text; -webkit-user-select: text; }
.recit-but { display: flex; gap: 7px; align-items: flex-start; padding: 9px 11px; border-radius: 11px; background: rgba(143,191,85,.14); border: 1px solid rgba(143,191,85,.4); font-weight: 600; font-size: 13.5px; }

/* ---------- classements */
.rangs { display: flex; flex-direction: column; gap: 6px; }
.rang { display: flex; align-items: center; gap: 11px; padding: 9px 13px 9px 9px; border-radius: 13px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.05); }
.rang-n { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.4); font: 700 15px var(--titre); color: var(--texte2); }
.rang-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.rang-nom b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang-nom small { color: var(--texte3); }
.rang-degats { color: var(--or); font-size: 15px; }
.rang.podium .rang-n { color: #2a1a08; }
.rang.p1 .rang-n { background: radial-gradient(circle at 35% 30%, #fff0c0, #e2ad3c); } .rang.p2 .rang-n { background: radial-gradient(circle at 35% 30%, #f4efe6, #b3a996); } .rang.p3 .rang-n { background: radial-gradient(circle at 35% 30%, #f1c9a0, #b06f3a); }
.rang.p1 { border-color: rgba(242,194,97,.5); }
.rang.moi { background: linear-gradient(90deg, rgba(255,138,61,.24), rgba(255,138,61,.06)); border-color: var(--braise); }
.chargement-doux { display: flex; justify-content: center; gap: 8px; padding: 30px; }
.chargement-doux i { width: 10px; height: 10px; border-radius: 50%; background: var(--braise); animation: lueur 1s ease-in-out infinite; }
.chargement-doux i:nth-child(2) { animation-delay: .2s; } .chargement-doux i:nth-child(3) { animation-delay: .4s; }

/* ---------- réglages, codes */
.code { display: block; padding: 12px 10px; border-radius: 12px; background: rgba(0,0,0,.5); border: 1px dashed var(--or2); color: var(--or); text-align: center;
  font: 700 18px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace; letter-spacing: .1em; user-select: all; -webkit-user-select: all; word-break: break-all; }
.code.grand { font-size: 21px; padding: 16px 8px; }
.transfert { display: flex; gap: 12px; align-items: center; }
.transfert .qr { width: 148px; height: 148px; flex: none; border-radius: 10px; }
.transfert > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.transfert p { font-size: 12.5px; color: var(--texte2); }

/* ---------- premier lancement */
.accueil { height: 100%; overflow-y: auto; padding: calc(var(--haut-sur) + 18px) 18px calc(var(--bas-sur) + 24px); display: flex; flex-direction: column; gap: 16px; position: relative;
  background: radial-gradient(90% 46% at 50% 14%, rgba(255,138,61,.3), rgba(242,194,97,.08) 55%, transparent 75%), linear-gradient(180deg, #1d1611, #100c09); }
.accueil > * { position: relative; }
.accueil-ciel { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.braise-vol { position: absolute; bottom: -10px; width: 5px; height: 5px; border-radius: 50%; background: var(--braise); box-shadow: 0 0 8px 2px rgba(255,138,61,.7); animation: monter 7s linear infinite; will-change: transform, opacity; }
.b1 { left: 12%; } .b2 { left: 34%; animation-delay: 2.2s; animation-duration: 9s; } .b3 { left: 58%; animation-delay: 4s; } .b4 { left: 78%; animation-delay: 1.2s; animation-duration: 8s; } .b5 { left: 90%; animation-delay: 5.5s; }
.b6 { left: 22%; width: 3px; height: 3px; animation-delay: 3.1s; animation-duration: 11s; } .b7 { left: 46%; width: 3px; height: 3px; background: #ffd27a; animation-delay: 6.4s; animation-duration: 10s; }
.b8 { left: 68%; width: 4px; height: 4px; animation-delay: .4s; animation-duration: 12s; } .b9 { left: 5%; width: 3px; height: 3px; background: #ffd27a; animation-delay: 7.6s; animation-duration: 9.5s; }
/* lueur de la forge au sol */
.accueil-sol { position: absolute; left: -10%; right: -10%; bottom: -40px; height: 220px; background: radial-gradient(50% 60% at 50% 100%, rgba(255,110,40,.32), rgba(226,90,28,.08) 60%, transparent 75%); animation: foyer 4.2s ease-in-out infinite; }
@keyframes foyer { 0%, 100% { opacity: .75; } 45% { opacity: 1; } 60% { opacity: .85; } }
.accueil-tete { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* blason : foyer, sceau de Ferronnie (deux anneaux en sens contraires), héros devant */
.accueil-blason { position: relative; width: 200px; height: 186px; display: grid; place-items: center; }
.accueil-blason > * { grid-area: 1 / 1; }
.accueil-foyer { width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(255,176,102,.5), rgba(226,90,28,.18) 50%, transparent 70%); animation: foyer 3.4s ease-in-out infinite; }
.sceau { width: 196px; height: 196px; will-change: transform; }
.sceau-a { animation: tourner 80s linear infinite; }
.sceau-b { width: 168px; height: 168px; animation: tourner 120s linear infinite reverse; }
@keyframes tourner { to { transform: rotate(360deg); } }
.accueil-portrait { width: 150px; align-self: end; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.accueil-tete h1 { margin-top: -6px; display: flex; flex-direction: column; line-height: 1; font-family: var(--titre); }
.accueil-tete h1 small { font-size: 17px; letter-spacing: .34em; text-transform: uppercase; color: var(--texte2); font-weight: 400; }
.accueil-tete h1 span { font-size: 38px; font-weight: 700; color: var(--or); margin-top: 6px;
  background: linear-gradient(180deg, #fff1c4 10%, #f2c261 48%, #c98a2e 80%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 0 #5a300c) drop-shadow(0 0 14px rgba(255,138,61,.45)); }
/* trait forgé sous le titre, gerbe d'étincelles au premier coup */
.accueil-trait { position: relative; display: block; width: 150px; height: 3px; margin-top: 10px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--braise) 20%, #ffe3a0 50%, var(--braise) 80%, transparent); box-shadow: 0 0 10px rgba(255,138,61,.8); }
.gerbe { position: absolute; left: 50%; top: 50%; }
.gerbe b { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffe3a0; box-shadow: 0 0 6px 1px var(--braise); opacity: 0; }
.accueil-tete p { margin-top: 10px; color: var(--texte2); font-size: 14px; }
.accueil-carte { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; border-radius: 18px;
  background: var(--rivets), linear-gradient(180deg, rgba(56,42,30,.97), rgba(36,27,20,.97)); border: 1px solid rgba(242,194,97,.32);
  box-shadow: inset 0 1px 0 rgba(255,235,190,.1), inset 0 0 0 3px rgba(0,0,0,.25), 0 14px 34px rgba(0,0,0,.55), 0 0 40px rgba(226,90,28,.08); }
.accueil-carte::before { content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #ffd27a, transparent); box-shadow: 0 0 10px rgba(255,180,90,.7); }
/* entrée : le foyer s'allume, le sceau se trace, le héros monte, le titre frappe, la carte sort de l'ombre */
.entree .accueil-foyer { animation: allumer 1.1s ease-out both, foyer 3.4s 1.1s ease-in-out infinite; }
.entree .sceau-a { animation: tracer 1.4s .15s cubic-bezier(.2,.8,.2,1) both, tourner 80s 1.55s linear infinite; }
.entree .sceau-b { animation: tracer-b 1.4s .3s cubic-bezier(.2,.8,.2,1) both, tourner 120s 1.7s linear infinite reverse; }
.entree .accueil-portrait { animation: surgir .8s .35s cubic-bezier(.2,.9,.3,1.15) both; }
.entree .accueil-tete h1 small { animation: apparaitre .6s .7s ease-out both; }
.entree .accueil-tete h1 span { animation: frapper .5s .9s cubic-bezier(.3,1.6,.5,1) both; }
.entree .accueil-trait { animation: etirer .5s 1.15s ease-out both; }
.entree .gerbe b { animation: gerbe .75s 1.15s ease-out both; }
.entree .accueil-tete p { animation: apparaitre .6s 1.35s ease-out both; }
.entree .accueil-carte, .accueil-carte.neuve { animation: sortir .6s cubic-bezier(.2,.8,.2,1) both; }
.entree .accueil-carte { animation-delay: 1.5s; }
.entree .ferronnie-cite { animation: apparaitre .9s 1.9s ease-out both; }
@keyframes allumer { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: .85; transform: scale(1); } }
@keyframes tracer { from { opacity: 0; transform: rotate(-70deg) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes tracer-b { from { opacity: 0; transform: rotate(80deg) scale(1.25); } to { opacity: 1; transform: none; } }
@keyframes surgir { from { opacity: 0; transform: translateY(26px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes apparaitre { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes frapper { 0% { opacity: 0; transform: scale(1.6); } 70% { opacity: 1; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes etirer { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes gerbe { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1.3); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(.3); } }
@keyframes sortir { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
.accueil-carte h2 { font: 700 20px var(--titre); color: var(--or); }
.accueil-prose { font: 400 15.5px/1.55 var(--titre); }
.accueil-alerte { display: flex; gap: 9px; padding: 11px 12px; border-radius: 12px; background: rgba(255,138,61,.16); border: 1px solid var(--braise); font-weight: 600; font-size: 14px; }
.accueil-alerte .ico { width: 24px; height: 24px; color: var(--braise); }
.champ { display: flex; flex-direction: column; gap: 5px; }
.champ span { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--texte2); }
.champ input { height: 50px; padding: 0 14px; border-radius: 13px; background: rgba(0,0,0,.45); border: 1px solid var(--bord); color: var(--parchemin); font: 600 17px var(--corps); user-select: text; -webkit-user-select: text; width: 100%; }
.champ input:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(242,194,97,.2); }
.champ input::placeholder { color: var(--texte3); font-weight: 400; }
.langues { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.langues button { min-height: 42px; border-radius: 12px; text-align: center; background: rgba(0,0,0,.3); border: 1px solid var(--bord); color: var(--texte2); font-weight: 600; }
.langues .actif { border-color: var(--or); color: var(--or); background: rgba(242,194,97,.12); }

@media (max-width: 359px) { .res small { display: none; } .res .ico { grid-row: auto; } .saison-puce small { display: none; } }
@media (min-width: 521px) { #app { box-shadow: 0 0 60px rgba(0,0,0,.8); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .eclair { opacity: 0; } }

/* ---------- ajouts de la reprise : gains d'un niveau, bannière de saison, bilan du siège */
.gains { display: flex; flex-direction: column; padding: 4px 10px; border-radius: 11px; background: rgba(143,191,85,.1); border: 1px solid rgba(143,191,85,.28); font-size: 13px; }
.gains .ligne { min-height: 24px; }
.gain-v { white-space: nowrap; color: var(--texte2); text-align: right; }
.gain-v .vers { color: var(--texte3); }
.mieux { color: var(--mousse); }
.ligne.eteinte { opacity: .5; }
.ligne b .ico { width: 16px; height: 16px; color: var(--mousse); }
.unite-nom { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
.unite-nom small { flex-basis: 100%; color: var(--texte2); font-size: 12.5px; }
.badge.fort { background: rgba(255,138,61,.2); border-color: var(--braise); color: #ffd9b0; }
.piece .fait, .noeud .fait { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(143,191,85,.2); color: var(--mousse); }
.piece .frein { font-size: 12px; }
.saison-bandeau { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 4px 12px; position: relative; z-index: 4; font-size: 12.5px; font-weight: 600; }
.saison-bandeau span { flex: 1; min-width: 0; }
.saison-bandeau time { white-space: nowrap; }
.saison-bandeau.libre { background: linear-gradient(90deg, #3f6a2c, #2a1f17 85%); border-bottom: 1px solid var(--mousse); color: #e9f6d2; }
.saison-bandeau.libre .ico { width: 18px; height: 18px; color: var(--braise); animation: battement 1.6s infinite; }
.saison-bandeau.froid { background: var(--fer1); border-bottom: 1px solid var(--acier); color: var(--eclair); letter-spacing: .03em; }
.saison-bandeau .sceau { width: 22px; height: 22px; flex: none; }
.bilan-siege { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; background: var(--fer1); border: 1px solid var(--fer3); border-radius: 3px; color: var(--acier2); font-size: 12.5px; letter-spacing: .03em; }
.fer-stock { display: inline-flex; align-items: center; gap: 5px; color: var(--eclair); }
.fer-stock .ico { width: 16px; height: 16px; }
.troupe small { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- 360 px de large : rien ne déborde */
.res { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 3px; row-gap: 0; padding: 3px 4px; min-width: 0; }
.res .ico { width: 17px; height: 17px; grid-row: auto; }
.res b { flex: 1; min-width: 0; font-size: 12px; letter-spacing: -.01em; }
.res small { flex-basis: 100%; text-align: center; font-size: 9px; letter-spacing: -.01em; }
@media (max-width: 359px) { .res small { display: none; } }
.code.grand { font-size: min(21px, 5.2vw); white-space: nowrap; word-break: normal; overflow: hidden; }
.flot.bas-gauche { max-width: calc(100% - 180px); }
.jeton { max-width: 100%; }
.segments button { line-height: 1.15; }
.choix-bat > div, .piece > div { overflow-wrap: anywhere; }
/* une action est partie au serveur : un fil de braise court en haut de l'écran */
body.occupe #app::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 90; background: linear-gradient(90deg, transparent, var(--braise), var(--or), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: filer .8s linear infinite; }
@keyframes filer { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* la vue est son propre plan : les z-index du camp (un par bâtiment, selon sa hauteur) et des boutons flottants
   ne passent plus devant les panneaux du bas ni devant les messages */
.vue { z-index: 0; isolation: isolate; }

/* l'histoire de la première arrivée (vues/histoire.js) */
.histoire .feuille-art { width: 96px; height: 104px; }
.histoire-portrait { width: 100%; height: 100%; }
.histoire-texte { font-size: 1.02rem; line-height: 1.55; margin: 4px 0 14px; }
.histoire-points { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.histoire-points i { width: 8px; height: 8px; border-radius: 50%; background: var(--bord); }
.histoire-points i.oui { background: var(--or, #d9a441); }

/* ---------- l'apparence du héros (lot 5) */
.silhouettes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.silhouette { padding: 7px 12px; border-radius: 999px; font-size: 13px; color: var(--texte2); background: var(--bois1); box-shadow: inset 0 0 0 1px var(--bord); }
.silhouette.choisie { color: var(--or); font-weight: 700; box-shadow: inset 0 0 0 2px var(--or), 0 0 12px rgba(242,194,97,.3); }
.teintes { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.teintes small { width: 64px; flex: none; color: var(--texte3); }
.nuancier { display: flex; flex-wrap: wrap; gap: 7px; }
.teinte { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0,0,0,.45), 0 0 0 1px var(--bord); transition: transform .1s; }
.teinte.choisie { transform: scale(1.12); box-shadow: inset 0 0 0 2px rgba(0,0,0,.45), 0 0 0 2px var(--or), 0 0 10px rgba(242,194,97,.5); }
