/* Shared auth layout: the form scrolls while the close button stays reachable. */
#authModal,#mobileAuthGate{
  z-index:2147483647;
  position:fixed;inset:auto 0 auto 0;top:var(--og-auth-top,0px);
  height:100vh;height:var(--og-auth-height,100dvh);box-sizing:border-box;
  padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  align-items:center;justify-content:center;overflow:hidden;overscroll-behavior:contain;
}
/* Account actions can be opened from rooms and the player; keep floating chat behind the dialog. */
body:has(#authModal.open) #liveChat,body:has(#authModal.open) #chatToggleBtn,
body:has(#mobileAuthGate.open) #liveChat,body:has(#mobileAuthGate.open) #chatToggleBtn{visibility:hidden!important}
#authModal .authcard,#mobileAuthGate .authcard{
  width:min(900px,100%);max-height:100%;min-height:0;overflow:hidden;box-sizing:border-box;
  grid-template-rows:minmax(0,1fr);animation:none;
}
#authModal .auth-main,#mobileAuthGate .auth-main{
  display:block;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;scroll-padding-block:14px;padding:52px 32px 24px;
}
#authModal .auth-visual,#mobileAuthGate .auth-visual{min-height:0}
#authModal .authcard>.x,#mobileAuthGate .authcard>.x{
  width:44px;height:44px;min-width:44px;min-height:44px;top:8px;right:8px;z-index:8;
  background:#101424;touch-action:manipulation;
}
#authModal .auth-tabs button,#mobileAuthGate .auth-tabs button{height:44px;min-height:44px}
#authModal .auth-pass-toggle,#mobileAuthGate .auth-pass-toggle{height:44px;min-height:44px;min-width:54px;right:3px}
#authModal .nxform input,#mobileAuthGate .nxform input{font-size:16px;min-width:0;min-height:48px;box-sizing:border-box}
#authModal .nxform input::-ms-reveal,#mobileAuthGate .nxform input::-ms-reveal{display:none}
#authModal .sub2,#mobileAuthGate .sub2,#authModal .nxswap,#mobileAuthGate .nxswap{color:#aeb7cf}
#authModal .auth-label,#mobileAuthGate .auth-label{color:#aeb7cf}
#authModal .nxform button,#mobileAuthGate .nxform button{touch-action:manipulation}
#authModal .auth-field[hidden],#mobileAuthGate .auth-field[hidden]{display:none}
#authModal .nxforgot button,#mobileAuthGate .nxforgot button,
#authModal .nxswap button,#mobileAuthGate .nxswap button{
  min-height:44px;padding:8px 2px;border:0;background:transparent;color:var(--cyan,#00e5ff);
  font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer;
}
#authModal .nxforgot button,#mobileAuthGate .nxforgot button{font-size:.88rem}
#authModal .nxerr,#mobileAuthGate .nxerr,#authModal .nxok,#mobileAuthGate .nxok{line-height:1.45;overflow-wrap:anywhere}
#authModal button:focus-visible,#mobileAuthGate button:focus-visible{outline:2px solid #69e7ff;outline-offset:2px}
#authModal [aria-busy="true"] button:disabled,#mobileAuthGate [aria-busy="true"] button:disabled{cursor:wait;opacity:.6}
@media(max-width:780px),(max-height:540px){
  #authModal .authcard,#mobileAuthGate .authcard{grid-template-columns:minmax(0,1fr);width:min(460px,100%);border-radius:20px}
  #authModal .auth-visual,#mobileAuthGate .auth-visual,#authModal .auth-kicker,#mobileAuthGate .auth-kicker{display:none}
  #authModal .auth-main,#mobileAuthGate .auth-main{padding:50px 20px 18px}
  #authModal h3,#mobileAuthGate h3{margin:0;font-size:1.12rem;line-height:1.3;letter-spacing:.1em}
  #authModal .sub2,#mobileAuthGate .sub2{font-size:.9rem;line-height:1.45;margin-top:6px}
  #authModal .auth-tabs,#mobileAuthGate .auth-tabs{margin-top:14px}
  #authModal .nxform,#mobileAuthGate .nxform{gap:10px;margin-top:14px}
  #authModal .nxswap,#mobileAuthGate .nxswap{margin-top:10px;padding-top:8px;font-size:.88rem}
  #authModal .nxforgot,#mobileAuthGate .nxforgot{margin-top:-6px;margin-bottom:-6px}
  #authModal .authcard::before,#mobileAuthGate .authcard::before{animation:none;display:none}
  #authModal .nxbtn.google,#mobileAuthGate .nxbtn.google{letter-spacing:.09em;font-size:.66rem}
}
@media(prefers-reduced-motion:reduce){
  #authModal *,#mobileAuthGate *,#authModal *::before,#mobileAuthGate *::before,#authModal *::after,#mobileAuthGate *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
