.end-tentacles{position:absolute;top:0;left:0;width:100%;height:0;z-index:1;pointer-events:none;opacity:0;transition:opacity .4s;image-rendering:pixelated}
.end-tentacles.is-active{opacity:1}
@media(prefers-reduced-motion:reduce){.end-tentacles{transition:none}}

/* Background tentacles stay between section backgrounds and their content. */
body:has(.end-tentacles)>section>*,
body:has(.end-tentacles)>.site-footer>*,
body:has(.end-tentacles) .lore-page>section>*,
body:has(.end-tentacles) .application-page>*{position:relative;z-index:2}
body:has(.end-tentacles)>main.hero{z-index:2}

/* These sections create their own stacking context. Lift the whole context,
   otherwise its text cannot escape the canvas even with a higher child z-index. */
body:has(.end-tentacles) :is(.discovery-section,.discovery-links,.realities-section){position:relative;z-index:2}
/* New detail pages share the same readable content layer as the original pages. */
body:has(.end-tentacles) :is(.realities-detail,.cave-page)>*{position:relative;z-index:2}
/* Story-first lore and rules use wrappers rather than direct section children. */
body:has(.end-tentacles) :is(.lore-story,.rules-page>.lore-hero,.rules-content){position:relative;z-index:2}


body:has(.end-tentacles) .login-page>*,body:has(.end-tentacles) .admin-page>*{position:relative;z-index:2}

/* The substrate sits over section art; content and golden lights remain above it. */
.is-corrupting body>main.hero{isolation:auto;z-index:auto}
.is-corrupting .hero__content,.is-corrupting .hero__footer{position:relative;z-index:2}
.is-corrupting .hero-logo:disabled{cursor:default}
.is-corrupting :is(.hero__backdrop,.hero__shade){opacity:calc(1 - var(--corruption-progress,0));transition:opacity .5s}
.is-corrupted :is(.lore-card,.placeholder-card,.faq-item,.custom-mod-card,.application-form){background:#130b1bd9;border-color:#73338c66}
.is-corrupting body:after{content:'';position:fixed;inset:0;z-index:1;pointer-events:none;background:radial-gradient(ellipse at 50% 52%,#8e23bd0a 10%,#70209f2c 65%,#a743d570 100%);box-shadow:inset 0 0 100px #ac43e555;opacity:calc(var(--corruption-progress,0) * (.2 + var(--corruption-pulse,0) * .65))}
.is-corruption-caster .ender-cursor{display:none}
.corruption-spells{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:160;image-rendering:pixelated}
@media(prefers-reduced-motion:reduce){.is-corrupting body:after{opacity:calc(var(--corruption-progress,0) * .35)}}

/* Contact infections use the same voxel renderer as the background tentacles. */
.content-corruption-mark{position:absolute;z-index:8;pointer-events:none;image-rendering:pixelated;max-width:none}
.content-corruption-mark[hidden]{display:none}
.content-infected-photo{filter:saturate(.75) sepia(.12);box-shadow:inset 0 0 15px #70258b,0 0 12px #6e248755}
.content-infected-captured{cursor:pointer;box-shadow:inset 0 0 40px #100718dd,0 0 16px #69227d66!important}
.content-infected-captured :is(a,button){cursor:pointer;filter:saturate(.35) brightness(.7)}
a.content-infected-captured{filter:saturate(.35) brightness(.7)}

/* Rule cards and lore text acquire corruption only after visible contact. */
.content-infected-text{color:#eadbf0;transition:color 1.9s ease,text-shadow 1.9s ease;text-shadow:0 0 12px #6f298238}
.content-infected-panel{background:#130b1bd9!important;border-color:#73338c88!important;transition:background-color 1.9s ease,border-color 1.9s ease}
.content-infected-photo{transition:filter 1.9s ease,box-shadow 1.9s ease}
@media(prefers-reduced-motion:reduce){.content-infected-text,.content-infected-panel,.content-infected-photo{transition:none}}
