#ua-finisher-stage,#ua-finisher-picker{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(1,7,17,.94);z-index:200000;font-family:"Microsoft JhengHei",sans-serif}
#ua-finisher-stage{touch-action:none;overscroll-behavior:contain}
.ua-finisher-frame{position:relative;width:96vw;height:96vh;height:96dvh;overflow:hidden;background:#061425;border:1px solid #335a6d;box-shadow:0 0 80px #062a3d}
.ua-finisher-frame>canvas,.ua-finisher-frame>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.ua-finisher-label{position:absolute;bottom:9%;left:5%;right:5%;z-index:1;color:#e4fbff;font-size:clamp(22px,4vw,42px);text-shadow:0 2px 12px #001520;text-align:center}
#ua-finisher-picker{background:#000b;z-index:200001;padding:16px;box-sizing:border-box}
#ua-finisher-picker section{width:min(580px,100%);max-height:90vh;max-height:90dvh;overflow:auto;box-sizing:border-box;padding:24px;background:var(--b-cream,#f5f1e8);color:var(--b-black,#151515);border:3px solid #111;box-shadow:7px 7px #0007}
#ua-finisher-picker h2{margin:0 0 14px;font-size:24px}
#ua-finisher-picker p{font-size:13px;line-height:1.7}
.ua-finisher-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
#ua-finisher-picker button{cursor:pointer;font:inherit;border:2px solid #444;padding:10px;background:#fff;color:#111}
.ua-finisher-choices button{min-height:92px;display:flex;flex-direction:column;justify-content:center;gap:8px;font-weight:bold!important}
.ua-finisher-choices button[aria-pressed="true"]{outline:3px solid #15849c;outline-offset:2px;background:#dff9ff!important}
.ua-finisher-choices img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;background:#061425}
#ua-finisher-picker label{display:flex;flex-direction:column;gap:8px;font-size:14px}
#ua-finisher-picker select{font:inherit;max-width:100%;padding:8px}
.ua-finisher-saved{min-height:22px;color:#155668}
.ua-finisher-close{width:100%}
.ua-finisher-choice{display:flex;flex-direction:column;gap:8px;min-width:0}.ua-finisher-choice>button[data-id]{flex:1;width:100%}.ua-finisher-choices .ua-finisher-audition{min-height:0;align-items:center;font-size:13px!important;background:#e9f5f7!important}
#ua-finisher-preview{position:fixed;inset:0;z-index:200002;background:#020812f5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:12px;box-sizing:border-box;color:#e4fbff;font-family:"Microsoft JhengHei",sans-serif}#ua-finisher-preview .ua-finisher-frame{width:96vw;height:80vh;height:80dvh}.ua-finisher-preview-controls{display:flex;gap:12px}.ua-finisher-preview-controls button{padding:10px 22px;border:1px solid #72b2c4;background:#152f42;color:#e4fbff;font:inherit;cursor:pointer}.ua-finisher-preview-controls button:disabled{opacity:.45;cursor:default}.ua-finisher-preview-status{margin:0;font-size:14px}

/* Battle-only return: bloom for 300 ms, dissolve to the board for 300 ms. */
#ua-finisher-stage[data-exit]{animation:ua-finisher-return var(--finisher-exit-duration) linear var(--finisher-exit-delay) both}
#ua-finisher-stage[data-exit="bloom"]::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at 50% 48%,#fff 0%,var(--finisher-exit-color) 60%);animation:ua-finisher-bloom var(--finisher-exit-duration) ease-out var(--finisher-exit-delay) both}
@keyframes ua-finisher-bloom{0%{opacity:0}50%,100%{opacity:1}}
@keyframes ua-finisher-return{0%,50%{opacity:1}100%{opacity:0}}

/* Battle-only entry; preview renders its original opening without a mask. */
#ua-finisher-stage[data-entry] .ua-finisher-frame{animation:ua-finisher-enter var(--finisher-entry-duration) ease-out var(--finisher-entry-offset) both}
#ua-finisher-stage[data-entry="reveal"]::before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,#b9efff55,transparent 70%);animation:ua-finisher-entry-light var(--finisher-entry-duration) ease-out var(--finisher-entry-offset) both;z-index:1}
@keyframes ua-finisher-enter{from{opacity:0;transform:scale(.985)}to{opacity:1;transform:scale(1)}}
@keyframes ua-finisher-entry-light{0%{opacity:0}35%{opacity:.6}100%{opacity:0}}
#ua-finisher-stage[data-entry]{background:transparent}
#ua-finisher-stage[data-entry] .ua-finisher-frame{box-shadow:0 0 80px #062a3d;background:#061425}

#ua-finisher-stage .ua-finisher-backdrop{position:absolute;inset:0;background:rgba(1,7,17,.94);animation:ua-finisher-backdrop var(--finisher-entry-duration,300ms) ease-out var(--finisher-entry-offset,0ms) both}
@keyframes ua-finisher-backdrop{from{opacity:0}to{opacity:1}}
#ua-finisher-stage[data-entry="quiet"] .ua-finisher-frame{animation-name:ua-finisher-backdrop}

.ua-finisher-choice{position:relative}
#ua-finisher-picker .ua-finisher-star{position:absolute;top:20px;left:20px;z-index:2;display:flex;align-items:center;justify-content:center;width:36px;height:36px;min-height:0;padding:0;border:1px solid #ffffffb3;border-radius:10px;background:#112330df;color:#fff;font-size:25px!important;line-height:1;box-shadow:0 2px 7px #0006;touch-action:manipulation}
#ua-finisher-picker .ua-finisher-star:hover{background:#274957}
#ua-finisher-picker .ua-finisher-star:focus-visible{outline:3px solid #50d6f2;outline-offset:2px}
#ua-finisher-picker .ua-finisher-star[aria-pressed="true"]{color:#ffd761!important;background:#30250aeb!important;border-color:#ffd761}
.ua-finisher-pool-status{font-weight:bold;color:#155668}
