/* The visible account bar stays above scrolling lobby/store/settings content.
   Immersive play keeps its existing header-free canvas and fixed camera. */
.app-shell{--shell-sidebar:210px;--shell-header:85px}
.main-shell{padding-top:calc(var(--shell-header) + env(safe-area-inset-top,0px))}
.topbar{position:fixed;inset:0 0 auto var(--shell-sidebar);height:calc(var(--shell-header) + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px);z-index:60;box-shadow:0 2px 8px #143d3010}
.is-playing .main-shell{padding-top:0}
@media(max-width:1150px){.app-shell{--shell-sidebar:175px}}
@media(max-width:850px){.app-shell{--shell-sidebar:76px;--shell-header:75px}}
@media(max-width:600px){.app-shell{--shell-sidebar:0px;--shell-header:69px}}


/* Phone home: cover the viewport, crop the lower scene, and keep art/neon/hit targets together. */
.mobile-home,.mobile-return,.mobile-orientation-guard{display:none}
@media(pointer:coarse) and (max-width:700px),(pointer:coarse) and (max-width:1100px) and (max-height:600px){
  .app-shell{--shell-sidebar:0px;--shell-header:56px;padding-bottom:0}
  .app-shell .sidebar{display:none}
  .app-shell .main-shell{margin-left:0}
  .app-shell .topbar{left:0}
  .mobile-return{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;flex:none;background:none;border:0;border-radius:8px}
  .app-shell .breadcrumb{display:none}
  .is-lobby{background:#101a38;color:#f2f5ff;min-height:100svh}
  .is-lobby .desktop-lobby,.is-lobby .desktop-lobby-heading,.is-lobby .app-footer,.is-lobby .account,.is-lobby .mobile-return{display:none}
  .is-lobby .main-shell{padding-top:0;min-height:100svh}
  .is-lobby .content{max-width:none;width:100%;padding:0;margin:0}
  .is-lobby .topbar{position:absolute;inset:8px max(8px,env(safe-area-inset-right,0px)) auto auto;width:auto;height:auto;padding:0;background:transparent;border:0;box-shadow:none;z-index:60}
  .is-lobby .header-right{display:grid;grid-template-columns:1fr 32px;gap:5px;align-items:start}
  .is-lobby .wallet-pill{min-height:30px;max-width:110px;padding:4px 8px;gap:5px;background:#101a38e8;border-color:#9dc1df60;color:#ffdfa2;grid-column:1;justify-content:flex-start}
  .is-lobby .wallet-pill.cards{color:#bceacb}
  .is-lobby .wallet-pill .icon{width:15px;height:15px;color:inherit}
  .is-lobby .wallet-pill strong{font-size:11px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .is-lobby .wallet-pill>span{display:none}
  .is-lobby .header-right>.icon-button{grid-column:2;grid-row:1;width:32px;height:32px;background:#101a38dc;color:#d2dbef}
  .is-lobby .demo-strip{position:absolute;top:calc(100svh - 20px - env(safe-area-inset-bottom,0px));left:0;right:0;padding:2px max(12px,env(safe-area-inset-right,0px)) 2px max(12px,env(safe-area-inset-left,0px));border:0;background:#101a3880;color:#c8d3e9;font-size:8px;line-height:16px;pointer-events:none;z-index:2}
  .is-lobby .lan-invite{margin:14px;background:#1c294a;border-color:#8edce855;color:#f2f5ff}
  .is-lobby .lan-invite a{color:#8edce8}
  .is-lobby .network-status{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:80vw;padding:5px 10px;border-radius:8px;z-index:62;font-size:11px;pointer-events:none}
  .is-lobby .network-status[data-state="connected"]{display:none}
  .mobile-home{display:block;position:relative;width:100%;height:100svh;height:100dvh;isolation:isolate;overflow:hidden}
  .mobile-home-scene{position:absolute;left:50%;top:0;transform:translateX(-50%);width:max(100%,calc(100svh * 1376 / 768));width:max(100%,calc(100dvh * 1376 / 768));aspect-ratio:1376/768}
  .home-scene-art{position:absolute;inset:0;background:url('/assets/mobile-home-theme-2.png') center/100% 100% no-repeat;filter:brightness(.88)}

  .home-hotspot{position:absolute;padding:0;border:0;border-radius:12px;background:transparent;min-width:44px;min-height:44px;-webkit-tap-highlight-color:transparent}
  .home-hotspot span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .home-hotspot:active{background:#ffffff14;box-shadow:0 0 12px #8edce866}
  .home-hotspot:focus-visible{outline:3px solid #fff3b2;outline-offset:3px;background:#ffffff12}
  .home-hotspot-public{left:41%;top:46%;width:16%;height:14%}
  .home-hotspot-friend{left:56.5%;top:6%;width:15%;height:18%}
  .home-hotspot-store{left:14%;top:36%;width:13%;height:18%}
  .home-hotspot-wardrobe{left:34%;top:22%;width:13%;height:17%}
  .home-hotspot-guild{left:81%;top:25%;width:13%;height:18%}
  .home-player{position:absolute;left:max(10px,env(safe-area-inset-left,0px));top:max(8px,env(safe-area-inset-top,0px));display:flex;flex-direction:column;align-items:center;gap:2px;width:100px;text-align:center;text-shadow:0 1px 4px #000}
  .home-player-frame{display:grid;place-items:center;width:58px;height:58px;padding:3px;border:2px solid #8edce8;border-radius:15px;background:#17233ee8;box-shadow:0 0 7px #8edce84d,inset 0 0 7px #8edce833;overflow:hidden}
  .home-player-frame .character-portrait{display:block;width:100%;height:100%;border-radius:10px}
  .home-player-name{font-size:12px;line-height:18px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f2f5ff}
  .home-player-id{font-size:10px;line-height:15px;color:#d1d9eb;white-space:nowrap}
  .home-resume{position:absolute;left:max(12px,env(safe-area-inset-left,0px));bottom:calc(26px + env(safe-area-inset-bottom,0px));display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:8px 12px;border-radius:9px;border:1px solid #ecc98388;background:#302716e8;color:#ffe5ae;font-size:12px}
  .mobile-orientation-guard{position:fixed;inset:0;z-index:1000;background:#101a38;color:#f2f5ff;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:32px;gap:20px}
  .mobile-orientation-guard strong{font-size:23px}
  .mobile-orientation-guard p{color:#b5c3de;font-size:14px;margin:0}
  .rotate-phone{width:86px;height:46px;border:3px solid #8edce8;border-radius:10px;box-shadow:0 0 18px #8edce833;position:relative}
  .rotate-phone::after{content:'';position:absolute;right:4px;top:18px;width:4px;height:4px;border-radius:50%;background:#8edce8}
}
@media(pointer:coarse) and (orientation:portrait) and (max-width:700px){
  body{overflow:hidden}
  #app,#modal,#toast{visibility:hidden}
  .mobile-orientation-guard{display:flex}
}
@media(max-width:600px){.is-lobby .wallet-pill{max-width:90px}}


.guild-join{max-width:360px;margin:auto}.guild-join h2{margin:8px 0}.guild-join p{line-height:1.55}.guild-join input{width:100%;text-align:center;font-size:28px;letter-spacing:.35em;font-variant-numeric:tabular-nums}.guild-keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}.guild-keypad button{min-height:48px;border:1px solid #c9bda8;border-radius:10px;background:#fffaf0;color:#284b3d;font-size:20px;touch-action:manipulation}.guild-keypad button:active{background:#dce9df}.guild-apply{width:100%;justify-content:center}.guild-applications small{display:block}.guild-applications button{min-height:38px;padding:6px 14px;margin:3px}@media(max-height:500px){.guild-join p{margin:6px 0;font-size:13px}.guild-keypad{gap:4px;margin:7px 0}.guild-keypad button{min-height:34px;font-size:17px}.guild-join input{font-size:22px}.guild-join h2{font-size:21px}}

@media(orientation:landscape) and (max-height:500px){dialog:has(.guild-join){max-width:640px;padding:16px 24px}.guild-join{max-width:none}.guild-join>.eyebrow{display:none}.guild-join h2{margin:0 24px 4px 0;line-height:1.4}.guild-join>p{margin:4px 0 10px;line-height:1.4}.guild-join form{display:grid;grid-template-columns:.9fr 1.1fr;column-gap:18px;row-gap:12px;align-items:start}.guild-join form>label{grid-column:1;grid-row:1}.guild-join input{height:48px;padding:6px;font-size:24px;letter-spacing:.2em}.guild-keypad{grid-column:2;grid-row:1 / span 2;margin:0;gap:6px}.guild-keypad button{min-height:38px;padding:4px;font-size:18px}.guild-join .guild-apply{grid-column:1;grid-row:2;min-height:44px;padding:8px;font-size:14px}.guild-join .dialog-error{margin-bottom:0}}
