/* Keep the original/mobile DOM order and handlers; only wide Worlds lobbies
   distribute the existing panels into three columns. */
.lobby-account-presence,.online-player-own-status{display:none;}
@media(min-width:1200px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{width:min(1720px,96%);margin:0 auto;padding:26px 0 24px;grid-template-columns:280px minmax(0,1fr) 350px;grid-template-rows:auto minmax(0,1fr);gap:18px 28px;overflow:auto;align-content:start;}
 body.worlds-ui #screen-lobby .lobby-left{display:contents;}
 body.worlds-ui #screen-lobby .lobby-right{grid-column:2;grid-row:1 / 3;min-height:700px;padding:0;gap:18px;}
 body.worlds-ui #screen-lobby .lobby-records{grid-column:1;grid-row:1;align-self:start;margin:0;}
 body.worlds-ui #screen-lobby .lobby-history{grid-column:1;grid-row:2;align-self:start;margin:0;}
 body.worlds-ui #screen-lobby .lobby-online{grid-column:3;grid-row:1 / 3;min-height:700px;margin:0;display:flex;flex-direction:column;overflow:hidden;}
 body.worlds-ui #screen-lobby :is(.lobby-records,.lobby-online,.lobby-chat){border-width:24px;border-image-width:24px;padding:8px 6px;}
 body.worlds-ui #screen-lobby .section-title{font-size:20px;}
 body.worlds-ui #screen-lobby .lobby-account-presence{display:block;text-align:center;}
 body.worlds-ui #lobby-account-name{display:block;font-size:22px;overflow-wrap:anywhere;margin:12px 0 4px;}
 body.worlds-ui #lobby-account-mood{font-size:14px;line-height:1.6;color:#6d6b5e;overflow-wrap:anywhere;}
 body.worlds-ui .lobby-account-presence label{display:block;margin-top:14px;font-size:13px;}
 body.worlds-ui #lobby-account-status{max-width:100%;margin-left:6px;padding:6px 8px;background:#eee5d1!important;color:#293f49!important;border:1px solid #aa9367;border-radius:3px;box-shadow:inset 0 1px #fff9;}
 body.worlds-ui #screen-lobby .lobby-account-statistics{grid-template-columns:1fr!important;}
 body.worlds-ui #screen-lobby .lobby-account-statistics .stat-box{padding:18px 4px;}
 body.worlds-ui #screen-lobby #stat-total{font-size:52px!important;}
 body.worlds-ui #screen-lobby #stat-fav-series{font-size:17px!important;line-height:1.5!important;overflow-wrap:anywhere;}
 body.worlds-ui #screen-lobby #account-info-avatar{padding:8px 0;}
 body.worlds-ui #screen-lobby #account-info-avatar .player-avatar{--avatar-size:180px!important;box-shadow:0 0 0 3px #d4bd82,0 4px 12px #172c3b35;}
 body.worlds-ui #screen-lobby .tile-grid{flex:1;min-height:400px;gap:14px;}
 body.worlds-ui #screen-lobby .tile-big{flex:1;height:clamp(300px,42vh,440px);min-height:300px;}
 body.worlds-ui #screen-lobby .tile-sm{min-height:82px;border-width:24px;border-image-width:24px;font-size:24px;}
 body.worlds-ui #screen-lobby .lobby-chat{flex:0 0 270px!important;min-height:240px!important;}
 body.worlds-ui #lobby-online-list{height:0!important;min-height:0;flex:1;overflow-y:auto;}
 body.worlds-ui #lobby-online-list>.online-player-row{padding:18px 0!important;gap:12px!important;align-items:flex-start!important;}
 body.worlds-ui #lobby-online-list .player-avatar{--avatar-size:52px!important;}
 body.worlds-ui #lobby-online-list .online-player-details>strong{font-size:16px;line-height:1.45;}
 body.worlds-ui #lobby-online-list .online-player-mood{font-size:13px;line-height:1.5;}
 body.worlds-ui #lobby-online-list .online-player-self select{display:none;}
 body.worlds-ui #lobby-online-list .online-player-own-status{display:inline;}
}
/* Account / gateway with chat and tools / online roster. */
.lobby-account-column{display:flex;flex-direction:column;min-width:0;align-items:stretch}
body.worlds-ui #screen-lobby .lobby-account-column .lobby-records{flex:none;height:auto;max-height:none;overflow:visible;padding-bottom:18px}
body.worlds-ui #screen-lobby .lobby-account-statistics .stat-box{padding:16px 4px!important}
body.worlds-ui #screen-lobby #stat-total{line-height:1.2;margin-bottom:8px}
.lobby-profile-entry{margin:12px 0}.lobby-profile-entry .profile-open{width:100%;min-width:0;font-size:18px}
/* The original theme uses a compact action row, not the tools' 2:1 tile. */
body:not(.worlds-ui):not(.worlds-skin) #screen-lobby .lobby-profile-entry .profile-open{
 aspect-ratio:auto;height:auto;min-height:48px;box-sizing:border-box;flex-direction:row;
 padding:10px 16px;gap:8px;font-size:16px;line-height:1.4;
}
body:not(.worlds-ui):not(.worlds-skin) #screen-lobby .profile-open .profile-entry-icon{width:20px;height:24px;color:currentColor}
@media(min-width:1200px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{grid-template-columns:320px minmax(0,1fr) minmax(0,1fr) 320px;grid-template-rows:minmax(440px,auto) 300px;gap:20px 24px;align-items:stretch}
 body.worlds-ui #screen-lobby .lobby-right,body.worlds-ui #screen-lobby .tile-grid{display:contents}
 body.worlds-ui #screen-lobby .lobby-account-column{grid-column:1;grid-row:1 / 3;align-self:start}
 body.worlds-ui #screen-lobby .lobby-account-column .lobby-records{align-self:stretch}
 body.worlds-ui #screen-lobby .lobby-profile-entry{position:relative;align-self:center;width:94%;margin:32px 0 12px;isolation:isolate}
 body.worlds-ui #screen-lobby .lobby-profile-entry::before,body.worlds-ui #screen-lobby .lobby-profile-entry::after{content:'';position:absolute;top:-47px;height:66px;width:30px;z-index:1;background:url('/assets/worlds/profile-rope.svg') center/contain no-repeat;pointer-events:none}
 body.worlds-ui #screen-lobby .lobby-profile-entry::before{left:20%}
 body.worlds-ui #screen-lobby .lobby-profile-entry::after{right:20%;transform:scaleX(-1)}
 body.worlds-ui #screen-lobby .tile-big{grid-column:2 / 4;grid-row:1;width:100%;height:100%;min-height:440px}
 body.worlds-ui #screen-lobby .lobby-chat{grid-column:2;grid-row:2;width:calc(100% + 24px);height:300px;min-height:0!important;box-sizing:border-box;overflow:hidden;padding:10px 12px}
 body.worlds-ui #screen-lobby #lobby-chat-messages{min-height:0!important;overflow:auto}
 body.worlds-ui #screen-lobby .tile-row{grid-column:3;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(4,minmax(0,1fr));gap:12px;min-width:0;width:min(100%,340px);justify-self:center;position:relative;left:-24px}
 body.worlds-ui #screen-lobby .tile-row .tile-sm{min-height:0;height:100%;width:100%;box-sizing:border-box;border-width:18px;border-image-width:18px;font-size:20px;gap:12px;padding:0 8px}
 body.worlds-ui #screen-lobby .lobby-online{grid-column:4;grid-row:1 / 3;min-height:0}
 body.worlds-ui #screen-lobby .lobby-profile-entry .profile-open{font-size:20px;gap:10px;padding:0 4px;border-width:22px;border-image-width:22px;box-sizing:border-box}
}
@media(min-width:1200px) and (max-width:1500px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{grid-template-columns:240px minmax(0,1fr) minmax(0,1fr) 240px;gap:18px}
 body.worlds-ui #screen-lobby .lobby-profile-entry .profile-open{font-size:17px;gap:7px;border-width:16px;border-image-width:16px}
 body.worlds-ui #screen-lobby .lobby-chat{padding:8px 4px;width:calc(100% + 8px)}
 body.worlds-ui #screen-lobby .tile-row{left:-8px}
 body.worlds-ui #screen-lobby .tile-row .tile-sm{font-size:18px}
}
@media(min-width:1200px) and (max-width:1500px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{grid-template-columns:240px minmax(0,1fr) minmax(0,1fr) 240px;gap:18px;}
 body.worlds-ui #screen-lobby :is(.lobby-records,.lobby-online,.lobby-chat){border-width:20px;border-image-width:20px;padding:6px 4px;}
 body.worlds-ui #screen-lobby #account-info-avatar .player-avatar{--avatar-size:150px!important;}
 body.worlds-ui #lobby-online-list>.online-player-row{padding:14px 0!important;}
 body.worlds-ui #screen-lobby .tile-sm{font-size:20px;}
}

/* A centered lower group: 56% chat, 4% gutter, 40% tools (850px maximum). */
@media(min-width:1200px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-chat{grid-column:2 / 4;width:min(56%,476px);justify-self:center;position:relative;left:calc(-1 * min(22%,187px));margin:0}
 body.worlds-ui #screen-lobby .tile-row{grid-column:2 / 4;width:min(40%,340px);justify-self:center;left:min(30%,255px);margin:0}
}
/* Equalize viewport gutters and the gaps flanking the 850px lower group.
   Total content = two sidebars + lower group; four equal spaces remain. */
@media(min-width:1501px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{width:min(96%,calc(50vw + 745px))}
}
@media(min-width:1200px) and (max-width:1500px) and (min-height:521px){
 body.worlds-ui #screen-lobby .lobby-body{width:min(96%,calc(50vw + 665px))}
}

/* Grow with usable desktop height instead of leaving a fixed 760px stage. */
@media(min-width:1200px) and (min-height:900px){
 body.worlds-ui #screen-lobby .lobby-body{grid-template-rows:clamp(440px,calc(60dvh - 100px),680px) clamp(300px,calc(40dvh - 50px),460px)}
 body.worlds-ui #screen-lobby .lobby-chat{height:100%}
 body.worlds-ui #screen-lobby .tile-row .tile-sm{font-size:clamp(20px,2.3vh,25px)}
 body.worlds-ui #screen-lobby #account-info-avatar .player-avatar{--avatar-size:clamp(180px,21vh,230px)!important}
 body.worlds-ui #screen-lobby .lobby-account-column .lobby-records{padding-bottom:clamp(18px,3vh,40px)}
}
@media(min-width:1200px) and (max-width:1500px) and (min-height:900px){
 body.worlds-ui #screen-lobby #account-info-avatar .player-avatar{--avatar-size:clamp(150px,17vh,165px)!important}
}
