section.gb-chat{padding:0!important;overflow:hidden;min-height:380px}
section.gb-chat>:not(.stage-mini-wrap){display:none!important}
.stage-mini-wrap{width:100%;height:100%;min-height:480px}
.stage-lounge-frame{border:0;width:100%;height:100%;display:block;background:#fffcfa}
.stage-mini-wrap iframe{min-height:480px}
.stage-lounge-dialog{position:fixed;padding:0;width:min(1180px,94vw);height:min(820px,90dvh);min-width:340px;min-height:340px;max-width:98vw;max-height:96dvh;resize:both;overflow:hidden;border:1px solid #e1c9d7;border-radius:14px;background:#fffcfa;box-shadow:0 28px 90px #27131f66}
.stage-lounge-dialog::backdrop{background:#24132066}
.stage-lounge-drag{height:40px;display:flex;align-items:center;gap:12px;padding:0 12px;background:#f8eaf1;color:#782746;cursor:move;touch-action:none;user-select:none;font:13px Arial,sans-serif}
.stage-lounge-drag strong{margin-right:auto}.stage-lounge-drag button{background:white;border:1px solid #e6ccda;border-radius:6px;width:28px;height:28px;cursor:pointer;font-size:20px;color:#782746}.stage-drag-hint{font-size:10px;color:#846b79}.stage-lounge-dialog>iframe{height:calc(100% - 40px)}
.stage-fullscreen{left:1vw!important;top:1dvh!important;width:98vw!important;height:98dvh!important;max-height:98dvh!important;resize:none}
@media(max-width:600px){.stage-drag-hint{display:none}.stage-lounge-dialog{width:96vw;height:90dvh;min-width:300px}.stage-mini-wrap,.stage-mini-wrap iframe{min-height:420px}}

.stage-lounge-resize{position:absolute;right:1px;bottom:1px;z-index:5;width:24px;height:24px;padding:0;border:0;background:#f8eaf1;color:#9b426e;cursor:nwse-resize;touch-action:none;border-radius:4px}
.gx-side{flex-direction:column!important;height:calc(100dvh - 225px);min-height:420px;gap:8px}
.gx-hub-wrap,.gx-chat-wrap{position:relative;display:flex;flex-direction:column;flex:1 1 0;min-height:0;overflow:hidden}
.gx-side .collapsed{flex:0 0 auto}
.gx-panel-toggle{flex:0 0 auto;padding-right:52px!important}
.gx-hub-wrap>:not(button){min-height:0;overflow:auto;flex:1}
.gx-chat-wrap>section.gb-chat{min-height:0!important;flex:1;display:flex;flex-direction:column}
.stage-mini-wrap,.stage-mini-wrap iframe{min-height:0!important;height:100%}
.stage-panel-expand{position:absolute;right:10px;top:7px;width:28px;height:25px;border:1px solid #e3b7cf;border-radius:6px;background:#fff8fc;color:#9f2568;z-index:3;cursor:pointer}

.stage-winner-avatar{width:32px;height:32px;object-fit:cover;border-radius:50%;vertical-align:middle;margin-right:8px;border:2px solid #ffd5e7}
.stage-photo-panel{margin:20px auto;padding:22px;max-width:650px;background:#fff9fc;border:1px solid #eed4e2;border-radius:14px;font:14px/1.5 Arial,sans-serif;color:#623749}.stage-photo-panel h2{font-size:20px;margin:0 0 8px}.stage-photo-panel input{display:block;margin:14px 0}.stage-photo-panel button{padding:9px 14px;margin:6px 8px 0 0;border:1px solid #d7aac2;border-radius:7px;background:white;color:#8e2159;cursor:pointer}.stage-photo-panel img{width:64px;height:64px;object-fit:cover;border-radius:50%;display:block;margin-top:10px}
.gx-side>.gx-hub-wrap:not(.collapsed),.gx-side>.gx-chat-wrap:not(.collapsed){flex:1 1 0!important}
.gx-side>.gx-hub-wrap.collapsed,.gx-side>.gx-chat-wrap.collapsed{flex:0 0 auto!important}
.stage-photo-panel img[hidden]{display:none!important}

.stage-lounge-dialog{z-index:10020;top:5dvh;left:max(3vw,calc((100vw - 1180px)/2));margin:0}.stage-lounge-dialog[hidden]{display:none!important}

/* Use the actual game grid height, rather than guessing a viewport offset. */
.gb.gx.gx-game-mode .gx-side{height:100%!important;align-self:stretch;min-height:0!important;justify-content:space-between}
.gx-chat-wrap.collapsed{margin-top:auto}
.gx-chat-wrap>section.gb-chat{flex:1 1 0!important;height:auto!important}
.stage-mini-wrap{display:flex;flex-direction:column;flex:1 1 0!important;height:auto!important;min-height:0!important}
.stage-mini-wrap iframe{flex:1 1 0;height:100%;min-height:0!important}

.community-roster-photo{display:block;width:100%;height:100%;border-radius:50%;object-fit:cover}.gx-game-players strong[data-buddy-profile]:focus-visible{outline:2px solid #bd2e7a;outline-offset:3px;border-radius:3px}

.community-profile-dialog{box-sizing:border-box;width:min(900px,calc(100vw - 32px));height:min(850px,calc(100dvh - 40px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid #ead3e1;border-radius:24px;background:#fff7fc;color:#512344;overflow:hidden;box-shadow:0 24px 80px #33112644}
.community-profile-dialog[open]{display:flex;flex-direction:column}.community-profile-dialog::backdrop{background:#3b173b80;backdrop-filter:blur(5px)}.community-profile-header{display:flex;justify-content:space-between;align-items:center;padding:18px 24px;gap:18px;border-bottom:1px solid #eddae6;flex-shrink:0}.community-profile-header strong{font:700 22px/1.25 Arial,sans-serif}.community-profile-header button{width:38px;height:38px;border:0;border-radius:50%;background:#f8e5f0;color:#8b365f;font:28px/1 Arial,sans-serif;cursor:pointer}.community-profile-frame{display:block;flex:1;width:100%;min-height:0;border:0;background:#fff7fc}@media(max-width:600px){.community-profile-dialog{width:calc(100vw - 16px);height:calc(100dvh - 24px);border-radius:18px}.community-profile-header{padding:13px 16px}.community-profile-header strong{font-size:19px}}

#stage-photo-panel{margin:24px 0 0!important;padding:13px 17px!important;max-width:none!important;box-sizing:border-box}#stage-photo-panel summary{cursor:pointer;font:600 14px/1.5 Arial,sans-serif!important;color:#80536e!important}#stage-photo-panel[open] summary{margin-bottom:15px}#stage-photo-panel button{color:#8e2159!important;background:#fff!important;border:1px solid #d7aac2!important;font:600 13px/1.4 Arial,sans-serif!important;min-height:38px;padding:9px 14px!important}#stage-photo-panel button:disabled{color:#927587!important;background:#f6eff3!important;opacity:1}#stage-photo-panel p{font:13px/1.7 Arial,sans-serif!important;color:#805a70!important}#stage-photo-panel input{max-width:100%;font:13px/1.5 Arial,sans-serif!important;color:#623749!important;background:#fff!important}#stage-photo-panel img[hidden]{display:none!important}

/* Preserve the game’s native phone/tablet visibility rules. */
@media(max-width:699px){.gb.gx.gx-game-mode .gx-side{display:none!important}.gb.gx.gx-game-mode .gx-play{width:100%;min-width:0}.stage-lounge-dialog{box-sizing:border-box;min-width:0;width:96vw;left:2vw!important}}

@media(min-width:700px) and (max-width:1100px) and (orientation:portrait){.gb.gx.gx-game-mode .gx-side{display:none!important}.gb.gx.gx-game-mode .gx-shell{display:flex!important}.gb.gx.gx-game-mode .gx-play{width:100%;min-width:0;flex:1}}

/* Keep popup controls below phone/PWA status areas. */
@media(max-width:600px){
.community-profile-dialog{top:calc(env(safe-area-inset-top,0px) + 12px);bottom:auto;margin:0 auto;height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px)}
.community-profile-header button{flex:0 0 44px;width:44px;height:44px;touch-action:manipulation}
.stage-lounge-dialog{--lounge-safe-top:env(safe-area-inset-top,0px);top:max(25dvh,calc(env(safe-area-inset-top,0px) + 12px));height:65dvh;min-height:300px;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);resize:none}
.stage-lounge-drag{height:52px;box-sizing:border-box;gap:6px;padding:4px 8px}
.stage-lounge-drag strong{visibility:hidden;min-width:0;overflow:hidden}
.stage-lounge-drag button{width:44px;height:44px;flex:0 0 44px}
.stage-lounge-resize{top:4px;right:108px;bottom:auto;width:44px;height:44px;border:1px solid #e6ccda;background:#fff8fc;font-size:22px;touch-action:none}
.stage-lounge-dialog>iframe{height:calc(100% - 52px)}
.stage-lounge-dialog.stage-fullscreen{top:calc(env(safe-area-inset-top,0px) + 8px)!important;height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 16px)!important;max-height:none}
}
