/* Approved ORAS battle direction. Load after battle-console.css and adventure-ui.css.
   Presentation only: IDs, event routing, server privacy and playback are unchanged.
   Outer screen sizing and physical controls are intentionally owned by the shell. */
.dual-console:has(#screen[data-scene="battle"]){
 --battle-ink:#214754;--battle-cream:#fff9df;--battle-steel:#b3cccb;
 --battle-teal:#397c89;--battle-edge:#224856;
}
.top-display:has(#screen[data-scene="battle"]) .display-dialogue{background:#244c59;border-top-color:#b5d3ca}
.top-display:has(#screen[data-scene="battle"]) .dialogue{background:linear-gradient(#397c8b,#1e4657);color:#f5f8e9;box-shadow:inset 0 0 0 1px #8bb6bb;text-shadow:none}
.top-display:has(#screen[data-scene="battle"]) .dialogue .speaker{color:#bfdbd8}
.dual-console:has(#screen[data-scene="battle"]) .trainer-status{background:linear-gradient(#468592,#204b5c);color:#eff7e8;border-bottom-color:#9fbebc}

/* Large names, true HP, types, status and stage readouts retain their existing nodes. */
.dual-console #screen[data-scene="battle"] :is(.battle-panel,.double-hp){
 border:2px solid #254955;background:linear-gradient(#f5f8e7 0%,#dceade 45%,#accfca 100%);
 color:#214654;box-shadow:2px 3px #16394677;
 clip-path:polygon(10px 0,100% 0,100% calc(100% - 10px),calc(100% - 10px) 100%,0 100%,0 10px);
}
.dual-console #screen[data-scene="battle"] .battle-panel{width:46%;max-width:46%;padding:5px 7px}
.dual-console #screen[data-scene="battle"] .battle-name{font-weight:700;color:#214654;text-shadow:none}
.dual-console #screen[data-scene="battle"] .bp-title>small{color:#3b6570}
.dual-console #screen[data-scene="battle"] .health{gap:4px;margin:4px 0;color:#3e696d}
.dual-console #screen[data-scene="battle"] .health>span:first-child:not([data-status]:not([data-status=""])){font-weight:700}
.dual-console #screen[data-scene="battle"] .hp{height:7px;border:1px solid #517772;background:#315d60;border-radius:4px;overflow:hidden}
.dual-console #screen[data-scene="battle"] .hp-value{color:#355e67;font-weight:700}
.dual-console #screen[data-scene="battle"] .caught-mark{color:#355e67}
.dual-console #screen[data-scene="battle"] .battle-panel .xp{background:#6b959a;height:3px;margin-top:4px}
.dual-console #screen[data-scene="battle"] .battle-panel .xp i{background:#c4eff0}
.dual-console #screen[data-scene="battle"] .bp-changes{max-height:25px}
.dual-console #screen[data-scene="battle"] #battle-field-state{background:#315e6ded;border:1px solid #b1cebe;border-radius:3px;color:#fff9e3}
/* Partners use one horizontal row per side, leaving the center of the field open. */
.dual-console #screen[data-scene="battle"] .double-hp{width:47%;max-width:47%;padding:4px 6px}
.dual-console #screen[data-scene="battle"] .double-hp.foe{top:3%;bottom:auto}
.dual-console #screen[data-scene="battle"] .double-hp.own{bottom:8%;top:auto}
.dual-console #screen[data-scene="battle"] .double-hp.slot-0{left:2%;right:auto}
.dual-console #screen[data-scene="battle"] .double-hp.slot-1{right:2%;left:auto}
.dual-console #screen[data-scene="battle"] .double-hp.choosing{border-color:#c98330;background:linear-gradient(#fff8d9,#d4e5c8);box-shadow:0 0 0 2px #ffe8a8}

/* Keep the whole touch surface scrollable at 220–280px content heights.
   No fixed content height and no flex-shrinking moves or utilities. */
#control-display .command-panel:is([data-kind="battle"],[data-kind="moves"],[data-kind="battle-message"]),
.dual-console:has(#screen[data-scene="battle"]) #control-display .overlay{
 background:radial-gradient(#527b7720 .8px,transparent 1px) 0 0/5px 5px,linear-gradient(#f5f8e9,#d9e7df 58%,#a9c8cc);
 color:#214754;overflow:auto;overscroll-behavior:contain;scroll-padding:12px;min-height:0;
}
#control-display .command-panel:is([data-kind="battle"],[data-kind="moves"],[data-kind="battle-message"]){
 display:flex;flex-direction:column;gap:10px;padding:10px;
}
#control-display .command-panel[hidden]{display:none}
#control-display .ds-command-caption{display:flex;justify-content:space-between;align-items:center;gap:8px;flex:none;margin:0;padding:9px 10px;background:linear-gradient(#468592,#214e5d);border:1px solid #6c9d9f;color:#f6f8e9;font:700 12px/1.3 system-ui,sans-serif;letter-spacing:.065em;text-align:left;min-height:36px}
#control-display .ds-command-caption>span{font-size:10px;letter-spacing:.025em;color:#cfdfd7;text-align:right}
#control-display .command-panel .ds-main-controls{flex:none;min-height:0;grid-template-columns:1fr .92fr 1fr;grid-template-rows:auto auto;grid-template-areas:'fight fight fight' 'bag run party';gap:10px 8px;align-items:end}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button{isolation:isolate;border:0;box-shadow:none;text-shadow:none;transition:none}
#control-display :is(.ds-main-controls,.ds-online-controls) button{--ds-edge:#254a56;--ds-face:linear-gradient(#f2f7e9,#b4cccf);background:var(--ds-edge);color:#214754;position:relative}
#control-display :is(.ds-main-controls,.ds-online-controls) button:before{inset:3px;background:var(--ds-face);background-size:auto;clip-path:inherit;border-radius:inherit;box-shadow:inset 0 0 0 1px #fff7da}
#control-display .ds-main-controls #fight,#control-display .ds-online-controls #online-fight{
 grid-area:fight;grid-column:1/-1;justify-self:center;align-self:center;width:82%;min-width:0;max-width:400px;min-height:152px;
 padding:26px 32px 20px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
 --ds-edge:#214754;--ds-face:#fff2cc;background:var(--ds-edge);color:#fff7d3;font:900 clamp(30px,9cqw,47px)/1 system-ui,sans-serif;letter-spacing:.015em;
 clip-path:polygon(50% 0,56% 7%,64% 2%,68% 12%,77% 8%,79% 20%,89% 18%,89% 30%,97% 32%,93% 42%,100% 50%,93% 58%,97% 68%,89% 70%,89% 82%,79% 80%,77% 92%,68% 88%,64% 98%,56% 93%,50% 100%,44% 93%,36% 98%,32% 88%,23% 92%,21% 80%,11% 82%,11% 70%,3% 68%,7% 58%,0 50%,7% 42%,3% 32%,11% 30%,11% 18%,21% 20%,23% 8%,32% 12%,36% 2%,44% 7%);
}
#control-display :is(#fight,#online-fight):after{content:'';position:absolute;inset:6px;z-index:-1;clip-path:inherit;background:repeating-linear-gradient(0deg,#ffffff16 0 1px,transparent 1px 3px),linear-gradient(#ff7841,#fa1636 45%,#e91f29 72%,#ffa447);pointer-events:none}
#control-display :is(#fight,#online-fight) .battle-command-label{color:#fff4c7;text-shadow:0 2px #b33523}
#control-display :is(#fight,#online-fight) .battle-command-sprite{width:43px;height:43px;max-width:none;object-fit:contain;image-rendering:pixelated;pointer-events:none}
#control-display :is(#fight,#online-fight) small{display:none}
#control-display .ds-main-controls #battle-bag{grid-area:bag;min-height:90px;padding:27px 10px 12px;background:#254a56;--ds-edge:#254a56;--ds-face:linear-gradient(#ffdf5a,#edb633 62%,#ffdf63);color:#634918;font:800 clamp(18px,5.5cqw,27px)/1 system-ui,sans-serif;clip-path:polygon(4% 20%,14% 16%,14% 0,47% 0,47% 17%,100% 29%,92% 100%,0 100%)}
#control-display .ds-main-controls #run{grid-area:run;min-height:50px;padding:8px 12px;--ds-edge:#254a56;--ds-face:linear-gradient(#99edfb,#4ac2e3 50%,#2290b6);background:#254a56;color:#164e65;font:800 clamp(15px,4.5cqw,23px)/1.05 system-ui,sans-serif;clip-path:polygon(13% 0,88% 0,100% 69%,80% 100%,14% 100%,0 48%)}
#control-display .ds-main-controls #battle-party,#control-display [data-kind="online-battle"] .ds-online-controls #online-party{
 grid-area:party;min-height:90px;padding:64px 4px 7px;--ds-edge:#254a56;--ds-face:linear-gradient(#a4f181,#43ce75 64%,#248a6b 65%,#248a6b 69%,#53d68c 70%);background:#254a56;color:#124e43;border-radius:90px 90px 0 0;clip-path:none;font:800 clamp(13px,3.9cqw,20px)/1 system-ui,sans-serif;
}
#control-display :is(#battle-party,#online-party):after{content:'';position:absolute;z-index:-1;width:20px;height:20px;left:50%;top:65%;transform:translate(-50%,-50%);border:4px solid #378b6d;border-radius:50%;background:#eefbc9;box-shadow:inset 0 0 0 3px #bbe99b;pointer-events:none}

/* Unbound, inspection and exit are always real, reachable buttons. */
#control-display .command-panel :is(.ds-utility-controls,.ds-move-tools){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:none;margin:0}
#control-display :is(.ds-utility-controls,.ds-move-tools) button,
#control-display [data-kind="online-battle"] .foot-actions button,
#control-display [data-kind="online-battle"] .ds-online-controls #online-show-stats{
 position:relative;min-height:44px;padding:7px 5px;border:2px solid #416c78;border-radius:4px;background:linear-gradient(#fffef2 0 44%,#d2dddd 46%,#afc5c9);box-shadow:inset 0 0 0 1px #ffffffb0,0 2px #71949a;color:#274e5a;font:700 12px/1.2 system-ui,sans-serif;text-shadow:none;text-align:center;overflow-wrap:anywhere;clip-path:none;
}
#control-display .ds-utility-controls #battle-unbound,#control-display [data-kind="online-battle"] .ds-online-controls #online-unbind-toggle{--ds-edge:#35556a;--ds-face:linear-gradient(120deg,#418876,#664681);min-height:44px;background:linear-gradient(120deg,#418876,#664681);border:2px solid #618884;border-radius:4px;color:#fff4ed;font:700 13px/1.2 system-ui,sans-serif;clip-path:none;text-shadow:none}
#control-display .ds-utility-controls #battle-unbound img{width:24px;height:24px}
#control-display .ds-utility-controls #battle-forfeit,#control-display [data-kind="online-battle"] :is(#online-refresh,#online-leave){background:linear-gradient(#4b7080,#2c5060);border-color:#63858e;color:#f1f5e8}
#control-display :is(.ds-move-tools,.battle-move-tools) :is(#moves-back,#online-back,#online-back-to-moves){background:linear-gradient(#9aedf5,#3db9d9 50%,#218ab2);color:#164d62}
#control-display .battle-party-balls{flex:none;justify-content:flex-end;gap:4px;height:20px;margin:0}
#control-display .battle-party-balls img{width:16px;height:16px}

/* Four type-colored slanted plates, plus the wide fifth signature. */
#control-display .command-panel .move-controls,#control-display [data-kind="online-battle"] .move-controls{flex:none;min-height:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:auto;gap:9px 8px;padding:0}
#control-display .move-controls button.ds-move,#control-display [data-kind="online-battle"] .move-controls button.ds-move{
 display:flex;flex-direction:column;justify-content:flex-start;gap:0;position:relative;min-height:112px;padding:11px 12px 10px;
 --ds-edge:#244956;--ds-face:linear-gradient(180deg,var(--move-type,#7a989c) 0%,var(--move-type,#7a989c) 50%,#203f45 80%);
 background:var(--ds-edge);border:0;color:#fffbed;text-align:left;
 clip-path:polygon(4% 0,94% 0,100% 100%,6% 100%,0 88%);
}
#control-display .move-controls button.ds-move:before{inset:3px;clip-path:inherit;box-shadow:inset 0 0 0 1px #f5edc8;background:repeating-linear-gradient(0deg,#ffffff18 0 1px,transparent 1px 3px),var(--ds-face);background-size:auto}
#control-display .move-controls .ds-move-name{margin:0 0 8px;text-align:center;font:700 clamp(15px,4.25cqw,22px)/1.1 system-ui,sans-serif;color:#fffbed;text-shadow:0 1px 1px #233a40;overflow-wrap:anywhere}
#control-display .move-controls .ds-move-meta{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:4px;width:100%}
#control-display .move-controls .ds-move-types{display:flex;flex-wrap:wrap;gap:3px}
#control-display .move-controls .ds-type{font:700 10px/1 system-ui,sans-serif;padding:3px 5px;border:1px solid #f9f4dc66;border-radius:3px;color:#fff;text-shadow:0 1px 2px #142b37;max-width:100%}
#control-display .move-controls .ds-pp{font:700 12px/1.2 system-ui,sans-serif;white-space:nowrap;color:#fffbed;text-shadow:0 1px 2px #142b37}
#control-display .move-controls .ds-move-metrics{display:flex;flex-wrap:wrap;gap:3px 7px;margin:5px 0 0;font:700 11px/1.25 system-ui,sans-serif;color:#f4f5e4;text-shadow:0 1px 2px #142b37}
#control-display .move-controls .ds-move-metrics>span{white-space:normal}
#control-display .move-controls .ds-move-extra{display:block;width:100%;margin:5px 0 0;text-align:right;font:700 10px/1.25 system-ui,sans-serif;color:#d7e8df;text-shadow:none}
#control-display .move-controls button.unbound-move{grid-column:1/-1;min-height:86px;--ds-face:linear-gradient(165deg,#34765d 0%,#2a6158 41%,#584981 42%,#7962a4);clip-path:polygon(3% 0,97% 0,100% 50%,97% 100%,3% 100%,0 50%);padding:10px 17px}
#control-display .move-controls .unbound-move .ds-move-name{color:#fff1d6;text-align:left;margin-bottom:7px}
#control-display .move-controls .unbound-move .ds-move-meta{flex-wrap:nowrap}
#control-display .move-controls .unbound-move :is(.ds-move-extra,.ds-pp,.ds-move-metrics,.ds-move-metrics span){color:#eee8ff}

/* Battle overlays use the same steel and teal frame, including bag/party inspectors. */
.dual-console:has(#screen[data-scene="battle"]) #control-display .overlay-header{background:linear-gradient(#498995,#255264);color:#f2f6e7;border-bottom:2px solid #81a8a8;padding:8px 10px;min-height:44px}
.dual-console:has(#screen[data-scene="battle"]) #control-display #modal-close{color:#fff6df;background:#315966;min-height:44px;min-width:44px}
.dual-console:has(#screen[data-scene="battle"]) #control-display .party-slot{border-color:#537b80;background:linear-gradient(#e5f7d7,#b5e0cf 52%,#91c6ba);color:#264f52;box-shadow:inset 0 0 0 1px #f5ffe5;min-height:74px;border-radius:10px 0 10px 0}
.dual-console:has(#screen[data-scene="battle"]) #control-display .party-option-list button{background:linear-gradient(#e2f8ed,#a0d8d5);color:#244d59;border-color:#4d8b97;min-height:44px}
.dual-console:has(#screen[data-scene="battle"]) #control-display .battle-selected-partner{background:linear-gradient(#e1f1d4,#b6dcd0);border-color:#517d6b;color:#274e4b;border-radius:12px 0}
#control-display .battle-inspect-moves button{background:linear-gradient(var(--move-type,#678a78),#264c50);color:#fff7e7;min-height:48px}
#control-display .battle-inspect-detail{background:#244c59;color:#f5f8e9;border-color:#a2c5c2}
#control-display .battle-summary-table{background:#deeee3;color:#214c53}
#control-display .battle-summary-table thead{background:#8dbbb5;color:#214c53}
#control-display .battle-summary-table td,#control-display .battle-summary-table th{border-color:#99b6b3}
#control-display :is(.battle-ability,.double-stat-card,.move-card,.live-battle-changes){color:#234b56;text-shadow:none}
#control-display .battle-condition-readout{border:1px solid #99b3ab;background:#365d66;color:#f2f5e6;padding:7px 9px;font:12px/1.4 system-ui,sans-serif}
#control-display .live-battle-changes{background:#dfebe2;border:1px solid #9bb9ad;padding:8px;font:12px/1.4 system-ui,sans-serif}

/* Online buttons never invent an item bag, decision countdown or private foe HP. */
#control-display [data-kind="online-battle"] .online-turn{margin:8px 0;padding:8px 10px;border:1px solid #6f989b;background:linear-gradient(#498995,#275565);color:#f5f8e8;font:700 12px/1.3 system-ui,sans-serif}
#control-display [data-kind="online-battle"] .online-turn span{font:11px/1.35 system-ui,sans-serif;color:#d5e5df}
#control-display [data-kind="online-battle"] #online-error:empty{display:none}
#control-display [data-kind="online-battle"] .ds-online-controls{grid-template-columns:1fr 1fr;grid-template-areas:'fight fight' 'party stats';gap:10px 8px;align-items:end}
#control-display [data-kind="online-battle"] .ds-online-controls #online-show-stats{grid-area:stats;min-height:60px}
#control-display [data-kind="online-battle"] .ds-online-controls #online-show-stats:before{display:none}
#control-display [data-kind="online-battle"] .ds-online-controls #online-unbind-toggle{grid-column:1/-1;min-height:44px}
#control-display [data-kind="online-battle"] .foot-actions{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0}
#control-display [data-kind="online-battle"] .foot-actions button{flex:1 1 100px;min-height:44px}
#control-display [data-kind="online-battle"] .battle-move-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#control-display [data-kind="online-battle"] :is(label,select){font:13px/1.4 system-ui,sans-serif;color:#234b56}
#control-display [data-kind="online-battle"] label{display:block;margin:10px 0 4px}
#control-display [data-kind="online-battle"] select{width:100%;min-height:44px;background:#f5f8ed;border:2px solid #74999a}
#control-display [data-kind="online-battle"] .online-wait{background:#e8f2df;border:2px solid #6c9c91;color:#2e5e55}
#control-display .online-double-actors{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:9px 0}
#control-display .online-double-actors button{min-height:52px;padding:8px;border:2px solid #416b78;border-radius:5px;background:linear-gradient(#fafced 0 43%,#d0dfdf 44%,#bbced0);box-shadow:inset 0 0 0 2px #edf8e9,0 2px #739195;color:#2c5864;font:700 12px/1.2 system-ui,sans-serif}
#control-display .online-double-actors button small{font:700 10px/1.2 system-ui,sans-serif;color:#5b7b79}
#control-display .online-double-actors button[data-ready="true"]{background:#d9eacf}
#control-display .online-double-actors button[data-ready="true"] small{color:#4a7c59}
#control-display .online-double-actors button[aria-pressed="true"]{border-color:#cf6f3e;box-shadow:inset 0 0 0 2px #fff4d4,0 2px #c78352}
#control-display .double-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0}
#control-display .double-targets button{position:relative;isolation:isolate;min-height:164px;display:flex;flex-direction:column;gap:6px;align-items:center;justify-content:center;padding:12px 13px;background:#305967;border:0;color:#234b55;clip-path:polygon(5% 0,95% 0,100% 50%,95% 100%,5% 100%,0 50%);font:700 14px/1.2 system-ui,sans-serif;box-shadow:none;text-align:center}
#control-display .double-targets button:before{content:'';position:absolute;inset:3px;z-index:-1;clip-path:inherit;background:linear-gradient(#e1eff0,#bfd9d9);box-shadow:inset 0 0 0 1px #f9ffe5}
#control-display .double-targets button[data-side="ally"]:before{background:linear-gradient(#f1f3d7,#d6e2be)}
#control-display .double-targets img{width:72px;height:72px;object-fit:contain;image-rendering:pixelated}
#control-display .double-targets strong{font:700 14px/1.2 system-ui,sans-serif;overflow-wrap:anywhere}
#control-display .double-targets small,#control-display .battle-target-types{font:700 10px/1.3 system-ui,sans-serif;color:#476b75}
#control-display .battle-target-health{display:block;width:90%;height:7px;background:#446d72;border:1px solid #496866;border-radius:3px;overflow:hidden;margin:0}
#control-display .battle-target-health i{display:block;height:100%;background:#7dce73}
#control-display .online-double-review{margin:12px 0;padding:0;border:0;background:transparent;color:#244c56}
#control-display .online-double-review>strong{display:block;font:700 12px/1.3 system-ui,sans-serif;text-transform:uppercase;margin:0 0 8px}
#control-display .online-action-review{position:relative;isolation:isolate;display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:100px;padding:12px 15px;margin:10px 0;background:#2e5a66;clip-path:polygon(3% 0,97% 0,100% 50%,97% 100%,3% 100%,0 50%)}
#control-display .online-action-review:before{content:'';position:absolute;inset:2px;z-index:-1;clip-path:inherit;background:linear-gradient(#f3f7e2,#bbdcd3);box-shadow:inset 0 0 0 1px #effee9}
#control-display .online-action-review>img{width:56px;height:66px;object-fit:contain;image-rendering:pixelated}
#control-display .online-action-review>div{min-width:0}
#control-display .online-action-review strong{display:block;font:700 14px/1.25 system-ui,sans-serif;overflow-wrap:anywhere}
#control-display .online-action-review p{margin:4px 0;font:700 13px/1.3 system-ui,sans-serif;color:#396b5c;overflow-wrap:anywhere}
#control-display .online-action-review small{color:#477c61;font:700 10px/1.2 system-ui,sans-serif}
#control-display .online-action-review button{min-height:44px;min-width:52px;padding:7px;border:2px solid #486f7a;border-radius:4px;background:linear-gradient(#fffdf0 45%,#c6d6d6 46%,#b0c8cb);color:#2b5360;font:700 10px/1.2 system-ui,sans-serif}
#control-display [data-kind="online-battle"] #online-double-confirm{display:block;width:100%;min-height:56px;margin:12px 0 0;border:2px solid #387a8f;border-radius:4px;background:linear-gradient(#a4eff4,#50c3df 50%,#2186ad);box-shadow:inset 0 0 0 2px #d2faff,0 3px #497985;color:#164b63;text-transform:uppercase;font:800 21px/1.2 system-ui,sans-serif}
#control-display .online-double-review .online-review-privacy{font:11px/1.35 system-ui,sans-serif;color:#4c6f75;margin:8px 4px;text-align:center}

/* Focus never covers move information or relies on motion. */
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:is(.control-selected,:focus-visible){--ds-edge:#fff0a8;background:#fff0a8!important;color:inherit!important;outline:0;box-shadow:none;filter:drop-shadow(0 0 2px #37545d)}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls) button:is(.control-selected,:focus-visible):before{inset:4px}
#control-display :is(.ds-utility-controls,.ds-move-tools,.battle-move-tools,.online-double-actors,.online-action-review) button:is(.control-selected,:focus-visible),
#control-display [data-kind="online-battle"] :is(#online-refresh,#online-leave,#online-double-confirm):is(.control-selected,:focus-visible){outline:3px solid #ed7749;outline-offset:-3px;background:linear-gradient(#fff7d5,#d8e6d1)!important;color:#173e50!important;box-shadow:inset 0 0 0 5px #fff1c2}
#control-display .double-targets button:is(.control-selected,:focus-visible){background:#ef8250!important;outline:0;color:#214a54!important}
#control-display .double-targets button:is(.control-selected,:focus-visible):before{background:#e6f1cd;inset:4px}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls,.ds-utility-controls,.online-double-actors,.double-targets,.online-action-review) button:disabled{opacity:.5;filter:grayscale(.75);cursor:default}
#control-display :is(.ds-main-controls,.ds-online-controls,.move-controls,.online-double-actors,.double-targets,.online-action-review) button:not(:disabled):active{transform:translateY(1px)}
@container (max-width:350px){
 #control-display .command-panel:is([data-kind="battle"],[data-kind="moves"]){padding:8px;gap:9px}
 #control-display .ds-main-controls #fight,#control-display .ds-online-controls #online-fight{width:94%;min-height:142px;padding:26px 24px 20px}
 #control-display .move-controls button.ds-move,#control-display [data-kind="online-battle"] .move-controls button.ds-move{padding:10px 10px;min-height:117px}
 #control-display .move-controls .ds-move-name{font-size:15px}
 #control-display .move-controls .ds-pp{font-size:12px}
 #control-display .move-controls .ds-type{font-size:10px;padding:3px}
 #control-display .move-controls .ds-move-metrics{font-size:11px;gap:3px 5px}
 #control-display .move-controls button.unbound-move{min-height:90px;padding:11px 14px}
 #control-display .ds-command-caption{font-size:11px;padding:8px}
 #control-display :is(.ds-utility-controls,.ds-move-tools) button,#control-display [data-kind="online-battle"] .battle-move-tools button{font-size:11px}
 #control-display .online-action-review{grid-template-columns:40px minmax(0,1fr);padding:12px;gap:7px}
 #control-display .online-action-review>img{width:40px;height:52px}
 #control-display .online-action-review button{grid-column:2;justify-self:end;min-width:74px}
 #control-display .online-action-review strong{font-size:12px}
 #control-display .online-action-review p{font-size:11px}
 #control-display .double-targets strong{font-size:12px}
 #control-display .double-targets img{width:62px;height:62px}
}
@media (prefers-reduced-motion:reduce){
 #control-display :is(.ds-main-controls,.ds-online-controls,.move-controls,.online-double-actors,.double-targets,.online-action-review) button{animation:none;transition:none}
 #control-display :is(.ds-main-controls,.ds-online-controls,.move-controls,.online-double-actors,.double-targets,.online-action-review) button:not(:disabled):active{transform:none}
}

/* Existing battle catalog controllers retain their pockets, restrictions and actions. */
.dual-console:has(#screen[data-scene="battle"]) #control-display .party-roster{flex:none;grid-template-rows:none;grid-auto-rows:minmax(74px,auto);min-height:min-content}
.dual-console:has(#screen[data-scene="battle"]) #control-display .party-option-list{flex:none;grid-auto-rows:minmax(44px,auto)}
.dual-console:has(#screen[data-scene="battle"]) #control-display .battle-selected-partner{flex:none;min-height:132px}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] :is(select,input,button){min-height:44px}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-stock{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(54px,auto);flex:none;min-height:0;overflow:visible;gap:8px}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-stock-item{padding:8px 12px;border:2px solid #7a753c;border-radius:3px;min-height:54px!important;color:#604722;background:linear-gradient(#ffe883,#f4bd38 55%,#ffdf62);box-shadow:inset 0 0 0 1px #fff9c5;text-shadow:none;font:700 12px/1.25 system-ui,sans-serif}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-stock-item[aria-pressed="true"]{border-color:#ca633f;background:linear-gradient(#fff6b0,#ffe063);color:#513d1c;outline:2px solid #f3864e;outline-offset:-2px}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-stock-item[hidden]{display:none}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-selection{background:#2f5863;color:#f4f5e5;border-color:#92b4ad}
.dual-console:has(#screen[data-scene="battle"]) #control-display [data-kind="bag"] .navigator-selection p{color:inherit}
.dual-console #screen[data-scene="battle"] #battle-hud:has(.double-hp) #battle-team-row{top:23%}
.dual-console #screen[data-scene="battle"] #battle-hud:has(.double-hp) #battle-field-state{top:auto;bottom:28%;max-width:48%;font-size:clamp(9px,2.4cqw,12px)}
#control-display .ds-online-controls #online-unbind-toggle:is(.control-selected,:focus-visible){color:#fff6e9!important}
/* On phone-width displays the primary commands fit before the physical cross.
   The upper HUD already carries the party balls and whose turn it is. */
@container (max-width:420px){
 #control-display .command-panel[data-kind="battle"]{padding:7px;gap:7px}
 #control-display .command-panel[data-kind="battle"]>.ds-command-caption,
 #control-display .command-panel[data-kind="battle"]>.battle-party-balls{display:none}
 #control-display .command-panel[data-kind="battle"] .ds-main-controls{gap:7px;grid-template-rows:auto auto}
 #control-display .ds-main-controls #fight{min-height:105px;width:90%;padding:13px 22px 11px;font-size:30px}
 #control-display #fight .battle-command-sprite{width:38px;height:38px}
 #control-display .ds-main-controls #battle-bag{min-height:62px;padding:22px 6px 8px;font-size:20px}
 #control-display .ds-main-controls #battle-party{min-height:62px;padding:42px 3px 5px;font-size:13px}
 #control-display .ds-main-controls #run{min-height:46px;font-size:17px}
 #control-display .command-panel[data-kind="battle"] .ds-utility-controls button{min-height:44px}
}

/* Doubles has a single native-coordinate layout, shared with its renderer.
   The separate readout strip keeps full field names and both team counts out
   of the 240×160 arena, including dense weather/terrain combinations. */
#double-battle-readouts{display:none}
.top-display:has(#screen[data-scene="battle"] #battle-hud.double-battle:not([hidden])) #double-battle-readouts{display:grid;grid-template-columns:1fr 1fr;gap:2px 8px;flex:none;padding:3px 7px;background:#244c59;border-top:1px solid #9dbeb6;color:#fff9e3}
#double-battle-readouts .battle-team-row{position:static;height:auto;min-height:13px;gap:2px;align-items:center}
#double-battle-readouts #battle-team-row{justify-content:flex-start}
#double-battle-readouts #battle-player-team-row{justify-content:flex-end}
#double-battle-readouts .battle-team-row:before{font:10px/1.2 system-ui,sans-serif;margin-right:4px}
#double-battle-readouts #battle-team-row:before{content:'Foe'}
#double-battle-readouts #battle-player-team-row:before{content:'You'}
#double-battle-readouts .team-ball{width:12px;height:12px}
#double-battle-readouts #battle-field-state{position:static;grid-column:1/-1;width:100%;max-width:none;padding:2px 0;border:0;border-radius:0;background:transparent;font:12px/1.2 Tiny5,monospace;text-align:left;white-space:normal;overflow-wrap:anywhere}
.dual-console #screen[data-scene="battle"] .double-hp{right:auto;bottom:auto;max-width:none;padding:2px 4px;border-width:1px;display:flex;flex-direction:column;justify-content:center;gap:1px;line-height:1;clip-path:polygon(5px 0,100% 0,100% calc(100% - 5px),calc(100% - 5px) 100%,0 100%,0 5px)}
.dual-console #screen[data-scene="battle"] .double-hp .bp-title{min-height:0;gap:2px;flex:none}
.dual-console #screen[data-scene="battle"] .double-hp .battle-name{font-size:clamp(10px,3.1cqw,15px);line-height:1;gap:2px}
.dual-console #screen[data-scene="battle"] .double-hp .bp-title>small{font-size:clamp(9px,2.4cqw,12px);line-height:1}
.dual-console #screen[data-scene="battle"] .double-hp .health{margin:1px 0;gap:3px;min-height:7px;font-size:clamp(8px,2.1cqw,11px);line-height:1;flex:none}
.dual-console #screen[data-scene="battle"] .double-hp .hp{height:6px}
.dual-console #screen[data-scene="battle"] .double-hp .ds-hud-footer{min-height:0;gap:2px;flex:none}
.dual-console #screen[data-scene="battle"] .double-hp .ds-hud-footer :is(.type,.hp-value){font-size:clamp(8px,2.15cqw,11px);line-height:1}
.dual-console #screen[data-scene="battle"] .double-hp .type{padding:0 1px}
.dual-console #screen[data-scene="battle"] .double-hp .ds-status[data-status]:not([data-status=""]){padding:0 2px}
@container(max-width:300px){
 .dual-console #screen[data-scene="battle"] .double-hp{padding:1px 3px;gap:0}
 .dual-console #screen[data-scene="battle"] .double-hp .health{margin:0}
 .dual-console #screen[data-scene="battle"] .double-hp .battle-orb{width:10px;height:10px}
 .dual-console #screen[data-scene="battle"] .double-hp.choosing .battle-name:before{font-size:10px}
}

/* Doubles Gauntlet keeps its readable adventure typeface through arena dialogue,
   battle HUD, field/status readouts and controls. Override the family on each
   descendant (including generated labels) because legacy font shorthands reset
   it to Tiny5. Keep every existing size, weight, line height and layout rule. */
.dual-console[data-frontier-mode="doubles"],
.dual-console[data-frontier-mode="doubles"] *{
 font-family:Arial,Helvetica,system-ui,sans-serif!important;
}
.dual-console[data-frontier-mode="doubles"] *::before,
.dual-console[data-frontier-mode="doubles"] *::after{
 font-family:Arial,Helvetica,system-ui,sans-serif!important;
}

/* Battle-only item consent: actions stay before content, not below a catalog. */
#control-display .navigator-menu[data-kind^="battle-item-"]{overflow:auto;gap:7px}
#control-display .battle-item-view{display:flex;flex-direction:column;gap:8px;min-height:0}
#control-display .battle-item-actions{display:flex;gap:8px;flex:none;position:sticky;top:0;z-index:1;background:#e8f2f3;padding:2px 0}
#control-display .battle-item-actions button{flex:1;min-height:44px;white-space:normal}
#control-display .battle-item-name{display:flex;align-items:center;gap:8px}
#control-display .battle-item-name .item-icon{width:32px;height:32px}
#control-display .battle-item-description{font-size:14px;line-height:1.3}
#control-display .battle-item-moves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#control-display .battle-item-move{display:flex;flex-direction:column;gap:6px;min-height:64px}
#control-display .battle-item-view .party-roster{margin:0;gap:6px;grid-auto-rows:minmax(60px,auto)}
#control-display .battle-item-view .party-slot img{height:42px;width:42px}
#control-display .battle-item-view .party-slot{min-height:60px}

/* Party-wide recovery retains its actions above a scrollable preview. */
#overlay[data-kind="party-item-confirm"] .foot-actions { position:sticky; top:0; z-index:2; background:var(--panel, #f7f3e8); padding:.5rem 0; }
#overlay[data-kind="party-item-confirm"] .party-item-targets { max-height:12rem; overflow:auto; }
