/* DS-inspired battle presentation. Scoped to battle displays and controls. */
.top-display:has(#screen[data-scene="battle"]) .display-dialogue{height:78px;background:#24272c;border-top:3px solid #8d939c}
.top-display:has(#screen[data-scene="battle"]) .dialogue{background:linear-gradient(110deg,#343a40,#21252b);color:#fffdf0;box-shadow:inset 0 0 0 2px #9da8b2;padding:10px 12px;text-shadow:1px 1px #111}
.top-display:has(#screen[data-scene="battle"]) .dialogue .speaker{color:#c5cfda;font-size:11px;margin-bottom:3px}
.top-display:has(#screen[data-scene="battle"]) .dialogue .battle-message{float:none;width:100%;padding:0!important;font-size:20px!important}

/* Slim, angled status plates. No HUD element spans the battlefield center. */
.dual-console :is(.battle-panel,.double-hp){background:linear-gradient(#fcfcf2 0 58%,#dce1d8 58%);color:#222c32;border:2px solid #313a42;border-radius:0;box-shadow:2px 3px #15232c80;padding:4px 7px;min-width:0;width:46%;max-width:46%;line-height:1;clip-path:polygon(7px 0,calc(100% - 7px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 7px) 100%,7px 100%,0 calc(100% - 7px),0 7px)}
.dual-console .battle-panel.enemy{left:2%;top:10%}
.dual-console .battle-panel.ally{right:2%;bottom:10%}
.dual-console :is(.battle-panel,.double-hp) .bp-title{display:flex;align-items:center;justify-content:space-between;gap:3px;min-height:16px}
.dual-console :is(.battle-panel,.double-hp) .battle-identity{flex:1;min-width:0;display:flex}
.dual-console :is(.battle-panel,.double-hp) .battle-name{font-size:clamp(13px,3.6cqw,18px);line-height:1.05;gap:2px}
.dual-console :is(.battle-panel,.double-hp) .bp-title>small{display:block;font-size:clamp(10px,2.6cqw,13px);line-height:1;white-space:nowrap;margin:0;flex:none}
.dual-console :is(.battle-panel,.double-hp) .health{display:flex;align-items:center;gap:4px;margin:3px 0;line-height:1;font-size:11px;color:#866e25}
.dual-console :is(.battle-panel,.double-hp) .hp{height:7px;min-width:0;flex:1;border:1px solid #263b39;background:#273e36;padding:1px;border-radius:0;margin:0}
.dual-console :is(.battle-panel,.double-hp) .hp i{display:block;height:100%;box-shadow:inset 0 1px #ffffff75}
.dual-console .ds-hud-footer{display:flex;justify-content:space-between;align-items:center;gap:3px;min-height:13px}
.dual-console .ds-hud-footer .battle-types{display:flex;flex-wrap:nowrap;gap:2px;min-width:0}
.dual-console .ds-hud-footer .type{font-size:clamp(9px,2.35cqw,12px);line-height:1;padding:1px 2px;box-shadow:none;border-width:1px;margin:0;white-space:nowrap}
.dual-console .ds-hud-footer .hp-value{font-size:clamp(10px,2.7cqw,14px);line-height:1;white-space:nowrap;margin:0;flex:none}
.dual-console .ds-hud-footer .caught-mark{position:static;font-size:9px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;min-width:0}
.dual-console .battle-panel .xp{height:3px;margin-top:3px;background:#687889;border:0}
.dual-console .battle-panel .xp i{height:3px;background:#45a4f1}
.dual-console .bp-changes{margin-top:2px;gap:2px;max-height:13px;overflow:hidden}
.dual-console .bp-changes .stat-stage,.dual-console .bp-changes .stat-more{font-size:9px;padding:0 2px;line-height:11px}
.dual-console .double-hp{width:46%;max-width:46%;padding:3px 5px}
.dual-console .double-hp.foe{left:2%;right:auto;bottom:auto}
.dual-console .double-hp.foe.slot-0{top:9%}
.dual-console .double-hp.foe.slot-1{top:31%}
.dual-console .double-hp.own{right:2%;left:auto;top:auto}
.dual-console .double-hp.own.slot-0{bottom:29%}
.dual-console .double-hp.own.slot-1{bottom:7%}
.dual-console .double-hp .battle-name{font-size:clamp(12px,3.3cqw,17px)}
.dual-console .double-hp.choosing{border-color:#cf8b25;background:linear-gradient(#fff9d6 0 58%,#eddfa7 58%)}
.dual-console .double-hp.choosing .battle-name:before{content:'▸';color:#9c5a06;flex:none;font-size:12px}
.ds-stage-mark{color:#85418f;font-size:11px}
.ds-status[data-status]:not([data-status=""]){padding:1px 2px;color:#fff;background:#86509e;border-radius:1px}
.ds-status[data-status="burn"]{background:#bd302d}.ds-status[data-status="paralysis"]{background:#8a6a18}.ds-status[data-status="freeze"]{background:#337e9c}.ds-status[data-status="sleep"]{background:#586986}
.dual-console #battle-team-row{left:3%;top:0;height:8%}
.dual-console #battle-player-team-row{right:3%;bottom:1%;height:7%}
.dual-console #battle-field-state{z-index:3;font-size:clamp(10px,2.5cqw,13px);padding:2px 4px;bottom:auto;top:0;left:auto;right:2%;width:auto;max-width:48%;background:#1e2a35e8}
.dual-console #battle-hud:has(#battle-field-state:not([hidden])) #battle-player-team-row{bottom:1%}

/* Lower touch screen: red action surface, dark type-lined move faces. */
#control-display .command-panel:is([data-kind="battle"],[data-kind="moves"]){padding:10px;background:linear-gradient(165deg,#a5acb4 0 3%,#e0e3df 3% 15%,#30353e 15% 85%,#c8cdc9 85% 97%,#7d8994 97%);color:#f9faf1}
#control-display .ds-command-caption{font:600 11px/1.2 system-ui,sans-serif;letter-spacing:.12em;color:#28343e;text-align:center;margin:0 0 8px}
#control-display .ds-main-controls{grid-template-columns:1fr .86fr 1fr;grid-template-areas:'fight fight fight' 'bag run party';gap:8px}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button{position:relative;isolation:isolate;--ds-edge:#9caab6;--ds-face:#242a31;background:var(--ds-edge);color:#fafaf2;border:0;border-radius:0;box-shadow:none;padding:9px 12px;clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 50%,calc(100% - 10px) 100%,10px 100%,0 50%);text-shadow:1px 2px #111;transition:none}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:before{content:'';position:absolute;inset:2px;z-index:-1;background:linear-gradient(#ffffff08 1px,transparent 1px),linear-gradient(90deg,#ffffff08 1px,transparent 1px),var(--ds-face);background-size:4px 4px,4px 4px,auto;clip-path:inherit;pointer-events:none}
#control-display .ds-main-controls #fight,#control-display .ds-online-controls #online-fight{grid-area:fight;grid-column:1/-1;--ds-edge:#572435;--ds-face:linear-gradient(#ea3653,#b50e32 58%,#6c122b);background:var(--ds-edge);border:0;min-height:78px;color:#fff8e7;font-size:32px;letter-spacing:2px}
#control-display :is(#fight,#online-fight) small{display:block;color:#ffddd8;font:12px/1.3 system-ui,sans-serif;letter-spacing:.05em;margin-top:3px;text-shadow:none}
#control-display .ds-main-controls #battle-bag{grid-area:bag;background:#c9ac55;--ds-edge:#c9ac55;color:#ffdf76;font-size:22px;min-height:60px}
#control-display .ds-main-controls #run{grid-area:run;background:#78a7be;--ds-edge:#78a7be;color:#8ddcfa;font-size:19px;min-height:60px}
#control-display .ds-main-controls #battle-party{grid-area:party;background:#79b978;--ds-edge:#79b978;color:#b9f09d;font-size:20px;min-height:60px}
#control-display .ds-utility-controls,#control-display .ds-move-tools{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-top:12px}
#control-display :is(.ds-utility-controls,.ds-move-tools) button{min-height:44px;padding:7px 4px;font-size:16px;line-height:1.1;text-align:center;background:#222c37;border:1px solid #96a5b6;color:#f4f4e9;box-shadow:inset 0 -3px #111827;border-radius:0;overflow-wrap:normal}
#control-display .ds-utility-controls #battle-unbound{color:#e8c9ff;border-color:#bd93e0;gap:3px;font-size:16px}
#control-display .ds-utility-controls #battle-unbound img{width:18px;height:18px}
#control-display .ds-utility-controls #battle-forfeit{color:#ffc3b8;border-color:#b0807c}
#control-display .ds-battle-details{margin-top:10px;color:#e2e7eb;background:#242c35;border:1px solid #84909a}
#control-display .ds-battle-details summary{padding:9px;min-height:38px;cursor:pointer;font:13px/1.4 system-ui,sans-serif}
#control-display .ds-battle-details .live-battle-changes{margin:0;padding:8px;background:#e8eeef;color:#253742}
#control-display .ds-battle-details .battle-condition-readout{padding:8px;color:#fff3c5;font-size:14px}
#control-display .move-controls{gap:10px 8px;padding:2px 0}
#control-display .move-controls button.ds-move{--ds-edge:var(--move-type,#a8b2bc);background:var(--ds-edge);border:0;text-align:left;min-height:82px;padding:10px 13px;color:#fffef1;font-size:21px}
#control-display .move-controls .ds-move-name{display:block;font-size:clamp(17px,4.8cqw,23px);line-height:1.05;overflow-wrap:normal;word-break:normal;margin-bottom:6px}
#control-display .move-controls .ds-move-meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:3px 5px;line-height:1.1}
#control-display .move-controls .ds-move-types{display:flex;flex-wrap:wrap;gap:2px}
#control-display .move-controls .ds-type{display:inline-block;background:var(--type-color);border:1px solid #eaf4ff77;padding:2px 3px;color:#fff;font-size:12px;line-height:1;text-shadow:1px 1px #172132;white-space:nowrap}
#control-display .move-controls .ds-pp{color:#f4f3e9;font-size:15px;white-space:nowrap;text-shadow:none}
#control-display .move-controls .ds-move-extra{display:block;color:#d2dce6;font:11px/1.25 system-ui,sans-serif;margin-top:5px;text-shadow:none}
#control-display .move-controls .unbound-move{grid-column:1/-1;min-height:64px;--ds-face:#342543}
#control-display .move-controls .unbound-move .ds-move-name{color:#f2dbff}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:is(.control-selected,:focus-visible){background:#fff2ad!important;color:#fff!important;outline:0;--ds-edge:#fff2ad;filter:drop-shadow(0 0 2px #fff3b0)}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:is(.control-selected,:focus-visible):before{inset:3px}
#control-display :is(.ds-utility-controls,.ds-move-tools) button:is(.control-selected,:focus-visible){background:#42536b!important;color:#fff!important;outline:2px solid #fff0a5;outline-offset:-2px}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls,.ds-utility-controls) button:disabled{opacity:.43;filter:grayscale(.65);cursor:default}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:not(:disabled):active{transform:translateY(1px)}
#control-display .ds-online-controls{grid-template-areas:'fight fight';grid-template-columns:1fr 1fr}
#control-display [data-kind="online-battle"] .ds-online-controls #online-party{background:#79b978;--ds-edge:#79b978;color:#b9f09d}
#control-display [data-kind="online-battle"] .ds-online-controls #online-unbind-toggle{background:#aa89d3;--ds-edge:#aa89d3;color:#ecd1ff}
#control-display [data-kind="online-battle"] .move-controls button.ds-move{border:0}
@container(max-width:350px){
 #control-display .ds-utility-controls button,#control-display .ds-move-tools button{font-size:14px}
 #control-display .move-controls button.ds-move{padding:9px 10px}
 #control-display .move-controls .ds-move-name{font-size:17px}
 .dual-console .ds-hud-footer .type{font-size:9px;padding:1px}
 .dual-console .ds-hud-footer .hp-value{font-size:10px}
}
