/* ZERO TWO anime post styles (js/anime.js): real artwork behind the card, colour grade, HUD grid, particles, running light frame.
   Developer-chosen per post. Works on the main post card (.ig-post) and the New arrivals shelf (.arr-card). */
.is-anime{--a1:#ff7eb6;--a2:#a78bfa;--a3:#ffd9ea;--r1:255,126,182;--r2:167,139,250;--r3:255,217,234}

/* ---------- card shell: dark cinematic glass over the art ---------- */
.is-anime{position:relative;overflow:hidden;isolation:isolate;color:#f6f1ff;
  background:#0f0a1f!important;border-color:transparent!important;opacity:1!important;
  box-shadow:0 0 0 1px rgba(var(--r1),0.4),0 24px 56px -24px rgba(var(--r1),0.85)!important;
  animation:fadeUp .5s var(--ease,ease) forwards,afxGlow 4s ease-in-out infinite;animation-delay:calc(var(--i,0)*45ms),0s;
  transition:transform .35s cubic-bezier(.2,.7,.2,1),box-shadow .35s}
.is-anime:hover{transform:translateY(-4px)}
.is-anime.is-excl::before,.is-anime.is-excl::after{display:none}
.is-anime>:not(.afx){position:relative;z-index:2}
.afx{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:inherit}
.afx-bg{z-index:0}
.afx-top{z-index:6}

/* artwork: slow drift, zooms in a little on hover */
.afx-art{position:absolute;inset:-4%;background-position:var(--apos,50% 15%);background-size:cover;background-repeat:no-repeat;transform:scale(1.04);transition:transform 1.2s cubic-bezier(.2,.7,.2,1),filter .6s;animation:afxDrift 18s ease-in-out infinite alternate;filter:saturate(1.12) contrast(1.04)}
.is-anime:hover .afx-art{transform:scale(1.12);filter:saturate(1.25) contrast(1.06)}
/* scrim keeps text readable: dark on the left and bottom, art shows through on the right */
.afx-scrim{position:absolute;inset:0;background:
  linear-gradient(90deg,rgba(12,7,26,.94) 0,rgba(12,7,26,.82) 34%,rgba(12,7,26,.34) 70%,rgba(12,7,26,.12) 100%),
  linear-gradient(0deg,rgba(12,7,26,.88),rgba(12,7,26,0) 46%),
  radial-gradient(90% 70% at 100% 0%,rgba(var(--r1),0.26),transparent 60%),
  radial-gradient(70% 60% at 0% 100%,rgba(var(--r2),0.22),transparent 62%)}
/* faint HUD grid + moving scan line */
.afx-grid{position:absolute;inset:0;opacity:.5;mix-blend-mode:screen;background:
  linear-gradient(rgba(var(--r3),0.09) 1px,transparent 1px) 0 0/28px 28px,
  linear-gradient(90deg,rgba(var(--r3),0.09) 1px,transparent 1px) 0 0/28px 28px;
  -webkit-mask:linear-gradient(100deg,transparent 30%,#000 100%);mask:linear-gradient(100deg,transparent 30%,#000 100%)}
.afx-hud{position:absolute;left:0;right:0;height:46%;top:-46%;background:linear-gradient(180deg,transparent,rgba(var(--r1),0.22) 88%,rgba(var(--r3),0.7) 100%);opacity:.55;animation:afxScan 6.5s cubic-bezier(.5,0,.5,1) infinite 1.2s}

/* running light frame + shine */
.afx-ring{position:absolute;inset:0;border-radius:inherit;padding:2px;overflow:hidden;
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}
.afx-ring::before{content:"";position:absolute;inset:-100%;background:conic-gradient(rgba(var(--r1),.16) 0 45%,var(--a1) 68%,var(--a3) 82%,var(--a2) 94%,rgba(var(--r1),.16));animation:afxRot 4.2s linear infinite}
.afx-shine{position:absolute;top:-10%;bottom:-10%;left:-45%;width:26%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.34),transparent);transform:skewX(-18deg);animation:afxShine 6s ease-in-out infinite 1.4s}

/* particles (per style) */
.afx-bg i{position:absolute;left:var(--x);top:-10%;width:calc(11px*var(--s));height:calc(11px*var(--s));opacity:0}
.fx-sakura .afx-bg i,.fx-petal .afx-bg i,.fx-frost .afx-bg i{border-radius:75% 0 75% 0;background:linear-gradient(135deg,var(--a3),var(--a1));box-shadow:0 0 8px rgba(var(--r1),0.6);animation:afxPetal var(--t) linear infinite var(--d)}
.fx-volt .afx-bg i,.fx-raiden .afx-bg i,.fx-azure .afx-bg i{top:var(--y);width:2px;height:calc(26px*var(--s));border-radius:2px;background:linear-gradient(var(--a3),var(--a1),transparent);box-shadow:0 0 8px var(--a1);transform:rotate(18deg);animation:afxZap 1.9s ease-in-out infinite var(--d)}
.fx-gold .afx-bg i,.fx-ink .afx-bg i,.fx-violet .afx-bg i{top:var(--y);width:calc(14px*var(--s));height:calc(14px*var(--s));background:linear-gradient(135deg,#fff,var(--a3) 40%,var(--a1));clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);filter:drop-shadow(0 0 4px var(--a1));animation:afxTwinkle 2.4s ease-in-out infinite var(--d)}

/* ---------- text on anime cards: light, with a soft shadow ---------- */
.is-anime .ig-title h3,.is-anime .arr-title,.is-anime .post-name{color:#fff!important;text-shadow:0 2px 14px rgba(0,0,0,.55)}
.is-anime .ig-desc,.is-anime .arr-desc{color:rgba(240,232,255,.86)!important}
.is-anime .ig-ago,.is-anime .dot,.is-anime .arr-top time,.is-anime .arr-foot,.is-anime .ig-stats,.is-anime .ig-stat{color:rgba(226,214,250,.74)!important}
.is-anime .arr-lang{color:#fff}
.is-anime .ig-more,.is-anime .pact{color:rgba(240,232,255,.88)!important}
.is-anime .pact.on{color:#ff8fa3!important}
.is-anime .ig-tags span{background:rgba(var(--r1),.22)!important;color:#fff!important;border:1px solid rgba(var(--r1),0.4)}
.is-anime .ig-media{background:rgba(8,4,20,.55)!important;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border:1px solid rgba(var(--r1),0.3)!important}
.is-anime .ig-media pre{color:#efe4ff!important}
.is-anime .ig-dlbtn{background:linear-gradient(110deg,var(--a1),var(--a2))!important;color:#fff!important;border:0!important;box-shadow:0 10px 26px -12px var(--a1)!important}
.is-anime .ig-head,.is-anime .ig-title,.is-anime .ig-acts{background:none!important;border-color:rgba(255,255,255,.12)!important}

/* anime tag in the corner */
.is-anime.ig-post::after{content:"";display:none}

@keyframes afxRot{to{transform:rotate(360deg)}}
@keyframes afxDrift{from{background-position:var(--apos,50% 15%);transform:scale(1.04)}to{background-position:calc(50% + 14px) calc(15% + 10px);transform:scale(1.1)}}
@keyframes afxScan{0%{top:-46%}70%,100%{top:110%}}
@keyframes afxGlow{0%,100%{box-shadow:0 0 0 1px rgba(var(--r1),0.34),0 18px 44px -24px rgba(var(--r1),0.65)}50%{box-shadow:0 0 0 1px rgba(var(--r1),0.6),0 26px 64px -18px rgba(var(--r1),0.95)}}
@keyframes afxShine{0%,60%{left:-45%}100%{left:140%}}
@keyframes afxPetal{0%{top:-12%;opacity:0;transform:translateX(0) rotate(0)}8%{opacity:.95}50%{transform:translateX(26px) rotate(170deg)}100%{top:108%;opacity:.9;transform:translateX(-16px) rotate(380deg)}}
@keyframes afxZap{0%,100%{opacity:0;transform:rotate(18deg) scaleY(.2)}12%{opacity:1;transform:rotate(18deg) scaleY(1)}30%{opacity:0;transform:rotate(18deg) translateY(14px) scaleY(.4)}}
@keyframes afxTwinkle{0%,100%{opacity:0;transform:scale(.2) rotate(0)}50%{opacity:1;transform:scale(1.15) rotate(90deg)}}

/* phones: the mobile layer sets content-visibility:auto on posts, which can pause effects; anime posts always render */
html body .ig-post.is-anime,html body .arr-card.is-anime{content-visibility:visible;contain:none}

/* small cards on the shelf: calmer, art centred on the face */
.arr-card.is-anime{min-height:176px;justify-content:flex-end}
.arr-card.is-anime .afx-scrim{background:linear-gradient(0deg,rgba(12,7,26,.95),rgba(12,7,26,.55) 52%,rgba(12,7,26,.1)),radial-gradient(90% 70% at 100% 0%,rgba(var(--r1),0.28),transparent 60%)}
.arr-card.is-anime .afx-bg i:nth-of-type(n+6){display:none}

/* ---------- v5 clean layout: art is a vivid banner on top, all text sits on a solid dark panel ----------
   Before, the artwork sat behind every line of text, so faces fought with titles and the code box. Now the art
   is shown clearly (no text on the face) and fades into the card, and the text is always on a plain surface. */
html:root:root:root body .is-anime.ig-post,html:root:root:root body .arr-card.is-anime{background:#0f0a1f linear-gradient(180deg,#120c26 0,#0d0819 100%)!important;background-color:#0f0a1f!important}
.is-anime.ig-post{--ah:184px}
.is-anime.ig-post .afx-bg{inset:0 0 auto 0;height:var(--ah);
  -webkit-mask-image:linear-gradient(180deg,#000 0,#000 58%,rgba(0,0,0,.55) 82%,transparent 100%);mask-image:linear-gradient(180deg,#000 0,#000 58%,rgba(0,0,0,.55) 82%,transparent 100%)}
.is-anime.ig-post .afx-art{inset:0;transform:none;background-size:cover;filter:saturate(1.12) contrast(1.05);animation:none}
.is-anime.ig-post:hover .afx-art{transform:scale(1.05);filter:saturate(1.22) contrast(1.08)}
/* light touch only: a soft shade behind the name row at the very top, a colour wash, nothing over the face */
.is-anime.ig-post .afx-scrim{background:
  linear-gradient(180deg,rgba(8,4,20,.62) 0,rgba(8,4,20,.18) 34%,rgba(8,4,20,0) 52%),
  linear-gradient(90deg,rgba(8,4,20,.5) 0,rgba(8,4,20,0) 42%),
  radial-gradient(80% 90% at 100% 0%,rgba(var(--r1),.22),transparent 62%)}
.is-anime.ig-post .afx-grid{-webkit-mask:linear-gradient(100deg,transparent 40%,#000 100%);mask:linear-gradient(100deg,transparent 40%,#000 100%);opacity:.35}
/* the title block starts below the banner, so the name row sits on the art and the words sit on the panel */
.is-anime.ig-post .ig-title{margin-top:calc(var(--ah) - 92px)!important;padding-top:0!important}
.is-anime.ig-post .ig-title h3{font-size:1.18em;letter-spacing:-.01em}
.is-anime.ig-post .ig-desc{color:rgba(238,230,255,.9)!important;line-height:1.5}
.is-anime.ig-post .ig-head{position:relative;z-index:3}
.is-anime.ig-post .ig-head .ig-who,.is-anime.ig-post .ig-head .ig-who *{text-shadow:0 1px 10px rgba(0,0,0,.85)}
.is-anime.ig-post .ig-more{background:rgba(8,4,20,.4)!important;border-radius:999px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
/* code preview and download button: solid, readable, no art behind them */
.is-anime.ig-post .ig-media{background:rgba(5,2,14,.72)!important;border:1px solid rgba(var(--r1),.28)!important;backdrop-filter:none;-webkit-backdrop-filter:none}
.is-anime.ig-post .ig-media pre{color:#f2eaff!important}
.is-anime.ig-post .ig-tags span{border-radius:999px;border:1px solid rgba(var(--r1),.45);background:rgba(var(--r1),.16)!important}
.is-anime.ig-post .ig-tags span{padding:2px 9px}
/* per-style focus so the face stays inside the banner */
.is-anime.fx-sakura .afx-art{background-position:50% 3%!important}
@media (max-width:640px){.is-anime.ig-post{--ah:164px}}

/* New arrivals shelf: art on the upper half, text on solid dark at the bottom */
.arr-card.is-anime{--ah:112px;min-height:200px}
.arr-card.is-anime .afx-bg{inset:0 0 auto 0;height:var(--ah);-webkit-mask-image:linear-gradient(180deg,#000 55%,transparent);mask-image:linear-gradient(180deg,#000 55%,transparent)}
.arr-card.is-anime .afx-art{inset:0;transform:none;animation:none}
.arr-card.is-anime .afx-scrim{background:linear-gradient(180deg,rgba(8,4,20,.5),rgba(8,4,20,0) 45%)}
.arr-card.is-anime .arr-title{margin-top:calc(var(--ah) - 54px)}

/* ---------- Developer-only style picker (upload + edit) ---------- */
.anim-opt{display:grid;gap:8px;padding:12px 14px;border-radius:14px;border:1px solid color-mix(in srgb,#ff7eb6 50%,transparent);background:color-mix(in srgb,#ff7eb6 7%,transparent)}
.anim-opt[hidden]{display:none}
.anim-opt .hint{margin:0}
.anim-tag{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#fff;background:linear-gradient(90deg,#ff7eb6,#a78bfa)}
.anim-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
.anim-pick button{--a1:#a78bfa;--a2:#6366f1;--r1:167,139,250;display:grid;gap:3px;align-content:start;padding:6px 6px 8px;text-align:left;font:inherit;cursor:pointer;border-radius:12px;border:1.5px solid var(--line2,#ddd);background:var(--surface,#fff);color:var(--text,#222);transition:transform .2s,border-color .2s,box-shadow .2s}
.anim-pick button:hover{transform:translateY(-2px);border-color:var(--a1)}
.anim-pick button.on{border-color:var(--a1);box-shadow:0 0 0 3px rgba(var(--r1),0.26),0 12px 22px -14px var(--a1)}
.anim-pick button:focus-visible{outline:2px solid var(--a1);outline-offset:2px}
.anim-pick .ap-ph{display:grid;place-items:center;height:92px;border-radius:8px;background:#e9e1fb center/cover no-repeat;position:relative;overflow:hidden}
.anim-pick button.on .ap-ph::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,transparent 60%,rgba(var(--r1),0.55))}
.anim-pick .ap-off .ap-ph svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8;opacity:.5}
.anim-pick b{font-size:12.5px;font-weight:750;line-height:1.2}
.anim-pick small{font-size:10.5px;line-height:1.3;opacity:.68}

@media (max-width:640px){.is-anime:hover{transform:none}.afx-grid{display:none}}
/* reduced motion (many phones turn this on with battery saver / remove animations): keep the artwork, frame and a calm glow; drop drifting, zooming, falling and flashing effects */
@media (prefers-reduced-motion:reduce){
  .is-anime{opacity:1!important;animation:afxGlow 6s ease-in-out infinite!important}
  .afx-art,.afx-hud,.afx-shine{animation:none!important}
  .afx-ring::before{animation-duration:12s!important}
  .afx-hud,.afx-shine{display:none}
  .fx-sakura .afx-bg i,.fx-petal .afx-bg i,.fx-frost .afx-bg i,.fx-volt .afx-bg i,.fx-raiden .afx-bg i,.fx-azure .afx-bg i{display:none}
  .is-anime:hover{transform:none}
}
