/* ==========================================================================================================
   1.0l NEXT LEVEL - NL BOOT (batch B4-boot: E17, E19, E20). Looks for public/js/nl-boot.js and the boot cover.
   PRESENTATION ONLY: transform / opacity. Rules sit under html.nl-<ID> where the item can be switched off
   ('cape.nl.off'), honour html[data-anim] and prefers-reduced-motion.
   ========================================================================================================== */

/* ---------------------------------------------------------------- E17 the boot cover's status line (slow WebView only)
   The four lines are stacked; each owns a quarter of an 8 s loop and only starts 2.2 s after the first paint, so a phone
   that lifts the cover on time never sees one. Nothing here moves: the lines cross-fade. */
#ccBoot .ccBootStatus{position:absolute;left:0;right:0;bottom:calc(24% - 26px);height:22px;pointer-events:none;
  font:800 13px/22px Nunito,system-ui,sans-serif;letter-spacing:.06em;color:#fff3c4;text-align:center;text-shadow:0 2px 0 #1b1430;}
#ccBoot .ccBootStatus span{position:absolute;left:0;right:0;opacity:0;animation:ccBootLine 8s linear 3;}   /* finite (the beat never loops); the cover's own 9 s fail-safe comes first */
#ccBoot .ccBootStatus span:nth-child(1){animation-delay:2.2s;}
#ccBoot .ccBootStatus span:nth-child(2){animation-delay:4.2s;}
#ccBoot .ccBootStatus span:nth-child(3){animation-delay:6.2s;}
#ccBoot .ccBootStatus span:nth-child(4){animation-delay:8.2s;}
@keyframes ccBootLine{0%{opacity:0;}3%{opacity:1;}22%{opacity:1;}25%{opacity:0;}100%{opacity:0;}}
#ccBoot.ccTitleQuick .ccBootStatus{bottom:calc(50% - 120px);}
/* STILL poster and OS reduced motion: nothing in the cover may run a keyframe, so the status line stays out (the 14 s
   recovery line is still there for a stuck load) */
#ccBoot.ccTitleStill .ccBootStatus{display:none;}
@media (prefers-reduced-motion:reduce){#ccBoot .ccBootStatus{display:none;}}

/* ---------------------------------------------------------------- E19 WELCOME BACK caption */
.nlWelcome{position:fixed;left:50%;z-index:94;translate:-50% 0;max-width:calc(100% - 32px);box-sizing:border-box;
  padding:7px 16px 8px;border:3px solid #1b1430;border-radius:10px;background:#ffd23f;color:#1b1430;text-align:center;
  box-shadow:4px 4px 0 #1b1430,0 10px 22px rgba(6,3,20,.45);rotate:-1.6deg;pointer-events:auto;cursor:pointer;
  animation:nlWelIn 420ms cubic-bezier(.2,1.5,.4,1) both;will-change:transform,opacity;}
.nlWelcome .nlWelTitle{font:400 clamp(20px,6.2vw,26px)/1.05 Bangers,'Bangers',cursive;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.nlWelcome .nlWelSub{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:3px;
  font:900 11.5px/1.2 Nunito,system-ui,sans-serif;letter-spacing:.08em;}
.nlWelcome .nlWelSub:empty{display:none;}
.nlWelcome .nlWelSub svg{width:18px;height:18px;flex:none;}
.nlWelcome .nlWelGuest{color:#5a1020;}
.nlWelcome .nlWelPop{animation:nlWelPop 360ms cubic-bezier(.2,1.6,.4,1) both;}
.nlWelcome.nlWelOut{animation:nlWelOut 240ms ease-in both;pointer-events:none;}
.nlWelcome.nlWelStill,.nlWelcome.nlWelStill.nlWelOut{animation:none;}
@keyframes nlWelIn{0%{opacity:0;transform:translateY(-18px) scale(.7);}60%{opacity:1;transform:translateY(2px) scale(1.06);}100%{opacity:1;transform:none;}}
@keyframes nlWelOut{0%{opacity:1;transform:none;}100%{opacity:0;transform:translateY(-10px) scale(.9);}}
@keyframes nlWelPop{0%{transform:scale(.6);}100%{transform:none;}}
html[data-anim="none"] .nlWelcome,html[data-anim="none"] .nlWelcome *{animation:none !important;}
html[data-anim="some"] .nlWelcome{animation-duration:160ms;}
@media (prefers-reduced-motion:reduce){.nlWelcome,.nlWelcome *{animation:none !important;}}

/* ---------------------------------------------------------------- E20 Coach greets the recruit (inside #onb) */
#onb.nlCoach .nlCoachRow{display:flex;align-items:flex-end;gap:8px;width:min(390px,100%);margin:auto 0 -6px;flex:none;
  position:relative;z-index:1;pointer-events:none;}
#onb.nlCoach #onbCard{margin:0 0 auto;}
#onb.nlCoach .nlCoachBust{flex:none;width:clamp(96px,28vw,124px);height:clamp(104px,30vw,134px);overflow:hidden;
  border-radius:16px 16px 0 0;position:relative;-webkit-mask-image:linear-gradient(#000 82%,transparent);mask-image:linear-gradient(#000 82%,transparent);}
#onb.nlCoach .nlCoachBust img{position:absolute;left:50%;top:0;width:250%;max-width:none;height:auto;translate:-46% -2%;
  filter:drop-shadow(0 4px 0 rgba(8,4,20,.55));}
#onb.nlCoach .nlCoachBubble{position:relative;flex:1 1 auto;min-width:0;margin-bottom:22px;padding:8px 12px 9px;
  background:#fff8e7;color:#1b1430;border:3px solid #1b1430;border-radius:14px;box-shadow:3px 3px 0 #1b1430;text-align:left;}
#onb.nlCoach .nlCoachBubble::before{content:'';position:absolute;left:-13px;bottom:12px;width:16px;height:16px;background:#fff8e7;
  border-left:3px solid #1b1430;border-bottom:3px solid #1b1430;transform:skewY(32deg) rotate(18deg);}
#onb.nlCoach .nlCoachBubble b{display:block;font:400 13px/1 Bangers,'Bangers',cursive;letter-spacing:.12em;color:#c2185b;margin-bottom:2px;}
#onb.nlCoach .nlCoachBubble span{display:block;font:900 clamp(14px,4.2vw,17px)/1.25 Nunito,system-ui,sans-serif;}
/* the beat: the bust slides in, the bubble pops, then the card springs up under her */
#onb.nlCoachIn .nlCoachBust{opacity:0;transform:translateX(-120%) rotate(-6deg);}
#onb.nlCoachIn .nlCoachBubble{opacity:0;transform:scale(.4);transform-origin:0 100%;}
#onb.nlCoachIn .nlCoachRow.nlOn .nlCoachBust{opacity:1;transform:none;transition:transform 420ms cubic-bezier(.2,1.35,.4,1),opacity 160ms ease-out;}
#onb.nlCoachIn .nlCoachRow.nlTalk .nlCoachBubble{opacity:1;transform:none;transition:transform 340ms cubic-bezier(.2,1.6,.4,1),opacity 120ms ease-out;}
#onb.nlCoachIn #onbCard{opacity:0;transform:translateY(60px) scale(.9);}
#onb.nlCoachCard #onbCard{animation:nlCoachCard 520ms cubic-bezier(.2,1.25,.4,1) both;}
#onb.nlCoachCard .nlCoachRow .nlCoachBust,#onb.nlCoachCard .nlCoachRow .nlCoachBubble{opacity:1;transform:none;}
#onb.nlCoachStill #onbCard{animation:none;}
@keyframes nlCoachCard{0%{opacity:0;transform:translateY(60px) scale(.9);}55%{opacity:1;transform:translateY(-6px) scale(1.02);}100%{opacity:1;transform:none;}}
#onbGo.nlCoachPulse{animation:nlCoachPulse 1.1s ease-in-out .5s 3;}
@keyframes nlCoachPulse{0%,100%{transform:none;}50%{transform:scale(1.045);}}
html[data-anim="none"] #onb.nlCoach *, html[data-anim="none"] #onb.nlCoach #onbCard{animation:none !important;transition:none !important;}
html[data-anim="some"] #onb.nlCoachCard #onbCard{animation-duration:220ms;}
html[data-anim="some"] #onbGo.nlCoachPulse{animation:none;}
@media (prefers-reduced-motion:reduce){#onb.nlCoach *, #onb.nlCoach #onbCard{animation:none !important;transition:none !important;}}
@media (max-height:700px){#onb.nlCoach .nlCoachBust{width:84px;height:88px;}#onb.nlCoach .nlCoachBubble{margin-bottom:12px;padding:6px 10px;}#onb.nlCoach .nlCoachBubble span{font-size:13px;}}
@media (max-height:600px){#onb.nlCoach .nlCoachRow{display:none;}}
