/* Shared phone and tablet layout. Navigation remains available without JS. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
main,section,article,aside,nav,form{min-width:0}
img,video{max-width:100%}
button,input,select,textarea{touch-action:manipulation}
.nav-enhanced{position:relative;z-index:20}
.nav-enhanced .topnav{flex-wrap:nowrap}
.nav-pages{display:flex;align-items:center;gap:inherit}
.nav-pages>a{color:var(--text-dim);padding:32px 0;white-space:nowrap}
.nav-pages>a.active{color:var(--brass);border-bottom:2px solid var(--brass)}
.topbar .nav-toggle,.nav-short-label{display:none}
body:has(#gameArea.show) .nav-pages>a{padding-block:20px}
@media(max-width:1100px){
 .topbar.nav-enhanced,body:has(#gameArea.show)>.topbar.nav-enhanced{display:flex;flex-wrap:nowrap;height:76px;min-height:76px;gap:16px;padding:12px 24px}
 .nav-enhanced .brand{flex:0 1 auto;min-width:0;font-size:16px}
 .nav-enhanced .brand small{font-size:10px;letter-spacing:.12em}
 .nav-enhanced .topnav{position:static;margin:0 0 0 auto;gap:14px;max-width:none;flex:0 0 auto}
 .topbar .nav-toggle{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 14px;font:600 14px var(--face)}
 .nav-toggle::after{content:'+';font-size:20px;line-height:1}.nav-open .nav-toggle::after{content:'−'}
 .nav-enhanced .nav-pages{display:none;position:absolute;top:100%;inset-inline:16px;max-height:calc(100dvh - 100px);overflow-y:auto;padding:10px;background:#1a251f;border:1px solid #56634d;box-shadow:0 14px 30px #0006;z-index:30}
 .nav-enhanced.nav-open .nav-pages{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .nav-pages>a,.nav-pages>a.active{padding:14px 16px;min-height:48px;border:1px solid transparent;font:600 16px/1.35 var(--face)}
 .nav-pages>a.active{background:#efbb5812;border-color:#efbb5870}.nav-pages>a:hover{background:#303d2d}
 .nav-pages>a:focus-visible,.nav-toggle:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
 main:not(.home-main){padding-inline:24px}
 .home-hero{min-height:620px;height:calc(100svh - 76px);max-height:850px}
 .home-hero-bottom{flex-wrap:wrap;margin-top:100px}
 .home-actions{gap:10px}.home-controls{margin-left:auto}
 .profile-account{gap:24px;padding:24px}.profile-connections{padding-left:24px}
}
@media(max-width:850px){
 .profile-account,.profile-progress{grid-template-columns:minmax(0,1fr)}
 .profile-connections{border-left:0;border-top:1px solid #46513f;padding:24px 0 0}
 .discussion-layout{grid-template-columns:minmax(0,1fr)}
 .member-bar{align-items:start;flex-direction:column;gap:12px}
 .member-bar .signin-preview{width:100%;display:flex;flex-wrap:wrap}
 .member-bar .signin-preview>*{flex:1 1 120px;justify-content:center;white-space:normal}
 .home-intro{gap:28px}.home-intro h2{font-size:clamp(42px,6vw,64px)}
}
@media(max-width:600px){
 .topbar.nav-enhanced,body:has(#gameArea.show)>.topbar.nav-enhanced{height:72px;min-height:72px;padding:10px 16px;gap:10px}
 .nav-enhanced .brand{gap:8px;font-size:13px;letter-spacing:.015em}.nav-enhanced .brand img{width:32px;height:32px}
 .nav-enhanced .brand small{font-size:9px;letter-spacing:.08em}
 .nav-enhanced .topnav{gap:8px}.topbar .nav-toggle{padding:8px 10px;min-width:60px}
 .nav-wide-label{display:none}.nav-short-label{display:inline}
 .nav-enhanced .nav-leaderboard{min-width:44px;font-size:14px}
 .nav-enhanced .nav-profile img{width:36px;height:36px}
 main:not(.home-main){padding:20px 16px 0}
 h1{font-size:clamp(32px,9vw,44px)}
 .mission-heading{align-items:start;gap:12px;flex-wrap:wrap}.sector-stamp{text-align:left}
 .member-bar{padding:14px;margin-bottom:20px}.member-bar .signin-preview{gap:8px}
 .member-bar .signin-preview>*{flex:1 1 80px;padding:10px 8px;min-height:44px}
 .member-bar>button{width:100%;min-height:48px}
 .home-hero{height:auto;min-height:0;max-height:none;padding:28px 16px 24px}
 .home-copy h1{font-size:clamp(56px,16vw,88px)}
 .home-stage{width:calc(100% + 32px);margin:24px -16px 0;aspect-ratio:16/9}
 .home-hero-bottom{margin-top:20px;gap:16px}.home-controls{width:100%;margin:0;justify-content:stretch}
 .home-controls button{flex:1;min-height:44px;font-size:14px}
 .home-intro{padding:40px 20px;grid-template-columns:1fr}.home-intro h2{font-size:44px}
 .home-page .site-footer{padding:28px 20px}.site-footer{padding-bottom:max(24px,env(safe-area-inset-bottom))}
 .profile-account,.profile-progress .profile-card,.profile-card{padding:20px}
 .profile-page .profile-wallets .signin-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .profile-page .profile-wallets .signin-preview button{width:100%}
 .member-form input:not([type=checkbox]),.member-form textarea,.member-form select{font-size:16px;min-width:0;max-width:100%}
 .member-form input[type=file]{font-size:14px;padding:10px 6px}
 .editor-actions{flex-wrap:wrap;gap:8px}.editor-actions button{flex:1 1 110px;min-height:48px}
 .discussion-heading,.board-heading{align-items:start;flex-wrap:wrap;gap:14px}.board-heading button{min-height:44px}
 .preview-notice,.holder-access{padding:18px;font-size:16px;line-height:1.6}
 .category-tabs{flex-wrap:wrap}.category-tabs button{min-height:44px;font-size:14px}
 .history-chapters>li{grid-template-columns:1fr;gap:12px}.history-socials{flex-direction:column}.history-socials a{width:100%;min-width:0}
 .history-socials a{font-size:20px}.history-socials a span{font-size:16px;overflow-wrap:anywhere}
 .shop-heading h1{font-size:clamp(42px,12vw,68px)}
 .site-footer .footer-links{gap:0 16px}.site-footer .footer-social{font-size:14px}
}
@media(max-width:380px){.nav-enhanced .brand>span{display:none}.nav-enhanced .brand img{width:36px;height:36px}.nav-enhanced .topnav{gap:12px}}
@media(min-width:601px) and (max-width:650px){.home-hero{height:auto;min-height:0;max-height:none}}

/* A collection grid, with one animation per visible card and PFP on demand. */
.owned-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:20px;align-items:start}
.owned-card{display:flex;flex-direction:column;gap:14px;min-width:0;padding:20px}
.owned-card .owned-name{font-size:20px;line-height:1.4;margin:0}
.owned-card .owned-mech{width:100%;aspect-ratio:1;object-fit:contain}
.owned-card .owned-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;width:100%;margin:0;padding-top:14px}
.owned-card .owned-links button{min-width:0;padding:10px 6px;min-height:44px;font-size:14px}
.owned-card .pfp-canvas.show{display:block;width:100%}
@media(max-width:600px){.owned-grid{grid-template-columns:1fr;gap:16px}.owned-card{padding:16px}.garage-heading{margin:10px 0 24px}.collection-filters{gap:12px;margin-top:12px}.collection-filters .chain-toggle{width:100%}.collection-filters button{min-height:44px}}

/* Crew browsing should use the screen, not a long strip of oversized cards. */
@media(max-width:1100px){
 #crewGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:14px;overflow:visible;padding:4px 0 16px}
 #crewGrid .crew-card{width:100%;padding:16px;max-width:none}
 .crew-actions{padding-bottom:max(12px,env(safe-area-inset-bottom))}
}
@media(max-width:600px){
 .briefing-art{min-height:0;padding:24px 20px 60px}.briefing-copy h2{font-size:36px}
 .briefing-copy p{font-size:16px}.briefing-mechs.featured-mechs img{height:190px}
 .briefing-invite{padding:20px}.console h2{font-size:28px}
 .crew-picker{padding:16px}.crew-toolbar{display:grid;grid-template-columns:1fr}
 #crewGrid{grid-template-columns:minmax(0,1fr)}
 #crewGrid .crew-card{display:grid;grid-template-columns:88px minmax(0,1fr);column-gap:12px;align-items:start}
 .crew-card-heading,.crew-loadout,.crew-card-footer{grid-column:1/-1}
 #crewGrid .crew-art{padding:12px 0}.crew-card .crew-roles{align-self:center;margin:12px 0}
 #crewGrid .crew-art img{width:88px;height:88px}.crew-arm-heading{font-size:14px}.crew-tactic{font-size:16px}
 .crew-actions{gap:12px;align-items:center}.crew-actions button{min-height:48px;padding:12px 16px;font-size:16px}
}

/* Phones and tablets get a full-width field and reachable touch controls. */
@media(max-width:1100px),(pointer:coarse){
 #gameArea .game-area{height:auto;min-height:0;grid-template-columns:minmax(0,1fr)}
 #gameArea .field-frame,#gameArea .command-bar{width:100%}
 #gameArea .battle-rail{height:auto;max-height:none;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto;align-items:start}
 #gameArea .tower-panel{grid-column:1/-1;max-height:none}
 #gameArea .tower-panel:has(.empty-panel){display:none}
 #gameArea .controls{flex-wrap:wrap}#gameArea .controls button,#gameArea .game-audio-controls button{min-height:44px;font-size:14px}
 #gameArea .command-bar{grid-template-columns:minmax(0,1fr) auto}
}
@media(max-width:600px){
 body:has(#gameArea.show)>main{padding:8px 12px 20px}
 #gameArea>.hud{grid-template-columns:1.3fr 1fr 1fr 1fr;margin-bottom:8px}
 #gameArea>.hud .sector,#gameArea>.hud .wave{grid-column:auto;border-bottom:0;border-right:1px solid var(--panel-line)}
 #gameArea>.hud>div{padding:10px 6px}#gameArea>.hud .dim{font-size:10px;line-height:1.4;min-height:28px;letter-spacing:0}
 #gameArea>.hud strong{font-size:16px;white-space:normal}#gameArea>.hud>button{display:none}
 #gameArea .field-label{gap:6px;padding:8px;font-size:12px}
 #gameArea .command-bar{grid-template-columns:1fr;gap:8px}
 #gameArea .command-bar>.controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 #gameArea .controls .primary{grid-column:1/-1}#gameArea .controls button{padding:10px 6px}
 #gameArea .command-bar>.msg{grid-column:1;grid-row:2;font-size:14px}
 #gameArea .game-audio-controls{grid-column:1;grid-row:3}#gameArea .game-audio-controls button{flex:1}
 #gameArea .battle-rail{grid-template-columns:minmax(0,1fr);gap:10px}
 #gameArea #mechRoster{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #gameArea #mechRoster .mech-card{grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto auto;text-align:left;min-height:76px;padding:10px;gap:6px}
 #gameArea #mechRoster .mech-card img{grid-row:1/3;width:42px;height:54px}#gameArea #mechRoster .cost{font-size:14px}
 #gameArea .result-card .result-actions{grid-template-columns:1fr}#gameArea .result-actions button{width:100%;min-height:48px}
}
@media(pointer:coarse) and (orientation:landscape) and (min-width:700px){
 #gameArea .game-area{grid-template-columns:minmax(0,1fr) 250px;gap:12px}
 #gameArea .battle-rail{grid-template-columns:minmax(0,1fr)}
 #gameArea>.hud{min-height:54px}#gameArea>.hud>div{padding:8px 12px}
 #gameArea>.hud strong{font-size:20px}#gameArea>.hud>button{display:none}
 #gameArea>.hud{grid-template-columns:1.3fr 1fr 1fr 1fr}
}

/* A compact arrival: the trailer and Play action fit together on a phone. */
@media(max-width:650px){
 .home-hero{padding:24px 16px 20px;height:auto;min-height:0;max-height:none}
 .home-copy h1{font-size:clamp(44px,12vw,72px);line-height:.94;margin-bottom:14px}
 .home-eyebrow{font-size:12px;letter-spacing:.1em;margin-bottom:12px}
 .home-tagline{font-size:16px;line-height:1.5}
 .home-stage{width:calc(100% + 32px);margin:20px -16px 0}
 .home-hero-bottom{margin-top:16px;gap:10px}
 .home-actions{gap:8px}
 .home-actions a{min-height:48px;padding:12px 16px;font-size:16px}
 .home-actions .home-secondary{min-height:44px;background:transparent;border-color:#68785d}
 .home-controls{gap:8px}.home-controls button{font-size:14px;padding:8px 10px}
 .topbar.nav-enhanced,body:has(#gameArea.show)>.topbar.nav-enhanced{height:64px;min-height:64px;padding:8px 12px;gap:6px}
 .nav-enhanced .brand{font-size:12px;gap:7px}.nav-enhanced .brand small{display:none}
 .nav-enhanced .brand img{width:28px;height:28px}.nav-enhanced .topnav{gap:6px}
 .topbar .nav-toggle{min-width:54px;padding:8px}.nav-toggle::after{display:none}
}

/* Quiet collection browsing with a bounded number of decoded previews. */
.owned-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,248px),1fr));gap:16px}
.owned-card{padding:16px;background:#1b251e;border:1px solid #3d4b38;gap:10px}
.owned-name{display:flex;justify-content:space-between;align-items:center}
.owned-name span{font:600 12px var(--face);letter-spacing:.08em;color:#b4c0aa}
.owned-preview{position:relative;width:100%;aspect-ratio:1;background:#131c16;border:1px solid #35432f;display:grid;place-items:center}
.owned-card .owned-mech{width:100%;height:100%;max-height:360px;object-fit:contain;font-size:14px;color:#bcc7b1;text-align:center}
.owned-mech[data-art-state="error"]{opacity:.35}
.art-retry{position:absolute;bottom:16px;min-height:44px;background:#253223;border-color:#a9ba8d}
.art-retry[hidden]{display:none}
.owned-card .card-status{font-size:14px;line-height:1.45;margin:0}
.owned-card .card-status:empty{display:none}
.owned-card .owned-links{padding-top:4px}
.collection-browse{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:16px;margin:24px 0 40px}
.collection-browse p{color:#b4c0aa;font-size:14px}.collection-browse button,.browse-more{min-height:48px}
.collection-browse[hidden],.collection-browse button[hidden],.browse-more[hidden]{display:none}
.garage-heading{text-align:left;margin:20px 0 28px}.garage-heading h1{font-size:clamp(32px,4vw,44px);margin:0 0 8px}
.garage-heading p{margin:0;font-size:16px}.collection-filters{justify-content:space-between}

/* Compare both arms without a sideways strip. The deploy bar stays in reach. */
#crewGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:16px;overflow:visible;padding:4px 0 20px;align-items:stretch}
#crewGrid .crew-tile{--crew-card-padding:16px}
#crewGrid .crew-card{display:grid;grid-template-columns:92px minmax(0,1fr);gap:12px;padding:16px;width:100%;max-width:none;align-content:start;align-items:start}
#crewGrid .crew-card-heading,#crewGrid .crew-loadout,#crewGrid .crew-card-footer{grid-column:1/-1}
#crewGrid .crew-card-heading>strong{font-size:18px}
#crewGrid .crew-art{padding:0}#crewGrid .crew-art img{width:92px;height:92px;font-size:12px}
#crewGrid .crew-roles{align-self:center;margin:0;gap:6px}
#crewGrid .crew-role{font-size:14px;padding:5px 7px}
#crewGrid .crew-loadout{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#crewGrid .crew-arm{gap:6px;padding-top:12px}
#crewGrid .crew-arm-heading{font-size:14px}.crew-arm-role{display:none}
#crewGrid .crew-weapon{font-size:16px}.crew-tactic{font-size:14px;line-height:1.5}
#crewGrid .crew-arm-stats{font-size:12px;margin-top:4px}
#crewGrid .crew-card-footer{margin-top:4px;padding-top:12px}
.crew-picker .crew-actions{position:sticky;top:0;bottom:auto;margin:16px 0 8px;padding:12px 0;border-bottom:1px solid #59644d;border-top:0;background:#1b2520;z-index:3;box-shadow:0 8px 14px #10171150}
.crew-picker .crew-actions p{margin:0;font-size:16px}.crew-results{font-size:14px}
.browse-more{display:block;margin:4px auto 16px}

/* Give the battlefield the available width; keep ancillary controls readable. */
#gameArea .field-frame,#gameArea .command-bar{width:100%}
#gameArea .game-area{height:auto;min-height:0}
#gameArea .battle-rail{height:auto;max-height:calc(100dvh - 160px);grid-template-rows:auto auto auto}
#gameArea .battle-art-status{border-left:2px solid #efbb58;padding:0 0 0 10px;margin-bottom:12px}
#gameArea .battle-art-status[hidden]{display:none}
#gameArea .battle-art-status p{font-size:14px;line-height:1.4;margin:0 0 8px;color:#c2cdb8}
#gameArea #retryMechArt{min-height:44px;font-size:14px;padding:8px 12px}
#gameArea #mechRoster .cost{font-size:14px}
@media(max-width:1100px),(pointer:coarse){#gameArea .battle-rail{max-height:none}}
@media(max-width:600px){
 .crew-picker{padding:14px}.crew-toolbar{gap:12px;margin:16px 0}
 .crew-wallets{font-size:14px}.crew-summary{padding:12px;gap:10px}
 #crewGrid{grid-template-columns:minmax(0,1fr);gap:12px}
 #crewGrid .crew-tile{--crew-card-padding:14px}
 #crewGrid .crew-card{padding:14px}
 .crew-picker .crew-actions{padding:10px 0}.crew-picker .crew-actions button{min-height:48px}
 #gameArea>.hud .dim{font-size:12px;min-height:30px;letter-spacing:0}
 #gameArea>.hud>div{padding:8px 6px}#gameArea>.hud strong{font-size:17px}
 #gameArea .field-label{font-size:12px;letter-spacing:0;flex-wrap:wrap}
 #gameArea .game-audio-controls button{padding:8px;min-height:44px}
 .garage-heading{margin:4px 0 24px}.collection-filters>span{display:none}
}
@media(max-width:359px){#crewGrid .crew-loadout{grid-template-columns:1fr}.nav-enhanced .brand>span{display:none}}

.crew-art{position:relative}
.crew-art:has(img[data-art-state="error"])::after{content:'Art unavailable';position:absolute;inset:0;display:grid;place-items:center;border:1px dashed #68785d;padding:8px;font:500 12px/1.4 var(--face);color:#becab4;text-align:center}
.crew-art img[data-art-state="error"],.owned-mech[data-art-state="error"]{visibility:hidden}

/* Sideways phones: a fitted field and one independently scrolling console. */
@media(orientation:landscape) and (min-width:600px) and (max-height:600px), (orientation:landscape) and (min-width:700px) and (max-width:1400px) and (max-height:1100px){
 body:has(#gameArea.show)>main{padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left))}
 #gameArea.show{display:grid;grid-template-rows:auto minmax(0,1fr);gap:8px;height:calc(100dvh - 16px);min-height:220px;scroll-margin-top:6px}
 #gameArea>.hud{grid-template-columns:1.3fr 1fr 1fr 1.1fr;min-height:48px;margin:0}
 #gameArea>.hud>div{padding:5px 10px;grid-column:auto;border-bottom:0}
 #gameArea>.hud .dim{font-size:12px;line-height:1.2;min-height:0;margin-bottom:2px;letter-spacing:0}
 #gameArea>.hud strong{font-size:18px;line-height:1.25}
 #gameArea>.hud>button{display:none}
 #gameArea .game-area{grid-template-columns:minmax(0,1fr) clamp(220px,29vw,270px);gap:10px;height:100%;min-height:0;align-items:stretch}
 #gameArea .battle-column{display:block;min-height:0;height:100%}
 #gameArea .field-frame{width:var(--landscape-field-width,min(100%,calc((100dvh - 110px)*16/9)));margin-inline:auto}
 #gameArea .field-label{min-height:30px;padding:6px 8px;gap:6px;flex-wrap:wrap;font-size:12px;letter-spacing:0;line-height:1.35}
 #gameArea.placing-mech #fieldSignal,#gameArea.placing-mech #fieldPhase{display:none}
 #gameArea .battle-rail{display:flex;flex-direction:column;gap:10px;height:100%;min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior-y:contain;padding:0 4px 8px;scroll-padding-top:60px}
 #gameArea .battle-rail>*{flex-shrink:0}
 #gameArea .battle-panel-switcher{order:0;position:sticky;top:0;z-index:4;display:flex;gap:6px;padding:0 0 8px;background:#141e18;box-shadow:0 4px 0 #141e18}
 #gameArea .battle-panel-switcher button{flex:1 0 auto;min-width:44px;min-height:44px;padding:7px 4px;font:600 13px/1.25 var(--face)}
 #gameArea .battle-panel-switcher button[hidden]{display:none}
 #gameArea .battle-panel-switcher #pauseBtn{flex:1 1 64px;min-width:44px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #gameArea .battle-rail .controls{order:5;display:grid;grid-template-columns:1fr;gap:8px;padding:0 0 8px}
 #gameArea[data-rail-view="crew"] :is(.holder-support,.tower-panel),#gameArea[data-rail-view="support"] :is(.crew-dock,.tower-panel),#gameArea[data-rail-view="tower"] :is(.crew-dock,.holder-support){display:none}
 #gameArea .controls button{min-height:44px;padding:7px 5px;font-size:14px;line-height:1.25;margin:0;width:100%}
 #gameArea #startWaveBtn{grid-column:auto}
 #gameArea #verificationNotice{order:1;font-size:14px;margin:0;padding:10px}
 #gameArea #verificationNotice button{min-height:44px;margin-top:8px}
 #gameArea .tower-panel{order:2;overflow:visible}
 #gameArea .tower-panel:not([data-mode="tower"]){display:none}
 #gameArea .tower-panel .panel-art,#gameArea .tower-panel>.loadout-names,#gameArea .tower-panel>.t-sub{display:none}
 #gameArea .tower-summary>div{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center}
 #gameArea .tower-summary .t-name{font-size:14px;margin:0}
 #gameArea .tower-summary .t-sub{font-size:12px;margin:0}
 #gameArea .tower-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0;border:0;box-shadow:none;background:none;margin:8px 0 10px}
 #gameArea .tower-panel .mech-key{padding:7px 4px;min-height:52px}
 #gameArea .tower-panel .mech-key-icon,#gameArea .tower-panel .mech-key-light{display:none}
 #gameArea .tower-panel .mech-key-copy strong{font-size:14px}
 #gameArea .tower-panel .mech-key-copy small{font-size:12px;line-height:1.3}
 #gameArea .crew-dock{order:3}
 #gameArea .holder-support{order:4}
 #gameArea .crew-dock,#gameArea .holder-support,#gameArea .tower-panel{padding:8px}
 #gameArea .dock-heading h2,#gameArea .support-heading h3{font-size:16px}
 #gameArea .dock-heading,#gameArea .support-heading{display:none}
 #gameArea .crew-drag-help{font-size:12px;line-height:1.35;margin:0 0 8px}
 #gameArea #mechRoster{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #gameArea #mechRoster .mech-card{grid-template-columns:28px minmax(0,1fr);grid-template-rows:1fr auto;gap:3px 5px;min-height:68px;padding:6px 4px;text-align:left}
 #gameArea #mechRoster .mech-card img{grid-row:1/3;width:28px;height:46px;align-self:center}
 #gameArea #mechRoster .m-name,#gameArea #mechRoster .cost{font-size:14px;line-height:1.2}
 #gameArea .command-bar{order:6;display:flex;flex-direction:column;width:100%;gap:8px;padding-top:0;margin:0}
 #gameArea .landscape-options{order:1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-bottom:4px}
 #gameArea .landscape-options button{min-height:44px;padding:7px 5px;font-size:14px}
 #gameArea .command-bar .msg{order:0;margin:0;font-size:14px}
 #gameArea .game-audio-controls{order:2;flex-wrap:wrap;align-self:stretch}
 #gameArea .game-audio-controls button{min-height:44px;font-size:14px;padding:7px 8px;flex:1}
 #gameArea .field-stage .run-result{position:absolute;inset:0;padding:8px;overflow:auto}
 #gameArea .result-card{padding:10px;max-height:100%}
 #gameArea .result-card h2{font-size:24px;margin-block:6px}
 #gameArea .result-card .result-actions{gap:6px;margin-top:8px}
 #gameArea .result-actions button{width:100%;min-height:44px;font-size:13px;padding:8px 4px}
}

/* Touch controls remain legible even with the compact battle rail. */
@media(pointer:coarse),(max-width:600px){
 #gameArea .support-grid{gap:10px}
 #gameArea .support-card{min-height:68px;padding:12px 10px;gap:6px}
 #gameArea .support-card strong{font-size:16px;line-height:1.25}
 #gameArea .support-state{font-size:14px;line-height:1.25}
 #gameArea .support-help button{min-height:48px}
}
@media(pointer:coarse) and (orientation:landscape) and (min-width:700px) and (min-height:601px){
 #gameArea .game-area{grid-template-columns:minmax(0,1fr) clamp(236px,24vw,290px)}
 #gameArea .battle-panel-switcher{flex-wrap:wrap}
 #gameArea .battle-panel-switcher button{font-size:14px;min-height:48px;padding:8px 6px}
 #gameArea .crew-dock,#gameArea .holder-support,#gameArea .tower-panel{padding:12px}
 #gameArea #mechRoster .mech-card{min-height:82px;grid-template-columns:36px minmax(0,1fr);padding:8px 6px}
 #gameArea #mechRoster .mech-card img{width:36px;height:56px}
 #gameArea .tower-panel .mech-key{min-height:60px}
}

/* Keep Pause/Resume readable when the selected-mech tab appears. */
@media(orientation:landscape) and (min-width:600px) and (max-height:600px), (orientation:landscape) and (min-width:700px) and (max-width:1400px) and (max-height:1100px){
 #gameArea .battle-panel-switcher{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 #gameArea .battle-panel-switcher button{min-width:0;overflow-wrap:normal;font-size:13px;padding:8px 4px}
 #gameArea .battle-panel-switcher #pauseBtn{grid-column:1/-1;overflow:visible;text-overflow:clip;min-width:0;white-space:normal;font-size:14px}
 #gameArea .battle-panel-switcher:has(button[hidden]) #pauseBtn{grid-column:auto}
}

/* A stable control strip: selecting a mech never inserts another button row. */
#gameArea[data-compact-battle] .battle-rail{align-items:stretch}
#gameArea[data-compact-battle] .battle-panel-switcher{display:grid;grid-template-columns:1fr 1.3fr 1fr 1.2fr;gap:4px;position:sticky;top:0;z-index:4;padding:0 0 8px;background:#141e18;box-shadow:0 4px 0 #141e18}
#gameArea[data-compact-battle] .battle-panel-switcher button{min-width:0;min-height:44px;padding:8px 2px;font:600 13px/1.25 var(--face);white-space:nowrap}
#gameArea[data-compact-battle] .battle-panel-switcher #pauseBtn{grid-column:auto;white-space:normal;overflow-wrap:anywhere;font-size:13px}
#gameArea[data-compact-battle] .battle-panel-switcher button[aria-pressed="true"]{border-color:var(--brass);color:var(--brass)}
#gameArea[data-compact-battle][data-rail-view="crew"] :is(.holder-support,.tower-panel),#gameArea[data-compact-battle][data-rail-view="support"] :is(.crew-dock,.tower-panel),#gameArea[data-compact-battle][data-rail-view="tower"] :is(.crew-dock,.holder-support){display:none}
#gameArea[data-compact-battle] .battle-settings{order:2;border-top:1px solid var(--panel-line);padding-top:4px}
#gameArea[data-compact-battle] .battle-settings summary{display:flex;align-items:center;min-height:44px;font:500 14px/1.4 var(--face);color:var(--text-dim);cursor:pointer}
#gameArea[data-compact-battle] .battle-settings summary::before{content:'+';color:var(--brass);margin-right:8px}
#gameArea[data-compact-battle] .battle-settings[open] summary::before{content:'−'}
#gameArea[data-compact-battle] .battle-settings summary:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
#gameArea[data-compact-battle] .battle-settings .landscape-options{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px}
#gameArea[data-compact-battle] .battle-settings .game-audio-controls{display:flex;flex-wrap:wrap;gap:8px}
#gameArea[data-compact-battle] .battle-settings button{min-height:44px;padding:8px;font-size:14px;flex:1}
#gameArea[data-compact-battle="landscape"] .crew-drag-help{display:none}
#gameArea[data-compact-battle="landscape"] .battle-rail{scroll-padding-top:56px}
#gameArea[data-compact-battle="landscape"] #mechRoster .mech-card{min-height:64px}

@media(max-width:600px){
 .crew-picker .crew-actions{top:env(safe-area-inset-top,0px)}
 #gameArea[data-compact-battle="portrait"]{scroll-margin-top:env(safe-area-inset-top,0px)}
 #gameArea[data-compact-battle="portrait"] .game-area{display:grid;grid-template-columns:1fr;gap:8px}
 #gameArea[data-compact-battle="portrait"] .battle-column{display:block;min-width:0}
 #gameArea[data-compact-battle="portrait"] .battle-rail{display:flex;flex-direction:column;height:auto;max-height:none;overflow:visible;gap:8px}
 #gameArea[data-compact-battle="portrait"] .battle-panel-switcher{order:0;top:env(safe-area-inset-top,0px)}
 #gameArea[data-compact-battle="portrait"] .battle-panel-switcher button{font-size:14px;padding:8px 4px}
 #gameArea[data-compact-battle="portrait"] #verificationNotice{order:1;margin:0}
 #gameArea[data-compact-battle="portrait"] :is(.crew-dock,.holder-support,.tower-panel){order:2}
 #gameArea[data-compact-battle="portrait"] .dock-heading{display:none}
 #gameArea[data-compact-battle="portrait"] .battle-rail .controls{order:3;display:grid;grid-template-columns:1fr;gap:8px}
 #gameArea[data-compact-battle="portrait"] .controls button{min-height:44px;width:100%;margin:0;grid-column:auto}
 #gameArea[data-compact-battle="portrait"] .command-bar{order:4;display:flex;flex-direction:column;gap:8px;padding:0}
 #gameArea[data-compact-battle="portrait"] .command-bar>.msg{order:0;margin:0;font-size:14px}
 #gameArea[data-compact-battle="portrait"] #mechRoster .mech-card{min-height:68px}
 #gameArea[data-compact-battle="portrait"] .run-result{scroll-margin-top:calc(90px + env(safe-area-inset-top,0px))}
 #gameArea[data-compact-battle="portrait"] .result-card{max-height:calc(100svh - 112px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));padding:12px}
 #gameArea[data-compact-battle="portrait"] .result-card .result-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
 #gameArea[data-compact-battle="portrait"] .result-actions button{font-size:14px;min-height:48px;padding:10px 6px}
 #gameArea[data-compact-battle="portrait"] #resultLeaderboardBtn{grid-column:1/-1}
}

/* The field owns the space; compact controls never cover it. */
#gameArea .hud .sector{overflow:hidden}
#gameArea .hud .sector .dim{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#gameArea .hud .sector strong{white-space:nowrap}
#gameArea[data-compact-battle] .battle-console{min-width:0;min-height:0}
#gameArea[data-compact-battle] .battle-quick-abilities{padding:6px;background:#18231d;border:1px solid var(--panel-line)}
#gameArea[data-compact-battle] .battle-quick-abilities .support-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#gameArea[data-compact-battle] .battle-quick-abilities .support-card{min-height:52px;padding:5px 3px;gap:3px;min-width:0;justify-content:center}
#gameArea[data-compact-battle] .battle-quick-abilities .support-card strong{font-size:12px;line-height:1.2}
#gameArea[data-compact-battle] .battle-quick-abilities .support-state{font-size:10px;line-height:1.2}
#gameArea[data-compact-battle] .battle-quick-abilities .support-card:disabled{opacity:.55}
#gameArea[data-compact-battle="portrait"] .battle-console{display:contents}
#gameArea[data-compact-battle="portrait"] .battle-quick-abilities{order:1;position:sticky;top:calc(env(safe-area-inset-top,0px) + 52px);z-index:3}
#gameArea[data-compact-battle="portrait"] :is(#renderNotice,#verificationNotice){order:2}
#gameArea[data-compact-battle="portrait"] :is(.crew-dock,.holder-support,.tower-panel){order:3}
#gameArea[data-compact-battle="portrait"] .controls{order:4}
#gameArea[data-compact-battle="portrait"] .command-bar{order:5}
@media(orientation:landscape) and (min-width:600px) and (max-height:600px), (orientation:landscape) and (min-width:700px) and (max-width:1400px) and (max-height:1100px){
 #gameArea.show{gap:6px}
 #gameArea>.hud{min-height:38px;grid-template-columns:1.4fr 1fr 1fr 1fr}
 #gameArea>.hud>div{padding:3px 8px}
 #gameArea>.hud strong{font-size:16px;line-height:1.2;white-space:nowrap}
 #gameArea>.hud .dim{font-size:10px;line-height:1.1;margin-bottom:1px}
 #gameArea .game-area{grid-template-columns:minmax(0,1fr) clamp(208px,24vw,250px);gap:8px}
 #gameArea .field-label{min-height:22px;padding:3px 6px;font-size:10px;gap:4px}
 #gameArea[data-compact-battle="landscape"] .battle-rail{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:6px;overflow:hidden;padding:0}
 #gameArea[data-compact-battle="landscape"] .battle-panel-switcher{position:static;order:0;padding:0;box-shadow:none}
 #gameArea[data-compact-battle="landscape"] .battle-console{order:1;overflow-y:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin;padding-right:3px}
 #gameArea[data-compact-battle="landscape"] .battle-console>*{flex-shrink:0}
 #gameArea[data-compact-battle="landscape"] .battle-quick-abilities{order:2}
 #gameArea[data-compact-battle="landscape"] .battle-quick-abilities .support-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #gameArea[data-compact-battle="landscape"] .battle-quick-abilities .support-card{min-height:44px}
 #gameArea[data-compact-battle="landscape"] .loadout-details[open]{max-height:180px;overflow:auto}
}

#gameArea[data-compact-battle="landscape"] .battle-panel-switcher button{font-size:12px;letter-spacing:0;padding-inline:1px}
#gameArea[data-compact-battle="landscape"] .battle-panel-switcher #pauseBtn{font-size:12px;overflow-wrap:normal;word-break:normal}
/* Phone navigation and safe areas are shared across every division. */
html{background:#131d17}
.garage-beta-banner{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 16px;padding:10px 16px;border-bottom:1px solid #56634d;background:#263324;color:#d9dfcf;font:500 13px/1.4 'IBM Plex Sans',sans-serif}
.garage-beta-banner strong{font:600 12px/1.4 'Chakra Petch',sans-serif;letter-spacing:.08em;color:#f4c86f}.garage-beta-banner a{color:#f4c86f;text-underline-offset:3px}
body[data-release-scope="garage"] #profilePreview{display:none!important}
@media(max-width:600px){.garage-beta-header .topnav>a:not(.nav-profile){display:none}.garage-beta-dock.mobile-dock{grid-template-columns:repeat(3,minmax(0,1fr))}.garage-beta-banner{justify-content:flex-start;gap:3px 12px;font-size:12px}.garage-beta-banner span{display:none}}
.mobile-dock{display:none}
.mobile-more{box-sizing:border-box;width:min(480px,calc(100vw - 20px));max-height:calc(100dvh - env(safe-area-inset-top,0px) - 24px);margin:auto auto 0;padding:22px 20px calc(24px + env(safe-area-inset-bottom,0px));background:#19261e;color:#f0efdf;border:1px solid #617153;border-radius:18px 18px 0 0;font:16px/1.5 'IBM Plex Sans',sans-serif;overflow:auto}
.mobile-more::backdrop{background:#030a07b8;backdrop-filter:blur(4px)}
.mobile-more-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}
.mobile-more h2{font:600 24px 'Chakra Petch',sans-serif;margin:0}
.mobile-more button{min-height:44px;padding:10px 16px;font:600 15px 'Chakra Petch',sans-serif;background:#26362a;border:1px solid #617153;color:#f0efdf;border-radius:5px;cursor:pointer}
.mobile-more-links{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mobile-more-links a,.mobile-more-links button{display:flex;align-items:center;justify-content:center;min-height:52px;padding:12px;color:#f0efdf;text-decoration:none;border:1px solid #526147;border-radius:5px;font:600 16px 'Chakra Petch',sans-serif;background:#202f24}
.mobile-more :focus-visible{outline:3px solid #efbb58;outline-offset:3px}
@media(max-width:600px){
 body{padding-top:env(safe-area-inset-top,0px);padding-bottom:calc(70px + env(safe-area-inset-bottom,0px))}
 html{scroll-padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}
 .topbar.nav-enhanced .nav-toggle,.topbar.nav-enhanced .nav-leaderboard{display:none!important}
 .mobile-dock{position:fixed;inset:auto 0 0;z-index:40;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:6px max(12px,env(safe-area-inset-left,0px)) calc(6px + env(safe-area-inset-bottom,0px));background:#142019f5;border-top:1px solid #4c5a42;backdrop-filter:blur(12px);font:500 12px/1.3 'Chakra Petch',sans-serif}
 .mobile-dock a,.mobile-dock button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:52px;padding:5px 8px;border:0;border-radius:7px;background:transparent;color:#b9c5b2;font:inherit;text-decoration:none;cursor:pointer}
 .mobile-dock svg{display:block;width:23px;height:23px}
 .mobile-dock [aria-current="page"],.mobile-dock [aria-expanded="true"]{color:#f4c86f;background:#efbb5810}
 .mobile-dock :focus-visible{outline:2px solid #efbb58;outline-offset:-2px}
 body:has(input:focus) .mobile-dock,body:has(textarea:focus) .mobile-dock,body:has(select:focus) .mobile-dock,body:has(#gameArea.show) .mobile-dock{display:none}
 body:has(#gameArea.show){padding-bottom:0}
}
body:has(.mobile-more[open]){overflow:hidden}


/* Simple battle controls: the landscape footer always remains reachable. */
#gameArea[data-compact-battle="portrait"] .battle-panel-switcher{grid-template-columns:1fr 1.25fr 1fr 1.15fr}
#gameArea[data-compact-battle] .battle-actions{min-width:0;min-height:44px}
#gameArea[data-compact-battle] .battle-quick-abilities[hidden]{display:none}
#gameArea[data-compact-battle] .battle-quick-abilities .support-card:is([data-used="true"],[data-unlocked="false"]){display:none}
#gameArea[data-compact-battle="portrait"] .battle-quick-abilities .support-grid{grid-template-columns:repeat(auto-fit,minmax(70px,1fr))}
#gameArea[data-compact-battle] .tower-summary{display:flex;gap:10px;align-items:center}
#gameArea[data-compact-battle] .tower-summary>.panel-art{display:block;width:42px;height:48px;flex:0 0 42px;object-fit:contain;filter:drop-shadow(0 2px 3px #0007)}
#gameArea[data-compact-battle] .tower-summary>div{min-width:0}
#gameArea .panel-art[data-art-state="error"]{display:none}
#gameArea[data-compact-battle="landscape"] .battle-rail{display:grid;grid-template-rows:44px minmax(0,1fr) 44px;gap:6px;overflow:hidden;padding:0;scroll-padding:0}
#gameArea[data-compact-battle="landscape"] .battle-panel-switcher{grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));height:44px;min-height:0;position:static;padding:0;box-shadow:none}
#gameArea[data-compact-battle="landscape"] .battle-panel-switcher button{font-size:13px;min-height:44px;padding:6px 2px}
#gameArea[data-compact-battle="landscape"] .battle-console{grid-row:2;order:0;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-right:2px;scroll-padding:4px}
#gameArea[data-compact-battle="landscape"] .battle-actions{grid-row:3;order:0;display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:5px;background:#141e18;z-index:4}
#gameArea[data-compact-battle="landscape"] .battle-actions>.controls{order:0;display:block;min-width:0;min-height:0;padding:0;margin:0}
#gameArea[data-compact-battle="landscape"] .battle-actions #startWaveBtn{height:44px;min-height:44px;font-size:12px;line-height:1.2;padding:4px;white-space:normal;margin:0}
#gameArea[data-compact-battle="landscape"] .battle-actions>#pauseBtn{min-width:0;min-height:44px;font-size:13px;padding:4px;white-space:nowrap;overflow-wrap:normal}
#gameArea[data-compact-battle="landscape"] .holder-support .support-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#gameArea[data-compact-battle="landscape"] .holder-support .support-card{min-height:50px;padding:6px 3px}
#gameArea[data-compact-battle="landscape"] .holder-support .support-card strong{font-size:12px}
#gameArea[data-compact-battle="landscape"] .holder-support .support-state{font-size:11px}
#gameArea[data-compact-battle="landscape"] .battle-settings{margin-top:2px}
#gameArea[data-compact-battle="landscape"] .command-bar>.msg{font-size:12px;line-height:1.35}
@media(max-width:600px){#gameArea>.hud .dim{min-height:0;font-size:11px;line-height:1.2}#gameArea>.hud>div{padding:7px 6px}}

@media(max-width:600px){body[data-owner-playtest="true"] .garage-beta-dock.mobile-dock{grid-template-columns:repeat(4,minmax(0,1fr))}}

@media(max-width:600px){.garage-beta-dock.mobile-dock.with-discussion{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Battle focus: use the viewport for the field, retaining an Account exit. */
body:has(#gameArea.show)>.topbar.nav-enhanced,body:has(#gameArea.show)>.topbar,body:has(#gameArea.show)>.garage-beta-banner,body:has(#gameArea.show)>main>#memberMount{display:none}
body:has(#gameArea.show)>main{max-width:1800px;padding:8px 12px}
#gameArea>.hud .base-total{font:500 13px var(--face);color:#c4cdbb}
#gameArea .base-integrity-track{height:4px;margin:4px 0 2px;background:#0d1712;border-radius:2px;overflow:hidden}
#baseIntegrityFill{display:block;width:100%;height:100%;background:#a9cf91;transition:width .18s ease-out}
#baseIntegrity.base-critical #baseIntegrityFill{background:#f59d80}
#baseIntegrityHint{display:block;font-size:11px;color:#c7d1be;line-height:1.3}
#baseIntegrity.base-hit #baseIntegrityHint{color:#ffe0c9}
#gameArea .wave-pressure{color:#ffd09b;font-weight:700}
#gameArea #startWaveBtn.rush-pressure{border-color:#b9956d;color:#ffdbaf;background:#302f26}
#gameArea .battle-account-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border:1px solid #59654d;border-radius:4px;color:#d0dcc5;font:500 13px var(--face);text-decoration:none}
#gameArea .battle-account-link:focus-visible{outline:2px solid var(--brass);outline-offset:2px}
#gameArea[data-compact-battle] .battle-account-link{display:none}
#gameArea[data-compact-battle] .battle-settings .battle-account-link{display:flex}
#gameArea .field-label #fieldPhase.wave-pressure{font-size:12px}
#gameArea .hud #waveProgress{display:block;font-size:12px;line-height:1.35}
.sector-base-note{font-weight:600;color:#f2d49a;border-left:2px solid #d4b76f;padding-left:10px}
#gameArea .wave-clear-toast{top:76px;padding:7px 14px;gap:1px}
#gameArea .wave-clear-toast span{font-size:9px}
#gameArea .wave-clear-toast strong{font-size:16px}
@media(min-width:1101px){#gameArea:not([data-compact-battle]) .game-area{grid-template-columns:minmax(0,1fr) 260px}#gameArea:not([data-compact-battle]) .field-frame,#gameArea:not([data-compact-battle]) .command-bar{width:100%}}
@media(orientation:landscape) and (min-width:700px) and (max-width:1400px) and (max-height:1100px){
 #gameArea>.hud{min-height:62px;grid-template-columns:1.2fr 1.3fr .7fr 1.2fr}
 #gameArea .game-area{grid-template-columns:minmax(0,1fr) clamp(208px,21vw,250px)}
 #gameArea>.hud .dim{font-size:11px}#gameArea>.hud strong{font-size:20px}
 #gameArea .field-label{min-height:30px;font-size:11px}
 #gameArea .wave-clear-toast{top:72px}
}
@media(max-width:600px){#gameArea .hud #waveProgress,#baseIntegrityHint{font-size:10px}#gameArea>.hud .base-total{font-size:11px}#gameArea>.hud{grid-template-columns:1fr 1.3fr .7fr 1.2fr}#gameArea>.hud strong{font-size:16px}}
@media(prefers-reduced-motion:reduce){#baseIntegrityFill{transition:none}}

#gameArea[data-compact-battle="portrait"]>.hud{position:sticky;top:0;z-index:6;background:#1b251f;box-shadow:0 3px 8px #0005}
/* A completed round needs room for every exit, even above a short landscape field. */
#gameArea[data-compact-battle="landscape"] .field-stage .run-result{position:fixed;inset:8px;z-index:12;padding:8px}

/* Keep crew deployment reachable below the sticky Account header. */
.crew-picker .crew-actions{top:calc(var(--ipg-header-height,88px) + env(safe-area-inset-top,0px))}
#beginRunBtn{scroll-margin-top:calc(var(--ipg-header-height,88px) + 20px)}
