/* QVIRO 1.5.1 battle polish. Scope all changes to the battle screen. */
html:has(#battle.view.active){scroll-padding-bottom:calc(80px + env(safe-area-inset-bottom))}
#battle button{scroll-margin-bottom:calc(80px + env(safe-area-inset-bottom))}
body:has(#battle.view.active) .app{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
#battle.view.active{height:calc(100dvh - 54px - 70px - env(safe-area-inset-top) - env(safe-area-inset-bottom));min-height:718px;padding:6px 10px;gap:4px;overflow:visible;background:radial-gradient(ellipse at 50% 0,#22433e66,transparent 60%)}
#battle .qv-battle-title{min-height:44px;flex-shrink:0}
#battle .qv-arena-label{display:block;font-size:10px;letter-spacing:.12em;color:#adc9ba;margin-bottom:2px}
#battle .qv-battle-title h2{font-size:20px;color:#f5d3a0}
#battle .qv-battle-title .btn{min-height:44px;padding:8px 14px;border-color:#637b70}
#battle .battle-art{flex:0 0 clamp(190px,24dvh,240px);border-color:#a69b6b;border-radius:18px;box-shadow:inset 0 0 26px #03191688,0 5px 18px #0005}
#battle .qv-battle-status{top:8px;bottom:auto;width:calc(50% - 12px);min-width:0;max-width:none;padding:6px 8px;gap:4px;background:linear-gradient(130deg,#102e2aee,#0a2429eb);border-color:#b4c6a94d;border-radius:10px;box-shadow:0 3px 9px #00161377}
#battle .qv-player-hud{left:8px;right:auto}
#battle .qv-enemy-hud{right:8px;left:auto}
#battle .qv-battle-status .row{display:block;font-size:10px;line-height:1.25}
#battle .qv-battle-status strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;margin-bottom:2px}
#battle .qv-battle-status .progress{height:6px;border:1px solid #d3e8c51a}
#battle .qv-battle-status .progress span{filter:none;transition:width .25s ease}
#battle .battle-art .qv-webgl-battle{top:64px;bottom:28px;height:calc(100% - 92px)}
#battle .qv-battle-reserves{position:absolute;left:10px;bottom:8px;z-index:5;display:flex;gap:12px;padding:4px 8px;font-size:11px;background:#092b2cde;border:1px solid #95cbb348;border-radius:8px;pointer-events:none}
#battle .qv-battle-turn{left:auto;right:10px;top:auto;bottom:8px;max-width:56%;padding:4px 8px;color:#ffe3b1;border-color:#c3ad764d;font-size:11px}
#battle .qv-battle-feedback{left:72%;top:58%;padding:6px 9px;font-size:18px;max-width:64%;white-space:normal;line-height:1.1;background:#15272aee}
#battle .qv-battle-feedback[data-target="hero"]{left:27%}
#battle .battle-art.enemy-attacking{animation:none}
#battle .battle-art.enemy-attacking #qv-fighter{animation:qv-hero-recoil .83s ease-in-out}
#battle .battle-art.enemy-attacking #enemyart{animation:qv-enemy-lunge .83s ease-in-out}
#battle .battle-art.enemy-attacking .qv-hit-ring{animation:qv-counter-flash .83s ease-out;background:radial-gradient(circle at 27% 58%,#ffdcb377,#e67c2900 48%)}
#battle .battle-art #qv-fighter{position:absolute;left:10%;top:64px;bottom:30px;height:auto;width:29%;max-width:none}
#battle .battle-art #qv-fighter svg{max-height:100%;max-width:100%;width:auto;height:100%}
#battle .battle-art #enemyart{position:absolute;left:54%;top:68px;bottom:34px;height:auto;width:39%;max-width:none}
#battle .qv-gem-legend{gap:5px}
#battle .qv-gem-guide{min-height:50px;padding:4px 1px;border-color:#618779;background:linear-gradient(150deg,#29453d,#112c2d);border-radius:10px;touch-action:manipulation}
#battle .qv-gem-guide>span{display:grid;place-items:center;height:20px;font-size:19px;filter:none}
#battle .qv-gem-guide svg{width:21px;height:23px;filter:drop-shadow(0 1px 2px #0008)}
#battle .qv-gem-guide strong{font-size:10px;color:#edf4df}
#battle .qv-gem-guide small{font-size:9px;color:#c2d8c8}
#battle #qv-gem-tip{font-size:11px;white-space:normal;overflow:visible;min-height:28px;line-height:1.25;color:#d1dfd4}
#battle #battlemsg{font-size:11px;line-height:1.25;min-height:14px;color:#f2cd93}
#battle .board{padding:5px;width:100%;max-width:440px;min-height:298px;gap:4px;border:1px solid #8b966459;border-radius:15px;background:linear-gradient(135deg,#58614a,#152e2d 12%,#0c2124 85%,#687557);box-shadow:inset 0 2px 7px #0008,0 4px 12px #0004;overflow:hidden}
#battle .gem{border-radius:9px;box-shadow:inset 0 1px #ffffff30,inset 0 -3px #0003,0 2px 3px #0006;touch-action:manipulation}
#battle .gem svg{width:76%;height:78%;max-width:39px;max-height:41px}
#battle .gem.g0{background:linear-gradient(145deg,#235770,#102f42);border-color:#6fb8d1}
#battle .gem.g1{background:linear-gradient(145deg,#7b4931,#412c27);border-color:#d6a06a}
#battle .gem.g2{background:linear-gradient(145deg,#366a46,#183c32);border-color:#8bbd8a}
#battle .gem.g3{background:linear-gradient(145deg,#75612b,#403b24);border-color:#d5bf6b}
#battle .gem.g4{background:linear-gradient(145deg,#526778,#233e4a);border-color:#99c6d0}
#battle .gem:disabled{opacity:1}
#battle .gem.selected,#battle .gem:focus-visible{outline:3px solid #ffe6a5;outline-offset:-3px;filter:brightness(1.25);box-shadow:inset 0 0 12px #f6cc6b55}
#battle .qv-battle-actions{gap:8px;min-height:44px}
#battle .qv-battle-actions .btn{min-height:44px;max-height:none;padding:8px;font-size:12px;border-radius:12px}
#battle .qv-battle-actions .btn:not(:disabled){background:linear-gradient(135deg,#476954,#21433c);border-color:#e5c98d;color:#fff0cd;box-shadow:inset 0 1px #ffebaf33}
@keyframes qv-enemy-lunge{0%,100%{translate:0}40%{translate:-55% 0}65%{translate:-15% 0}}
@keyframes qv-hero-recoil{0%,35%,100%{translate:0}48%{translate:-12% 0}}
@keyframes qv-counter-flash{0%,30%,100%{opacity:0;transform:scale(1)}42%{opacity:1;transform:scale(1)}}
@media(max-height:760px){
 #battle.view.active{gap:4px;min-height:680px}
 #battle .battle-art{flex-basis:164px}
 #battle .qv-gem-guide{min-height:44px;padding:1px;gap:0}
 #battle .qv-gem-guide>span{height:18px}
 #battle .qv-gem-guide svg{height:19px;width:18px}
 #battle .qv-gem-guide strong{font-size:9px}
 #battle .qv-gem-guide small{font-size:8px}
 #battle .battle-art .qv-webgl-battle{top:53px;bottom:24px;height:calc(100% - 77px)}
 #battle .qv-battle-status{top:5px;padding:4px 6px}
 #battle .battle-art #qv-fighter{top:52px;bottom:24px}
 #battle .battle-art #enemyart{top:56px;bottom:25px}
}
@media(max-width:350px){
 #battle.view.active{padding-inline:6px}
 #battle .qv-gem-guide svg{width:18px}
 #battle .qv-battle-status strong{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
 #battle .gem{transition:none!important}
 #battle .qv-battle-feedback.is-visible{animation:none;opacity:1;transform:translate(-50%,-50%)}
}
