/* Fit the complete character board to the viewport. Row count follows the
   rendered column count, including inert fillers; no hidden/scrolled fighters. */
#select.console-select {
 display:flex;flex-direction:column;box-sizing:border-box;
 height:100dvh;min-height:0;max-height:100dvh;
 padding:12px clamp(10px,2vw,32px) max(10px,env(safe-area-inset-bottom));
 overflow:hidden;
}
#select .select-top {
 flex:0 0 48px;box-sizing:border-box;width:100%;max-width:1600px;
 height:48px;min-height:0;margin:0 auto 6px;padding:0 0 4px;
}
#select .console-heading h2 {font-size:32px}
#select .console-heading small {font-size:8px;margin-bottom:2px}
#select .selection-body,#select.online-fighter-select .selection-body,#select[data-solo-party="true"] .selection-body {
 flex:1 1 0;min-height:0;max-width:1600px;margin:0 auto;
 grid-template-columns:minmax(0,1fr) auto;
 grid-template-rows:44px minmax(0,1fr) clamp(120px,18dvh,180px) 44px;
 gap:6px 12px;overflow:visible;
}
#select.online-fighter-select .selection-body {grid-template-rows:0 minmax(0,1fr) clamp(120px,18dvh,180px) 44px}
#select .console-rule-strip {box-sizing:border-box;height:44px;min-height:0;padding:0 10px;gap:10px;flex-wrap:nowrap;align-content:center}
#select .roster-column,#select.online-fighter-select .roster-column {min-height:0;grid-template-rows:14px minmax(0,1fr)}
#select .roster-head {height:14px;font-size:8px}
#select .roster,#select .roster.expanded-roster {
 --roster-columns:10;display:grid;grid-template-columns:repeat(var(--roster-columns),minmax(0,1fr));
 grid-template-rows:repeat(var(--roster-rows,5),minmax(0,1fr));grid-auto-rows:minmax(0,1fr);
 box-sizing:border-box;height:100%;min-height:0;max-height:100%;gap:4px;padding:3px;
 overflow:hidden;overflow-x:hidden;overflow-y:hidden;scrollbar-width:none;
}
#select .fighter-card,#select .expanded-roster .fighter-card {min-height:0;height:100%}
#select .fighter-art-crop {inset:2px 2px 20px}
#select .fighter-name,#select .expanded-roster .fighter-name {
 left:2px;right:2px;bottom:2px;height:18px;padding:1px 0;
 font-size:clamp(9px,.98vw,15px);letter-spacing:0;white-space:normal;overflow-wrap:anywhere;text-align:center;
}
#select .fighter-coming-soon .fighter-name {font-size:8px}
#select .fighter-badge,#select .fighter-badge.blue {top:2px;height:16px;min-width:20px;padding:0 3px;font-size:10px}
#select .fighter-badge[data-coin="2"],#select .fighter-badge[data-coin="3"] {top:auto;bottom:21px;height:16px}
#select .player-deck,#select[data-solo-party="true"] .player-deck,#select.online-fighter-select .player-deck {
 grid-column:1/-1;grid-row:3;grid-template-columns:repeat(4,minmax(0,1fr));
 grid-template-rows:minmax(0,1fr);gap:6px;min-height:0;height:100%;
}
#select .player-bay,#select[data-solo-party="true"] .cpu-slot,#select.online-fighter-select .player-bay {min-height:0;height:100%}
#select .player-preview .bay-fighter-label,#select.online-fighter-select .player-preview .bay-fighter-label {padding:12px 7px 6px}
#select .player-preview b,#select.online-fighter-select .player-preview b {font-size:clamp(16px,1.8vw,28px);white-space:normal;line-height:.95}
#select .player-preview .bay-fighter-label>span,#select .bay-state {display:none}
#select .cpu-slot .player-preview .bay-fighter-label {padding:2px 5px}
#select .cpu-slot .player-preview b {font-size:clamp(12px,1.5vw,20px)}
#select .cpu-slot-closed {gap:3px;padding:4px}
#select .cpu-slot-closed .reserved-player {font-size:26px}
#select .cpu-slot-closed>b {font-size:10px;margin:0}
#select .console-bottom,#select.online-fighter-select .console-bottom {
 grid-column:1;grid-row:4;display:flex;min-height:0;height:44px;gap:12px;
}
#select .roster-note {gap:12px}
#select .arena-choice>span {display:none}
.menu-equipment #select #start,.menu-equipment #select.online-fighter-select #start {
 grid-column:2;grid-row:4;min-height:44px;height:44px;min-width:190px;padding:4px 16px;font-size:27px;
}
#select .control-summary,#select.online-fighter-select .control-summary {display:none}
@media (max-width:999px) {
 #select .roster,#select .roster.expanded-roster {--roster-columns:8}
 #select .player-tab,#select .player-two .player-tab {font-size:10px;padding:0 6px}
 #select .player-tab.active:after {content:none}
 #select .rule-entry>b {font-size:16px}
 #select .console-rule-caption {display:none}
 #select .console-bottom {gap:8px}
 .menu-equipment #select .roster-note [data-ui="utility"] {font-size:11px}
}
/* Wide, short windows get more columns instead of cutting off the last row. */
@media (min-width:1000px) and (max-height:650px) {
 #select .roster,#select .roster.expanded-roster {--roster-columns:20}
}
@media (min-width:600px) and (max-width:999px) and (max-height:650px) {
 #select .roster,#select .roster.expanded-roster {--roster-columns:12}
}
@media (min-width:600px) and (max-height:650px) {
 #select.console-select {padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom))}
 #select .select-top {height:44px;flex-basis:44px}
 #select .console-heading h2 {font-size:28px}
 #select .selection-body,#select[data-solo-party="true"] .selection-body {grid-template-rows:44px minmax(0,1fr) 120px 44px}
 #select.online-fighter-select .selection-body {grid-template-rows:0 minmax(0,1fr) 120px 44px}
 #select .fighter-name,#select .expanded-roster .fighter-name {font-size:clamp(8px,.94vw,12px)}
}
@media (max-width:599px) {
 #select.console-select {padding:6px 6px max(6px,env(safe-area-inset-bottom))}
 #select .select-top {height:44px;flex-basis:44px;gap:6px}
 #select .console-heading h2 {font-size:23px}
 #select .console-heading small {font-size:7px}
 #select .selection-body,#select.online-fighter-select .selection-body,#select[data-solo-party="true"] .selection-body {
  grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 120px 44px 44px;gap:4px;
 }
 #select.online-fighter-select .selection-body {grid-template-rows:0 minmax(0,1fr) 120px 44px 44px}
 #select .console-rule-strip {padding:0 5px;gap:5px}
 #select .rule-entry {flex:1 1 auto;gap:5px;min-width:0}
 #select .rule-entry>span {display:none}
 #select .rule-entry>b {font-size:13px;white-space:nowrap}
 #select .cpu-difficulty-quick {flex:0 1 auto;margin:0;gap:4px;min-width:0;font-size:7px}
 .menu-equipment #select #cpuDifficultyChoice {min-width:64px;padding-inline:5px;font-size:11px}
 #select .roster,#select .roster.expanded-roster {--roster-columns:8;gap:2px;padding:2px}
 #select .fighter-name,#select .expanded-roster .fighter-name {font-size:9px;height:18px}
 #select .fighter-coming-soon .fighter-name {font-size:7px}
 #select .fighter-badge,#select .fighter-badge.blue {min-width:16px;padding:0 2px;font-size:8px;height:13px}
 #select .player-deck,#select[data-solo-party="true"] .player-deck {gap:3px}
 #select .player-tab,#select .player-two .player-tab,#select .cpu-slot .player-tab {font-size:9px;padding:0 3px;white-space:normal}
 #select .player-preview b,#select .cpu-slot .player-preview b {font-size:12px;overflow-wrap:anywhere}
 #select .player-preview .bay-fighter-label {padding:6px 3px}
 #select .cpu-slot .player-preview .bay-fighter-label {padding:1px 2px}
 #select .cpu-slot-closed {padding:2px;gap:2px}
 #select .cpu-slot-closed .reserved-player {font-size:22px}
 #select .cpu-slot-closed>b {font-size:8px}
 body.menu-equipment #select .cpu-slot-add {font-size:10px;padding:2px}
 body.menu-equipment #select .cpu-slot-tools select {padding:0 1px;font-size:10px}
 body.menu-equipment #select .cpu-slot-remove {flex:0 0 34px;width:34px;min-width:0;font-size:8px;padding:0}
 #select .console-bottom,#select.online-fighter-select .console-bottom {grid-column:1;grid-row:4;display:flex;height:44px;gap:8px}
 #select .roster-note {width:auto;gap:8px;flex:0 0 auto}
 #select .arena-choice {width:auto;min-width:0;flex:1;gap:0}
 #select #chooseStage {max-width:100%;min-width:0;text-align:right}
 #select #chooseStage b {font-size:11px;white-space:normal}
 .menu-equipment #select .roster-note [data-ui="utility"] {font-size:10px}
 .menu-equipment #select #start,.menu-equipment #select.online-fighter-select #start {grid-column:1;grid-row:5;font-size:25px;min-width:0}
}
@media (min-width:600px) and (max-width:999px) and (max-height:430px) {
 #select .roster,#select .roster.expanded-roster {--roster-columns:20}
}
/* On very short landscape displays the optional CPU controls share their
   station's top rail, freeing height for portraits without removing actions. */
@media (min-width:600px) and (max-height:430px) {
 #select .selection-body,#select[data-solo-party="true"] .selection-body {grid-template-rows:44px minmax(0,1fr) 88px 44px}
 #select.online-fighter-select .selection-body {grid-template-rows:0 minmax(0,1fr) 88px 44px}
 #select .cpu-slot .player-tab {width:38%;right:auto;padding:0 3px;font-size:9px}
 #select .cpu-slot-tools {left:38%;top:0;bottom:auto;width:62%;border-top:0}
 #select .cpu-slot .player-preview {bottom:0;height:100%}
 #select .cpu-slot-closed {gap:1px;padding:3px}
 #select .cpu-slot-closed .reserved-player {font-size:20px}
 #select .cpu-slot-closed>b {font-size:8px}
 body.menu-equipment #select .cpu-slot-remove {flex-basis:44px;width:44px;font-size:8px}
 body.menu-equipment #select .cpu-slot-tools select {padding-inline:2px;font-size:10px}
}
/* Keep 73 fighters on three readable rows in wide, shallow desktop windows. */
@media (min-width:1200px) and (max-height:500px) {
 #select .roster,#select .roster.expanded-roster {--roster-columns:25}
}
/* Preserve the full 73-character board on compact portrait phones. */
@media (max-width:599px) and (max-height:600px) {
 #select .selection-body,#select[data-solo-party="true"] .selection-body {grid-template-rows:44px minmax(0,1fr) 100px 44px 44px}
 #select.online-fighter-select .selection-body {grid-template-rows:0 minmax(0,1fr) 100px 44px 44px}
}
