/* Touch controls remain reachable without changing combat rules. */
@media(max-width:700px){
 .game-nav{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,44px);grid-auto-columns:max-content;gap:5px;overflow-x:auto;overflow-y:hidden;padding:5px 0 8px;scrollbar-width:thin;max-width:100%}
 .game-nav .nav-settings{display:contents}
 .game-nav button,.game-nav>a,.game-nav summary{box-sizing:border-box;min-height:44px;font-size:11px;padding:10px;display:flex;align-items:center;justify-content:center;white-space:nowrap}
 .game-nav .settings-menu{align-self:stretch}
 .game-nav .menu-popover{position:fixed;inset:auto 12px 12px;z-index:100;max-height:60dvh;overflow:auto}
 .command-shell{grid-template-rows:135px auto auto}
 .army-roster{grid-auto-columns:170px}
 .army-unit{min-height:96px}
 .unit-info{padding-right:43px}
 .unit-info>strong{font-size:11px}.unit-info>span{font-size:12px}
 .unit-actions{grid-template-columns:44px;grid-template-rows:44px 44px;gap:4px}
 .unit-actions button{min-height:44px;font-size:12px}.unit-actions button small{font-size:8px}
 .army-roster .unit-training{width:36px;height:36px;right:-4px;bottom:-5px;opacity:.9}
 .royal-command{grid-template-columns:64px minmax(0,1fr);min-height:220px}
 .command-deck{grid-template-rows:auto minmax(69px,auto) auto;gap:6px}
 .command-actions{flex-wrap:wrap}.command-actions button{min-height:44px;font-size:10px;flex:1}
 .command-actions kbd{display:none}
 .command-deck .royal-heading{flex-wrap:wrap;white-space:normal;min-height:32px}
 .command-deck #royal-message{white-space:normal;overflow:visible;line-height:1.5;font-size:11px}
 .decision-controls{gap:6px;padding:6px}
 .decision-controls button{min-height:44px;min-width:44px;font-size:11px;flex:1;padding:8px}
 .decision-controls span{font-size:11px;line-height:1.5}
 #decision-plan{font-size:12px;line-height:1.5}
 .battle>.battlebar{min-height:44px;height:auto;flex-wrap:wrap;padding:4px 7px}
 .battlebar button,.battlefoot button,.battlefoot .primary{min-height:44px;font-size:11px}
 .battle>.battlefoot{height:auto;min-height:54px;flex-wrap:wrap}
 .battle>.field{min-height:185px}
 dialog{max-width:calc(100vw - 16px);box-sizing:border-box;scroll-padding-top:54px}
 dialog .close{min-width:44px;min-height:44px;font-size:22px}
 #decisions-modal,#field-lab-modal{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:90dvh;padding:16px}
 #decisions-modal h2,#field-lab-modal h2{padding-right:48px;font-size:24px}
 #decisions-modal p,#field-lab-modal p{font-size:14px;line-height:1.6}
 .lab-grid{gap:12px 8px}.lab-grid label{min-width:0;font-size:13px}
 .lab-grid input,.lab-grid select,#reserve-select,#lab-formation{width:100%;min-width:0;min-height:44px;font-size:16px;padding:8px}
 #reserve-select{margin-top:6px}#lab-run{min-height:44px;width:100%;margin-top:10px;font-size:13px}
 #lab-result{overflow-wrap:anywhere}#lab-canvas{box-sizing:border-box}
 #tree-modal button{min-height:44px}#tree-close{min-width:44px}
 #tree-modal .tree-tools{flex-wrap:wrap}
 #tree-modal #tree-viewport{touch-action:none}
 .retry-preparation button{min-height:44px;font-size:11px}
 body:has(#coop-entry){overflow-x:hidden}
 body:has(#coop-entry) main{min-width:0;padding:10px}
 body:has(#coop-entry) header{gap:8px;padding:10px}
 body:has(#coop-entry) header a,body:has(#coop-entry) header button,body:has(#coop-entry) header summary{min-height:44px;box-sizing:border-box;display:inline-flex;align-items:center;font-size:12px;padding:8px}
 .coop-entry-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
 .coop-entry-actions label{min-width:0}.coop-entry-actions select,.coop-entry-actions input{width:100%;max-width:none;box-sizing:border-box;min-height:44px;font-size:16px}
 .coop-entry-actions button{min-height:44px;width:100%;white-space:normal}
 .coop-kings{grid-template-columns:repeat(2,minmax(0,1fr))}
 .coop-kings strong,.coop-kings small{overflow-wrap:anywhere;line-height:1.5}
 .coop-toolbar>*{min-width:0}.coop-toolbar button,.coop-roster button,.coop-research button{min-width:44px;min-height:44px;font-size:12px;white-space:normal}
 .coop-toolbar [role=group]{display:flex;gap:6px}
 .coop-roster{grid-template-columns:repeat(2,minmax(0,1fr))}
 .coop-roster article{min-width:0;padding:8px}.coop-roster strong,.coop-roster small{overflow-wrap:anywhere}
 .coop-roster button{margin-right:4px;padding:8px}
 .coop-research button{min-width:calc(50% - 8px);flex:1;overflow-wrap:anywhere}
 .coop-skills{grid-template-columns:repeat(2,minmax(0,1fr))}.coop-skills button{min-width:0;padding:8px;font-size:12px;overflow-wrap:anywhere}
 .coop-audio{position:fixed;right:12px;left:12px;top:100px;width:auto;max-width:none;box-sizing:border-box;max-height:70dvh;overflow:auto}
 .coop-audio input[type=range]{min-height:44px;max-width:100%;width:100%;box-sizing:border-box}
 #coop-canvas{box-sizing:border-box;touch-action:manipulation}
 .room-bar strong{font-size:20px;letter-spacing:1px;overflow-wrap:anywhere;min-width:0}
 body:has(#coop-entry) footer{flex-wrap:wrap;gap:12px}
}
@media(max-width:700px){
 #tree-modal .tree-header{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:10px}
 #tree-modal .tree-header>div{min-width:0}
 #tree-modal .tree-resources{min-width:0;max-width:100%;gap:4px}
 #tree-modal .tree-resources strong{font-size:13px;white-space:normal;overflow-wrap:anywhere;text-align:right}
 #research-tooltip{display:none!important}
 .tree-toolbar{height:auto;flex-wrap:wrap;gap:6px}.tree-toolbar>div{flex-wrap:wrap;gap:5px}
 #tree-modal .tree-toolbar button{font-size:10px;min-width:44px;min-height:44px}
 .royal-command .royal-order{min-height:44px;font-size:10px}
}
@media(max-width:700px){
 .decision-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .decision-controls button{width:100%;min-width:0;min-height:48px;line-height:1.4}
 .decision-controls span{grid-column:1/-1}
 .decision-controls span:empty{display:none}
 .command-deck{grid-template-rows:auto auto auto auto}
 #king-orders{min-height:44px}#king-orders button{min-height:44px;font-size:11px;line-height:1.3}#king-orders small{font-size:10px;line-height:1.4}
 #coop-leave{min-height:44px}
}
@media(max-width:1000px){
 #decisions-modal>.close,#field-lab-modal>.close{min-width:44px;min-height:44px;font-size:22px}
 .lab-grid input,.lab-grid select,#reserve-select,#lab-formation{min-height:44px;font-size:16px;min-width:0;box-sizing:border-box;max-width:100%}
 #lab-run{min-height:44px}
 .decision-controls button{min-height:44px;font-size:11px;line-height:1.4}
 #coop-room button,#coop-entry button{min-height:44px}
 .coop-entry-actions input,.coop-entry-actions select{min-height:44px;font-size:16px}
}
