/* Lobby layout owns the viewport. Reflow content instead of scaling or clipping actions. */
html,html body{position:fixed;inset:0;width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
html body #game-shell{height:var(--visible-height,100dvh)!important;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);overflow:hidden}
.scenery,.shade,#embers{position:absolute}.lobby-footer{display:none}
html body .lobby-header{min-height:56px;padding:6px clamp(12px,3vw,42px);gap:8px}.lobby-header .top-actions{margin-right:80px;gap:8px;min-width:0}.top-actions button{min-width:44px;min-height:44px!important;padding:6px 10px!important;font-size:11px!important}#enter-fullscreen{display:block}.top-actions #identity{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-lang-toggle]{min-height:44px;top:max(10px,env(safe-area-inset-top))!important;right:max(10px,env(safe-area-inset-right))!important}
html body .lobby-layout,html body[data-screen=character] .lobby-layout{position:relative;left:auto;top:auto;transform:none!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,480px);gap:clamp(12px,3vw,42px);width:100%;height:100%!important;min-height:0!important;max-height:100%!important;max-width:1440px!important;margin:0 auto;padding:8px clamp(12px,3vw,42px) 12px!important;overflow:visible;align-items:center;container:lobby / size}
html body .lobby-card,html body[data-screen=character] .lobby-card{width:100%!important;max-width:100%!important;height:auto!important;max-height:100%;min-height:0;display:flex;flex-direction:column;gap:12px;padding:clamp(16px,2vw,28px)!important;overflow:visible!important;animation:none;transform:none}
.story{align-self:center;padding:0!important}.story .brand-hero{max-height:min(32dvh,280px)}.steps{margin:0!important;font-size:12px;gap:8px}.steps li{min-width:0}.steps b{flex:none}.lobby-card .screen{min-width:0;min-height:0;animation:none}
.screen h2{font-size:clamp(22px,2.5vw,28px);line-height:1.3;margin:0 0 8px}.screen .eyebrow{margin:0 0 8px}.screen .muted{font-size:14px;line-height:1.5;margin:0 0 14px}.screen .small{font-size:12px;line-height:1.45;margin:0}
.lobby-card button:not(.character-slot),.lobby-card input{touch-action:manipulation;min-height:44px}.lobby-card :is(.google,.primary,.secondary){font-size:14px!important;padding:8px 12px}.lobby-card .text-button{font-size:12px!important;padding:6px 4px;margin:0}
.login-actions{display:flex;flex-direction:column;gap:10px}.login-actions .divider{margin:0}.login-actions>button:not([hidden])+button:not([hidden]){margin-top:0!important}#login-screen .divider:has(+#login-quick[hidden]){display:none}
.lobby-status{min-height:0;margin:0!important;font-size:12px;line-height:1.4;overflow-wrap:anywhere}.lobby-status:empty{display:none}.server{min-height:64px;min-width:0;padding:12px;gap:10px}.server strong{font-size:16px}.server small{font-size:12px;line-height:1.4}.server-number{font-size:26px}#servers-screen{display:grid;gap:10px}#servers-screen>p,#servers-screen>h2{margin:0}
html body[data-screen=character] .lobby-layout{grid-template-columns:minmax(0,1100px);justify-content:center}html body[data-screen=character] .story{display:none}
html body[data-screen=character] .character-body{display:grid!important;grid-template-columns:minmax(130px,23%) minmax(0,1fr) minmax(200px,35%)!important;gap:12px!important;align-items:stretch;min-height:0}
.character-heading{gap:8px;align-items:center;margin:0}.character-heading>div:first-child{min-width:0}.character-heading h2{margin:0}.character-heading .eyebrow{font-size:10px;letter-spacing:1px;line-height:1.3;margin:0 0 4px;overflow-wrap:anywhere}.character-heading-actions{display:flex;align-items:center;gap:10px;flex:none}.character-heading .slot{font-size:12px;white-space:nowrap;padding:3px 8px}#back-servers{white-space:nowrap}
#character-screen:not([hidden]){display:flex;flex-direction:column;gap:10px}#progression-hint{font-size:12px;line-height:1.4;white-space:normal;padding:4px 10px!important;margin:0!important;border-radius:8px;overflow-wrap:anywhere}
html body[data-screen=character] #character-slots{display:grid!important;grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(44px,1fr);gap:7px!important;max-height:none;min-height:0;overflow:visible;margin:0!important}
html body[data-screen=character] button.character-slot{display:grid!important;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:7px;min-width:0;min-height:44px!important;height:auto!important;padding:5px 7px!important;border-radius:10px;font-size:12px;line-height:1.25}
html body[data-screen=character] .slot-portrait{grid-row:1/3;width:32px!important;height:32px!important}.character-slot strong{font-size:12px!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.character-slot small{font-size:10px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body[data-screen=character] .character-stage{min-height:0!important;padding:8px;justify-content:center;overflow:visible}html body[data-screen=character] .hero-art{width:min(220px,100%)!important;max-width:100%!important;max-height:none;min-height:0;aspect-ratio:1;flex:none;height:auto!important}
.hero-art.rig-preview{animation:none!important;transform:none!important;filter:none!important}.character-stage:has(.rig-preview)>.pedestal{display:none!important}.stage-name{font-size:16px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;min-height:0}.class-badge{display:none!important}.pose-controls{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 0}.pose-controls button{font-size:11px!important;min-width:44px;padding:4px 8px}
html body[data-screen=character] .character-details{display:flex;flex-direction:column;min-height:0;gap:8px;padding:12px!important;overflow:visible}.class-summary{display:none!important}html body[data-screen=character] #character-form:not([hidden]){display:flex!important;flex-direction:column;gap:6px}
html body[data-screen=character] #hero-name{font-size:16px!important;min-height:44px!important;height:44px!important;margin:0;padding:6px 10px;line-height:1.3}#character-form label[for=hero-name],#gender-options legend{font-size:12px;font-weight:700}#name-hint{font-size:10px!important;line-height:1.3}
html body[data-screen=character] #gender-options{margin:0!important;gap:6px!important;display:grid!important;grid-template-columns:1fr 1fr}#gender-options legend{margin:0 0 4px!important;line-height:1.2}html body[data-screen=character] #gender-options label{min-height:44px!important;font-size:13px;min-width:0}
html body[data-screen=character] #existing-character:not([hidden]){display:flex;flex-direction:column;gap:8px;flex:none}html body[data-screen=character] #existing-name{font-size:19px!important;margin:0;line-height:1.3;overflow-wrap:anywhere}html body[data-screen=character] #existing-detail{font-size:12px!important;margin:0;line-height:1.4;overflow-wrap:anywhere}#existing-character>.small{display:none}
html body[data-screen=character] :is(#enter-world,#create-character,#change-class){min-height:44px!important;height:auto!important;font-size:14px!important;margin:0;padding:8px 10px}.delete-link{align-self:stretch}
@media(max-width:700px){
 .lobby-header .top-actions #identity,.lobby-header #identity-link{display:none}.wordmark{font-size:13px!important}.wordmark span{display:none}.wordmark .brand-emblem{width:30px!important;height:30px!important}.top-actions{gap:5px!important}.top-actions button{font-size:10px!important}.lobby-header .top-actions{margin-right:70px}
 html body .lobby-layout{grid-template-columns:minmax(0,1fr);max-width:560px!important}.story{display:none}
 html body[data-screen=character] .character-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
 html body[data-screen=character] #character-slots{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:52px;gap:5px!important}
 html body[data-screen=character] .character-stage{grid-column:1;grid-row:2;padding:4px}.pose-controls{display:none!important}html body[data-screen=character] .character-details{grid-column:2;grid-row:2;padding:8px!important}html body[data-screen=character] .hero-art{width:min(160px,100%)!important}
 .character-heading-actions{gap:4px}.character-heading .slot{font-size:10px;padding:2px 6px}#back-servers{font-size:10px!important}.character-heading .eyebrow{display:none}.character-heading h2{font-size:19px!important}.character-slot small{font-size:9px!important}
 html body[data-screen=character] button.character-slot{grid-template-columns:minmax(0,1fr);justify-items:center;padding:4px!important}html body[data-screen=character] .slot-portrait{display:none}html body[data-screen=character] #existing-name{font-size:15px!important}.stage-name{font-size:13px}
}
@container lobby (max-height:560px){
 html body .lobby-card,html body[data-screen=character] .lobby-card{gap:8px!important;padding:14px!important}.steps{font-size:11px}.steps b{width:20px;height:20px}.screen h2{font-size:23px!important}.screen .eyebrow{font-size:8px!important;margin-bottom:4px}.screen .muted{font-size:13px!important;margin-bottom:8px}.login-actions{gap:6px}.screen .small{font-size:11px!important;line-height:1.4}.lobby-status{font-size:11px}
 html body[data-screen=character] .steps{display:none}html body[data-screen=character] #progression-hint{font-size:10px!important;line-height:1.3;padding:3px 8px!important}html body[data-screen=character] #character-screen{gap:7px}html body[data-screen=character] .character-heading h2{font-size:21px!important}html body[data-screen=character] .character-details{padding:8px!important;gap:6px}html body[data-screen=character] .hero-art{width:min(170px,100%)!important}html body[data-screen=character] #existing-name{font-size:17px!important}
}
@container lobby (max-height:410px){
 html body .lobby-card,html body[data-screen=character] .lobby-card{padding:10px 12px!important;gap:6px!important}.steps{display:none}#login-screen{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:16px;align-items:center}.login-intro .eyebrow{display:none}.login-intro .muted{margin:0}.screen h2{font-size:20px!important}.screen .muted{font-size:12px!important}.login-actions .small{font-size:10px!important}.login-actions .divider{display:none}.login-actions{gap:6px}.lobby-status{font-size:10px}.server{padding:8px}.server strong{font-size:14px}.server small{font-size:11px}
 html body[data-screen=character] #progression-hint,html body[data-screen=character] .character-heading .eyebrow{display:none}html body[data-screen=character] .character-heading h2{font-size:19px!important}html body[data-screen=character] .pose-controls{display:none!important}
 html body[data-screen=character] .character-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important}
 html body[data-screen=character] #character-slots{grid-column:1/-1;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:48px;gap:5px!important}
 html body[data-screen=character] button.character-slot{grid-template-columns:minmax(0,1fr);justify-items:center;font-size:10px!important;padding:4px!important}html body[data-screen=character] .slot-portrait{display:none}
 html body[data-screen=character] .character-stage{grid-column:1;grid-row:2;padding:4px!important}html body[data-screen=character] .character-details{grid-column:2;grid-row:2;padding:6px 8px!important}html body[data-screen=character] .hero-art{width:min(130px,100%)!important}
 html body[data-screen=character] #existing-name{display:none}html body[data-screen=character] #existing-character{gap:6px!important}html body[data-screen=character] #existing-detail{font-size:11px!important;line-height:1.3}html body[data-screen=character] #name-hint{display:none}
 html body[data-screen=character] #character-form:not([hidden]){display:grid!important;grid-template-columns:1fr 1fr;gap:4px 8px!important}html body[data-screen=character] #character-form>label,html body[data-screen=character] #hero-name{grid-column:1}html body[data-screen=character] #gender-options{grid-column:2;grid-row:1/3;align-self:end}html body[data-screen=character] #create-character{grid-column:1/-1}
}
@container lobby (max-height:285px){
 html body .lobby-card,html body[data-screen=character] .lobby-card{gap:4px!important;padding:6px 10px!important}.login-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px}.login-actions .small{grid-column:1/-1;font-size:10px!important;line-height:1.3}.login-actions #login-guest{grid-column:1/-1}.login-intro .muted{font-size:11px!important}.screen h2{font-size:18px!important}#servers-screen .eyebrow,#servers-screen .muted{display:none}#servers-screen{gap:6px}
 html body[data-screen=character] .character-body{gap:4px!important}html body[data-screen=character] #character-screen{gap:4px}html body[data-screen=character] #character-slots{grid-auto-rows:44px;gap:4px!important}html body[data-screen=character] .character-heading h2{font-size:17px!important}html body[data-screen=character] .character-heading{min-height:44px}html body[data-screen=character] .hero-art{width:min(100px,100%)!important}html body[data-screen=character] .character-details{padding:4px 6px!important}html body[data-screen=character] #existing-detail{display:none}html body[data-screen=character] #gender-options legend,html body[data-screen=character] #character-form label[for=hero-name]{font-size:10px!important}html body[data-screen=character] #switch-account{display:none}
}
/* These optional previews never compete with entry actions on a compact screen. */
html body .lobby-header .top-actions button{min-height:44px!important;min-width:44px!important;font-size:11px!important;padding:6px 8px!important}
html body:not([data-screen=character]) .lobby-card{max-width:100%!important;min-width:0;padding:16px!important}
html body :is(#login-screen,#servers-screen) button,html body[data-screen=character] #back-servers{min-height:44px!important;font-size:12px!important}
.login-intro,.login-actions,.lobby-card,.character-body,.character-details,fieldset{min-width:0}
html body[data-screen=character] #gender-options legend{float:none;width:auto}
html body[data-screen=character] :is(.class-badge,.class-summary,#switch-account){display:none!important}
html body[data-screen=character] .pose-controls button{min-height:44px!important}
@media(max-width:700px){
 html body[data-screen=character] .pose-controls{display:none!important}
 html body[data-screen=character] #character-form:not([hidden]){display:flex!important;flex-direction:column;gap:6px!important}
 html body[data-screen=character] #gender-options{grid-column:auto;grid-row:auto;align-self:stretch!important}
 html body[data-screen=character] #gender-options legend{display:none}
 html body[data-screen=character] #gender-options label{font-size:11px!important}
}
@media(max-width:400px){.wordmark>div{display:none}}
@container lobby (max-height:560px){html body[data-screen=character] #progression-hint{display:none}}
/* The keyboard gets the form; the roster and preview return when it closes. */
.lobby-feedback{display:flex;align-items:center;gap:8px;min-width:0}.lobby-feedback .lobby-status{flex:1}.lobby-feedback button{flex:none}.login-intro .small{margin-top:8px}
html body[data-screen=character] .lobby-feedback:has(.lobby-status:empty){display:none}
html body #servers-screen .text-button,html body[data-screen=character] #delete-character{min-height:44px!important;padding:4px!important}
html.lobby-short body .lobby-header{min-height:44px;padding-top:0;padding-bottom:0}
html.lobby-short body .lobby-layout,html.lobby-short body[data-screen=character] .lobby-layout{padding-top:4px!important;padding-bottom:4px!important}
html.lobby-short [data-lang-toggle]{top:env(safe-area-inset-top,0px)!important}
@container lobby (max-height:410px){#servers-screen>.eyebrow,#servers-screen>.muted{display:none}}
@container lobby (max-height:410px) and (min-width:500px){html body[data-screen=character] #character-form:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 8px!important}html body[data-screen=character] #gender-options{grid-column:2;grid-row:1/3;align-self:end!important}}
@container lobby (max-height:285px){
 .login-actions .small{display:none}.login-intro .small{font-size:10px!important;line-height:1.3}
 #servers-screen{grid-template-columns:1fr 1.4fr;gap:6px 12px}#servers-screen h2{grid-column:1;grid-row:1}#servers-screen .server-list{grid-column:2;grid-row:1/4}#servers-screen>.small{grid-column:1;grid-row:2}#back-login{grid-column:1;grid-row:3}
 html body[data-screen=character] .hero-art{width:min(64px,100%)!important}
 html body[data-screen=character] #character-form>label[for=hero-name]{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
 html body[data-screen=character] #hero-name{grid-row:1}html body[data-screen=character] #gender-options{grid-row:1}html body[data-screen=character] #create-character{grid-row:2}
 .stage-name{font-size:12px!important}
}
/* The keyboard gets the form; the roster and preview return when it closes. */
html.keyboard-open body[data-screen=character] .lobby-header,html.keyboard-open body[data-screen=character] :is(.steps,.character-heading,#progression-hint,#character-slots,.character-stage,#profession-options){display:none!important}
html.keyboard-open body[data-screen=character] .character-body{display:block!important}html.keyboard-open body[data-screen=character] .lobby-layout{padding:4px 10px!important}html.keyboard-open body[data-screen=character] .lobby-card{padding:6px 10px!important}html.keyboard-open body[data-screen=character] .character-details{padding:4px!important}
html.keyboard-open body[data-screen=character] #character-form:not([hidden]){display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 8px!important}html.keyboard-open #character-form>label,html.keyboard-open #hero-name{grid-column:1}html.keyboard-open #gender-options{grid-column:2;grid-row:1/3}html.keyboard-open #create-character{grid-column:1/-1}
