/* Approved Battle/Endless setup: room to breathe on desktop, native scrolling on phones. */
#menu[data-view="setup"] .logo, #menu[data-view="setup"] .menu-news { display:none; }
#menu[data-view="setup"] .menu-center { padding:calc(60px + var(--safe-t)) calc(24px + var(--safe-r)) calc(20px + var(--safe-b)) calc(24px + var(--safe-l)); }
#setup.menu-sheet { width:100%;max-width:none;height:100%;max-height:100%;margin:0;grid-template: auto minmax(0,1fr) auto / minmax(0,1fr);border-top:2px solid var(--line);background:#0b1b29f2; }
#setup .menu-command { display:block;padding:12px 18px 0; }
#setup .setup-head { display:flex;gap:14px;margin:0 0 8px; }
#setup .setup-title { font-size:clamp(18px,1.5vw,28px);letter-spacing:0; }
#setup .setup-mech-trigger { margin-left:auto;display:flex;align-items:center;gap:10px;min-height:48px;width:210px;padding:4px 12px;background:#1a2d3e;border:1px solid var(--line-dim); }
.setup-mech-trigger img { width:36px;height:40px;object-fit:contain; }
.setup-mech-trigger strong { font-size:16px; }.setup-mech-trigger span { margin-left:auto;color:var(--line); }
#setup .mode-note { display:none; }#setup .modes { margin:0 0 10px;display:flex;gap:6px; }#setup .modes button { flex:1;min-height:44px;font-size:14px;letter-spacing:0; }
#setup .battle-scroll { display:grid;grid-template-columns:minmax(0,1.65fr) minmax(240px,.85fr) minmax(260px,1fr);gap:0;padding:0;overflow:hidden;align-items:stretch; }
#setup .setup-side { display:contents; }
#setup :is(.setup-maps,.setup-roster,.setup-settings) { min-width:0;min-height:0;padding:18px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin; }
#setup :is(.setup-roster,.setup-settings) { border-left:1px solid var(--line-dim); }
#setup .battle-section,#setup .battle-fold { margin:0 0 16px;padding:0;border:0;background:none;box-shadow:none; }
#setup .battle-section h2 { font-size:18px;letter-spacing:0;margin:0 0 12px;white-space:normal; }
#setup .battle-section h2 i { display:none; }
#setup .battle-location,#setup .battle-note:not([data-board-status]):not([data-board-guest]),#setup #battle-loadout { display:none; }
#setup .battle-area,#setup .endless-area { height:100%;display:flex;flex-direction:column;margin:0; }
#setup .battle-area .row,#setup .endless-area .row { display:flex;flex:1;min-height:0;margin:0; }
#setup .battle-section-head { margin:0 0 12px; }
#setup #place,#setup #district { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(108px,1fr));gap:10px;width:100%;height:100%; }
#setup :is(#place,#district) button { position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:flex-end;justify-content:flex-start;min-width:0;min-height:108px;padding:12px;border:1px solid #4b6575;background:#142b3a;color:#ffce65;font:800 clamp(16px,1.32vw,28px)/1.14 var(--font);text-align:left;letter-spacing:0;text-shadow:0 2px 3px #000,0 0 12px #000; }
#setup :is(#place,#district) img { position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 42%;z-index:-2; }
#setup :is(#place,#district) button::before { content:'';position:absolute;inset:0;background:linear-gradient(transparent 28%,#06142125 45%,#061421ef 100%);z-index:-1; }
#setup :is(#place,#district) button[aria-pressed="true"] { border-color:#ffce65;box-shadow:inset 0 0 0 1px #ffce65; }
#setup :is(#place,#district) button[aria-pressed="true"]::after { content:'✓';position:absolute;right:8px;top:8px;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#ffce65;color:#122535;text-shadow:none;font-size:18px; }
#setup .battle-opponents .battle-section-head { display:block; }#setup .battle-opponents .battle-section-head .row { margin-top:12px; }
#setup #foe { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px; }
#setup #foe button { min-height:60px;font-size:13px; }#setup #foe img { object-fit:contain;height:48px; }
#setup #battle-rules { margin:0; }#setup #battle-rules>h2 { font-size:20px;margin:0;padding:0 0 16px; }#setup #battle-rules .battle-chevron { display:none; }
#setup #battle-rules .battle-fold-body { display:block;padding:0; }#setup #battle-rules .row { display:block;margin:0 0 16px; }
#setup #battle-rules .label { display:block;font-size:14px;margin-bottom:8px; }#setup #battle-rules .seg { width:100%; }#setup #battle-rules button { min-height:44px;font-size:14px; }
#setup .battle-invasion { display:flex;align-items:center;gap:10px;margin:8px 0 16px; }#setup .battle-invasion h2 { font-size:14px;margin:0; }
#setup .battle-invasion .seg { margin-left:auto;flex:0 0 112px; }#setup #endless-board { margin-top:20px; }
#setup .menu-deploy { display:flex;flex-direction:row;align-items:center;gap:16px;margin:0;padding:10px 18px;border-top:1px solid var(--line-dim); }
#setup .battle-summary { min-width:0;flex:1;margin:0;font-size:13px; }#setup .menu-deploy .go { flex:none;margin:0 0 0 auto;width:220px;min-height:48px;font-size:17px; }
#setup #room-leave { margin:0; }#setup [hidden] { display:none!important; }
#setup[data-waiting="true"] .battle-scroll { grid-template-columns:1fr; }#setup[data-waiting="true"] .setup-maps,#setup[data-waiting="true"] .setup-settings { display:none; }
#setup[data-endless="true"] .battle-scroll { grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr); }#setup[data-endless="true"] .setup-roster:has(#players[hidden]):has(#online[hidden]) { display:none; }
#setup[data-defense="true"] .battle-scroll { grid-template-columns:1fr; }#setup[data-defense="true"] .setup-roster,#setup[data-defense="true"] .setup-settings { display:none; }
#setup[data-defense="true"] .setup-maps { display:block;grid-column:1/-1;grid-row:auto; }
.setup-base { max-width:900px;margin:auto;text-align:center; }.setup-base h2 { margin:0 0 12px; }.setup-base img { max-height:45vh;width:100%;object-fit:contain; }.setup-base p { color:var(--dim); }
#setup[data-defense="true"] .setup-roster::before { content:attr(data-defense-label); }
.setup-teams-title { display:flex;gap:12px;align-items:center;margin-bottom:10px; }.setup-teams-title h3 { margin:0;font-size:20px;flex:1; }
.setup-teams button,.setup-dialog button { border:1px solid #476072;background:#1a2d3e;min-height:44px;color:var(--ink);padding:8px; }
.setup-teams button:hover,.setup-dialog button:hover { border-color:var(--line);background:#254052; }
.setup-team { border:1px solid #3b5364;margin-bottom:12px;background:#192c3caa; }.setup-team>header { border-top:3px solid #73b9f3;display:flex;align-items:center;gap:12px;background:#6eb4ff14; }.setup-team.team-1>header { border-color:#ef8e94;background:#ed657c22; }
.setup-team h3 { margin:0;padding:12px;font-size:18px;flex:1; }.setup-team>header>span { font-size:12px;color:var(--dim); }.setup-team>header button { align-self:stretch;width:48px;font-size:24px; }
.setup-team-member { display:flex;gap:8px;align-items:center;padding:8px;margin:0 8px;border-bottom:1px solid #3b5364;min-height:76px; }.setup-team-member:last-child { border-bottom:0; }
.setup-member-mech { width:48px;height:54px;padding:2px!important;flex:none; }.setup-member-mech img { width:100%;height:100%;object-fit:contain; }
.setup-team-member>span:not(.setup-self) { min-width:0;flex:1; }.setup-team-member strong { display:block;font-size:15px;overflow-wrap:anywhere; }.setup-team-member small { display:block;color:var(--dim);font-size:11px;line-height:1.3; }
.setup-transfer { width:44px;flex:none;display:grid;justify-items:center;padding:2px!important; }.setup-transfer b { font-size:24px;line-height:24px; }.setup-transfer small { font-size:10px;color:inherit; }.setup-transfer.to-1 { color:#f1a3a7; }.setup-transfer.to-0 { color:#99d2ff; }
.setup-remove,.setup-self { width:36px;flex:none; }.setup-self { font-size:10px;color:var(--line);text-align:center; }.setup-empty-team { padding:8px 12px;color:var(--dim);font-size:13px; }
.setup-dialog { color:var(--ink);font-family:var(--font);width:calc(100% - 64px);max-width:none;max-height:calc(100dvh - 64px);margin:auto;padding:0;border:1px solid #476072;border-top:2px solid var(--line);background:#0b1c2b;overflow:hidden; }
.setup-dialog[open] { display:grid;grid-template-rows:auto minmax(0,1fr) auto; }.setup-dialog::backdrop { background:#020b15ca; }
.setup-dialog>header { display:flex;align-items:center;gap:16px;padding:14px 24px;border-bottom:1px solid #476072; }.setup-dialog h2 { flex:1;margin:0;font-size:26px; }.setup-dialog>header button { padding:8px 16px; }
.setup-dialog-body { padding:24px;min-height:0;overflow:auto;overscroll-behavior:contain; }.setup-mech-grid { display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px; }
.setup-mech-card { position:relative;min-width:0;display:flex; }.setup-dialog .setup-mech-select { width:100%;min-width:0;display:flex;flex-direction:column;padding:16px;text-align:left; }
.setup-mech-select>img { width:100%;height:clamp(200px,43vh,500px);object-fit:contain; }.setup-mech-caption { display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:70px;padding-right:48px; }.setup-mech-caption strong { font-size:clamp(16px,1.25vw,25px); }.setup-mech-caption small { color:var(--dim);font-size:12px;line-height:1.3; }
.setup-dialog .setup-mech-select[aria-pressed="true"] { background:#2b4454;border-color:#8ad5f4;box-shadow:inset 0 -3px #8ad5f4; }
.setup-dialog .setup-customize { position:absolute;right:10px;bottom:24px;width:44px;height:44px;padding:0;display:grid;place-items:center;color:#95d6f3; }
.setup-dialog:has(.setup-custom-layout) { width:min(1400px,85%); }.setup-custom-layout { display:grid;grid-template-columns:minmax(180px,.8fr) minmax(0,1.2fr);gap:32px;align-items:center; }.setup-custom-art { display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px;background:radial-gradient(ellipse,#2c495c,#0e2232); }.setup-custom-art img { width:100%;height:min(43vh,440px);object-fit:contain; }.setup-custom-art strong { font-size:22px; }.setup-custom-art span { color:var(--dim); }
.setup-custom-layout h3 { font-size:24px;margin:0 0 20px; }.setup-colors { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }.setup-dialog .setup-color { display:flex;flex-direction:column;align-items:center;gap:12px;padding:18px 8px;font-size:14px; }.setup-color i { width:40px;height:40px;border-radius:50%;border:2px solid #ffffff80; }.setup-color[aria-pressed="true"] { outline:2px solid var(--line);outline-offset:-2px; }.setup-color[aria-pressed="true"] i::after { content:'✓';display:grid;place-items:center;height:100%;font:900 24px var(--font);color:white;text-shadow:0 1px 3px black; }.setup-custom-layout p { color:var(--dim);font-size:13px;line-height:1.4;margin-top:20px; }
.setup-dialog>footer { display:flex;justify-content:flex-end;padding:12px 24px;border-top:1px solid #476072; }.setup-dialog>footer button { min-width:180px;background:#f7c76b;color:#132431;font-weight:700; }
@media(min-width:1800px) { #setup :is(.setup-maps,.setup-roster,.setup-settings) { padding:24px; }#setup .battle-scroll { grid-template-columns:minmax(0,1.75fr) minmax(0,.95fr) minmax(0,1fr); }#setup .battle-section h2 { font-size:24px; }#setup #battle-rules .row { margin-bottom:24px; }.setup-team-member { min-height:92px; }.setup-member-mech { width:60px;height:70px; } }
@media(max-width:1279px) {
  #setup .battle-scroll { grid-template-columns:minmax(0,1.25fr) minmax(240px,1fr); }
  #setup .setup-side { display:block;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin; }
  #setup .setup-side>section { overflow:visible; }
  #setup .setup-settings { border-top:1px solid var(--line-dim); }
  .setup-mech-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }.setup-mech-select>img { height:clamp(110px,20vh,180px); }
}
@media(max-height:599px),(max-width:959px) {
  #menu[data-view="setup"] .menu-center,:root.ph #menu[data-view="setup"] .menu-center { padding:calc(46px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); }
  #setup .menu-command { padding:6px 10px 0; }#setup .setup-head { gap:10px;margin:0 0 4px; }#setup .setup-title { font-size:16px; }#setup .setup-mech-trigger { width:164px;min-height:44px;height:44px; }#setup .setup-mech-trigger img { height:32px; }#setup .setup-mech-trigger strong { font-size:14px; }
  #setup .modes { gap:4px;margin-bottom:6px; }#setup .modes button { font-size:12px;min-height:44px;padding:4px; }
  #setup .battle-scroll,#setup[data-endless="true"] .battle-scroll { grid-template-columns:minmax(0,1.2fr) minmax(240px,1fr);overflow:hidden; }
  #setup :is(.setup-maps,.setup-roster,.setup-settings) { padding:10px; }#setup .setup-side { display:block;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain; }#setup .setup-side>section { overflow:visible; }#setup .battle-section h2,#setup #battle-rules>h2 { font-size:16px; }#setup #place,#setup #district { grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(4,minmax(112px,1fr));gap:6px; }
  #setup :is(#place,#district) button { min-height:112px;font-size:16px;padding:8px; }
  #setup .menu-deploy { padding:6px 10px;gap:10px; }#setup .menu-deploy .go { min-height:44px;width:150px;font-size:15px; }#setup .battle-summary { font-size:11px; }
  .setup-team h3 { font-size:15px;padding:8px; }.setup-team-member { min-height:64px;padding:6px 0;gap:4px;margin:0 4px; }.setup-member-mech { width:40px;height:48px; }.setup-team-member strong { font-size:12px; }.setup-team-member small { font-size:10px; }.setup-remove,.setup-self { width:32px; }
  .setup-dialog { width:calc(100% - 24px);max-height:calc(100dvh - 24px); }.setup-dialog>header { padding:6px 12px; }.setup-dialog h2 { font-size:18px; }.setup-dialog-body { padding:12px; }.setup-mech-grid { grid-template-columns:repeat(3,minmax(0,1fr));gap:8px; }.setup-dialog .setup-mech-select { padding:8px; }.setup-mech-select>img { height:82px; }.setup-mech-caption { min-height:56px; }.setup-mech-caption strong { font-size:15px; }.setup-mech-caption small { font-size:10px; }.setup-dialog .setup-customize { bottom:12px;right:8px; }
  .setup-dialog:has(.setup-custom-layout) { width:calc(100% - 24px); }.setup-custom-layout { grid-template-columns:130px minmax(0,1fr);gap:16px; }.setup-custom-art { padding:6px;gap:4px; }.setup-custom-art img { height:110px; }.setup-custom-art strong { font-size:16px; }.setup-custom-art span { font-size:11px; }.setup-custom-layout h3 { font-size:17px;margin-bottom:8px; }.setup-colors { gap:6px; }.setup-dialog .setup-color { padding:6px;gap:5px;font-size:11px; }.setup-color i { width:28px;height:28px; }.setup-custom-layout p { font-size:11px;margin-top:8px; }.setup-dialog>footer { padding:6px 12px; }
}


@media(min-width:1280px) and (min-height:600px) { #setup[data-endless="true"]:has(#players:not([hidden])) .battle-scroll,#setup[data-endless="true"][data-online="true"]:not([data-waiting="true"]) .battle-scroll { grid-template-columns:minmax(0,1.7fr) minmax(240px,.85fr) minmax(260px,1fr); } }

#setup[data-defense="true"] .setup-side { display:none; }

.setup-teams .setup-remove { width:44px;min-width:44px; }
@media(max-width:599px) {
  #setup .setup-head { flex-wrap:wrap; }#setup .setup-title { flex:1; }
  #setup .setup-mech-trigger { width:100%;margin-left:0; }
  #setup .modes { flex-wrap:wrap; }#setup .modes button { flex:1 1 45%; }
  #setup .battle-scroll,#setup[data-endless="true"] .battle-scroll { display:block;overflow:auto; }
  #setup .setup-side { display:contents; }#setup :is(.setup-maps,.setup-roster,.setup-settings) { overflow:visible; }
  #setup .battle-area,#setup .endless-area { height:auto; }
  #setup #place,#setup #district { grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(6,minmax(120px,1fr)); }
  #setup .menu-deploy .go { width:124px; }.setup-mech-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .setup-custom-layout { grid-template-columns:90px minmax(0,1fr);gap:10px; }.setup-colors { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
