.ultimate-scene{position:fixed;inset:0;pointer-events:none;z-index:1600;overflow:hidden;background:linear-gradient(#10182b38,transparent 50%)}
.ultimate-caption{position:absolute;left:50%;top:8%;transform:translateX(-50%);padding:12px 24px;border:1px solid #ffe6a3;border-radius:24px;background:#13283de8;color:#fff1b1;font-size:clamp(18px,2.5vw,32px);white-space:nowrap;box-shadow:0 0 28px #ffde7340}
.ultimate-prop{position:absolute;width:220px;height:100px;filter:drop-shadow(0 0 18px #92d9ff);font-size:135px;line-height:.8;text-align:center}
.ultimate-cloud .ultimate-prop{color:#344958;text-shadow:0 -10px 0 #657b8b,30px 0 0 #253744,-30px 0 0 #253744}
.ultimate-gatling .ultimate-prop{width:70px;height:auto;aspect-ratio:1399/1124;filter:drop-shadow(0 0 8px #ffde9570)}
.gatling-art{display:block;width:100%;height:auto;max-width:none;object-fit:contain}
.ultimate-hammer .ultimate-prop{font-size:80px;opacity:.8}
.ultimate-hit{position:fixed;pointer-events:none;z-index:1700;width:75px;height:100px;transform:translate(-50%,-50%)}
.ultimate-hit.cloud{height:260px;margin-top:-95px;filter:drop-shadow(0 0 12px #77cfff)}
.ultimate-hit svg{width:100%;height:100%}
.ultimate-hit.hammer{font-size:70px;color:#ffe794;text-shadow:0 0 20px #ffb443;animation:hammer-star .6s both}
@keyframes hammer-star{from{transform:translate(-50%,-50%) scale(.3)}to{transform:translate(-50%,-70%) scale(1.4);opacity:0}}
.ultimate-hammer-actor{position:fixed;pointer-events:none;z-index:1750}.ultimate-hammer-actor .fighter{width:100%;height:100%}
.ultimate-hammer-actor .ultimate-hammer{position:absolute;right:-35px;top:-35px;font-size:65px;transform-origin:15% 80%;animation:hammer-swing .6s}
@keyframes hammer-swing{0%,20%{transform:rotate(-70deg)}55%{transform:rotate(30deg)}75%,100%{transform:rotate(-20deg)}}
.ult-excited .figure-wrap{animation:ult-laugh .24s alternate infinite!important}@keyframes ult-laugh{to{transform:translateY(-8px) rotate(6deg)}}
.ultimate-lock{position:fixed;inset:0;z-index:1500;cursor:wait;background:transparent;display:flex;align-items:flex-end;justify-content:center;padding-bottom:7vh;pointer-events:all}
.ultimate-lock p{background:#172b42e8;color:white;border-radius:18px;padding:12px 24px;backdrop-filter:blur(14px)}
.ultimate-choices{display:flex;gap:16px;justify-content:center;flex-wrap:wrap}.ultimate-choices button{min-width:150px;padding:20px;background:#182d44e8;color:#fff3bb;border:2px solid #e9cb73;border-radius:20px;font-size:22px}
.charge-option{border-color:#d1a5ff!important}.charge-meter{color:#e9bdff;font-weight:bold}
.battle-screen.ultimate-active .arena-bottom{visibility:hidden}.battle-screen.ultimate-active #voice-panel{pointer-events:none;visibility:hidden}
@media(prefers-reduced-motion:reduce){.ult-excited .figure-wrap{animation:none!important}.ultimate-hit{filter:none}.ultimate-prop{filter:none}}

.spell-grid:has(.charge-option){grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-height:500px){.ultimate-choices button{padding:12px;font-size:18px}.ultimate-caption{top:3%;padding:8px 16px;font-size:20px}.ultimate-lock{padding-bottom:3vh}}
.battle-screen .round-battle.phase-ultimate .arena-bottom{left:50%;right:auto;top:50%;bottom:auto;transform:translate(-50%,-50%);width:min(80vw,650px);max-height:75dvh;overflow:auto;padding:20px!important;background:linear-gradient(135deg,#234650ec,#182b43eb)!important;backdrop-filter:blur(18px);border:1px solid #c5e4f488!important;border-radius:24px;pointer-events:auto;z-index:40}
.battle-screen .ultimate-choices button{background:#24465ee6!important;opacity:.95!important;box-shadow:0 4px 15px #00172555!important;border:2px solid #f1d080!important;color:#fff4cb!important;font-weight:800;min-height:90px;padding:16px!important;border-radius:18px!important;text-shadow:none!important}
.battle-screen .phase-ultimate h2{font-size:clamp(22px,3vw,32px);color:#fff3c4;margin:0 0 20px}
.battle-screen .ultimate-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.battle-screen .ultimate-choices button{min-width:0;font-size:clamp(16px,2.5vw,24px)}
@media(max-height:500px){.battle-screen .round-battle.phase-ultimate .arena-bottom{padding:12px!important;max-height:84dvh}.battle-screen .ultimate-choices button{min-height:65px;padding:10px!important}.battle-screen .phase-ultimate h2{margin-bottom:10px}}

/* A mirrored rig keeps the muzzle flash and recoil attached to either barrel direction. */
.gatling-rig,.gatling-kick{position:relative;width:100%;height:100%;transform-origin:42% 55%;will-change:transform}
.gatling-muzzle{position:absolute;left:97.3%;top:22%;width:60%;pointer-events:none;opacity:0;transform:translate(-5.5%,-50%) scale(var(--flame-x,1),var(--flame-y,1));transform-origin:5.5% 50%;will-change:transform,opacity}
.gatling-muzzle img{display:block;width:100%;height:auto}
.gatling-firing .gatling-art{filter:drop-shadow(2px 0 3px #ffbc7155)}
.gatling-dust{position:absolute;pointer-events:none;z-index:1}
.gatling-dust>img{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:fill;transform:translate(-50%,-100%);transform-origin:50% 100%;will-change:transform,opacity}
.gatling-ground-puff{position:absolute;left:0;top:0;width:115%;height:16%;border-radius:50%;background:radial-gradient(ellipse,#f4eedcc0,#d6c7a650 45%,transparent 72%);animation:gatling-ground-puff .55s ease-out both}
@keyframes gatling-ground-puff{from{transform:translate(-50%,-35%) scale(.3);opacity:.8}to{transform:translate(-50%,-35%) scale(1.8);opacity:0}}
.ultimate-gatling .ultimate-prop{z-index:2}.ultimate-caption{z-index:3}
@media(prefers-reduced-motion:reduce){.gatling-ground-puff{animation:none;opacity:.15}.gatling-rig,.gatling-kick,.gatling-muzzle{will-change:auto}}

.ult-gunner .figure-wrap{animation:none!important}
.ult-gunner .held-fire{visibility:hidden}
.ult-gunner .casting-arm{animation:gunner-grip .18s ease-in-out alternate infinite}
@keyframes gunner-grip{from{transform:rotate(-3deg)}to{transform:rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.ult-gunner .casting-arm{animation:none!important}}

/* Single-target cinematic. Only the combatants' copies animate during the global pause. */
.ultimate-active .round-fighter *, .battle-warning .round-fighter *{animation-play-state:paused!important}
.punch-source-hidden>.figure-wrap{visibility:hidden!important}
.ultimate-punch{background:#04061240}.ultimate-punch.punch-intro{background:#000}
.punch-closeup{position:absolute;inset:0;display:grid;place-items:center;overflow:hidden;background:radial-gradient(ellipse at 50% 55%,#352b66 0,black 67%)}
.punch-closeup[hidden],.ultimate-punch-actor[hidden]{display:none!important}
.punch-portrait{position:relative;height:76vh;width:52vh;z-index:2;filter:drop-shadow(0 0 20px #e4b6ff)}
.punch-portrait .fighter,.ultimate-punch-actor .fighter{width:100%!important;height:100%!important;animation:none!important;max-width:none!important}
.punch-portrait .sprite-svg,.ultimate-punch-actor .sprite-svg{width:100%;height:100%;max-width:none}
.punch-energy{position:absolute;left:50%;top:50%;width:110vmax;height:110vmax;transform:translate(-50%,-50%);background:repeating-conic-gradient(from 8deg,transparent 0deg 13deg,#fff8e5 14deg 15deg,transparent 16deg 33deg,#be92ffb0 34deg 36deg,transparent 37deg 48deg);mask-image:radial-gradient(circle,white 0 2%,transparent 49%);animation:punch-energy 1.2s ease-out both}
.punch-title{position:absolute;bottom:5vh;left:10%;right:10%;text-align:center;font-size:clamp(26px,5vw,64px);font-weight:1000;color:white;text-shadow:0 0 18px #ae72ff;z-index:3}
@keyframes punch-energy{0%{opacity:0;transform:translate(-50%,-50%) scale(.2)}25%{opacity:1}70%{opacity:.75}100%{opacity:0;transform:translate(-50%,-50%) scale(1.5) rotate(28deg)}}
.ultimate-punch-actor{position:fixed;z-index:4;pointer-events:none;will-change:transform}
.punch-fist{position:absolute;top:34%;left:calc(50% + var(--punch-facing)*30%);font-size:clamp(20px,3vw,48px);opacity:0;transform-origin:0 50%;filter:drop-shadow(0 0 5px #ffd18a)}
.punch-combo .punch-fist{animation:punch-fist .18s infinite linear}.punch-combo .fist-two{top:46%;animation-delay:-.09s}
@keyframes punch-fist{0%{opacity:.2;transform:translateX(0) scale(.7)}50%{opacity:1;transform:translateX(calc(var(--punch-facing)*18px)) scale(1.2)}100%{opacity:0;transform:translateX(0) scale(.6)}}
.punch-impact{position:fixed;z-index:5;width:72px;height:72px;pointer-events:none;color:#fff8bb;filter:drop-shadow(0 0 6px #ff9d3b)}
.punch-impact i{position:absolute;inset:8%;border:3px solid #ffe7a8;border-radius:50%}.punch-impact b{font-size:68px;line-height:1}
.battle-screen .ultimate-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(prefers-reduced-motion:reduce){.punch-energy{animation:none;opacity:.3}.punch-combo .punch-fist{animation:none;opacity:.7}.ultimate-punch-actor{will-change:auto}}
.ultimate-punch-actor>.fighter{transform:scaleX(var(--punch-facing))}
.ultimate-punch-actor .casting-forearm>path:nth-of-type(2),.ultimate-punch-actor .casting-forearm>path:nth-of-type(3),.ultimate-punch-actor .held-fire,.ultimate-punch-actor .held-potion{display:none}
.punch-combo .casting-forearm{transform-origin:115px 126px;animation:punch-arm .18s linear infinite}
@keyframes punch-arm{0%,100%{transform:translate(0,0) rotate(12deg)}50%{transform:translate(12px,-4px) rotate(-18deg)}}
@media(prefers-reduced-motion:reduce){.punch-combo .casting-forearm{animation:none}}

.punch-damage-number{position:fixed;z-index:7;pointer-events:none;font-size:clamp(23px,3vw,40px);font-weight:1000;color:#fff4bd;text-shadow:0 2px 2px #9c281e,0 0 7px #ff633b}

/* Playful targeted ultimate: never intercept clicks or lock the room. */
.dance-ball{position:fixed;z-index:940;pointer-events:none;width:32px;height:32px;border:3px solid white;border-radius:50%;background:conic-gradient(#ff4287,#ffbd21,#eaff54,#3be7b6,#438fff,#bd5cff,#ff4287);box-shadow:0 0 16px #fff,0 0 32px #fc5cdb}
.dance-marker{position:fixed;z-index:930;pointer-events:none;transform:translate(-50%,-50%)}
.dance-marker[hidden],.dance-ball[hidden]{display:none}
.dance-ring{position:absolute;inset:0;border-radius:50%;animation:dance-ring-clockwise 6s linear var(--ring-delay,0s) infinite;will-change:transform}
.dance-ring>i{position:absolute;left:50%;top:50%;width:50%;height:1px;transform-origin:0 0;transform:rotate(var(--angle));color:var(--color)}
.dance-marker i b{display:block;position:absolute;left:88%;top:0;font:900 var(--arrow-size,20px)/1 sans-serif;text-shadow:0 1px 2px #172845,0 0 5px white;transform:translateY(-50%) rotate(180deg);animation:dance-arrow .55s ease-in-out var(--beat) infinite alternate}
.dance-marker strong{position:absolute;top:-37%;left:50%;transform:translateX(-50%);white-space:nowrap;font:bold clamp(12px,2vw,22px)/1.3 sans-serif;color:#fff;paint-order:stroke fill;-webkit-text-stroke:3px #9a36dc;text-shadow:0 3px 6px #38227d}
.dance-moving{animation:dance-abdomen-sway 1s ease-in-out var(--dance-delay,0s) infinite!important;transform-origin:var(--dance-pivot,50% 60%);will-change:transform}
@keyframes dance-ring-clockwise{to{transform:rotate(360deg)}}
@keyframes dance-arrow{to{left:80%;filter:brightness(1.3)}}
@keyframes dance-abdomen-sway{0%,50%,100%{transform:rotate(0deg)}25%{transform:rotate(30deg)}75%{transform:rotate(-30deg)}}
.dance-choice{margin:8px auto;background:linear-gradient(120deg,#a647df,#e85c9b);color:white;border:2px solid #fff2a8}.dance-choice:disabled{opacity:.55}
@media(prefers-reduced-motion:reduce){.dance-moving{animation:dance-gentle 2s ease-in-out infinite!important}.dance-marker i b,.dance-ring{animation:none}@keyframes dance-gentle{50%{transform:translateY(-3px)}}}

/* Only a live 就是你 target owns this temporary skin-preserving joint rig. */
.joint-dance-canvas{position:absolute;pointer-events:none;z-index:2;display:block;max-width:none!important;max-height:none!important}
.joint-dance-active>.sprite-svg>.sprite-body,.joint-dance-active>.sprite-svg>.sprite-wings,.joint-dance-active>.sprite-photo{visibility:hidden}
.joint-dance-active>.held-fire,.joint-dance-active>.held-potion,.joint-dance-active>.cosmetic-charm{z-index:3}
