/* Screen/pane flags (worlds-screen-*, *-pane, .rp-deck-row) replace :has(); `#_` never matches and only keeps the original :has(#id) specificity. */
/* Sanctuary lobby: text-free artwork, original DOM actions. */
body.worlds-ui{--worlds-ink:#293743;--worlds-paper:#e5ddca;--worlds-gold:#d9bf84;--worlds-title:Georgia,'Noto Serif TC','PMingLiU',serif;}
@media(min-width:1000px) and (min-height:521px){
body.worlds-ui #screen-lobby{background:#23384d url('/assets/worlds/lobby-sanctuary.png') center/cover no-repeat;color:var(--worlds-ink);}
body.worlds-ui #screen-lobby .lobby-header{height:auto;min-height:60px;flex-wrap:wrap;flex-shrink:0;background:linear-gradient(#132132eb,#132132eb),url('/assets/worlds/stone.png') center/cover;border:0;border-bottom:2px solid #bca57890;color:#f0e6cd;box-shadow:0 5px 16px #07121b80;}
body.worlds-ui #screen-lobby .lobby-logo{font-family:var(--worlds-title);font-size:23px;border:0;letter-spacing:4px;padding:14px 22px;color:#f2dfb4;text-shadow:0 2px 2px #000;}
body.worlds-ui #screen-lobby .lobby-logo:after{display:none;}
body.worlds-ui #screen-lobby .lobby-ver{background:transparent;border:0;color:#c0cdd6;font:12px Arial,sans-serif;padding:10px 12px;}
body.worlds-ui #screen-lobby .user-info{border:0;padding:10px 20px;gap:8px;flex-wrap:wrap;}
body.worlds-ui #screen-lobby .user-badge{border:0;border-left:1px solid #baa77f70;border-radius:0;color:#f5e2b5;background:transparent;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
body.worlds-ui #screen-lobby .btn-logout{border:0;border-bottom:1px solid #a8b0ad80;color:#e2e8e8;padding:7px 10px;border-radius:0;font-family:Arial,sans-serif;}
body.worlds-ui #screen-lobby .btn-logout[hidden]{display:none;}
body.worlds-ui #screen-lobby .lobby-body{width:min(1200px,96%);margin:10px auto 12px;padding:0 12px 14px;grid-template-columns:minmax(300px,.9fr) minmax(0,1.8fr);gap:24px;overflow:auto;scrollbar-width:thin;scrollbar-color:#b6a788 #1a293b;}
body.worlds-ui #screen-lobby .lobby-left,body.worlds-ui #screen-lobby .lobby-right{background:transparent;border:0;padding:0;gap:4px;overflow:visible;min-width:0;min-height:760px;}
body.worlds-ui #screen-lobby .lobby-left{padding-top:26px;}
/* Nine-slice preserves carved corners as each panel changes size. */
body.worlds-ui #screen-lobby :is(.lobby-records,.lobby-online,.lobby-chat,.tile-sm),body.worlds-ui #screen-lobby .lobby-history button{border:34px solid transparent;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 34px / 0 stretch;background:none;border-radius:0;box-shadow:none;filter:drop-shadow(0 7px 5px #07132280);}
body.worlds-ui #screen-lobby .lobby-records{padding:4px 6px 8px;flex-shrink:0;}
body.worlds-ui #screen-lobby .section-title{font-family:var(--worlds-title);font-size:20px;font-weight:700;letter-spacing:3px;border:0;padding:0 0 12px;margin:0 0 12px;color:#30383c;text-align:center;text-shadow:0 1px 1px #fff9,0 -1px #554b3620;border-bottom:1px solid #7a6c4c50;}
body.worlds-ui #screen-lobby .lobby-records>div:nth-child(2){border:0!important;}
body.worlds-ui #screen-lobby .stat-box{background:transparent;border-color:#88765340;padding:10px 4px!important;min-width:0;}
body.worlds-ui #screen-lobby .stat-val{color:#293944;font-family:Georgia,serif;font-size:56px!important;text-shadow:0 1px #fff8;}
body.worlds-ui #screen-lobby .stat-lbl{font-size:13px;color:#5c605c;letter-spacing:0;}
body.worlds-ui #stat-fav-series{font-size:17px!important;overflow-wrap:anywhere;}
body.worlds-ui #screen-lobby .lobby-online{flex:1;min-height:220px;display:flex;flex-direction:column;padding:0 2px 4px;}
body.worlds-ui #lobby-online-list{flex:1;height:auto!important;min-height:80px;overflow-wrap:anywhere;scrollbar-width:thin;scrollbar-color:#8a806c transparent;}
body.worlds-ui #lobby-online-list>div{padding:7px 0!important;gap:5px!important;}
body.worlds-ui #lobby-online-list button{border-radius:2px!important;box-shadow:inset 0 1px #ffffff60,0 2px 2px #52422b30;}
body.worlds-ui #screen-lobby .lobby-history button{width:100%;padding:0!important;border:26px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 26px / 0 stretch!important;background:none!important;color:#293743!important;font-family:var(--worlds-title)!important;font-size:18px!important;text-shadow:0 1px #fff9;}
body.worlds-ui #screen-lobby .tile-grid{gap:0;}
body.worlds-ui #screen-lobby .tile{font-family:var(--worlds-title);transition:filter .16s;color:#293743;}
body.worlds-ui #screen-lobby .tile-big{position:relative;isolation:isolate;height:clamp(340px,44vh,490px);min-height:340px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;filter:drop-shadow(0 9px 6px #0a1b3180);}
body.worlds-ui #screen-lobby .tile-big:before{content:'';position:absolute;inset:0;z-index:-1;background:url('/assets/worlds/lobby-gateway.png') center bottom/contain no-repeat;pointer-events:none;}
body.worlds-ui #screen-lobby .tile-big .tile-icon{display:none;}
body.worlds-ui #screen-lobby .tile-big>div:last-child{position:absolute;top:66%;left:50%;transform:translate(-50%,-50%);white-space:nowrap;font-size:clamp(28px,2.5vw,38px);letter-spacing:4px;color:#182d3f;text-shadow:0 1px 2px #fff,0 0 12px #eef9ff,0 0 22px #eef9ff;font-weight:900;}
body.worlds-ui #screen-lobby .tile-big>div:last-child:after{content:'';display:block;margin:10px auto 0;width:84%;height:1px;background:linear-gradient(90deg,transparent,#8d7040,transparent);}
body.worlds-ui #screen-lobby .tile-row{gap:4px;}
body.worlds-ui #screen-lobby .tile-sm{aspect-ratio:auto;min-height:100px;flex-direction:row;gap:16px;font-size:25px;padding:2px 4px;border-width:26px;border-image-width:26px;text-shadow:0 1px #fff9;}
body.worlds-ui #screen-lobby .tile-sm .tile-icon{font-size:0;width:28px;height:32px;flex-shrink:0;position:relative;color:#454331;}
/* Decorative silhouettes; existing button labels and click handlers remain. */
body.worlds-ui #screen-lobby .tile-sm:first-child .tile-icon:before{content:'';position:absolute;inset:2px 4px 4px 2px;border:2px solid currentColor;border-radius:2px;transform:rotate(-12deg);box-shadow:3px 3px 0 -1px #c8bfaa,5px 5px currentColor;}
body.worlds-ui #screen-lobby .tile-sm:last-child .tile-icon:before{content:'';position:absolute;inset:3px 0;border:2px solid currentColor;border-radius:3px 3px 5px 5px;background:linear-gradient(90deg,transparent 46%,currentColor 47%,currentColor 53%,transparent 54%);}
body.worlds-ui #screen-lobby :is(.tile,.lobby-history button):hover{filter:brightness(1.1) drop-shadow(0 3px 8px #f5d69d50);}
body.worlds-ui #screen-lobby .lobby-chat{padding:0 6px 4px;min-height:230px!important;}
body.worlds-ui #screen-lobby .lobby-chat .section-title{text-align:left;font-size:18px;letter-spacing:2px;margin-bottom:8px;padding-bottom:8px;}
body.worlds-ui #lobby-chat-messages{min-height:60px!important;background:#f5efde35!important;border:0!important;padding:4px 2px 8px!important;overflow-wrap:anywhere;scrollbar-width:thin;scrollbar-color:#8a806c transparent;}
body.worlds-ui #screen-lobby .lobby-chat input,body.worlds-ui #screen-lobby .lobby-chat button{border:1px solid #877b60!important;border-radius:3px;box-shadow:inset 0 1px 3px #3c392430;}
body.worlds-ui #lobby-chat-input{background:#ede6d5!important;color:#263b47;}
body.worlds-ui #screen-lobby .lobby-chat button:last-child{background:linear-gradient(#314250,#192c3d)!important;color:#f2e5c5!important;font-family:var(--worlds-title)!important;}
body.worlds-ui #screen-lobby :is(button,input,select):focus-visible{outline:3px solid #e2b85e;outline-offset:3px;}
body.worlds-ui #screen-lobby .tile-big:focus-visible{outline-offset:-12px;}
/* Original mode chooser, with the same material and action order. */
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal{background:#061321c9!important;padding:20px;}
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal>div{width:min(660px,100%);min-width:0!important;max-height:calc(100dvh - 40px);overflow-y:auto;background:none!important;border:38px solid transparent!important;border-image:url('/assets/worlds/lobby-stone-frame.png') 210 fill / 38px / 0 stretch!important;border-radius:0;padding:8px 10px!important;filter:drop-shadow(0 16px 25px #0009);scrollbar-width:thin;}
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal>div>div:first-child{font-family:var(--worlds-title)!important;color:#334953;border-bottom:1px solid #89795780!important;}
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal button{border:1px solid #99896870!important;border-radius:3px;background:#f4efdf90!important;box-shadow:inset 0 1px #fff8,0 2px 3px #64543b30;}
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal button:hover{background:#243c4d!important;}
body.worlds-ui.worlds-screen-lobby:not(#_) #startGameModal button:focus-visible{outline:3px solid #b88836;outline-offset:3px;}
@media(max-height:760px){body.worlds-ui #screen-lobby .lobby-body{margin:6px auto;}body.worlds-ui #screen-lobby .lobby-left,body.worlds-ui #screen-lobby .lobby-right{min-height:724px;}body.worlds-ui #screen-lobby .lobby-left{padding-top:0;}body.worlds-ui #screen-lobby .tile-big{height:340px;}body.worlds-ui #screen-lobby .lobby-chat{min-height:230px!important;}}
@media(prefers-reduced-motion:reduce){body.worlds-ui #screen-lobby .tile{transition:none;}}
}
