/* Responsive overlay layout. The battlefield remains the whole screen. */
:root{--view-w:100vw;--view-h:100dvh;--safe-l:max(8px,env(safe-area-inset-left));--safe-r:max(8px,env(safe-area-inset-right));--safe-t:max(6px,env(safe-area-inset-top));--safe-b:max(6px,env(safe-area-inset-bottom))}
html,body{width:100%;height:100%;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
*,*:before,*:after{box-sizing:border-box}button,input,select{font-family:inherit}button{white-space:nowrap;touch-action:manipulation}
.veil,.codex-overlay{position:fixed;inset:0;padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);height:var(--view-h);width:var(--view-w);overflow:auto;overscroll-behavior:contain;align-items:safe center}
.home-card,.online-card,.result-card,.pause-card,.codex-shell{max-width:100%;max-height:calc(var(--view-h) - var(--safe-t) - var(--safe-b));margin:auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.home-card{width:min(510px,100%)}.home-card h1,.home-card .subtitle,.race-tab,.wallet,.home-footer,.button-name{white-space:nowrap}.race-description,.v3-loadout-note{white-space:nowrap;overflow-x:auto;scrollbar-width:thin;margin:5px 0;max-width:100%}
.home-footer{font-size:10px}.home-actions{display:flex;gap:8px}.home-actions>button{flex:1;min-width:0;margin:0}.home-actions small{display:block;white-space:nowrap;font-size:10px}.v3-lobby-tools{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px!important}.v3-lobby-tools button{white-space:nowrap;min-width:0;min-height:34px;font-size:12px!important;padding:6px 8px!important}
#hud{left:var(--safe-l);right:var(--safe-r);top:var(--safe-t);width:auto;gap:8px;display:grid;grid-template-columns:minmax(0,1fr) 90px minmax(0,1fr)}#hud.hidden{display:none}.team{min-width:0;width:100%;gap:5px;padding:5px 7px}.team>div{min-width:0;flex:1}.team small{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.team>strong{white-space:nowrap;font-size:13px}.team-mark{display:none}.clock{min-width:0;width:auto;padding:4px 7px}.clock>small,.clock>span{white-space:nowrap;font-size:10px}.clock>b{font-size:23px}
#cornerControls{top:auto;bottom:var(--safe-b);left:calc(50% - 45px);right:auto;display:flex;gap:6px;z-index:5}#cornerControls .small-icon{width:37px;height:34px}.menu-button{left:var(--safe-l);top:65px;bottom:auto}.roster-button{right:var(--safe-r);top:65px;width:44px;height:44px}.synergy-hud{right:calc(var(--safe-r) + 50px);top:65px;width:44px;height:44px}.synergy-hud b{font-size:18px}.skill-controls{left:var(--safe-l);bottom:var(--safe-b);gap:8px}.round.skill{width:64px;height:64px}.skill svg{width:34px;height:34px}.button-name{font-size:10px}.charges{font-size:10px}.summon{right:var(--safe-r);bottom:var(--safe-b);width:84px;height:84px}.summon canvas{width:47px;height:44px}.summon>strong{font-size:14px}.summon .tickets{font-size:12px}.summon .plus{font-size:20px}.combo-badge{right:calc(var(--safe-r) + 91px);bottom:calc(var(--safe-b) + 15px);font-size:12px;padding:8px 12px;min-height:36px}
.combo{width:clamp(310px,54vw,580px);max-width:calc(var(--view-w) - 148px);left:50%;right:auto;top:65px;bottom:auto;max-height:calc(var(--view-h) - 158px);overflow:auto;transform:translateX(-50%);z-index:8;padding:7px}.combo header{display:flex;gap:6px;align-items:center;min-width:0}.combo header>span{min-width:0;flex:1;white-space:nowrap;overflow:auto;font-size:11px}.combo-tools{display:flex;flex:none;gap:4px}.combo-tools button{min-width:32px;min-height:30px;padding:4px 7px;font-size:11px}.choices{gap:6px}.choice{min-width:0;padding:5px;grid-template-columns:48px minmax(0,1fr)}.choice img{width:48px;height:47px}.choice strong,.choice .tier,.choice small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.choice strong{font-size:12px}.choice small{font-size:10px}.choice .combo-synergy{white-space:nowrap;overflow-x:auto;text-overflow:clip;font-size:9px}.combo-foot{white-space:nowrap;font-size:9px}
.merge-feed{top:119px;width:clamp(115px,17vw,185px)}.merge-feed.mine{left:var(--safe-l)}.merge-feed.enemy{right:var(--safe-r)}.merge-notice{min-height:46px;padding:3px;gap:3px}.merge-notice img{width:32px;height:35px}.merge-notice strong{font-size:10px}.merge-notice small,.merge-notice span{font-size:8px}
.drawer{top:var(--safe-t);right:var(--safe-r);bottom:var(--safe-b);height:auto;max-width:calc(var(--view-w) - var(--safe-l) - var(--safe-r));width:min(365px,78vw);display:flex;flex-direction:column}.drawer.hidden{display:none}.drawer header,.drawer nav{flex:none}.drawer-content{min-height:0;overflow:auto}.unit-row>div{min-width:0;flex:1}.unit-row strong,.unit-row small{white-space:nowrap;overflow:auto}.unit-row strong{font-size:12px}.unit-row small{font-size:10px}.drawer nav{overflow:auto;white-space:nowrap}.drawer nav button{min-width:56px;padding:8px 6px;font-size:11px}
.codex-shell,.v3-shell{width:min(1150px,100%);height:calc(var(--view-h) - var(--safe-t) - var(--safe-b));display:flex;flex-direction:column;overflow:hidden}.codex-header{flex:none;min-width:0;gap:7px;padding:8px 10px}.codex-header h2{font-size:18px;white-space:nowrap}.codex-header small{font-size:9px;white-space:nowrap}.codex-header .close{flex:none;min-width:34px;min-height:34px}.codex-filters{flex:none;padding:6px 8px;gap:5px;min-width:0;overflow-x:auto;white-space:nowrap;flex-wrap:nowrap}.codex-filters button,.v3-tabs button{flex:none;padding:6px 9px;min-height:32px;font-size:11px}.v3-tabs{display:flex;flex:none;margin-left:auto}.v3-atlas-main{grid-template-columns:minmax(0,1fr) minmax(175px,25%);min-height:0;overflow:hidden}.v3-atlas-view,.v3-atlas-detail{min-height:0;min-width:0;overscroll-behavior:contain}.v3-atlas-detail{padding:8px}.v3-detail-hero{grid-template-columns:53px minmax(0,1fr)}.v3-detail-hero img{width:52px;height:52px}.v3-detail-hero h3{font-size:13px;white-space:nowrap;overflow-x:auto}.v3-detail-hero small,.v3-detail-hero p{font-size:10px;white-space:nowrap;overflow:auto}.v3-recipe{display:flex;flex-direction:row;flex-wrap:nowrap;gap:7px;padding:6px;margin:6px;overflow-x:auto}.v3-materials,.v3-results{flex:0 0 auto;flex-wrap:nowrap;gap:4px}.v3-mini-unit{width:70px;min-width:70px;max-width:70px;flex:none;padding:3px;min-height:69px}.v3-mini-unit img{width:40px;height:40px}.v3-mini-unit strong{font-size:10px;line-height:1.5;white-space:nowrap;max-width:100%;overflow:auto;text-align:left}.v3-mini-unit small{font-size:9px;white-space:nowrap}.v3-arrow{flex:none}.v3-result-choice{flex:none;min-width:70px;width:70px}.v3-atlas-detail .v3-recipe{flex-direction:column;overflow:visible}.v3-atlas-detail .v3-materials,.v3-atlas-detail .v3-results{max-width:100%;overflow-x:auto}.v3-atlas-detail .v3-mini-unit{min-width:65px;width:65px}.v3-ability{font-size:11px;line-height:1.65;word-break:keep-all;overflow-wrap:anywhere}.v3-note{font-size:11px;word-break:keep-all;overflow-wrap:anywhere}.v3-tier-filters{white-space:nowrap;overflow:auto;flex-wrap:nowrap}.v3-zoom{gap:3px}.v3-zoom button{min-height:30px;font-size:10px;padding:4px 6px}.v3-graph-unit{width:170px;max-width:none}.v31-synergy-main{grid-template-columns:130px minmax(0,1fr);min-height:0}.v31-trait-list{padding:6px}.v31-trait{min-height:53px;padding:6px}.v31-trait strong{font-size:11px;white-space:nowrap}.v31-trait-detail{padding:8px;min-width:0}.v31-stages{gap:4px}.v31-stage{padding:5px;font-size:10px}.v31-member-grid{grid-template-columns:repeat(auto-fill,minmax(90px,1fr))}.v31-member strong{white-space:nowrap;max-width:100%;overflow:auto;font-size:10px}
.upgrade-grid{grid-template-columns:repeat(auto-fit,minmax(225px,1fr));min-height:0;overflow:auto;padding:8px}.upgrade-card{min-width:0;padding:7px;gap:5px;grid-template-columns:44px minmax(0,1fr)}.upgrade-card img{width:44px;height:46px}.upgrade-card strong,.upgrade-card small{white-space:nowrap;overflow:auto;max-width:100%;font-size:11px}.upgrade-button{white-space:nowrap;min-height:32px;font-size:11px}.codex-note{font-size:10px;flex:none;padding:5px 8px;word-break:keep-all}.result-card h1{font-size:38px;margin:5px}.result-card button{min-height:36px;padding:7px}.result-stats{margin:9px 0}.online-card{width:min(730px,100%);padding:12px}.online-card header h2{font-size:20px}.online-card button{white-space:nowrap;min-height:36px;padding:7px 10px}.online-bar{display:flex;flex-wrap:nowrap;gap:7px;min-width:0}.online-bar input{min-width:0;flex:1}.online-title-row{flex-wrap:nowrap;gap:6px}.online-title-row h3{font-size:14px;white-space:nowrap;overflow:auto}.online-title-row>div{min-width:0}.online-title-row button{font-size:11px}.online-member strong,.online-member small,.online-member span{white-space:nowrap;overflow:auto}.online-members{gap:7px}.online-member{min-width:0;min-height:65px;padding:8px}.online-actions{flex-wrap:nowrap;gap:6px}.online-actions button{min-width:0;flex:1}.online-note,.online-warning{word-break:keep-all;overflow-wrap:anywhere;font-size:11px}.online-rooms{max-height:34dvh}.online-status{font-size:11px;line-height:1.5;min-height:29px;padding:6px 8px}.online-room-row>div{min-width:0}.online-room-row strong{white-space:nowrap;display:block;overflow:auto}.online-room-row button{flex:none}
#netStatus{position:fixed;left:50%;bottom:calc(var(--safe-b) + 39px);transform:translateX(-50%);max-width:calc(var(--view-w) - 230px);padding:4px 8px;border-radius:5px;background:#17333cdb;color:#edd39b;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;z-index:6}#netStatus.hidden{display:none}
@media(orientation:landscape) and (max-height:430px){.home-card{padding:10px 14px;width:min(590px,100%)}.mini-crest,.home-card .intro,.race-figures{display:none!important}.home-card h1{font-size:27px;margin:4px!important;line-height:1.1}.eyebrow{font-size:9px}.home-card .subtitle{font-size:12px;margin:3px 0!important}.race-tabs{gap:6px;margin:5px 0}.race-tab{padding:6px 9px;min-height:32px}.race-description{font-size:10px}.wallet{margin:4px 0;font-size:11px}.faction-lobby{margin:5px 0}.v3-loadout-note{font-size:9px;margin:3px 0}.home-actions button{min-height:37px;padding:7px 10px}.home-footer{margin-top:7px;padding-top:5px}.home-actions .primary,.home-actions .secondary{font-size:13px}.home-card #resume{font-size:11px;margin:3px;padding:2px}.team small{font-size:10px}.clock>b{font-size:21px}.round.skill{width:56px;height:56px}.skill-controls{gap:6px}.summon{width:70px;height:70px}.summon canvas{width:36px;height:32px}.summon .tickets{font-size:11px}.summon>strong{font-size:12px}.combo-badge{right:calc(var(--safe-r) + 76px)}.combo{top:58px;max-height:calc(var(--view-h) - 140px);width:58vw;padding:5px}.choice{grid-template-columns:38px minmax(0,1fr);gap:3px}.choice img{width:38px;height:39px}.choice strong{font-size:11px}.choice small{font-size:9px}.combo-foot{font-size:8px}.merge-feed{top:108px}.roster-button,.synergy-hud,.menu-button{top:58px}.roster-button,.synergy-hud{width:38px;height:38px}.synergy-hud{right:calc(var(--safe-r) + 43px)}.menu-button{width:35px;height:35px}.v31-side-tabs{margin:0 8px 5px}.v3-shell .codex-header h2{font-size:16px}.codex-header small{display:none}.v3-atlas-main{grid-template-columns:minmax(0,1fr) 170px}.v3-zoom button[data-zoom="focus"]{display:none}.result-reward{font-size:22px;margin:5px}.result-card{padding:12px}.result-card h1{font-size:29px}.result-stats{padding:7px}.result-stats b{font-size:19px}.online-card header{margin-bottom:5px}.online-note{margin:4px 0 7px}.online-faction{margin:4px 0;font-size:10px}.online-warning{font-size:9px}}
@media(max-width:650px){#hud{grid-template-columns:minmax(0,1fr) 80px minmax(0,1fr);gap:5px}.team{padding:4px}.team>strong{font-size:11px}.clock>small{font-size:9px}.v3-atlas-main{grid-template-columns:minmax(0,1fr)}.v3-atlas-detail{display:none}.v3-atlas-main.detail-open .v3-atlas-view{display:none}.v3-atlas-main.detail-open .v3-atlas-detail{display:block;width:100%;height:100%;border:0}.v3-atlas-main.detail-open .v3-atlas-detail .v3-materials,.v3-atlas-main.detail-open .v3-atlas-detail .v3-results{max-width:100%}.mobile-detail-back{display:block!important;position:sticky;top:0;z-index:2;min-height:34px;padding:6px 12px;margin:0 0 8px;background:#294952;color:#f0ddac;border:1px solid #759087;border-radius:5px;font-size:12px}.v3-mini-unit{width:82px;min-width:82px;max-width:82px}.v3-mini-unit strong{font-size:11px}.v3-tabs{gap:3px}.v3-tabs button{padding:5px 7px;font-size:10px}.codex-filters button{padding:5px 7px;min-height:31px;font-size:10px}.v31-synergy-main{grid-template-columns:110px minmax(0,1fr)}.v31-trait-heading h3{font-size:15px}.v31-trait-heading>strong{font-size:10px}.v31-stage strong{font-size:12px}.merge-feed{width:108px}.merge-notice img{width:27px}.merge-notice strong{font-size:9px}.merge-notice small{font-size:7px}.combo{max-width:calc(var(--view-w) - 114px);width:64vw}.online-actions button{font-size:11px;padding:6px}.online-title-row small{font-size:10px}}
.mobile-detail-back{display:none}.hidden{display:none!important}
@media(prefers-reduced-motion:reduce){.merge-notice{animation:none!important}}
.online-card{background:#142f39;border:1px solid #637f7c;border-radius:10px;color:#efe1be}.online-card header{display:flex;align-items:center;justify-content:space-between;gap:8px}.online-card header h2{margin:3px 0}.online-card header small{font-size:10px;color:#b4d1c1}.online-card input{background:#0e2730;color:#eddfbf;border:1px solid #617e7d;border-radius:5px;padding:8px;max-width:100%}.online-title-row{display:flex;align-items:center;justify-content:space-between;margin:9px 0}.online-members{display:grid;grid-template-columns:1fr 1fr}.online-member{display:flex;flex-direction:column;gap:5px;border:1px solid #527573;border-radius:6px;background:#1c3c44}.online-member.is-ready{border-color:#c8c285}.online-actions{display:flex}.online-rooms{min-height:45px;overflow:auto}.online-room-row{display:flex;justify-content:space-between;align-items:center;padding:7px;gap:7px}.online-status{background:#102932;border-radius:5px}.online-warning{opacity:.78;margin:6px 0}.online-note{margin:5px 0 8px}.online-card .primary,.online-card .secondary{margin:0;width:auto}
/* Reserve space for labels and ticket counters below the circular icons. */
.skill-controls{bottom:calc(var(--safe-b) + 21px)}.summon{bottom:calc(var(--safe-b) + 26px)}.v3-graph-unit{width:170px!important;min-width:170px!important;max-width:170px!important}
