/* ==========================================================================================================
   1.0l NEXT LEVEL - NL CORE (batch B1-core: E01-E06). Shared looks for public/js/nl-core.js.
   PRESENTATION ONLY: transform / scale / translate / opacity. Each item's rules sit under html.nl-<ID>
   (nl-core.js paints those classes from NL.on), so switching an item off in localStorage 'cape.nl.off'
   also switches its CSS off. html[data-anim] (FULL / SOME / NONE) is honoured on every rule.
   ========================================================================================================== */

/* ---------------------------------------------------------------- E01 layers + flights */
.nlLayer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; contain: strict; }
.nlFly { position: absolute; left: 0; top: 0; will-change: transform, opacity; pointer-events: none; }
.nlFly > * { width: 100%; height: 100%; box-sizing: border-box; }
.nlCoin {
  border-radius: 50%; border: 2px solid #1b1430;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .95) 0 12%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 50% 50%, #ffe680 0 46%, #f3b51b 47% 60%, #ffd23f 61% 100%);
  box-shadow: inset 0 -2px 0 rgba(150, 82, 0, .55), 0 2px 0 rgba(10, 6, 24, .45);
}
.nlFly .nlFlyMini { flex: none; margin: 0; box-shadow: 0 6px 14px rgba(0, 0, 0, .45); }
@keyframes nlBump { 0% { scale: 1; } 35% { scale: 1.18; } 100% { scale: 1; } }
.nlBump { animation: nlBump 260ms cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes nlTabBump { 0% { scale: 1; } 30% { scale: 1.22; } 60% { scale: .96; } 100% { scale: 1; } }
.nlTabBump { animation: nlTabBump 420ms cubic-bezier(.2, 1.4, .4, 1) both; }
html[data-anim="none"] .nlBump, html[data-anim="none"] .nlTabBump { animation: none; }
html[data-anim="some"] .nlTabBump { animation-duration: 200ms; }

/* ---------------------------------------------------------------- E03 the toast (#netToast keeps its id and contract) */
html.nl-E03 #netToast.nlToast, .nlToast.nlToastPrev, .nlToast.nlToastOut {
  position: fixed; left: 50%; z-index: 97; translate: -50% 0;
  display: flex; align-items: center; gap: 9px; box-sizing: border-box;
  width: max-content; max-width: min(360px, calc(100vw - 24px));
  padding: 9px 14px 9px 10px; border-radius: 14px;
  border: 3px solid #0a0618; border-left-width: 7px;
  background: linear-gradient(180deg, #2e2358, #1d1540);
  color: #fff8e7; font-family: 'Bangers', Impact, sans-serif; font-size: 16px; letter-spacing: .8px; line-height: 1.12;
  text-align: left; box-shadow: 4px 6px 0 rgba(0, 0, 0, .45);
  pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
html.nl-E03 #netToast.nlToast[hidden] { display: none !important; }
/* tone edges: the #netToast form carries the id so it outranks the base rule above (fix round 1) */
html.nl-E03 #netToast.nlToast.nlTone-info, .nlToast.nlTone-info { border-left-color: #3fd0c9; }
html.nl-E03 #netToast.nlToast.nlTone-reward, .nlToast.nlTone-reward { border-left-color: #ffd23f; box-shadow: 0 0 0 2px rgba(255, 210, 63, .55), 4px 6px 0 rgba(0, 0, 0, .45); }
html.nl-E03 #netToast.nlToast.nlTone-bad, .nlToast.nlTone-bad { border-left-color: #ff6b6b; }
.nlToast .nlToastIco { flex: 0 0 22px; width: 22px; height: 22px; display: block; }
.nlToast .nlToastIco svg { width: 100%; height: 100%; display: block; }
.nlToast[data-n]::after { content: attr(data-n); margin-left: 2px; padding: 0 6px; border-radius: 8px; background: #ffd23f; color: #1b1430; font-size: 13px; }
@keyframes nlToastIn { 0% { opacity: 0; transform: translateY(14px) scale(.9); } 60% { opacity: 1; transform: translateY(-3px) scale(1.02); } 100% { opacity: 1; transform: none; } }
@keyframes nlToastOut { to { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes nlToastUp { from { opacity: 1; transform: translateY(46px); } to { opacity: .82; transform: scale(.94); } }
html.nl-E03 #netToast.nlToast.nlToastIn { animation: nlToastIn 240ms cubic-bezier(.2, .9, .3, 1.2) both; }
.nlToast.nlToastPrev { opacity: .82; transform: scale(.94); animation: nlToastUp 200ms ease-out both; transform-origin: 50% 100%; }
.nlToast.nlToastOut, .nlToast.nlToastPass { pointer-events: none !important; }
.nlToast.nlToastOut { animation: nlToastOut 170ms ease-in both; }
.nlToast.nlToastBump { animation: nlBump 220ms ease-out both; }
html[data-anim="some"] #netToast.nlToast.nlToastIn { animation: moFade 90ms ease-out both; }
html[data-anim="none"] #netToast.nlToast.nlToastIn, html[data-anim="none"] .nlToast.nlToastPrev,
html[data-anim="none"] .nlToast.nlToastOut, html[data-anim="none"] .nlToast.nlToastBump { animation: none; }
/* the reason card (a greyed tab / card says why) wears the same edge: gold, it is a rule, not an error */
html.nl-E03 .ccReason { border-left-width: 8px; border-left-color: #ffd23f; }

/* ---------------------------------------------------------------- E04 exits: menu drawer, its shade, the reason card, the account card */
@keyframes nlOut { to { opacity: 0; scale: .94; } }
@keyframes nlMenuOut { to { opacity: 0; scale: .9; translate: 0 -8px; } }
@keyframes nlShadeOut { to { opacity: 0; } }
@keyframes nlReasonOut { to { opacity: 0; scale: .92; translate: 0 10px; } }
.nlClosing { pointer-events: none !important; }
html.nl-E04 .ccMenu.nlClosing { display: flex !important; animation: nlMenuOut var(--mo-close, 130ms) ease-in both !important; }
html.nl-E04 .ccMenuShade.nlClosing { display: block !important; animation: nlShadeOut var(--mo-close, 130ms) ease-in both !important; }
html.nl-E04 .ccReason.nlClosing { display: flex !important; animation: nlReasonOut var(--mo-close, 130ms) ease-in both !important; }
html[data-anim="none"] .nlClosing { animation: none !important; display: none !important; }
/* the menu shade fades in too (it used to blink on) */
@keyframes nlShadeIn { from { opacity: 0; } to { opacity: 1; } }
html.nl-E04[data-anim="full"] .ccMenuShade:not([hidden]):not(.nlClosing) { animation: nlShadeIn 160ms ease-out both; }
/* the account card opens on the menu spring: .85 > 1.05 > 1 over a fading scrim (FULL only; SOME and NONE keep polish.css) */
@keyframes nlCardIn { 0% { opacity: 0; transform: scale(.85); } 55% { opacity: 1; transform: scale(1.05); } 78% { transform: scale(.985); } 100% { opacity: 1; transform: none; } }
html.nl-E04[data-anim="full"] body:not(.cc-rm) #netOv:not(.hidden):not(.netProfilePage) #netCard { animation: nlCardIn 260ms cubic-bezier(.25, .9, .35, 1) both; }
@media (prefers-reduced-motion: reduce) {
  html.nl-E04 .ccMenu.nlClosing, html.nl-E04 .ccMenuShade.nlClosing, html.nl-E04 .ccReason.nlClosing { animation: none !important; display: none !important; }
}
