/* =====================================================================================
   1.0l NEXT LEVEL - BATTLE FLOW (batch B8-battle-flow, E34-E41). public/js/nl-flow.js + cinematics.js hooks.
   Every rule sits under html.nl-<ID> (NL.flag paints the class; 'cape.nl.off' removes it) and honours
   html[data-anim] (REDUCE MOTION / ANIMATIONS SOME / NONE): motion only under data-anim="full".
   Transform / opacity animations only.
   ===================================================================================== */

/* ---------------------------------------------------------------- E34 the Turbo button (HUD strip) */
html.nl-E34 body.cc-hud #ccStrip .nlTurbo{
  position:relative;flex:0 0 auto;margin-left:auto;margin-right:6px;
  width:40px;height:30px;padding:0;border:0;border-radius:var(--cc-r-pill,15px);cursor:pointer;
  display:flex;align-items:center;justify-content:center;overflow:visible;
  background:var(--cc-glass,rgba(18,12,36,.72));color:#cfc6ef;
  box-shadow:inset 0 0 0 1.5px rgba(207,198,239,.45);
  -webkit-tap-highlight-color:transparent;
}
html.nl-E34 body.cc-hud #ccStrip .nlTurbo[hidden]{display:none}
html.nl-E34 body.cc-hud #ccStrip.nlHasTurbo .cc-nw{margin-left:0}
html.nl-E34 #ccStrip .nlTurbo svg{position:relative;width:20px;height:16px;fill:currentColor;stroke:#1b1430;stroke-width:1.6;stroke-linejoin:round;overflow:visible}
html.nl-E34 #ccStrip .nlTurboHit{position:absolute;left:-4px;right:-4px;top:-7px;bottom:-7px;border-radius:var(--cc-r-pill,15px)}
html.nl-E34 body.cc-hud #ccStrip .nlTurbo.on{
  color:#1b1430;background:linear-gradient(#ffe066,#ffb627);
  box-shadow:inset 0 0 0 1.5px #fff3b0,0 0 12px rgba(255,210,63,.75),0 2px 0 #8a5a00;
}
html.nl-E34 body.cc-hud #ccStrip .nlTurbo.on svg{stroke:#7a4b00}
html.nl-E34 #ccStrip .nlTurboLines{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none;opacity:0}
html.nl-E34 #ccStrip .nlTurbo.on .nlTurboLines{opacity:1;
  background:repeating-linear-gradient(90deg,rgba(255,255,255,0) 0 7px,rgba(255,255,255,.55) 7px 9px,rgba(255,255,255,0) 9px 16px);
  background-size:32px 100%;}
html[data-anim="full"].nl-E34 #ccStrip .nlTurbo.on .nlTurboLines{animation:nlTurboRun .45s linear infinite}
@keyframes nlTurboRun{from{background-position:0 0}to{background-position:-32px 0}}
html[data-anim="full"].nl-E34 #ccStrip .nlTurbo.nlPop{animation:nlTurboPop .32s cubic-bezier(.2,1.4,.4,1)}
html[data-anim="some"].nl-E34 #ccStrip .nlTurbo.nlPop{animation:nlTurboFade .2s ease-out}
@keyframes nlTurboPop{0%{transform:scale(1.25,.7)}45%{transform:scale(.88,1.14)}100%{transform:scale(1)}}
@keyframes nlTurboFade{from{opacity:.4}to{opacity:1}}
@media (max-width:360px){ html.nl-E34 body.cc-hud #ccStrip .nlTurbo{width:34px;margin-right:4px} }

/* ---------------------------------------------------------------- E35 READY... (the quick countdown's one cell) */
html.nl-E35 #cineCount.nlReady{font-size:58px;letter-spacing:4px}

/* ---------------------------------------------------------------- E36 the Story mission title card (#nlMission in #cineFx) */
#nlMission{
  top:36%;width:min(86vw,360px);box-sizing:border-box;padding:16px 18px 18px;
  background:#fff8e7;color:#1b1430;border:4px solid #1b1430;border-radius:6px;
  box-shadow:8px 8px 0 #1b1430,0 0 0 3px #ffd23f inset;
  background-image:radial-gradient(rgba(27,20,48,.10) 1.2px,transparent 1.4px);background-size:9px 9px;
  text-align:center;line-height:1.05;
}
#nlMission.nlHasArt{padding-top:58px}
#nlMission .nlMissionArt{
  position:absolute;left:50%;top:-44px;width:88px;height:88px;margin-left:-44px;border-radius:50%;overflow:hidden;
  background:#2a1d4d;border:4px solid #1b1430;box-shadow:0 0 0 3px #e03131,4px 4px 0 #1b1430;
}
#nlMission .nlMissionArt:empty{display:none}
#nlMission .nlMissionArt>*,#nlMission .nlMissionArt img,#nlMission .nlMissionArt canvas{width:100%;height:100%;display:block;object-fit:cover}
#nlMission .nlMissionKick{
  display:inline-block;padding:4px 10px 3px;margin-bottom:8px;background:#e03131;color:#fff8e7;transform:rotate(-2deg);
  font-family:'Bangers','Impact',system-ui,sans-serif;font-size:17px;letter-spacing:2px;box-shadow:3px 3px 0 #1b1430;
}
#nlMission .nlMissionTitle{
  font-family:'Bangers','Impact',system-ui,sans-serif;font-size:34px;letter-spacing:1.5px;color:#1b1430;
  text-shadow:2px 2px 0 #ffd23f;overflow-wrap:anywhere;
}

/* ---------------------------------------------------------------- E36 the VS slam (Clash / Co-op matchup) */
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsPlate{
  position:fixed;width:132px;height:132px;z-index:2;pointer-events:none;
}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsPlate[hidden]{display:none}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVs-red{left:14px}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVs-blue{right:14px}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsPlate::before{
  content:'';position:absolute;left:-8%;right:-8%;top:16%;bottom:10%;transform:skewX(-12deg);border-radius:10px;
  border:3px solid #fff8e7;box-shadow:5px 5px 0 rgba(0,0,0,.45);
  background:radial-gradient(rgba(255,255,255,.25) 1.2px,transparent 1.4px) 0 0/8px 8px,var(--nlvs-bg);
}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVs-red{--nlvs-bg:linear-gradient(140deg,#ff6b6b,#a51d2d)}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVs-blue{--nlvs-bg:linear-gradient(140deg,#74c0fc,#1c5bb8)}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsBust{position:absolute;left:4%;right:4%;top:0;bottom:14%;filter:drop-shadow(2px 3px 0 rgba(0,0,0,.5))}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsBust>*,html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsBust img,html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsBust canvas{width:100%;height:100%;display:block;object-fit:contain;object-position:50% 100%}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsCap{
  position:absolute;left:-6%;right:-6%;bottom:2%;padding:3px 4px 2px;text-align:center;transform:skewX(-12deg);
  background:#1b1430;color:#fff8e7;border-radius:4px;font-family:'Bangers','Impact',system-ui,sans-serif;font-size:14px;letter-spacing:1px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
html.nl-E36 #vsStrip.bvScreen.nlVs .bvSeal{position:relative;overflow:visible}
html.nl-E36 #vsStrip.bvScreen.nlVs .nlVsBolt{
  position:absolute;left:50%;top:50%;width:44px;height:74px;margin:-37px 0 0 -22px;z-index:-1;
  fill:#ffd23f;stroke:#1b1430;stroke-width:4;stroke-linejoin:round;opacity:0;
  filter:drop-shadow(0 0 8px rgba(255,210,63,.9));
}
html.nl-E36 #vsStrip.bvScreen.nlVs.vsIn .nlVsBolt{opacity:1}
/* motion (FULL only): the sides slide in from their own edge, the seal slams, the bolt flashes, the stage shakes */
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .bvPlayer.vsThem{animation:nlVsInThem 400ms cubic-bezier(.15,.9,.25,1.12) both!important}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .bvPlayer.vsYou{animation:nlVsInYou 400ms 60ms cubic-bezier(.15,.9,.25,1.12) both!important}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .bvSeal{animation:nlVsSeal 420ms 330ms cubic-bezier(.3,1.5,.5,1) both!important}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .nlVsBolt{animation:nlVsBolt 700ms 380ms ease-out both}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .nlVs-red{animation:nlVsPlateL 460ms 80ms cubic-bezier(.2,1.25,.4,1) both}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.vsIn:not(.vsStill):not(.nlVsCalm) .nlVs-blue{animation:nlVsPlateR 460ms 140ms cubic-bezier(.2,1.25,.4,1) both}
html[data-anim="full"].nl-E36 #vsStrip.bvScreen.nlVs.nlVsShake .bvStage{animation:nlVsShake 260ms linear}
@keyframes nlVsInThem{from{opacity:0;transform:translateX(-110%) skewX(-10deg)}70%{opacity:1;transform:translateX(3%) skewX(-3deg)}to{opacity:1;transform:none}}
@keyframes nlVsInYou{from{opacity:0;transform:translateX(110%) skewX(-10deg)}70%{opacity:1;transform:translateX(-3%) skewX(-3deg)}to{opacity:1;transform:none}}
@keyframes nlVsSeal{from{opacity:0;transform:skew(-7deg) scale(3.2) rotate(-14deg)}60%{opacity:1;transform:skew(-7deg) scale(.86) rotate(2deg)}to{opacity:1;transform:skew(-7deg) scale(1)}}
@keyframes nlVsBolt{0%{opacity:0;transform:scale(.4)}12%{opacity:1;transform:scale(1.5)}30%{opacity:.6;transform:scale(1.1)}45%{opacity:1}100%{opacity:1;transform:scale(1.18)}}
@keyframes nlVsPlateL{from{opacity:0;transform:translateX(-160%)}to{opacity:1;transform:none}}
@keyframes nlVsPlateR{from{opacity:0;transform:translateX(160%)}to{opacity:1;transform:none}}
@keyframes nlVsShake{0%,100%{transform:none}20%{transform:translate(-4px,2px)}40%{transform:translate(4px,-2px)}60%{transform:translate(-3px,-1px)}80%{transform:translate(2px,1px)}}

/* ---------------------------------------------------------------- E37 the leader cast panel (#nlCastPanel, cinematics.js castPanel) */
#nlCastPanel{position:fixed;left:0;right:0;top:80px;height:118px;z-index:61;pointer-events:none;will-change:transform,opacity}
#nlCastPanel::before{content:'';position:absolute;left:0;right:0;top:16px;height:94px;clip-path:polygon(0 22%,100% 0,100% 78%,0 100%);background:var(--cast-col,#ffd23f);opacity:.9}
#nlCastPanel .nlCpBand{
  position:absolute;left:0;right:0;top:20px;height:86px;opacity:.95;
  clip-path:polygon(0 22%,100% 0,100% 78%,0 100%);
  background:
    radial-gradient(rgba(255,255,255,.22) 1.3px,transparent 1.5px) 0 0/8px 8px,
    linear-gradient(100deg,var(--cast-col,#ffd23f) 0 30%,#1b1430 30.4% 31.4%,rgba(27,20,48,.94) 31.8% 100%);
}
#nlCastPanel .nlCpBust{
  position:absolute;left:10px;bottom:6px;width:112px;height:112px;
  filter:drop-shadow(3px 4px 0 rgba(0,0,0,.55));
}
#nlCastPanel .nlCpBust>*,#nlCastPanel .nlCpBust img,#nlCastPanel .nlCpBust canvas{width:100%;height:100%;display:block;object-fit:contain;object-position:50% 100%}
#nlCastPanel .nlCpName{
  position:absolute;left:140px;right:12px;top:40px;transform-origin:0 50%;
  font-family:'Bangers','Impact',system-ui,sans-serif;font-size:30px;letter-spacing:1.5px;line-height:1;color:#fff8e7;
  text-shadow:3px 3px 0 #1b1430,-1px -1px 0 #1b1430,1px -1px 0 #1b1430,-1px 1px 0 #1b1430;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#nlCastPanel .nlCpLine{
  position:absolute;left:146px;right:14px;top:76px;
  font:900 12px/1.15 'Nunito',sans-serif;color:#fff8e7;letter-spacing:.4px;text-shadow:1px 1px 0 #1b1430;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ---------------------------------------------------------------- E39 SO CLOSE! + TRY AGAIN first */
html.nl-E39 #over .overCard{position:relative}
html.nl-E39 #over .nlSoClose{
  position:absolute;right:-8px;top:-26px;z-index:5;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 12px 6px;
  background:#ffd23f;color:#1b1430;border:3px solid #1b1430;border-radius:8px;transform:rotate(7deg);
  box-shadow:4px 4px 0 #1b1430;
}
html.nl-E39 #over .nlSoClose b{font-family:'Bangers','Impact',system-ui,sans-serif;font-size:24px;letter-spacing:1.5px;line-height:1;font-weight:400}
html.nl-E39 #over .nlSoClose em{font:900 10px/1 'Nunito',sans-serif;font-style:normal;letter-spacing:.6px}
html.nl-E39 #over .nlScBar{display:block;width:92px;height:8px;border:2px solid #1b1430;border-radius:4px;background:#3b2f5c;overflow:hidden}
html.nl-E39 #over .nlScBar i{display:block;height:100%;background:linear-gradient(#ff8787,#e03131);transform-origin:0 50%}
html[data-anim="full"].nl-E39 #over .nlSoClose.nlScIn{animation:nlScSlap .34s cubic-bezier(.2,1.5,.4,1) both}
@keyframes nlScSlap{from{opacity:0;transform:rotate(-16deg) scale(2.3)}to{opacity:1;transform:rotate(7deg) scale(1)}}
html.nl-E39 #over .overActs>#againBtn.nlTryFirst{order:-1!important;box-shadow:0 0 0 3px #ffd23f,0 0 18px rgba(255,210,63,.8)}
html[data-anim="full"].nl-E39 #over .overActs>#againBtn.nlTryFirst:not(.cine-locked){animation:nlTryGlow 1.4s ease-in-out infinite}
@keyframes nlTryGlow{0%,100%{box-shadow:0 0 0 3px #ffd23f,0 0 10px rgba(255,210,63,.55)}50%{box-shadow:0 0 0 3px #fff3b0,0 0 22px rgba(255,210,63,.95)}}

/* ---------------------------------------------------------------- E40 PLAY AGAIN beside NEXT on the result pages
   final pass: only where the game already offers it (data-result-again, the W335 E-056 switch). J chose NEXT only by default, so E40 styles the pair, it never forces PLAY AGAIN on. */
html.nl-E40 #over[data-result-again] .overActs{gap:10px}
html.nl-E40 #over[data-result-again] .overActs>#againBtn:not(.hidden){display:inline-flex!important;align-items:center;justify-content:center;flex:1 1 0;min-width:0}
html.nl-E40 #over[data-result-again] .overActs>#resultJourneyNext{flex:1 1 0;min-width:0}
html.nl-E40 #over[data-result-again] .overActs>#againBtn:not(.hidden){
  background:linear-gradient(#ffe066,#ffb627);color:#1b1430;text-shadow:none;border:2px solid #8a5a00;box-shadow:0 4px 0 #8a5a00;
}

/* ---------------------------------------------------------------- E40 the damage-share strip (#nlDmgShare in #overBody) */
html.nl-E40 #nlDmgShare{margin:10px 2px 6px;padding:10px 10px 8px;border-radius:12px;background:rgba(27,20,48,.07);border:2px solid rgba(27,20,48,.14)}
html.nl-E40 #over[data-result-phase="rewards"] #nlDmgShare{display:none}
html.nl-E40 #nlDmgShare .nlDsHead{font:900 11px/1 'Nunito',sans-serif;letter-spacing:1.4px;color:#284566;margin:0 0 8px 2px}
html.nl-E40 #nlDmgShare .nlDsVs{display:flex;height:20px;border-radius:10px;overflow:hidden;margin:0 0 9px;border:2px solid #1b1430;font:900 10px/16px 'Nunito',sans-serif;letter-spacing:.5px}
html.nl-E40 #nlDmgShare .nlDsYou{flex:1 1 0;background:linear-gradient(#74c0fc,#1c7ed6);color:#fff;padding:0 7px;white-space:nowrap;overflow:hidden}
html.nl-E40 #nlDmgShare .nlDsThem{flex:1 1 0;background:linear-gradient(#ff8787,#e03131);color:#fff;padding:0 7px;text-align:right;white-space:nowrap;overflow:hidden}
html.nl-E40 #nlDmgShare .nlDsRows{display:flex;flex-direction:column;gap:5px}
html.nl-E40 #nlDmgShare .nlDsRow{display:flex;align-items:center;gap:8px;height:32px}
html.nl-E40 #nlDmgShare .nlDsArt{position:relative;flex:0 0 30px;width:30px;height:30px;border-radius:8px;background:#1b1430;box-shadow:0 0 0 2px #1c7ed6}
html.nl-E40 #nlDmgShare .nlDsArt>canvas,html.nl-E40 #nlDmgShare .nlDsArt>img{width:100%;height:100%;display:block;border-radius:8px}
html.nl-E40 #nlDmgShare .nlDsRow.mvp .nlDsArt{box-shadow:0 0 0 2px #ffd23f,0 0 10px rgba(255,210,63,.8)}
html.nl-E40 #nlDmgShare .nlDsCrown{position:absolute;left:4px;top:-11px;width:22px;height:14px;fill:#ffd23f;stroke:#1b1430;stroke-width:1.8;stroke-linejoin:round;transform:rotate(-12deg)}
html.nl-E40 #nlDmgShare .nlDsBar{flex:1 1 auto;height:14px;border-radius:7px;background:rgba(27,20,48,.14);overflow:hidden}
html.nl-E40 #nlDmgShare .nlDsBar i{display:block;height:100%;border-radius:7px;background:linear-gradient(#74c0fc,#1c7ed6);transform-origin:0 50%;transform:scaleX(0)}
html.nl-E40 #nlDmgShare .nlDsRow.mvp .nlDsBar i{background:linear-gradient(#ffe066,#f59f00)}
html.nl-E40 #nlDmgShare .nlDsRow b{flex:0 0 40px;text-align:right;font:900 13px/1 'Nunito',sans-serif;color:#163b68;font-variant-numeric:tabular-nums}
