.hero-duo{--hero-sheet:url('assets/battle-heroes/00-base.png');pointer-events:none;mix-blend-mode:normal;isolation:isolate}
/* Lift the whole stacking context during a strike, then restore normal layering. */
.game .base:has(.hero-figure[data-pose="attack"]){z-index:30}
.game.boss-mode .candidates.hero-duo:has(.hero-figure[data-pose="attack"]){z-index:30}
.game.boss-mode .classroom:has(.hero-figure[data-pose="attack"]){isolation:auto}
.hero-duo .hero-figure[data-pose="attack"]{z-index:10}
.borrowed-spirit{
 position:absolute;left:50%;top:12%;width:clamp(32px,36%,76px);aspect-ratio:1;
 transform:translate(-50%,-50%);z-index:1;pointer-events:none;
 filter:drop-shadow(0 4px 4px #84699038);
}
.borrowed-spirit .spirit-art{display:block;animation:borrowedSpiritFloat 3.4s ease-in-out infinite}
.borrowed-spirit .spirit-art img{width:100%;height:100%;object-fit:contain}
.game.chapter-mode .borrowed-spirit{left:66%;top:8%}
.candidates.hero-duo .borrowed-spirit{left:50%;top:26%;width:25%;max-width:82px}
@keyframes borrowedSpiritFloat{0%,100%{transform:translate(-3px,2px) rotate(-3deg)}50%{transform:translate(3px,-7px) rotate(3deg)}}
@media(prefers-reduced-motion:reduce){.borrowed-spirit .spirit-art{animation:none}}
.hero-figure{position:absolute;aspect-ratio:1;background-image:var(--hero-sheet);background-size:300% 200%;background-repeat:no-repeat;background-position:0 var(--hero-row);filter:drop-shadow(0 7px 5px #604d4340);transform-origin:50% 78%;will-change:background-position,transform;z-index:2}
.hero-man{--hero-row:0%;transform:scaleX(-1)}
.hero-woman{--hero-row:100%}
.hero-figure[data-pose="attack"]{background-position:50% var(--hero-row);animation:heroAttack .58s ease-out both}
.hero-figure[data-pose="hit"]{background-position:100% var(--hero-row);animation:heroHit .66s ease-out both}
.base .hero-duo{position:absolute;inset:0;z-index:3}
.base .hero-figure{width:106%;bottom:-5%}
.base .hero-man{right:72%}
.base .hero-woman{left:72%}
.base>span{z-index:4}
.game.chapter-mode .base .hero-man{left:0;right:auto;bottom:7%;transform:none}
.game.chapter-mode .base .hero-woman{left:50%;bottom:-7%}
.game.boss-mode .candidates.hero-duo{left:var(--enc-avatarX,50%);bottom:var(--enc-avatarBottom,1%);width:calc(var(--enc-avatarH,180px)*1.22);height:var(--enc-avatarH,180px);transform:translateX(-50%);z-index:5;opacity:1}
.candidates.hero-duo .hero-figure{width:73%}
.candidates.hero-duo .hero-man{left:-3%;bottom:-3%;transform:none}
.candidates.hero-duo .hero-woman{right:-3%;bottom:11%}
.candidates.hero-duo.hit .hero-figure{display:block}
@keyframes heroAttack{0%{translate:0 0}35%{translate:0 -7px}65%{translate:0 4px}100%{translate:0 0}}
@keyframes heroHit{0%,100%{translate:0 0;filter:drop-shadow(0 7px 5px #604d4340)}30%{translate:7px -3px;filter:drop-shadow(0 0 12px #fff1b8)}60%{translate:-5px 2px}}
@media(max-width:680px){.base .hero-figure{width:110%}.base .hero-man{right:68%}.base .hero-woman{left:68%}.game.boss-mode .candidates.hero-duo{left:calc(var(--enc-avatarX,50%) + clamp(14px,5vw,25px));width:calc(var(--enc-avatarH,130px)*1.28)}}
@media(max-height:560px){.base .hero-figure{width:96%}.game.boss-mode .candidates.hero-duo{width:calc(var(--enc-avatarH,105px)*1.15)}.candidates.hero-duo .hero-figure{width:72%}}

/* Standalone transparent sprites keep every pose and its effects inside its own frame. */
.hero-duo.cutout-heroes .hero-figure{background-size:contain;background-position:center bottom}
.hero-duo.cutout-heroes .hero-man{background-image:url('assets/battle-heroes/base-poses/man-idle.png')}
.hero-duo.cutout-heroes .hero-man[data-pose="attack"]{background-image:url('assets/battle-heroes/base-poses/man-attack.png')}
.hero-duo.cutout-heroes .hero-man[data-pose="hit"]{background-image:url('assets/battle-heroes/base-poses/man-hit.png')}
.hero-duo.cutout-heroes .hero-woman{background-image:url('assets/battle-heroes/base-poses/woman-idle.png')}
.hero-duo.cutout-heroes .hero-woman[data-pose="attack"]{background-image:url('assets/battle-heroes/base-poses/woman-attack.png')}
.hero-duo.cutout-heroes .hero-woman[data-pose="hit"]{background-image:url('assets/battle-heroes/base-poses/woman-hit.png')}
.hero-duo.cutout-heroes .hero-figure[data-pose="attack"]{scale:1.43}
.base .hero-duo.cutout-heroes .hero-man[data-pose="attack"]{margin-left:18px}
.candidates.hero-duo.cutout-heroes .hero-figure[data-pose="attack"]{scale:1.35}

/* The fusion artwork has a two-character idle/hit frame and separate full attack frames. */
.hero-duo.fused-cutouts .hero-figure{aspect-ratio:3/4;background-image:var(--fusion-idle);background-size:200% 100%;background-repeat:no-repeat}
.hero-duo.fused-cutouts .hero-man{background-position:left center}
.hero-duo.fused-cutouts .hero-woman{background-position:right center}
.hero-duo.fused-cutouts .hero-figure[data-pose="hit"]{background-image:var(--fusion-hit)}
.hero-duo.fused-cutouts .hero-man[data-pose="hit"]{background-position:left center}
.hero-duo.fused-cutouts .hero-woman[data-pose="hit"]{background-position:right center}
.hero-duo.fused-cutouts .hero-figure[data-pose="attack"]{aspect-ratio:1;background-size:contain;background-position:center bottom;scale:1.43}
.hero-duo.fused-cutouts .hero-man[data-pose="attack"]{background-image:var(--fusion-man-attack)}
.hero-duo.fused-cutouts .hero-woman[data-pose="attack"]{background-image:var(--fusion-woman-attack)}
.base .hero-duo.fused-cutouts .hero-figure:not([data-pose="attack"]){width:80%}
.candidates.hero-duo.fused-cutouts .hero-figure:not([data-pose="attack"]){width:55%}
.candidates.hero-duo.fused-cutouts .hero-figure[data-pose="attack"]{scale:1.35}

/* Give the arena more of the viewport while keeping the four choices stable. */
.game{grid-template-rows:48px 50px minmax(0,1fr) auto}
.battle-header h2{margin:0}
.hud{gap:14px;padding:5px 13px;border-radius:13px 13px 0 0}
.hud>div>b{margin-top:1px}
.health span{margin-bottom:3px}
.arena-layout{grid-template-columns:155px minmax(0,1fr)}
.miss-tray{padding:9px 8px}
.input-dock{padding:6px 12px 5px}
.target-line,.choice-play .target-line{height:43px;min-height:43px;margin-bottom:5px;overflow:hidden;line-height:1.35}
.target-line #targetClue,.choice-play .target-line #targetClue{max-height:40px;overflow:hidden}
#answerInput{min-height:44px;padding:8px 12px}
.input-tools button{min-height:26px}
.choice-play .input-dock{padding:5px 9px max(5px,env(safe-area-inset-bottom))}
.answer-choices{grid-auto-rows:50px;min-height:107px;gap:6px}
.answer-choices button{height:50px;min-height:50px;padding:5px 8px;font-size:13px;line-height:1.25}
.choice-status{height:18px;min-height:18px;margin-top:3px}
@media(max-width:680px){
 .game.boss-mode .candidates.hero-duo.cutout-heroes:has(.hero-figure[data-pose="attack"]){left:50%}
 .game.boss-mode .candidates.hero-duo.fused-cutouts:has(.hero-figure[data-pose="attack"]){left:50%}
 .game,.game.choice-play{grid-template-rows:42px 45px minmax(0,1fr) auto}
 .hud{gap:6px;padding:5px 7px}
 .arena-layout{display:block}
 .input-dock{padding:5px 7px max(3px,env(safe-area-inset-bottom))}
 .target-line,.choice-play .target-line{height:38px;min-height:38px;margin-bottom:4px;font-size:10px}
 .target-line #targetClue,.choice-play .target-line #targetClue{max-height:36px}
 .answer-choices{grid-auto-rows:48px;min-height:102px;gap:5px}
 .answer-choices button{height:48px;min-height:48px;font-size:12px}
 .choice-status{height:16px;min-height:16px}
 .input-tools button{min-height:23px}
}
@media(max-height:500px) and (min-width:600px){
 .game,.game.choice-play{grid-template-rows:36px 38px minmax(0,1fr) auto}
 .target-line,.choice-play .target-line{height:28px;min-height:28px}
 .target-line #targetClue,.choice-play .target-line #targetClue{max-height:26px}
 .answer-choices{grid-auto-rows:44px;min-height:44px}
 .answer-choices button{height:44px;min-height:44px}
}
