/* =========================================================
   Mahjong Radar Version 99 — registration scroll and brand fix.
   The authentication brand is one centred block. It is removed completely
   from form panels, and mobile registration uses one full-height scroll area.
   ========================================================= */

.auth-brand-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  max-width:100%;
  margin:0 auto;
  text-align:center;
}
.auth-brand-text{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  margin:0 auto;
  text-align:center;
}
.auth-brand-text #au-appname,
.auth-brand-text .brand-domain{
  display:block;
  width:100%;
  margin-left:auto;
  margin-right:auto;
  text-align:center!important;
}
.auth-brand-text .brand-domain{
  box-sizing:border-box;
  padding-left:.11em;
}

/* The emblem/title/domain used to sit outside the registration panel. Hiding
   the complete wrapper prevents it from reserving even one pixel of space. */
#auth.form-mode .auth-brand-block,
#auth[data-auth-panel="au-register"] .auth-brand-block,
#auth[data-auth-panel="au-verify"] .auth-brand-block,
#auth[data-auth-panel="au-login"] .auth-brand-block,
#auth[data-auth-panel="au-forgot"] .auth-brand-block,
#auth[data-auth-panel="au-reset"] .auth-brand-block,
#auth[data-auth-panel="au-closed"] .auth-brand-block{
  display:none!important;
  width:0!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

@media (max-width:760px){
  /* Extra protection for mixed-cache deployments: no public or legacy logo can
     remain visible while the registration form is active. */
  body.mr-registration-active #auth .mobile-onboarding,
  body.mr-registration-active #auth .mobile-welcome-logo,
  body.mr-registration-active #auth .public-topbar,
  body.mr-registration-active #auth .public-hero,
  body.mr-registration-active #auth .public-values,
  body.mr-registration-active #auth .seo-public-links,
  body.mr-registration-active #auth .auth-brand-block,
  body.mr-registration-active #auth .auth-emblem,
  body.mr-registration-active #auth #au-appname,
  body.mr-registration-active #auth .brand-domain,
  body.mr-registration-active #auth .au-inner>.sub{
    display:none!important;
  }

  /* Registration itself is the single scroll surface. The heading, messages,
     every field, policy text and submit button all move together. */
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .public-shell,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .public-main,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .auth-card,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .au-inner{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register:not(.hidden){
    display:block!important;
    position:relative!important;
    flex:1 1 auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
    padding:0 0 max(44px,calc(30px + env(safe-area-inset-bottom)))!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
    scroll-behavior:smooth!important;
    scroll-padding-block:12px 170px!important;
    box-sizing:border-box!important;
    background:linear-gradient(180deg,#fffdf8,#f8f2e7)!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .registration-heading{
    position:relative!important;
    inset:auto!important;
    z-index:2!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:calc(13px + env(safe-area-inset-top)) 58px 12px 15px!important;
    text-align:left!important;
    background:rgba(255,253,248,.98)!important;
    border-bottom:1px solid rgba(181,138,59,.30)!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #register-errors{
    display:block;
    width:auto!important;
    margin:9px 13px 0!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #register-errors:not(.show){
    display:none!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .registration-scroll{
    display:block!important;
    flex:none!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:14px 14px max(48px,calc(34px + env(safe-area-inset-bottom)))!important;
    overflow:visible!important;
    overscroll-behavior:auto!important;
    touch-action:auto!important;
    box-sizing:border-box!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .registration-form-grid{
    grid-template-columns:1fr!important;
    gap:0!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register .field,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register .policy-ack,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register .registration-submit{
    scroll-margin-block:18px 175px!important;
  }
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register input,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register select,
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] #au-register textarea{
    min-height:50px!important;
    font-size:16px!important;
    scroll-margin-block:18px 180px!important;
  }

  /* When the keyboard is visible, the heading becomes one compact line and can
     immediately scroll out of view with the rest of the form. */
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] .registration-heading{
    padding:7px 50px 7px 12px!important;
  }
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] .registration-heading p,
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] .registration-heading span{
    display:none!important;
  }
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] .registration-heading h2{
    margin:0!important;
    font-size:18px!important;
    line-height:1.2!important;
  }
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] #au-register:not(.hidden){
    padding-bottom:150px!important;
    scroll-padding-block:8px 190px!important;
  }
  body.mr-auth-keyboard-open #auth.form-mode[data-auth-panel="au-register"] .registration-scroll{
    padding-top:9px!important;
    padding-bottom:165px!important;
  }

  /* Keep the close control available without allowing it to consume a header
     row or interfere with vertical form movement. */
  body.auth-active #auth.form-mode[data-auth-panel="au-register"] .auth-close{
    position:absolute!important;
    z-index:40!important;
    top:calc(8px + env(safe-area-inset-top))!important;
    right:8px!important;
    width:38px!important;
    height:38px!important;
    margin:0!important;
  }
}
