/* ===== MenuFX: wallpapers, panel art, tile tilt and the screen entrance (js/menufx.js) ===== */
/* each screen's wallpaper: PixiJS draws it behind the screens; this still copy shows until then, or without WebGL */
.mfx-wall > .mn-bg { background:linear-gradient(rgba(5,4,12,.55), rgba(5,4,12,.8)), var(--wall) center / cover, #05040c; }
.mfx-wall > .mn-bg::after { display:none; }
.menufx .mfx-wall > .mn-bg { visibility:hidden; }

/* panel art: a layer under each hub tile's text, darker on the text side, sliding against the pointer */
.tile .t-art { position:absolute; inset:-16px; z-index:0; pointer-events:none; opacity:0; background:var(--art) center / cover no-repeat;
  transform:translate(calc((var(--mx, .5) - .5) * -20px), calc((var(--my, .5) - .5) * -12px)) scale(1.02); transition:transform .35s var(--ease), opacity .5s; }
.tile .t-art.in { opacity:.92; } .tile:hover .t-art.in { opacity:1; }
.tile .t-art::after { content:''; position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(8,7,18,.94), rgba(8,7,18,.72) 34%, rgba(8,7,18,.18) 72%, rgba(8,7,18,.08)), linear-gradient(rgba(8,7,18,.1) 50%, rgba(8,7,18,.7)); }
.tile .t-art.ph { filter:saturate(.6) brightness(.7); }                  /* a placeholder until the panel art is made */
.t-story .t-art { background-position:center 40%; }
.t-story .t-art::after { background:linear-gradient(90deg, rgba(8,7,18,.92), rgba(8,7,18,.6) 40%, rgba(8,7,18,.05) 75%), linear-gradient(rgba(8,7,18,0) 55%, rgba(8,7,18,.75)); }
.t-quick .t-art, .t-duel .t-art { background-position:right center; }

/* the glass catches light where the pointer is */
.tile .t-glare { position:absolute; inset:0; z-index:3; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(circle 280px at calc(var(--mx, .5) * 100%) calc(var(--my, .5) * 100%), rgba(255,255,255,.09), transparent 70%); }
.tile:hover .t-glare { opacity:1; }

/* tilt toward the pointer; the story beast floats in front of its land */
.mfx .tile, .mfx .tile:hover { transform:perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px)) scale(var(--ts, 1));
  transition:transform .22s ease-out, border-color .25s, box-shadow .25s; }
.mfx .tile:hover { --ty:-3px; } .mfx .tile:active { --ts:.985; --ty:0px; }
.mfx .t-story .t-cut, .mfx .t-story:hover .t-cut { z-index:1; transform:translate(calc((var(--mx, .5) - .5) * 16px), calc((var(--my, .5) - .5) * 9px)) scale(var(--cs, 1)); transition:transform .35s var(--ease); }
.mfx .t-story:hover { --cs:1.03; }

/* entrance: hub tiles rise in one after another, other screens fade up */
.mfx-in .hub-grid > .tile { animation:mfxRise .6s var(--ease) both; animation-delay:calc(var(--i, 0) * 55ms + 60ms); }
.mfx-in > :not(.mn-bg):not(.hub-grid) { animation:mfxFade .45s var(--ease) both; }
@keyframes mfxRise { from { opacity:0; translate:0 22px; } }
@keyframes mfxFade { from { opacity:0; translate:0 10px; } }
.calm .mfx-in .hub-grid > .tile, .calm .mfx-in > * { animation:none; }
.calm .tile .t-art, .calm .t-story .t-cut { transform:none !important; }

/* once Pell's cart art is in, it replaces the plain Shard icon on the Shop tile */
.t-shop .t-art.in:not(.ph) ~ .t-ic { display:none; }

/* hover clip: sits over the still inside the art layer (under its dark gradient), shown only while it plays */
.tile .t-art .t-vid { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:var(--vpos, center); opacity:0; transition:opacity .35s; }
.tile .t-art .t-vid.on { opacity:1; }
.t-quick .t-art .t-vid, .t-duel .t-art .t-vid { --vpos:right center; } .t-story .t-art .t-vid { --vpos:center 40%; }
.calm .tile .t-art .t-vid { display:none; }
