/* (5/12/2026, Kiko a choisi B et B) Barres du donjon : escalier (marches, rayures, %) et chefs (médaillon, 4 phases).
   Code : client/js/barres.js. Les autres barres qui utilisent #h-boss (boss de guilde, Arceus) gardent leur style : tout ce
   qui suit ne s'applique qu'avec la classe bb-b (chefs, mini-chefs, légendaires de faille, hors-la-loi). */

/* ---------- éclats de pixels (communs aux deux barres) ---------- */
.bb-eclats { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 4; }
.bb-px { position: absolute; pointer-events: none; z-index: 4; animation: bb-vole var(--d, .8s) linear forwards; }
@keyframes bb-vole {
  0% { transform: translate(0, 0); opacity: 1; }
  40% { transform: translate(calc(var(--dx) * .45), var(--dy)); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) * .2 + 46px)); opacity: 0; }
}

/* ---------- escalier « L'équipe descend… » ---------- */
body #hud .box.stairs-bar { width: 264px; padding: 5px 10px 7px !important; }
#h-stairs .sb-haut { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1; }
#h-stairs .sb-esc { display: flex; align-items: flex-end; height: 15px; flex: none; filter: drop-shadow(1px 1px 0 #05081a); }
#h-stairs .sb-esc i { width: 5px; background: #2a3a70; box-shadow: inset 0 1px 0 rgba(255,255,255,.15); }
#h-stairs .sb-esc i:nth-child(1) { height: 15px; } #h-stairs .sb-esc i:nth-child(2) { height: 12px; }
#h-stairs .sb-esc i:nth-child(3) { height: 9px; } #h-stairs .sb-esc i:nth-child(4) { height: 6px; } #h-stairs .sb-esc i:nth-child(5) { height: 3px; }
#h-stairs .sb-esc i.on { background: #ffd35c; box-shadow: inset 0 2px 0 #fff6c8; animation: sb-marche .25s steps(2) 1; }
@keyframes sb-marche { 0% { filter: brightness(2); } }
#h-stairs .sb-t { flex: 1; text-align: center; color: #fff; white-space: nowrap; }
#h-stairs .sb-pc { min-width: 40px; text-align: right; color: #c8d4f0; font-size: 14px; }
body #hud #h-stairs .bar { height: 14px; margin-top: 5px; border: 2px solid #05081a; background: #0a1233; border-radius: 0; box-shadow: 0 0 0 1px rgba(127,166,239,.25); }
body #hud #h-stairs .bar > i { transform: none !important; transition: clip-path .1s linear;
  background: linear-gradient(135deg, #ffd35c 25%, #e8a020 25% 50%, #ffd35c 50% 75%, #e8a020 75%) 0 0 / 16px 16px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.55); animation: sb-rayures .5s linear infinite; }
@keyframes sb-rayures { to { background-position: 16px 0; } }
/* recul : rayures rouges (la barre tremble déjà : escalier-verrou.css) */
body #hud #h-stairs.recul .bar > i { background: linear-gradient(135deg, #ffa0a0 25%, #ff5a46 25% 50%, #ffa0a0 50% 75%, #ff5a46 75%) 0 0 / 16px 16px !important; }
#h-stairs.recul .sb-pc { color: #ff8a7a; }
/* arrivée en bas : « En route ! », barre qui scintille, onde dorée, flèche qui rebondit */
#h-stairs .sb-fleche { display: none; position: absolute; left: 50%; top: 100%; margin-top: 2px; transform: translateX(-50%); color: #ffd35c; font-size: 22px; line-height: 1;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000; pointer-events: none; }
#h-stairs.plein .sb-fleche { display: block; animation: sb-saute .3s ease-in-out infinite alternate; }
@keyframes sb-saute { to { transform: translate(-50%, 8px); } }
#h-stairs.plein .sb-t, #h-stairs.plein .sb-pc { color: #ffd35c; }
#h-stairs.plein .bar > i { animation: sb-rayures .5s linear infinite, sb-scintille .12s steps(2) infinite; }
@keyframes sb-scintille { 50% { filter: brightness(1.7); } }
#h-stairs.plein::after { content: ''; position: absolute; inset: -2px; border: 3px solid #ffd35c; pointer-events: none; animation: sb-onde .7s ease-out forwards; }
@keyframes sb-onde { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.22, 1.9); opacity: 0; } }
body.is-touch #hud .box.stairs-bar { width: 200px; padding: 3px 7px 5px !important; }
body.is-touch #h-stairs .sb-haut { font-size: 13px; gap: 5px; }
body.is-touch #h-stairs .sb-pc { min-width: 30px; font-size: 12px; }
body.is-touch #hud #h-stairs .bar { height: 10px; margin-top: 3px; }

/* ---------- barre des chefs B : médaillon + 4 phases ---------- */
#hud .bossbar:not(.bb-b) .bb-only { display: none; }
body #hud .box.bossbar.bb-b { display: grid; grid-template-columns: 46px 1fr; column-gap: 9px; align-items: center; text-align: left;
  width: min(440px, calc(42vw / var(--hud, 1))); padding: 6px 10px 6px 6px !important; }
body #hud .bossbar.bb-b > :not(.bb-med):not(.bb-eclats):not(.bb-ko) { grid-column: 2; }
#hud .bossbar.bb-b .bb-med { grid-column: 1; grid-row: 1 / span 8; align-self: center; width: 46px; height: 46px; box-sizing: border-box;
  border: 3px solid #b88a2e; background: #2a0a10; box-shadow: 0 0 0 2px #05081a, inset 0 0 0 1px #05081a; position: relative; transition: border-color .08s; }
#hud .bossbar.bb-b .bb-med::after { content: ''; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; background: #ffd35c; box-shadow: 40px 0 0 #ffd35c, 0 40px 0 #ffd35c, 40px 40px 0 #ffd35c; }
#hud .bossbar.bb-b .bb-por { display: block; width: 40px; height: 40px; image-rendering: pixelated; }
#hud .bossbar.bb-b.bb-med-flash .bb-med { border-color: #ffffff; box-shadow: 0 0 0 2px #05081a, 0 0 12px rgba(255, 226, 140, .95); }
#hud .bossbar.bb-b.bb-rit .bb-med { animation: bb-rit .36s steps(2) infinite; border-color: #ffd35c; }
@keyframes bb-rit { 50% { transform: translateY(-3px); } }
/* nom au-dessus de la barre (plus écrit dessus) */
body #hud .bossbar.bb-b .bn { position: static; height: auto; justify-content: flex-start; margin: 0 0 3px; font-size: 16px; }
body #hud .bossbar.bb-b .bn b { color: #ffd35c; }
/* la barre : cadre sombre, liseré bordeaux, rivets dorés entre les phases */
body #hud .bossbar.bb-b .bar { height: 18px; padding: 3px; border: 2px solid #05081a; border-radius: 0; overflow: visible; box-shadow: none;
  background:
    linear-gradient(#ffd35c, #ffd35c) calc(25% - 2px) 0 / 5px 3px no-repeat, linear-gradient(#ffd35c, #ffd35c) calc(25% - 2px) 100% / 5px 3px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) calc(50% + 0px) 0 / 5px 3px no-repeat, linear-gradient(#ffd35c, #ffd35c) calc(50% + 0px) 100% / 5px 3px no-repeat,
    linear-gradient(#ffd35c, #ffd35c) calc(75% + 2px) 0 / 5px 3px no-repeat, linear-gradient(#ffd35c, #ffd35c) calc(75% + 2px) 100% / 5px 3px no-repeat,
    #4a2a3a; }
body #hud .bossbar.bb-b .bar > i { display: none; }
#hud .bossbar.bb-b .bb-segs { display: flex; gap: 3px; height: 100%; }
#hud .bossbar.bb-b .bb-seg { flex: 1; position: relative; overflow: hidden; background: #1a0a12; }
#hud .bossbar.bb-b .bb-seg.vide { background: #10050a; }
#hud .bossbar.bb-b .bb-seg em { position: absolute; inset: 0; transform-origin: left; }
#hud .bossbar.bb-b .bb-tr { background: #fff0e0; }
#hud .bossbar.bb-b .bb-pv { background: linear-gradient(180deg, #ffa090 0 2px, #e83030 2px calc(100% - 2px), #8a1010 calc(100% - 2px)); transition: transform .08s linear; }
#hud .bossbar.bb-b.bb-coup .bb-pv { background: #ffffff; }
#hud .bossbar.bb-b.bb-bas .bb-pv { animation: bb-bat .5s steps(2) infinite; }
@keyframes bb-bat { 50% { filter: brightness(1.4) saturate(1.3); } }
#hud .bossbar.bb-b .bb-phase { margin-top: 3px; font-size: 13px; line-height: 1; color: #c8d4f0; }
/* chef vaincu : « Vaincu ! » sur la barre vide */
#hud .bossbar.bb-b .bb-ko { display: none; }
#hud .bossbar.bb-b.bb-vaincu .bb-ko { display: block; position: absolute; left: 64px; right: 10px; top: 50%; text-align: center; font-size: 26px; color: #ffd35c; z-index: 5; pointer-events: none;
  text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 0 3px 0 #000; animation: bb-ko-pop .35s steps(4) both; }
@keyframes bb-ko-pop { 0% { transform: translateY(-50%) scale(2.2); opacity: 0; } 100% { transform: translateY(-50%) scale(1); opacity: 1; } }
#hud .bossbar.bb-b.bb-vaincu .bb-phase { visibility: hidden; }
/* place prise : les annonces et le journal passent dessous */
#hud #h-boss.bb-b:not(.hidden) ~ #h-banner .banner.small { top: calc(var(--bb-bas, 112px) + 10px); }
body.is-touch #hud .box.bossbar.bb-b { width: min(320px, 44vw); grid-template-columns: 38px 1fr; column-gap: 6px; padding: 3px 6px 3px 4px !important; }
body.is-touch #hud .bossbar.bb-b .bb-med { width: 38px; height: 38px; border-width: 2px; }
body.is-touch #hud .bossbar.bb-b .bb-med::after { width: 4px; height: 4px; left: -2px; top: -2px; box-shadow: 34px 0 0 #ffd35c, 0 34px 0 #ffd35c, 34px 34px 0 #ffd35c; }
body.is-touch #hud .bossbar.bb-b .bb-por { width: 34px; height: 34px; }
body.is-touch #hud .bossbar.bb-b .bn { font-size: 13px; margin-bottom: 2px; }
body.is-touch #hud .bossbar.bb-b .bar { height: 12px; padding: 2px; }
body.is-touch #hud .bossbar.bb-b .bb-phase { font-size: 11px; margin-top: 2px; }
body.is-touch #hud #h-boss.bb-b:not(.hidden) ~ .hud-log { top: calc(var(--bb-bas, 80px) + 4px); }
body.is-touch #hud .bossbar.bb-b.bb-vaincu .bb-ko { left: 48px; font-size: 18px; }
