/* THE FLUX FORGE — the Arcade's Avatar Bay scroll scene around the .ab-banner card (SCROLL DOWN ANIMATIONS, worker C,
   2026-10-16). Engine + sources: /games/ab-forge.js. Mode flags are set on <html> by the inline script right before
   #abForge, BEFORE the section is laid out, so every height below is known at first paint (CLS 0):
     html.abf-m  = JS + motion  → tall section, sticky stage, the card lands at the bottom of the stage
     html.abf-rm = JS + reduced → a still loadout above the card, no pin, no loop
     neither     = JS off       → the card exactly as it always was (this file only hides the stage)
   The card itself (.ab-banner) is never restyled except its outer margin while it sits inside the stage. */
.abf{position:relative;--abf-nav:114px;--abf-T:92svh;--abf-gold:#ffd97a;--abf-flux:#ff8a4d;--abf-cy:#6ee7ff}
@media(max-width:767px){.abf{--abf-nav:191px;--abf-T:96svh}}
@media(max-width:349px){.abf{--abf-nav:235px}}
.abf-stage{display:none}

/* ---------- motion: pinned stage ---------- */
html.abf-m .abf{height:calc(max(440px,100svh - var(--abf-nav)) + var(--abf-T));margin:10px 0 34px}
html.abf-m .abf-pin{position:sticky;top:var(--abf-nav);height:max(440px,calc(100svh - var(--abf-nav)));overflow:hidden;contain:layout paint}
html.abf-m .abf-stage,html.abf-rm .abf-stage{display:block;position:absolute;inset:0;pointer-events:none;
  font-family:'Space Grotesk',system-ui,sans-serif;color:#e8ecff;
  background:
    radial-gradient(46% 40% at 50% 70%,rgba(255,138,77,.13),transparent 72%),
    radial-gradient(38% 46% at 50% 38%,rgba(110,231,255,.09),transparent 74%),
    linear-gradient(180deg,rgba(6,7,20,0) 0%,rgba(6,7,20,.55) 18%,rgba(6,7,20,.55) 82%,rgba(6,7,20,0) 100%)}
html.abf-m .abf-cv{position:absolute;inset:0;width:100%;height:100%;display:block}
html.abf-m .abf-land{position:absolute;left:0;right:0;bottom:20px;z-index:3;opacity:0;will-change:transform,opacity;
  animation:abfShow .01s 4s forwards}                                 /* fallback: if the engine never boots, the card shows */
html.abf-m .abf.is-live .abf-land{animation:none}
html.abf-m .abf-land:focus-within{opacity:1!important;transform:none!important}   /* keyboard users always see what they focus */
@keyframes abfShow{to{opacity:1}}
/* phones: the card is never in the pinned frame. The pin holds the stage (reserved by padding, so the late-built stage
   never shifts anything) with the card in flow right under it; while pinned the card sits below the fold, and it rises
   in only once the pin lets go, so it never rests over the bottom JOIN / ✦ chips. The ::after spacer is the travel. */
@media(max-width:767px){
  html.abf-m .abf{height:auto}
  html.abf-m .abf::after{content:"";display:block;height:var(--abf-T)}
  html.abf-m .abf-pin{height:auto;padding-top:max(440px,calc(100svh - var(--abf-nav)))}
  html.abf-m .abf-stage{inset:0 0 auto 0;height:max(440px,calc(100svh - var(--abf-nav)))}
  html.abf-m .abf-land{position:relative;bottom:auto;padding:18px 0 6px}
}
/* iPads: the shared JOIN / ✭ / ✦ chips own the bottom ~100 px; the card lands clear of them. Phones have no room to
   spare, so there the card rests at the bottom only for the last stretch of the pin, then scrolls up clear of the chips. */
@media(min-width:768px) and (max-width:1099px) and (min-height:700px){html.abf-m .abf-land{bottom:112px}}
html.abf-m .abf .ab-banner,html.abf-rm .abf .ab-banner{margin:0 auto}
/* inside the stage the card gets a solid night backing so the forge behind it never shows through its glass */
html.abf-m .abf .ab-banner{background-color:rgba(9,10,26,.94)}
/* the fixed bottom chips (JOIN tray 10–197 px, ◆⚡ meter, ✦ pill) live in the outer ~200 px of each side: where the card is
   not lifted above them, it lands at most 100% − 440 px wide so it never rests on them */
@media(min-width:1100px),(min-width:768px) and (max-height:699px){html.abf-m .abf .ab-banner{max-width:min(880px,calc(100% - 440px))}}
html.abf-m .abf .ab-go{position:relative;overflow:hidden}
html.abf-m .abf .ab-go::after{content:"";position:absolute;top:-20%;bottom:-20%;left:0;width:46%;pointer-events:none;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.85),transparent);transform:translateX(-160%) skewX(-18deg);opacity:0}
html.abf-m .abf-land.is-shine .ab-go::after{animation:abfShine 1.1s cubic-bezier(.3,.7,.3,1) .1s 1 both}
@keyframes abfShine{0%{opacity:1;transform:translateX(-160%) skewX(-18deg)}100%{opacity:1;transform:translateX(330%) skewX(-18deg)}}
html.abf-m .abf-land.is-down .ab-banner{border-color:rgba(255,217,122,.75);box-shadow:0 18px 60px -24px #ff8a4d,0 0 0 1px rgba(255,217,122,.25) inset}

/* ---------- the head: kicker, title, guest line / signed-in meter ---------- */
.abf-head{position:absolute;z-index:2;left:max(28px,calc(50% - 600px));top:calc((100% - 170px) / 2 - 92px);width:min(310px,27vw)}   /* top-anchored: text below it may rewrap, the title never moves */
.abf-kick{margin:0;font-family:Michroma,sans-serif;font-size:10.5px;letter-spacing:.24em;color:var(--abf-flux);text-shadow:0 0 14px rgba(255,138,77,.55)}
.abf-h{margin:10px 0 0;font-family:Michroma,sans-serif;font-size:clamp(22px,2.6vw,34px);line-height:1.12;letter-spacing:.04em;color:#fff;
  text-shadow:0 0 26px rgba(110,231,255,.35)}
.abf-h b{display:block;font-weight:400;background:linear-gradient(90deg,var(--abf-gold),var(--abf-flux));-webkit-background-clip:text;background-clip:text;color:transparent;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.abf-h{transition:text-shadow .5s}
.abf-head.is-max .abf-h{text-shadow:0 0 22px rgba(255,138,77,.85),0 0 46px rgba(255,190,110,.45)}   /* FULL LOADOUT: the title catches fire (no text change = no shift) */
.abf-sub{margin:12px 0 0;font-size:14px;line-height:1.5;color:#aab3d6;max-width:30ch}
.abf-me{margin:14px 0 0;font-size:13px;color:#cfd6f5;font-variant-numeric:tabular-nums;contain:layout paint}
.abf-me b{color:var(--abf-flux);font-size:17px;text-shadow:0 0 12px rgba(255,120,60,.55)}
.abf-me[hidden]{display:none}

/* ---------- the loadout panel (real item names + real Bay prices) ---------- */
.abf-load{position:absolute;z-index:2;right:max(28px,calc(50% - 600px));top:calc((100% - 170px) / 2);transform:translateY(-50%);
  width:min(300px,27vw);margin:0;padding:14px 14px 10px;list-style:none;border:1px solid rgba(255,217,122,.18);border-radius:18px;
  background:linear-gradient(180deg,rgba(14,16,36,.72),rgba(8,9,22,.62))}
.abf-load::before{content:attr(data-h);display:block;margin:0 0 8px 4px;font-family:Michroma,sans-serif;font-size:9px;letter-spacing:.22em;color:#8f99c4}
.abf-load li{display:flex;align-items:center;gap:10px;padding:7px 6px;border-radius:12px;opacity:.38;transition:opacity .3s,background-color .3s}
.abf-load li .ic{flex:none;width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:rgba(255,255,255,.04)}
.abf-load li .ic svg{max-width:30px;max-height:30px;width:auto;height:auto}
.abf-load li .tx{flex:1;min-width:0;display:flex;flex-direction:column}
.abf-load li .sl{font-family:Michroma,sans-serif;font-size:8.5px;letter-spacing:.2em;color:#8f99c4}
.abf-load li .nm{font-size:13px;font-weight:600;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.abf-load li .pr{flex:none;min-width:5.6em;text-align:right;font-size:12px;font-weight:600;color:var(--abf-flux);font-variant-numeric:tabular-nums}
.abf-load li .pr::before{content:"✓ ";color:#7dffb0;opacity:0}
.abf-load li.is-in{opacity:.75}
.abf-load li.is-on{opacity:1;background:linear-gradient(90deg,rgba(255,138,77,.16),rgba(255,217,122,.04))}
.abf-load li.is-empty .nm{color:#8f99c4;font-weight:500;font-style:italic}
.abf-load li.is-empty .pr{color:#8f99c4;font-size:9.5px;letter-spacing:.14em}
.abf-load li.is-empty .pr::before{content:none}
.abf-load li.is-empty .ic{background:transparent;box-shadow:inset 0 0 0 1.5px rgba(143,153,196,.35)}
.abf-load li.is-on .ic{background:rgba(255,138,77,.16);box-shadow:0 0 18px -4px rgba(255,138,77,.8)}
.abf-load li.is-on .pr::before{opacity:1}

/* ---------- caption under the pilot ---------- */
.abf-cap{position:absolute;z-index:2;left:50%;top:0;margin:0;transform:translate(-50%,0);white-space:nowrap;
  font-family:Michroma,sans-serif;font-size:11px;letter-spacing:.2em;color:#fff;text-shadow:0 0 14px rgba(255,138,77,.7);will-change:transform}
.abf-cap .v{color:var(--abf-gold)}

/* ---------- narrow screens (phones, iPad portrait): title on top, loadout as five pips ---------- */
@media(max-width:899px){
  .abf-head{left:16px;right:16px;top:8px;transform:none;width:auto;text-align:center}
  .abf-kick{font-size:9.5px}
  .abf-h{margin-top:6px;font-size:22px}
  .abf-h b{display:inline}
  .abf-sub{display:none}
  .abf-me{margin-top:6px;font-size:12px}
  .abf-me b{font-size:14px}
  .abf-load{left:50%;right:auto;top:auto;transform:translateX(-50%);width:auto;padding:0;border:0;background:none;display:flex;align-items:flex-start;gap:6px}
  .abf-load::before{display:none}
  .abf-load li{padding:0;opacity:.32}
  .abf-load li .tx,.abf-load li .pr{display:none}
  .abf-load li .ic{width:38px;height:38px;border:1px solid rgba(255,217,122,.22)}
  .abf-cap{font-size:10px;letter-spacing:.16em}
}

/* ---------- reduced motion: a still loadout, no pin ---------- */
html.abf-rm .abf{margin:18px 0 40px}
html.abf-rm .abf-pin{position:relative;height:auto;padding-top:458px}   /* the still's room is reserved before the engine inserts it (CLS 0) */
html.abf-rm .abf-stage{position:absolute;inset:0 0 auto 0;height:440px}
html.abf-rm .abf-cv{display:none}
html.abf-rm .abf-still{position:absolute;left:50%;top:50%;transform:translate(-50%,-52%)}
html.abf-rm .abf-cap{top:auto;bottom:6px}
@media(max-width:899px){
  html.abf-rm .abf-pin{padding-top:478px}
  html.abf-rm .abf-stage{height:460px}
  html.abf-rm .abf-still{top:118px;transform:translateX(-50%)}
}
html.abf-rm .abf-load li{opacity:1}
.abf-host{position:absolute;left:-10000px;top:0;width:10px;height:10px;overflow:hidden;visibility:hidden;pointer-events:none;contain:strict}
/* returning visitors (/scene-memory.js): a seen forge boots FINISHED — no pin travel, FULL LOADOUT with the card landed */
html.abf-m.scm-f-forge #abForge{--abf-T:0px}
/* the finished pilot opens the Avatar Bay (ab-forge.js sizes .abf-hit over the figure once FULL LOADOUT lands) */
.abf-hit{display:none}
html.abf-m .abf-stage.is-max .abf-hit{display:block;position:absolute;left:0;top:0;z-index:3;pointer-events:auto;cursor:pointer;border-radius:46% 46% 34% 34%;
  transition:box-shadow .25s ease,background-color .25s ease}
html.abf-m .abf-stage.is-max .abf-hit:hover{background:radial-gradient(closest-side,rgba(255,217,122,.10),transparent);
  box-shadow:0 0 70px -10px rgba(255,170,90,.55)}
html.abf-m .abf-stage.is-max .abf-hit::after{content:"OPEN AVATAR BAY \2192";position:absolute;left:50%;bottom:-6px;transform:translate(-50%,100%);
  white-space:nowrap;font:500 10.5px/1 Michroma,sans-serif;letter-spacing:.22em;color:#ffd97a;text-shadow:0 2px 10px #000;opacity:0;transition:opacity .2s ease}
html.abf-m .abf-stage.is-max .abf-hit:hover::after{opacity:1}
html.abf-rm .abf-still{pointer-events:auto;cursor:pointer}
