/* =====================================================================================
   1.0l NEXT LEVEL - BATTLE FX looks (batch B7-battle-fx, public/js/nl-battle.js).
   E30 the boss bar, E31 the edge pulse and the BOSS IN n chip. Every rule sits under html.nl-<ID>
   (painted by NL.flag), so 'cape.nl.off' hides an item's looks with its behaviour. Motion is
   transform / opacity only; REDUCE MOTION (html[data-anim="none"], .nlbCalm) keeps everything still.
   ===================================================================================== */

/* ---------------- E30: the boss bar, under the HUD strip ---------------- */
.nlbBoss { display: none; }
html.nl-E30 .nlbBoss {
  display: block; position: absolute; left: 10px; right: 10px; top: 80px; z-index: 30;
  pointer-events: none; opacity: 0; transform: translate3d(0, -8px, 0);
  transition: opacity .22s ease-out, transform .22s ease-out;
}
html.nl-E30 .nlbBoss.nlbOn { opacity: 1; transform: none; }
/* final pass: the TEAM-UP splash (z 12, ~1.5 s) owns the same band; the bar steps back while it shows instead of covering its ribbon */
html.nl-E30 #tuSplash.tuShow ~ .nlbBoss.nlbOn, html.nl-E30 #gameWrap:has(> #tuSplash.tuShow) > .nlbBoss.nlbOn { opacity: 0; }
html.nl-E30 .nlbRow { display: flex; align-items: center; gap: 7px; height: 36px; }
html.nl-E30 .nlbRow + .nlbRow { margin-top: 3px; }
html.nl-E30 .nlbFace {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: #170d33; box-shadow: 0 0 0 2px #0a0618, 0 2px 0 2px rgba(10, 6, 24, .55);
  transform: rotate(-4deg);
}
html.nl-E30 .nlbFace canvas { width: 100%; height: 100%; display: block; }
html.nl-E30 .nlbMain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
html.nl-E30 .nlbPlate { display: flex; align-items: center; gap: 8px; height: 15px; padding-left: 4px; }
html.nl-E30 .nlbName {
  font: 15px/1 Bangers, cursive; letter-spacing: .05em; color: #fff8e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 1.5px 0 #1b1430, -1.5px 0 #1b1430, 0 1.5px #1b1430, 0 -1.5px #1b1430, 1px 2px 0 #1b1430;
}
html.nl-E30 .nlbTag {
  flex: 0 0 auto; font: 14px/1 Bangers, cursive; letter-spacing: .06em; color: #ffe066; font-style: normal;
  background: #e03131; padding: 2px 7px 1px; border-radius: 4px; box-shadow: 0 0 0 2px #1b1430;
  transform: rotate(-5deg) scale(.4); opacity: 0; transition: opacity .12s, transform .25s cubic-bezier(.2, 1.8, .4, 1);
}
html.nl-E30 .nlbTag.nlbTagOn { opacity: 1; transform: rotate(-5deg) scale(1); }
html.nl-E30 .nlbBar {
  position: relative; display: block; height: 14px; border-radius: 3px; overflow: hidden;
  background: #241638; box-shadow: 0 0 0 2px #0a0618, 0 0 0 3.5px rgba(255, 248, 231, .38), 0 3px 0 2px rgba(10, 6, 24, .5);
  transform: skewX(-14deg); margin: 0 4px 0 6px;
}
html.nl-E30 .nlbBar > i { position: absolute; inset: 0; display: block; transform-origin: 0 50%; }
html.nl-E30 .nlbLag { background: #fff8e7; transform: scaleX(1); }
html.nl-E30 .nlbHp {
  background: linear-gradient(180deg, #ff9b9b 0%, #ff4d4d 38%, #d42a2a 62%, #9e1b1b 100%); transform: scaleX(1);
}
html.nl-E30 .nlbTicks {
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 2px), rgba(10, 6, 24, .78) calc(25% - 2px) 25%);
}
html.nl-E30 .nlbBar::after {           /* a glossy top highlight */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 40%; background: rgba(255, 255, 255, .22); pointer-events: none;
}
/* half health: the bar runs hot */
html.nl-E30 .nlbEnraged .nlbHp { background: linear-gradient(180deg, #ffc078 0%, #ff7a1a 38%, #e8590c 62%, #a63c06 100%); }
html.nl-E30 .nlbEnraged .nlbFace { box-shadow: 0 0 0 2px #e8590c, 0 2px 0 2px rgba(10, 6, 24, .55); }
/* under 10%: a quick pulse */
html.nl-E30 .nlbLow .nlbHp { animation: nlbLow .36s ease-in-out infinite alternate; }
@keyframes nlbLow { from { opacity: 1; } to { opacity: .45; } }
html.nl-E30 .nlbCalm .nlbLow .nlbHp, html[data-anim="none"].nl-E30 .nlbLow .nlbHp { animation: none; }
html.nl-E30 .nlbCalm .nlbTag { transition: none; }
/* two or three bosses stack, smaller */
html.nl-E30 .nlbMulti .nlbRow { height: 25px; gap: 6px; }
html.nl-E30 .nlbMulti .nlbFace { width: 25px; height: 25px; border-radius: 6px; }
html.nl-E30 .nlbMulti .nlbPlate { height: 11px; }
html.nl-E30 .nlbMulti .nlbName { font-size: 12px; }
html.nl-E30 .nlbMulti .nlbTag { font-size: 11px; padding: 1px 5px 0; }
html.nl-E30 .nlbMulti .nlbBar { height: 9px; }

/* ---------------- E31: boss tension ---------------- */
.nlbEdge, .nlbCount { display: none; }
html.nl-E31 .nlbEdge {
  display: block; position: absolute; inset: 0; z-index: 29; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 75% 62% at 50% 50%, rgba(224, 49, 49, 0) 58%, rgba(224, 49, 49, .42) 86%, rgba(150, 18, 30, .7) 100%);
  transition: opacity .3s ease-out;
}
html.nl-E31 .nlbEdge.nlbOn { opacity: .3; }
html.nl-E31 .nlbCount {
  display: flex; position: absolute; left: 50%; top: 84px; z-index: 32; pointer-events: none;
  align-items: center; gap: 7px; padding: 3px 13px 2px 11px; border-radius: 999px;
  background: rgba(27, 20, 48, .94); box-shadow: 0 0 0 2px #e03131, 0 3px 0 2px #0a0618;
  font: 15px/1 Bangers, cursive; letter-spacing: .06em; color: #ffd8d8;
  opacity: 0; transform: translate3d(-50%, -6px, 0); transition: opacity .18s, transform .18s;
}
html.nl-E31 .nlbCount.nlbOn { opacity: 1; transform: translate3d(-50%, 0, 0); }
html.nl-E31 .nlbCount b { display: inline-block; min-width: 14px; text-align: center; font-size: 24px; font-weight: normal; color: #ff6b6b;
  text-shadow: 1.5px 0 #1b1430, -1.5px 0 #1b1430, 0 1.5px #1b1430, 0 -1.5px #1b1430; }
