/* QA30: DQ-inspired front view. Two readable status/command windows; one large enemy. */
#battle{padding:0!important;display:block!important;overflow:hidden;background:linear-gradient(180deg,#152038 0%,#273547 49%,#272c2d 72%,#111923 100%);font-family:system-ui,-apple-system,'Noto Sans JP',sans-serif}
#battle.hidden{display:none!important}
#battle .dq-scene{position:absolute;inset:0;overflow:hidden;background:radial-gradient(ellipse at 51% 39%,#485269 0%,#27354d 38%,#0c192a 98%);pointer-events:none}
#battle .dq-mist{position:absolute;left:0;right:0;top:14%;height:54%;background:repeating-linear-gradient(0deg,transparent 0 7px,#bac5ba08 8px 9px),radial-gradient(ellipse at 32% 87%,#b1b4ae40,transparent 58%);opacity:.55}
#battle .dq-ridge{position:absolute;left:-3%;width:106%;height:39%;bottom:20%;background:#162331;clip-path:polygon(0 50%,8% 28%,17% 46%,25% 7%,34% 48%,43% 24%,54% 51%,66% 17%,78% 43%,88% 12%,100% 44%,100% 100%,0 100%)}
#battle .ridge2{bottom:15%;opacity:.64;transform:scaleX(-1);background:#17291f;filter:brightness(1.15)}
#battle .dq-ground{position:absolute;bottom:0;left:0;right:0;height:40%;background:repeating-linear-gradient(88deg,#15251b12 0 19px,#8a8c6e0a 20px 22px),linear-gradient(#27362f 0%,#252e25 20%,#171f1b 98%);border-top:2px solid #75826c7a}
#battle .dq-status,#battle .dq-commands,#battle .dq-log{position:absolute;background:rgba(9,15,24,.94);border:2px solid #d3c9a8;border-radius:5px;box-shadow:0 0 0 2px #39404a,0 5px 15px #0008;color:#faf5e9;z-index:2;box-sizing:border-box}
#battle .dq-smalltitle{font-size:13px;color:#dcd9bc;opacity:.87;letter-spacing:.08em;margin-bottom:6px;white-space:nowrap}
#battle .dq-status{top:4%;right:3%;width:51%;padding:11px 13px 9px}
#battle .partyBattlers{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px 12px;width:100%!important;max-height:none!important}
#battle .battlehero{display:grid!important;grid-template-columns:15px minmax(62px,1.1fr) minmax(66px,1fr) minmax(63px,1fr);align-items:center;gap:4px!important;background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;min-width:0!important;padding:3px 2px!important;width:100%!important;min-height:21px;white-space:nowrap;color:#f6f4ee}
#battle .battlehero b{font-size:15px!important;font-weight:600;white-space:nowrap!important;flex:initial!important}
#battle .turn-cursor{color:#fae39b;font-size:12px}
#battle .stat-pair{display:flex;align-items:center;gap:3px;font-size:11px;color:#dfe2e3;min-width:0}
#battle .stat-pair strong{font-size:12px;color:#fff}
#battle .meter{display:block;flex:1;height:4px;min-width:8px;background:#28353e;border-radius:2px;overflow:hidden}
#battle .meter i{display:block;height:100%;background:#83c08e}
#battle .meter.mp i{background:#8aafd3}
#battle .battlehero.turn{background:#c3ad7830!important}
#battle .battlehero.ko{opacity:.5;filter:grayscale(1)}
#battle .battleenemy{position:absolute;top:17%;left:17%;width:43%!important;height:52%;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:6px;z-index:1;text-shadow:0 2px 5px black}
#battle .enemyicon.has-enemy-art{flex-shrink:0;width:clamp(155px,22vw,245px)!important;height:clamp(145px,32vh,222px)!important;max-height:67%;animation:dq-idle 1.5s ease-in-out infinite alternate!important;filter:drop-shadow(0 12px 8px #040710ce)}
#battle .enemyicon .qa22-enemy-art{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
#battle .enemyname{font-size:18px;white-space:nowrap;letter-spacing:.05em;color:#f9efd7}
#battle .hpbar{height:7px;width:68%;max-width:160px;background:#151923;border:1px solid #b6a886;border-radius:3px;overflow:hidden}
#battle .hpbar i{background:#b8d08a}
#battle .dq-commands{left:2.5%;bottom:4%;width:31%;height:29%;padding:10px 13px}
#battle .dq-commands .command-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,1fr);gap:3px 10px;height:calc(100% - 20px)}
#battle .command-grid button{background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:1px 2px!important;font-size:16px!important;text-align:left;white-space:nowrap;overflow:visible;min-width:0;min-height:28px;color:#fff8e9!important;transform:none!important}
#battle .command-grid button:hover,#battle .command-grid button:focus-visible{color:#f9ce76!important;outline:1px solid #c9b481}
#battle .command-grid button small{font-size:10px!important;line-height:1.2;color:#b9d6d4;white-space:nowrap;display:block}
#battle .dq-log{right:2.5%;bottom:4%;width:62%;height:29%;padding:10px 15px}
#battle .dq-log p{font-size:17px!important;line-height:1.65;white-space:normal;margin:0!important;max-height:100%;overflow:hidden;color:#f8f1e3}
@keyframes dq-idle{from{transform:translateY(1px)}to{transform:translateY(-4px)}}
#battle .dq-hit{animation:dq-enemy-hit .35s steps(3,end)!important}
@keyframes dq-enemy-hit{0%,100%{filter:brightness(1);transform:translateX(0)}25%,75%{filter:brightness(3);transform:translateX(-8px)}50%{filter:brightness(.4);transform:translateX(9px)}}
#battle .dq-hurt{animation:dq-party-hurt .35s ease-out}
@keyframes dq-party-hurt{0%{background:#cf555571}100%{background:transparent}}
#battle .dq-damage{position:absolute;top:-8%;left:70%;font-weight:900;color:#ffe18d;font-size:24px;pointer-events:none;animation:dq-damage-up .85s ease-out forwards}
@keyframes dq-damage-up{to{opacity:0;transform:translateY(-28px)}}
@media(max-width:800px),(max-height:450px){
 #battle .dq-status{top:3%;right:2%;width:51%;padding:7px 8px}
 #battle .dq-smalltitle{font-size:11px;margin-bottom:3px}
 #battle .partyBattlers{gap:1px 6px}
 #battle .battlehero{grid-template-columns:10px minmax(36px,1fr) minmax(35px,1fr) minmax(33px,1fr);gap:2px!important;padding:1px!important;min-height:18px}
 #battle .battlehero b{font-size:12px!important}
 #battle .stat-pair{font-size:9px;gap:2px}
 #battle .stat-pair strong{font-size:10px}
 #battle .meter{display:none}
 #battle .battleenemy{top:12%;height:59%;left:12%;width:47%!important}
 #battle .enemyicon.has-enemy-art{width:clamp(130px,23vw,200px)!important;height:clamp(120px,29vh,180px)!important}
 #battle .enemyname{font-size:14px}
 #battle .dq-commands{padding:6px 9px;height:32%;bottom:3%;width:34%}
 #battle .dq-commands .command-grid{height:calc(100% - 15px);gap:0 6px}
 #battle .command-grid button{font-size:13px!important;min-height:20px}
 #battle .command-grid button small{font-size:8px!important}
 #battle .dq-log{bottom:3%;right:2%;width:60%;height:32%;padding:6px 10px}
 #battle .dq-log p{font-size:13px!important;line-height:1.38}
}
/* Overrides the inherited five-column battleactions grid. Without this,
   the new command panel's children squeeze into a single 1/5 column. */
#battle .dq-commands.battleactions{display:block!important;grid-template-columns:none!important}
#battle .dq-commands .command-grid{width:100%}
#battle .dq-commands .command-grid button{min-width:0;overflow:hidden;text-overflow:clip}
