/* Battle-only layout: the battlefield stays visible while the lower screen changes. */
/* Pair every inspection surface with its own foreground, independent of the overlay theme. */
#control-display :is(.battle-ability,.double-stat-card,.move-card,.live-battle-changes,.navigator-selection,.navigator-stock-item,.summary-move-detail,.catalog-notes){color:#203744;text-shadow:none}
#control-display .battle-ability :is(summary,.ability-description){color:#203744}
#control-display .battle-stat-table{background:#e3edf2;color:#203744;text-shadow:none}
#control-display .battle-stat-table thead{color:#203744}
#control-display .battle-inspect-detail :is(.move-description,.move-heading,small){color:#edf4f2;text-shadow:none}
.dual-console:has(#screen[data-scene=battle]){--battle-ink:#f7f7ed;--battle-edge:#919da8}
.top-display:has(#screen[data-scene=battle]) .display-dialogue{height:64px}
.top-display:has(#screen[data-scene=battle]) .dialogue{padding:8px 12px;background:linear-gradient(100deg,#27322f,#151c20);box-shadow:inset 0 2px #a5b3aa,inset 0 -2px #111;color:#fff}
.top-display:has(#screen[data-scene=battle]) .dialogue p,.top-display:has(#screen[data-scene=battle]) .dialogue .battle-message{font-size:18px!important;line-height:1.15}
.dual-console #screen[data-scene=battle] .battle-panel{width:43%;max-width:43%;padding:3px 6px;box-shadow:2px 3px #1119}
.dual-console #screen[data-scene=battle] .battle-panel.enemy{top:9%;left:2%}
.dual-console #screen[data-scene=battle] .battle-panel.ally{bottom:9%;right:2%}
.dual-console #screen[data-scene=battle] .bp-changes:empty{display:none}
.dual-console #screen[data-scene=battle] .battle-name{font-size:clamp(12px,3.2cqw,17px)}
.dual-console #screen[data-scene=battle] .health{margin:2px 0}
.dual-console #screen[data-scene=battle] .health>[data-status=burn]{background:#bb302f;color:#fff;padding:1px 3px}
.dual-console #screen[data-scene=battle] .health>[data-status=paralysis]{background:#b88a16;color:#fff;padding:1px 3px}
.dual-console #screen[data-scene=battle] .health>[data-status=poison],.dual-console #screen[data-scene=battle] .health>[data-status=toxic]{background:#86509e;color:#fff;padding:1px 3px}
.dual-console:has(#screen[data-scene=battle]) .trainer-status{background:#20252a;border-bottom:2px solid #87939b;padding:5px 8px;font-size:14px;line-height:1.1}
.dual-console:has(#screen[data-scene=battle]) .touch-screen{height:max(400px,var(--lower-height))}
.dual-console:has(#screen[data-scene=battle]) .touch-controls[data-enabled=true]{display:flex;flex:none;height:56px;gap:6px!important;padding:5px 8px;justify-content:space-between;background:#202830}
.dual-console:has(#screen[data-scene=battle]) .touch-controls .dpad{display:flex;gap:4px}
.dual-console:has(#screen[data-scene=battle]) .touch-controls .dpad button{width:36px;height:40px;min-height:40px}
.dual-console:has(#screen[data-scene=battle]) .touch-controls #back-button,.dual-console:has(#screen[data-scene=battle]) .touch-controls #interact-button{width:44px;height:42px;min-height:42px;min-width:42px}
.dual-console:has(#screen[data-scene=battle]) .touch-help{display:none}
#control-display .command-panel:is([data-kind=battle],[data-kind=moves],[data-kind=battle-message]){display:flex;flex-direction:column;gap:8px;padding:10px;overflow:hidden;background:linear-gradient(170deg,#b50929 0%,#6e1321 24%,#292d31 24.3%,#292d31 87%,#abb1ad 87.4%,#d9ddd7 100%);color:#f7f7ed}
#control-display .command-panel[hidden]{display:none}
#control-display .ds-command-caption{color:#fff6e6;margin:0;font:14px/1.2 Tiny5,monospace;letter-spacing:.06em;flex:none}
#control-display .command-panel .ds-main-controls{flex:1;min-height:0;grid-template-columns:1fr .85fr 1fr;grid-template-rows:minmax(80px,1.7fr) minmax(48px,1fr);grid-template-areas:'fight fight fight' 'bag run party';gap:12px 6px}
#control-display .ds-main-controls #fight{min-height:0;font-size:32px;--ds-edge:#c2c9c6;--ds-face:linear-gradient(#ee183e,#ae0524);clip-path:polygon(0 0,100% 0,100% 78%,64% 78%,59% 100%,41% 100%,36% 78%,0 78%);padding-bottom:20px}
#control-display .ds-main-controls #fight small{display:none}
#control-display .ds-main-controls :is(#battle-bag,#battle-party,#run){min-height:44px;font-size:clamp(16px,5cqw,24px);padding:8px 6px}
#control-display .command-panel .ds-utility-controls,#control-display .command-panel .ds-move-tools{flex:none;margin:0;gap:5px;grid-template-columns:repeat(3,minmax(0,1fr))}
#control-display :is(.ds-utility-controls,.ds-move-tools) button{min-height:40px;padding:5px 3px;font-size:14px;border:2px solid #80939f;background:#182129;color:#f5f5e9;box-shadow:inset 0 -2px #070b10}
#control-display .ds-utility-controls #battle-unbound{font-size:14px}
#control-display .battle-party-balls{display:flex;justify-content:center;gap:5px;height:20px;flex:none;align-items:center}
#control-display .battle-party-balls img{width:18px;height:18px;image-rendering:pixelated}
#control-display .battle-party-balls .fainted{filter:grayscale(1);opacity:.4}
#control-display .battle-party-balls .empty{filter:grayscale(1);opacity:.18}
#control-display .command-panel .move-controls{flex:1;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;padding:0}
#control-display .command-panel .move-controls button.ds-move{min-height:0;padding:8px 12px;text-align:center;display:flex;flex-direction:column;justify-content:center}
#control-display .move-controls .ds-move-name{font-size:clamp(16px,4.5cqw,23px);margin:0 0 5px;line-height:1.05;overflow-wrap:anywhere}
#control-display .move-controls .ds-move-meta{justify-content:center;gap:4px}
#control-display .move-controls .ds-move-extra{font-size:11px;margin-top:3px;color:#dae4ee}
#control-display .move-controls .ds-pp{font:14px/1 Tiny5,monospace}
#control-display .move-controls .ds-type{font-size:12px}
#control-display .move-controls .unbound-move .ds-move-name{color:#f8e9ff}
#control-display .move-controls .unbound-move .ds-pp,#control-display .move-controls .unbound-move .ds-move-extra{color:#ece5fa}
#control-display .move-controls .unbound-move .ds-type{color:#fff}
#control-display .command-panel .continue-action{margin:auto 0;min-height:64px!important;background:#283640;color:#fff;border:2px solid #aab6c1}
/* Six party slots, with no pagination and no battlefield-covering preview. */
.dual-console:has(#screen[data-scene=battle]) #control-display .overlay{background:linear-gradient(165deg,#801126,#282c31 30%);color:#f4f6ec}
.dual-console:has(#screen[data-scene=battle]) #control-display .overlay-header{position:static;background:#20292e;color:#f4f6ec;border-bottom:2px solid #9fb17a;margin:0;padding:5px 7px;min-height:36px}
.dual-console:has(#screen[data-scene=battle]) #control-display .overlay-header h2{font-size:19px}
.dual-console:has(#screen[data-scene=battle]) #control-display #modal-close{background:#293b49;color:#8cdeff;min-height:32px;padding:3px;min-width:36px;border:0}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-roster{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));flex:1;min-height:0;gap:6px;padding:0}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot{min-height:0;padding:5px;border:2px solid #81b552;background:repeating-linear-gradient(0deg,#242b2d 0 3px,#293033 3px 4px);color:#fff;box-shadow:inset 0 0 0 2px #10191b;display:grid;grid-template-columns:32px minmax(0,1fr);gap:4px;border-radius:8px 0 8px 0}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot>img{width:32px;height:40px;object-fit:contain}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot-info{gap:2px}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot-info strong{font-size:16px;line-height:1}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot-info>span{font-size:12px;line-height:1}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot .hp{height:6px;margin:2px 0;border:1px solid #b2c4b5;background:#111}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-option-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.dual-console:has(#screen[data-scene=battle]) #control-display .party-option-list button{background:#202b30;color:#edf7df;border:2px solid #829b69;min-height:44px;font-size:18px}
.battle-selected-partner{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;border:2px solid #8bb45d;margin:8px 16%;background:#20282b;border-radius:14px 0;text-align:center}
.battle-selected-partner img{height:64px;width:64px;object-fit:contain;image-rendering:pixelated}
#control-display .battle-inspect-moves{display:grid;grid-template-columns:1fr 1fr;gap:6px;flex:none}
#control-display .battle-inspect-moves button{padding:6px;min-height:48px;background:#263036;color:#fff;border:2px solid var(--move-type,#8a9);font-size:17px}
#control-display .battle-inspect-moves small{display:block;color:#d8e8ed;font-size:12px}
#control-display .battle-inspect-moves button[aria-pressed=true]{background:#405545;outline:2px solid #e6edaa;outline-offset:-4px}
#control-display .battle-inspect-detail{padding:8px;background:#202b31;border:1px solid #a3b2ac;flex:1;min-height:0;overflow:auto}
#control-display .battle-inspect-detail h3{font-size:19px}
#control-display .battle-inspect-detail p{font-size:14px;line-height:1.25;margin:4px 0}
.dual-console:has(#screen[data-scene=battle]) .touch-screen:has(#overlay[data-kind=battle-party-detail]:not([hidden])){height:580px}
#control-display [data-kind=battle-party-detail] .party-card{flex:none;display:flex;gap:8px;padding:0;background:transparent;border:0;margin:0;min-height:0}
#control-display [data-kind=battle-party-detail] .party-card>img{width:40px;height:40px;object-fit:contain}
#control-display [data-kind=battle-party-detail] .party-card h3{display:none}
#control-display [data-kind=battle-party-detail] .party-card p{font-size:14px;margin:0}
#control-display .battle-summary-data{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px}
#control-display .battle-summary-data p{font:14px/1.2 system-ui,sans-serif;margin:0;padding:5px;background:#1c292f}
#control-display .battle-summary-table{border-collapse:collapse;width:100%;color:#f4f6ed;font:14px/1.2 Tiny5,monospace}
#control-display .battle-summary-table th,#control-display .battle-summary-table td{padding:4px 3px;text-align:right;border-bottom:1px solid #566565}
#control-display .battle-summary-table th:first-child{text-align:left}
#control-display .battle-summary-table thead{color:#c8e4a5;background:#192429}
#control-display [data-kind=online-battle]:has(.ds-online-controls),#control-display [data-kind=online-battle]:has(.move-controls){background:linear-gradient(165deg,#a80829,#292d31 35%);color:#f7f7ed}
#control-display .ds-online-controls #online-fight{--ds-face:linear-gradient(#ed173a,#a50725);--ds-edge:#bfcacb}
.dual-console:has(#screen[data-scene=battle]) #control-display .foot-actions{margin:0;gap:6px}
.dual-console:has(#screen[data-scene=battle]) #control-display .foot-actions button{font-size:16px;min-height:36px;padding:5px 7px;background:#263640;color:#eaf5ec;border:1px solid #96acac}
#control-display .battle-selected-partner p{font-size:16px;margin:3px}
@media(max-width:360px){#control-display .command-panel:is([data-kind=battle],[data-kind=moves]){padding:7px;gap:6px}.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot-info strong{font-size:14px}.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot{grid-template-columns:24px minmax(0,1fr)}.dual-console:has(#screen[data-scene=battle]) #control-display .party-slot>img{width:24px}}
