/* ============================================================
   WOW-APP: motion and touch polish for the member portal and the team app (preview, Nov 2026).
   Pairs with /js/wow-app.js. Colours come from the night tokens already on the page,
   so the portal glows volt and the team app glows scarlet without separate rules.
   Only motion and feedback change: no layout, wording, or behaviour.
   Everything is scoped to html.wow-app, which wow-app.js adds; reduced motion gets none of it.
   ============================================================ */

@keyframes wa-in{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes wa-pop{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}
@keyframes wa-up{from{transform:translateY(100%)}to{transform:none}}
@keyframes wa-shine{to{background-position:-200% 0}}

/* ---------- screens glide in when you change pages ---------- */
/* portal: each page is shown by switching display, which restarts this animation */
html.wow-app #portalApp [id^="page-"]{animation:wa-in .45s cubic-bezier(.16,1,.3,1) both}
/* ...and its cards follow one after another (wow-app.js adds .wa-enter for a moment when a page opens) */
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item){animation:wa-in .55s cubic-bezier(.16,1,.3,1) both}
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item):nth-child(2){animation-delay:.05s}
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item):nth-child(3){animation-delay:.1s}
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item):nth-child(4){animation-delay:.15s}
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item):nth-child(5){animation-delay:.2s}
html.wow-app #portalApp [id^="page-"].wa-enter :is(.p-card,.nt-glass,.event-list-item,.ps-item):nth-child(n+6){animation-delay:.24s}
/* team app: the screen re-draws on every tap, so wow-app.js adds .wa-enter only when the view itself changes */
html.wow-app #main.wa-enter > *{animation:wa-in .5s cubic-bezier(.16,1,.3,1) both}
html.wow-app #main.wa-enter > *:nth-child(2){animation-delay:.05s}
html.wow-app #main.wa-enter > *:nth-child(3){animation-delay:.1s}
html.wow-app #main.wa-enter > *:nth-child(4){animation-delay:.15s}
html.wow-app #main.wa-enter > *:nth-child(5){animation-delay:.2s}
html.wow-app #main.wa-enter > *:nth-child(n+6){animation-delay:.24s}

/* ---------- pop-ups open like they mean it ---------- */
html.wow-app .modal-overlay .modal-box{animation:wa-pop .4s cubic-bezier(.16,1,.3,1) both}
html.wow-app :is(#pushUI,#mustUI) .sheet{animation:wa-up .45s cubic-bezier(.16,1,.3,1) both}
@media (min-width:700px){html.wow-app :is(#pushUI,#mustUI) .sheet{animation-name:wa-pop}}

/* ---------- presses you can feel ---------- */
html.wow-app :is(.p-btn,.btn,.nt-btn,.mobile-nav-item,.tab-nav-item,.chips button,.scale button,.sqpick button,.att button,#bnav a,nav.tabs a,.nt-dock a,.nt-dock button){
  transition:transform .35s cubic-bezier(.34,1.56,.64,1),background-color .2s,color .2s,border-color .2s,box-shadow .25s,filter .2s}
html.wow-app :is(.p-btn,.btn,.nt-btn,.mobile-nav-item,.tab-nav-item,.chips button,.scale button,.sqpick button,.att button,#bnav a,nav.tabs a,.nt-dock a,.nt-dock button):active{
  transform:scale(.95);transition-duration:.08s}
html.wow-app :is(.p-btn-primary,.btn:not(.sec):not(.ghost)):hover{box-shadow:0 8px 26px rgba(var(--glow-rgb),.28)}
/* the active tab grows a glowing underline */
html.wow-app :is(#bnav a.on,nav.tabs a.on,.mobile-nav-item.active){position:relative}
html.wow-app :is(#bnav a.on,.mobile-nav-item.active)::after{content:"";position:absolute;left:30%;right:30%;bottom:2px;height:3px;border-radius:3px;
  background:var(--glow);box-shadow:0 0 12px var(--glow);animation:wa-in .35s cubic-bezier(.16,1,.3,1) both}

/* ---------- celebration burst (yes, going, saved, done) ---------- */
.wa-burst{position:fixed;left:0;top:0;width:0;height:0;pointer-events:none;z-index:99999}
.wa-burst i{position:absolute;left:0;top:0;width:7px;height:7px;border-radius:2px;background:var(--glow,#ddf247);
  box-shadow:0 0 8px rgba(var(--glow-rgb,221,242,71),.8);will-change:transform,opacity}
.wa-burst i:nth-child(3n){background:var(--ice,#fff);border-radius:50%}
.wa-ring{position:fixed;border-radius:999px;pointer-events:none;z-index:99998;border:2px solid var(--glow,#ddf247);
  box-shadow:0 0 18px rgba(var(--glow-rgb,221,242,71),.6);animation:wa-ring .6s cubic-bezier(.16,1,.3,1) forwards}
@keyframes wa-ring{from{opacity:.9;transform:scale(1)}to{opacity:0;transform:scale(1.45)}}

/* ---------- "Loading..." shimmers instead of sitting there ---------- */
html.wow-app .wa-loading{background:linear-gradient(90deg,var(--dim,#9db5ac) 0%,var(--ice,#fff) 25%,var(--dim,#9db5ac) 50%) 0 0/200% 100%;
  -webkit-background-clip:text;background-clip:text;color:transparent !important;animation:wa-shine 1.4s linear infinite}

/* ---------- the toast slides with a little spring ---------- */
html.wow-app #toast{transition:opacity .25s,transform .45s cubic-bezier(.34,1.56,.64,1)}

@media (prefers-reduced-motion:reduce){
  html.wow-app *,html.wow-app *::after{animation:none !important}
  .wa-burst,.wa-ring{display:none}
}
