/* HUD du donjon allégé (5/11, lot I6, rapport 4.3, 5.1, 5.2, 5.4, 5.5).
   Dans la ROM, le haut de l'écran n'a presque pas de cadre : ici, des cadres fins (1 px clair + 1 px sombre), semi-transparents,
   avec un petit coin doré en pixels ; le journal sans cadre qui s'efface ; la barre du chef plus étroite avec le nom écrit dessus ;
   la barre des attaques avec l'icône du type et la recharge en voile circulaire ; la roue de capture en pixels. */

/* ---------- Cadres fins ---------- */
body #hud .box.hud-panel, body #hud .box.mm-box, body #hud .box.bossbar, body #hud .box.stairs-bar {
  border: 1px solid rgba(143,184,255,.55); border-image: none; border-radius: 2px;
  background: linear-gradient(180deg, rgba(16,30,74,.74), rgba(6,12,34,.66));
  box-shadow: 0 0 0 1px rgba(2,5,15,.8), inset 0 0 0 1px rgba(2,5,15,.55), inset 0 1px 0 rgba(255,255,255,.1);
  filter: none;
}
/* coins dorés en pixels (2 traits de 3 px à chaque coin), comme les losanges des fenêtres, en tout petit */
body #hud .box.hud-panel::before, body #hud .box.mm-box::before, body #hud .box.bossbar::before {
  content: ''; position: absolute; inset: -2px; pointer-events: none; opacity: .85;
  background:
    linear-gradient(#ffd35c, #ffd35c) left top / 4px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) left top / 1px 4px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) right top / 4px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) right top / 1px 4px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) left bottom / 4px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) left bottom / 1px 4px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) right bottom / 4px 1px no-repeat, linear-gradient(#ffd35c, #ffd35c) right bottom / 1px 4px no-repeat;
}
body:not(.is-touch) #hud .box.hud-panel { padding: 8px 10px; width: 300px; }
body:not(.is-touch) #hud .box.mm-box { padding: 4px !important; }
body.is-touch #hud .box.hud-panel { padding: 3px 6px !important; }
body.is-touch #hud .box.mm-box { padding: 2px !important; }

/* ---------- Barre du chef : plus étroite, le nom écrit sur la barre ---------- */
body #hud .box.bossbar { width: min(400px, calc(40vw / var(--hud, 1))); padding: 3px !important; }
body #hud .bossbar .bar { height: 22px; border-radius: 1px; }
body #hud .bossbar .bn { position: absolute; left: 3px; right: 3px; top: 3px; height: 22px; z-index: 1; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 16px; line-height: 1; white-space: nowrap; overflow: hidden; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000, 0 2px 0 #000; }
body #hud .bossbar .bn .muted { color: #e8ecff; }
body #hud .bossbar .bn .lvl { padding: 0 4px; line-height: 16px; background: rgba(0,0,0,.45); }
body.is-touch #hud .box.bossbar { width: min(300px, 40vw); padding: 2px !important; }
body.is-touch #hud .bossbar .bar { height: 18px; }
body.is-touch #hud .bossbar .bn { left: 2px; right: 2px; top: 2px; height: 18px; }

/* ---------- Annonces de rang : sous la barre du chef, plus par-dessus ---------- */
#hud #h-boss:not(.hidden) ~ #h-banner .banner.small { top: 92px; }
body.is-touch #hud #h-boss:not(.hidden) ~ #h-banner .banner.small { top: 30%; }

/* ---------- Journal : sans cadre, il s'efface après 4 s ---------- */
body:not(.is-touch) #hud .hud-log { border: 0; border-image: none; filter: none; padding: 4px 10px !important; border-radius: 2px;
  background: linear-gradient(90deg, rgba(4,8,24,.6), rgba(4,8,24,.35) 60%, rgba(4,8,24,0)); }
body:not(.is-touch) #hud .hud-log div { text-shadow: 0 2px 0 #000, 0 0 4px #000; animation: logIn .25s, logOut .8s 4s forwards; }
body:not(.is-touch) #hud .hud-log.calme { opacity: 0; }
body.is-touch #hud .hud-log div { animation: logIn .25s, logOut .8s 4s forwards; }
#hud .hud-log div.log-discret { font-size: 14px; opacity: .85; } /* (26/11) recrues déjà possédées, dialogues coupés dans les Réglages */

/* ---------- Barre des attaques ---------- */
#hud .mv { grid-template-columns: 42px 1fr; width: 224px; min-height: 44px; padding: 3px 10px 3px 4px; gap: 8px; border-radius: 2px;
  border: 1px solid rgba(143,184,255,.5); background: linear-gradient(180deg, rgba(20,36,84,.8), rgba(8,16,44,.74));
  box-shadow: 0 0 0 1px rgba(2,5,15,.8), inset 0 1px 0 rgba(255,255,255,.1); }
/* 5/11 soir (retour de Kiko) : le rond est de la couleur du type avec la touche dessus, comme avant le lot I6 ;
   la recharge reste un voile sombre circulaire qui se vide sur le rond, la touche reste lisible par-dessus. */
#hud .mv .orb { position: relative; width: 36px; height: 36px; margin-left: 2px; border-radius: 50%; overflow: visible; font-size: 18px; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.55); background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 42%), var(--tc);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 2px rgba(2,5,15,.7), 0 0 10px var(--tc); }
#hud .mv .orb .voile { position: absolute; inset: 0; border-radius: 50%; z-index: 1; }
#hud .mv .orb .k { position: relative; z-index: 2; line-height: 1; }
#hud .mv .orb .k img { vertical-align: middle; }
/* (26/11, Kiko) à la manette, seulement l’icône du bouton : plus de rectangle noir (fond et bordure des touches du clavier) */
.mv .k:has(.pad-btn), .pick .k:has(.pad-btn) { background: none; border: 0; padding: 0; }
#hud .mv .orb .cad { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; font-size: 16px; }
#hud .mv.locked.planned .orb { filter: grayscale(.7) brightness(.6); }
#hud .mv .sub { color: #a9b8e0; }
#hud .mv.charge .nm, #hud .mv.charge .sub { opacity: .55; }
#hud .mv.ready .orb { animation: orbPret .45s ease-out; }
@keyframes orbPret { 0% { transform: scale(1.22); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #fff, 0 0 16px #fff; } 100% { transform: none; } }
/* (3/12, Kiko) recharge à part de la zone de renfort / du champ d'une signature (20 s, game.js majRenfHud) : un éclair bleu traverse le bas
   du bouton de gauche à droite (--p : avancement) ; arrivé au bord, le bouton brille en bleu tant que la zone est prête. */
#hud .mv { position: relative; }
/* (4/12, Kiko) même éclair que la version 1 de la case signature (etoiles-bleues.css --sig-bolt) : éteint (bleu nuit), il se remplit
   de gauche à droite pendant les 20 s (--p) ; plein, il frappe (flash) puis respire tant que la zone est prête. */
#hud .mv .renf { position: absolute; left: 4px; right: 4px; bottom: -4px; height: 11px; pointer-events: none; z-index: 3;
  background: var(--sig-bolt-off) center / 100% 100% no-repeat; }
#hud .mv .renf::before { content: ''; position: absolute; inset: 0; background: var(--sig-bolt) center / 100% 100% no-repeat;
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); filter: drop-shadow(0 0 3px #60c8ff); }
#hud .mv .renf.plein::before { clip-path: none; animation: renfFrappe .7s ease-out, renfRespire 1.8s ease-in-out .7s infinite; }
#hud .mv .renf.plein b { display: none; }
@keyframes renfFrappe { 0% { filter: drop-shadow(0 0 12px #e8f8ff) brightness(2.2); } 100% { filter: drop-shadow(0 0 3px #60c8ff); } }
@keyframes renfRespire { 0%, 100% { filter: drop-shadow(0 0 3px #60c8ff); } 50% { filter: drop-shadow(0 0 8px #bfe8ff) brightness(1.35); } }
#hud .mv .renf.hidden { display: none; }
#hud .mv .renf b { position: absolute; left: var(--p, 0%); top: -3px; width: 10px; height: 16px; margin-left: -5px; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h3L6 6h3L2 16l2-7H1z' fill='%23bfe2ff'/%3E%3Cpath d='M6 1h1L5 6h2L4 12l1-5H3z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 3px #7ab8ff); animation: renfEclair .25s steps(2) infinite; }
/* (3/12) boutons tactiles : l'anneau bleu fait le tour du bouton pendant la recharge de la zone, puis il brille en bleu */
#touch .t-btn.renf-t::after { content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; padding: 6px; filter: drop-shadow(0 0 3px #7ab8ff);
  background: conic-gradient(#8fd0ff var(--rp, 0deg), rgba(143,208,255,.15) 0); -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
#touch .t-btn.renf-pret { box-shadow: 0 0 14px #7ab8ff, 0 0 0 2px #bfe2ff inset; animation: renfPret 1.4s ease-in-out infinite; }
@keyframes renfEclair { 50% { filter: drop-shadow(0 0 6px #bfe2ff) brightness(1.4); } }
#hud .mv.renf-pret { border-color: #8fd0ff; animation: renfPret 1.4s ease-in-out infinite; }
#hud .mv.renf-pret .orb { box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 2px rgba(120,190,255,.9), 0 0 12px #7ab8ff; }
@keyframes renfPret { 0%, 100% { box-shadow: 0 0 0 1px rgba(2,5,15,.8), 0 0 8px rgba(90,160,255,.55), inset 0 1px 0 rgba(255,255,255,.1); }
  50% { box-shadow: 0 0 0 1px rgba(2,5,15,.8), 0 0 18px rgba(140,200,255,.95), inset 0 0 10px rgba(120,190,255,.35); } }

/* ---------- Roue de capture en pixels ---------- */
.rl-wheel { width: 192px; height: 210px; }
.rl-wheel canvas { width: 192px; height: 210px; image-rendering: pixelated; }
.rl-wheel.mise canvas { animation: roueMise .45s ease-out; }
@keyframes roueMise { 0% { filter: brightness(1.8) drop-shadow(0 0 10px #c9a0ff); transform: scale(1.06); } 100% { filter: none; transform: none; } }
.rl-tk { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.rl-tk:empty { display: none; }
.rl-j { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 16px; border: 1px dashed rgba(143,184,255,.5); border-radius: 2px; background: rgba(2,5,15,.5); color: #c8d4f4; }
.rl-j b { color: #9ef0ff; font-weight: normal; }
.rl-j.mise { border-style: solid; border-color: var(--gold-line); color: var(--gold); background: rgba(80,50,0,.35); }
.rl-j.fait { opacity: .6; }
.rl-act .btn { display: inline-flex; align-items: center; gap: 10px; }
.rl-k { display: inline-block; min-width: 18px; padding: 0 4px; font-size: 16px; line-height: 18px; text-align: center; border-radius: 2px; background: rgba(2,5,15,.7); border: 1px solid rgba(255,255,255,.4); color: #fff; }
.rl-ajout:not([disabled]) { animation: ajoutPulse 1.4s ease-in-out infinite; }
@keyframes ajoutPulse { 50% { filter: brightness(1.25); } }
.rl-fait { animation: pop .25s; }
body.is-touch .rl-wheel, body.is-touch .rl-wheel canvas { width: 128px; height: 140px; }
body.is-touch .rl-k { display: none; } /* au doigt, pas de touche à montrer */
body.is-touch .rl-act .btn { min-height: 40px; }

/* ---------- Escorté à terre (12/11) : bandeau en haut, sous l'étage, avec le temps pour le ranimer ---------- */
body #hud .box.escorte-ko { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px !important; min-width: 250px; border: 1px solid rgba(255,120,120,.75); border-radius: 2px; image-rendering: pixelated;
  background: linear-gradient(180deg, rgba(74,16,22,.82), rgba(34,6,12,.74)); box-shadow: 0 0 0 1px rgba(15,2,5,.85), inset 0 1px 0 rgba(255,255,255,.12); }
body #hud .escorte-ko.hidden { display: none; }
body #hud .escorte-ko.entre { animation: ek-entre .35s steps(4) both; }
body #hud .escorte-ko img { width: 36px; height: 36px; image-rendering: pixelated; border: 1px solid rgba(255,150,150,.6); background: #1a0610; }
body #hud .escorte-ko .ek-txt { flex: 1; font-size: 14px; line-height: 1.15; }
body #hud .escorte-ko .ek-txt .muted { font-size: 12px; color: #ffc4c4; }
body #hud .escorte-ko .bar { height: 5px; margin-top: 3px; background: #1a0610; }
body #hud .escorte-ko .bar > i { display: block; height: 100%; transform-origin: left; background: linear-gradient(180deg, #ffb0b0, #ff4a4a 60%, #a01c1c); transition: transform .9s linear; }
body #hud .escorte-ko .ek-s { font: 700 22px/1 'Pixelify', sans-serif; color: #fff; text-shadow: 2px 2px 0 #2a0000; min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
body #hud .escorte-ko.urgent { animation: ek-bat .5s steps(2) infinite; }
body #hud .escorte-ko.urgent .ek-s { color: #ff8a8a; }
@keyframes ek-entre { from { transform: translate(-50%, -14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes ek-bat { 50% { border-color: #ff4a4a; box-shadow: 0 0 0 1px rgba(15,2,5,.85), 0 0 10px rgba(255,60,60,.55); } }
body.is-touch #hud .box.escorte-ko { top: 28px; min-width: 200px; padding: 2px 6px 2px 2px !important; }
body.is-touch #hud .escorte-ko img { width: 26px; height: 26px; }
body.is-touch #hud .escorte-ko .ek-s { font-size: 18px; min-width: 38px; }
/* (18/11) Lieutenants du chef (histoire, livre 2) : une petite barre de vie chacun, sous celle du chef */
#h-boss .bar-lieuts { display: flex; gap: 10px; }
#h-boss .bar-lieuts:empty { display: none; }
#h-boss .bar-lieuts .bl { flex: 1; min-width: 0; margin-top: 4px; }
#h-boss .bar-lieuts small { display: block; font-size: 11px; opacity: .85; line-height: 1.1; }
#h-boss .bar-lieuts .bar { display: block; height: 6px; }
