/* Only a surviving, repeatable defeat adds this existing-engine entry point. */
#retry-coach[hidden]{display:none!important}
#retry-coach{position:fixed;z-index:45;height:44px;min-height:44px;min-width:44px;padding:5px;border:2px solid #8bd5bf;border-radius:6px;background:#193947;color:#c9ffe8;font-size:14px;pointer-events:auto;touch-action:manipulation}
body.playing.retry-ready:not(.mobile-ui) #hud-deploy-count{bottom:calc(100% + 53px)}
body.playing.retry-ready.mobile-portrait #hud-bottom{padding-top:48px}
body.playing.retry-ready.mobile-ui:not(.mobile-portrait) #hud-shop-controls{top:-48px}
body.playing.retry-ready.mobile-ui:not(.mobile-portrait) .shop-area{top:4px}
#result-continue:disabled{opacity:.8;cursor:default}
/* Result confirmation must remain above the shop and inside short screens. */
body.playing #combat-result{position:fixed;z-index:90;max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain}
body.playing.mobile-ui #combat-result{width:min(530px,calc(100vw - 24px));max-height:calc(var(--mobile-vh,100dvh) - 16px);padding:10px 14px;background:#102035f5!important;border:1px solid #91b9b5!important}
body.playing.mobile-ui #combat-result .result-sparkles{display:none}
body.playing.mobile-ui #combat-result #result-title{font-size:30px;letter-spacing:-1px;margin:3px 0}
body.playing.mobile-ui #combat-result #result-description{max-height:110px;overflow:auto;font-size:11px;line-height:1.45;margin:5px 0;padding:8px}
body.playing.mobile-ui #combat-result #result-rewards{margin:6px 0;gap:4px;flex-wrap:wrap;font-size:11px}
body.playing.mobile-ui #combat-result #result-rewards>span{padding:4px 6px}
body.playing.mobile-ui #combat-result #result-continue{position:sticky;bottom:0;z-index:1;display:block;width:100%;min-height:44px;margin-top:6px}
@media(max-height:460px){body.playing.mobile-ui #combat-result #result-description{max-height:72px}body.playing.mobile-ui #combat-result #result-overline{margin:0;font-size:9px}body.playing.mobile-ui #combat-result #battle-analysis-btn{min-height:32px;padding:4px}}
/* Compact content, natural height: the result needs no scrolling at any target size. */
body.playing #combat-result,body.playing.mobile-ui #combat-result{display:flex;flex-direction:column;align-items:stretch;gap:8px;width:min(520px,calc(100vw - 24px));max-height:none;overflow:visible;padding:18px;box-sizing:border-box}
body.playing #combat-result.hidden{display:none}
body.playing #combat-result .result-sparkles{display:none}
body.playing #combat-result #result-title,body.playing.mobile-ui #combat-result #result-title{font-size:clamp(28px,5vw,52px);margin:0;line-height:1.12}
body.playing #combat-result #result-overline,body.playing.mobile-ui #combat-result #result-overline{font-size:11px;margin:0;line-height:1.3}
body.playing #combat-result #result-description,body.playing.mobile-ui #combat-result #result-description{width:auto;min-width:0;max-height:none;overflow:visible;padding:10px;margin:0;font-size:13px;line-height:1.45}
body.playing #combat-result #result-description strong,body.playing.mobile-ui #combat-result #result-description strong{display:block}
body.playing #combat-result .result-badge{float:left;width:36px;height:36px;object-fit:contain;margin-right:6px}
body.playing #combat-result #result-rewards,body.playing.mobile-ui #combat-result #result-rewards{display:flex;flex-wrap:wrap;justify-content:center;gap:4px;margin:0;font-size:12px}
body.playing #combat-result #result-rewards>span,body.playing.mobile-ui #combat-result #result-rewards>span{padding:4px 6px}
body.playing #combat-result #result-continue,body.playing.mobile-ui #combat-result #result-continue{position:static;min-height:44px;width:100%;margin:0;font-size:15px}
body.playing #combat-result #result-life,body.playing.mobile-ui #combat-result #result-life{margin:0;font-size:18px}
@media(max-height:460px){body.playing #combat-result{padding:10px;gap:5px}body.playing #combat-result #result-description,body.playing.mobile-ui #combat-result #result-description{padding:7px;font-size:11px}body.playing #combat-result #result-title,body.playing.mobile-ui #combat-result #result-title{font-size:28px}}
#story-dialogue .story-portrait img{animation:story-zoom 3s ease-out both}
#story-dialogue .story-copy p{animation:story-reveal .65s steps(20,end) both}
@keyframes story-zoom{from{transform:scale(.94)}to{transform:scale(1.035)}}
@keyframes story-reveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
body.playing #combat-result.result-impact:before{inset:10%}
#unit-popover[hidden]{display:none!important}
#unit-popover{position:fixed;z-index:64;box-sizing:border-box;padding:10px;color:#e5f1ed;background:#112a38f5;border:1px solid #a6c7c2;border-radius:9px;box-shadow:0 5px 16px #06121bb0;overflow:auto;overscroll-behavior:contain;font-size:11px;line-height:1.35}
#unit-popover header{display:flex;gap:8px;padding-right:28px;align-items:center}#unit-popover header img{width:48px;height:48px;object-fit:contain;image-rendering:pixelated}#unit-popover header strong{font-size:15px}#unit-popover header span,#unit-popover small{display:block}#unit-popover small{font-size:10px;color:#accbc9}
#unit-popover [data-unit-close]{position:absolute;right:0;top:0;width:44px;height:44px;padding:0;background:transparent;border:0;color:#d7eeeb;font-size:25px}
.unit-pop-stats{display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;margin:6px 0}.unit-pop-stats span{display:flex;justify-content:space-between}.unit-pop-skill p{margin:2px 0 5px}.unit-pop-gear{display:grid;gap:3px;margin-top:6px}.unit-pop-gear>div{display:flex;gap:6px;align-items:center;min-height:25px}.unit-pop-gear img{width:24px;height:24px;object-fit:contain;image-rendering:pixelated}.unit-pop-empty{color:#73949f}
#unit-popover [data-unit-gear]{width:100%;min-height:44px;margin-top:5px;padding:4px;font-size:12px}
