/* register.html */
html.auth-register,html.auth-register *{box-sizing:border-box}
html.auth-register,html.auth-register body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:#02070d;color:#f7e8c1}
html.auth-register body{
 min-height:100dvh;
 overflow-x:hidden;
 background:radial-gradient(circle at 50% 28%,#0d2940 0,#061624 35%,#02070d 72%);
}
html.auth-register .page{
 min-height:100dvh;
 width:100%;
 padding:18px;
 display:flex;
 flex-direction:column;
 align-items:center;
}
html.auth-register .topbar{
 width:min(1180px,100%);
 display:grid;
 grid-template-columns:1fr auto 1fr;
 align-items:center;
 gap:16px;
}
html.auth-register .back-btn,html.auth-register .lang-select{
 height:42px;
 border:1px solid #a87322;
 border-radius:10px;
 background:#07131e;
 color:#f4cd73;
 box-shadow:0 5px 18px #0007;
 font-weight:800;
}
html.auth-register .back-btn{
 justify-self:start;
 padding:0 14px;
 cursor:pointer;
}
html.auth-register .lang-wrap{justify-self:end}
html.auth-register .lang-select{padding:0 11px;outline:none;cursor:pointer}
html.auth-register .brand{text-align:center;white-space:nowrap}
html.auth-register .brand .crown{
 display:block;
 color:#f4cd73;
 font-size:27px;
 line-height:22px;
 height:22px;
}
html.auth-register .brand h1{
 margin:0;
 font-family:Georgia,serif;
 font-size:44px;
 letter-spacing:4px;
 color:#f4cd73;
 text-shadow:0 3px 10px #000;
}
html.auth-register .brand p{
 margin:3px 0 0;
 font-size:11px;
 letter-spacing:4px;
 color:#dcae4f;
}
html.auth-register .brand p:before,html.auth-register .brand p:after{
 content:"◆";
 font-size:6px;
 margin:0 10px;
}

html.auth-register .hero{
 width:min(760px,100%);
 margin:28px auto 0;
 text-align:center;
}
html.auth-register .hero-icon{
 width:82px;
 height:82px;
 margin:0 auto 10px;
 border:1px solid #b57b25;
 border-radius:22px;
 background:linear-gradient(180deg,#12314a,#081824);
 display:flex;
 align-items:center;
 justify-content:center;
 font-size:43px;
 box-shadow:0 14px 30px #0008;
}
html.auth-register .hero h2{
 margin:0;
 color:#f4cd73;
 font-family:Georgia,serif;
 font-size:34px;
 letter-spacing:1px;
}
html.auth-register .hero p{
 margin:8px auto 0;
 color:#aebdca;
 font-size:14px;
 line-height:1.45;
 max-width:540px;
}

html.auth-register .card{
 width:min(560px,100%);
 margin:24px auto 0;
 padding:28px;
 border:1px solid #a87322;
 border-radius:22px;
 background:linear-gradient(180deg,#0b1c2a,#06111b);
 box-shadow:0 24px 70px #000b,0 0 30px #b77a2426;
}
html.auth-register .form{
 display:grid;
 gap:14px;
}
html.auth-register .field{
 display:grid;
 gap:6px;
}
html.auth-register label{
 color:#d8c69f;
 font-size:13px;
 font-weight:800;
}
html.auth-register input{
 width:100%;
 height:50px;
 padding:0 14px;
 border:1px solid #334c5e;
 border-radius:10px;
 outline:none;
 background:#07131e;
 color:#f7e8c1;
 font-size:15px;
}
html.auth-register input:focus{
 border-color:#c58a31;
 box-shadow:0 0 0 2px #c58a3125;
}
html.auth-register .country-select{
 width:100%;
 height:50px;
 padding:0 42px 0 14px;
 border:1px solid #334c5e;
 border-radius:10px;
 outline:none;
 background:#07131e;
 color:#f7e8c1;
 font-size:15px;
 cursor:pointer;
}
html.auth-register .country-select:focus{
 border-color:#c58a31;
 box-shadow:0 0 0 2px #c58a3125;
}
html.auth-register .hint{
 margin-top:-2px;
 color:#8295a3;
 font-size:11px;
 line-height:1.35;
}
html.auth-register .submit{
 margin-top:4px;
 min-height:52px;
 border:1px solid #2b86ff;
 border-radius:11px;
 background:linear-gradient(#1467d8,#0750b4);
 color:#fff;
 box-shadow:0 6px 18px #003c9970;
 font-size:15px;
 font-weight:900;
 cursor:pointer;
}
html.auth-register .submit:disabled{
 opacity:.55;
 cursor:not-allowed;
}
html.auth-register .status{
 min-height:22px;
 margin-top:14px;
 padding:0 4px;
 text-align:center;
 font-size:13px;
 line-height:1.4;
}
html.auth-register .status.error{color:#ff8d8d}
html.auth-register .status.success{color:#79e59b}
html.auth-register .login-link{
 margin:22px -28px -28px;
 padding:18px 24px 20px;
 border-top:1px solid #213847;
 text-align:center;
 color:#91a2ae;
}
html.auth-register .login-link button{
 border:0;
 background:transparent;
 color:#f4cd73;
 font-size:15px;
 font-weight:900;
 cursor:pointer;
 padding:6px 10px;
}
html.auth-register .login-link .legal-links{
 display:inline-flex;
 flex-wrap:wrap;
 align-items:center;
 justify-content:center;
 gap:2px 7px;
 margin-left:8px;
}
html.auth-register .login-link .privacy-link{
 display:inline-block;
 max-width:100%;
 margin:0;
 padding:4px 6px;
 color:#b8c6d1;
 font-size:11px;
 line-height:1.25;
 text-decoration:none;
}
html.auth-register .login-link .privacy-link:hover{
 color:#f4cd73;
 text-decoration:underline;
}
html.auth-register .login-link .privacy-link:focus-visible{
 outline:2px solid #2b86ff;
 outline-offset:2px;
 border-radius:3px;
}

@media(max-width:700px){
 html.auth-register .page{padding:10px 10px 18px}
 html.auth-register .topbar{grid-template-columns:1fr auto 1fr;gap:6px}
 html.auth-register .back-btn{height:38px;padding:0 9px;font-size:11px}
 html.auth-register .lang-select{height:38px;max-width:118px;padding:0 7px;font-size:11px}
 html.auth-register .brand .crown{display:none}
 html.auth-register .brand h1{font-size:25px;letter-spacing:2px}
 html.auth-register .brand p{display:none}

 html.auth-register .hero{margin-top:20px}
 html.auth-register .hero-icon{width:68px;height:68px;border-radius:18px;font-size:36px}
 html.auth-register .hero h2{font-size:27px}
 html.auth-register .hero p{font-size:13px;padding:0 10px}

 html.auth-register .card{
  margin-top:18px;
  padding:22px 16px;
  border-radius:18px;
 }
 html.auth-register input{height:48px;font-size:14px}
 html.auth-register .submit{min-height:50px}
 html.auth-register .login-link{
  margin:20px -16px -22px;
  padding:16px 14px 17px;
 }
}


/* =========================================================
   CHESSORA REGISTER — FIXED VIEWPORT
   The browser page itself never scrolls.
   If the registration form is taller than the viewport,
   only the registration card scrolls internally.
   ========================================================= */

html.auth-register,html.auth-register body{
 width:100%;
 height:100%;
 min-height:0;
 overflow:hidden!important;
 overscroll-behavior:none;
}

html.auth-register body{
 position:fixed;
 inset:0;
 min-height:0!important;
}

html.auth-register .page{
 box-sizing:border-box;
 width:100%;
 height:100dvh;
 min-height:0!important;
 padding:clamp(7px,1.5vh,16px);
 display:grid;
 grid-template-rows:auto auto minmax(0,1fr);
 gap:clamp(7px,1.3vh,13px);
 align-items:stretch;
 overflow:hidden!important;
}

html.auth-register .topbar{
 width:min(1180px,100%);
 margin:0 auto;
 flex:0 0 auto;
}

html.auth-register .brand .crown{
 font-size:clamp(19px,2.7vh,27px);
 line-height:1;
 height:auto;
}

html.auth-register .brand h1{
 font-size:clamp(27px,4.5vh,44px);
 line-height:1;
}

html.auth-register .brand p{
 margin-top:2px;
}

html.auth-register .hero{
 width:min(760px,100%);
 margin:0 auto;
 align-self:center;
}

html.auth-register .hero-icon{
 width:clamp(50px,7.4vh,70px);
 height:clamp(50px,7.4vh,70px);
 margin:0 auto clamp(4px,.9vh,8px);
 border-radius:clamp(14px,2.2vh,19px);
 font-size:clamp(26px,4.3vh,37px);
}

html.auth-register .hero h2{
 font-size:clamp(23px,3.7vh,32px);
 line-height:1.05;
}

html.auth-register .hero p{
 margin-top:5px;
 font-size:clamp(10.5px,1.65vh,13.5px);
 line-height:1.3;
}

html.auth-register .register-card{
 box-sizing:border-box;
 width:min(600px,100%);
 height:100%;
 min-height:0;
 margin:0 auto!important;
 padding:clamp(14px,2vh,24px);
 border-radius:18px;
 overflow-y:auto;
 overflow-x:hidden;
 overscroll-behavior:contain;
 scrollbar-width:thin;
 scrollbar-color:#496171 #07131e;
}

html.auth-register .register-card::-webkit-scrollbar{
 width:7px;
}

html.auth-register .register-card::-webkit-scrollbar-track{
 background:#07131e;
 border-radius:99px;
}

html.auth-register .register-card::-webkit-scrollbar-thumb{
 background:#496171;
 border-radius:99px;
}

html.auth-register .register-card::-webkit-scrollbar-thumb:hover{
 background:#a87322;
}

html.auth-register .form-grid{
 gap:clamp(9px,1.3vh,13px);
}

html.auth-register .field{
 gap:5px;
}

html.auth-register .field label{
 font-size:clamp(10px,1.5vh,12px);
}

html.auth-register .field input{
 min-height:clamp(38px,5.4vh,44px);
}

html.auth-register .hint{
 margin-top:3px;
 font-size:clamp(9px,1.35vh,11px);
 line-height:1.25;
}

html.auth-register .actions{
 margin-top:clamp(10px,1.5vh,15px);
 gap:10px;
}

html.auth-register .btn{
 min-height:clamp(40px,5.8vh,48px);
}

html.auth-register .status{
 min-height:15px;
 margin-top:7px;
}

html.auth-register .login-row{
 margin-top:clamp(12px,1.8vh,18px);
 padding-top:clamp(10px,1.5vh,15px);
}

/* Compact laptop screens */
@media(min-width:701px) and (max-height:780px){
 html.auth-register .page{
  padding:6px 10px;
  gap:6px;
 }

 html.auth-register .back-btn,html.auth-register .lang-select{
  height:34px;
 }

 html.auth-register .brand .crown,html.auth-register .brand p{
  display:none;
 }

 html.auth-register .brand h1{
  font-size:27px;
 }

 html.auth-register .hero-icon{
  width:42px;
  height:42px;
  margin-bottom:3px;
  font-size:23px;
 }

 html.auth-register .hero h2{
  font-size:21px;
 }

 html.auth-register .hero p{
  margin-top:2px;
  font-size:10px;
 }

 html.auth-register .register-card{
  padding:10px 14px;
 }

 html.auth-register .form-grid{
  gap:7px;
 }

 html.auth-register .field{
  gap:3px;
 }

 html.auth-register .field label{
  font-size:10px;
 }

 html.auth-register .field input{
  min-height:34px;
  height:34px;
  font-size:12px;
 }

 html.auth-register .hint{
  margin-top:2px;
  font-size:9px;
 }

 html.auth-register .actions{
  margin-top:8px;
 }

 html.auth-register .btn{
  min-height:36px;
  font-size:12px;
 }

 html.auth-register .status{
  min-height:12px;
  margin-top:4px;
  font-size:9px;
 }

 html.auth-register .login-row{
  margin-top:8px;
  padding-top:7px;
  font-size:10px;
 }
}

/* Mobile:
   page remains fixed; register-card is the only scrollable area. */
@media(max-width:700px){
 html.auth-register .page{
  padding:
   max(6px,env(safe-area-inset-top))
   7px
   max(6px,env(safe-area-inset-bottom));
  gap:6px;
 }

 html.auth-register .topbar{
  width:100%;
  gap:5px;
 }

 html.auth-register .back-btn{
  height:34px;
  padding:0 7px;
  font-size:9px;
 }

 html.auth-register .lang-select{
  height:34px;
  max-width:104px;
  padding:0 5px;
  font-size:9px;
 }

 html.auth-register .brand .crown,html.auth-register .brand p{
  display:none;
 }

 html.auth-register .brand h1{
  font-size:22px;
  letter-spacing:1.8px;
 }

 html.auth-register .hero{
  width:100%;
 }

 html.auth-register .hero-icon{
  width:40px;
  height:40px;
  margin-bottom:2px;
  border-radius:12px;
  font-size:21px;
 }

 html.auth-register .hero h2{
  font-size:19px;
 }

 html.auth-register .hero p{
  max-width:470px;
  margin-top:2px;
  padding:0 6px;
  font-size:9.5px;
  line-height:1.2;
 }

 html.auth-register .register-card{
  width:100%;
  padding:10px;
  border-radius:14px;
 }

 html.auth-register .form-grid{
  grid-template-columns:1fr;
  gap:7px;
 }

 html.auth-register .field{
  gap:3px;
 }

 html.auth-register .field label{
  font-size:10px;
 }

 html.auth-register .field input{
  min-height:35px;
  height:35px;
  font-size:12px;
 }

 html.auth-register .hint{
  font-size:9px;
 }

 html.auth-register .actions{
  margin-top:8px;
  gap:6px;
 }

 html.auth-register .btn{
  min-height:36px;
  font-size:11px;
 }

 html.auth-register .status{
  min-height:12px;
  margin-top:4px;
  font-size:9px;
 }

 html.auth-register .login-row{
  margin-top:9px;
  padding-top:8px;
  font-size:10px;
 }
}

@media(max-width:390px){
 html.auth-register .topbar{
  grid-template-columns:auto 1fr auto;
 }

 html.auth-register .back-btn{
  max-width:82px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
 }

 html.auth-register .lang-select{
  max-width:88px;
 }

 html.auth-register .brand h1{
  font-size:19px;
  letter-spacing:1.3px;
 }

 html.auth-register .hero-icon{
  display:none;
 }

 html.auth-register .hero h2{
  font-size:17px;
 }

 html.auth-register .hero p{
  font-size:8.5px;
 }
}



/* CHESSORA REGISTER — LIGHT THEME (visual overrides only) */
html.auth-register[data-theme="light"]{color-scheme:light}
html.auth-register[data-theme="light"],html.auth-register[data-theme="light"] body{
 background:#eadfcd;
 color:#25384a;
}
html.auth-register[data-theme="light"] body{
 background:radial-gradient(circle at 50% 28%,#fffdf8 0,#f3eadc 44%,#dfcfb7 100%);
}
html.auth-register[data-theme="light"] .back-btn,html.auth-register[data-theme="light"] .lang-select{
 border-color:#b7812d;
 background:#fffaf2;
 color:#8a5b12;
 box-shadow:0 5px 18px #72522a24;
}
html.auth-register[data-theme="light"] .lang-select option{
 background:#fffaf2;
 color:#26394b;
}
html.auth-register[data-theme="light"] .brand .crown,html.auth-register[data-theme="light"] .brand h1{
 color:#9b670f;
 text-shadow:0 2px 8px #ffffffa8;
}
html.auth-register[data-theme="light"] .brand p{color:#a36c12}
html.auth-register[data-theme="light"] .hero-icon{
 border-color:#b7812d;
 background:linear-gradient(180deg,#fffdf8,#f1e5d3);
 color:#8f5e0d;
 box-shadow:0 14px 30px #72522a2e;
}
html.auth-register[data-theme="light"] .hero h2{color:#8f5e0d}
html.auth-register[data-theme="light"] .hero p{color:#667886}
html.auth-register[data-theme="light"] .card,html.auth-register[data-theme="light"] .register-card{
 border-color:#b7812d;
 background:linear-gradient(180deg,#fffdf8,#f1e5d3);
 box-shadow:0 24px 70px #5a402c45,0 0 30px #b77a2418;
 scrollbar-color:#ad9271 #eee1cf;
}
html.auth-register[data-theme="light"] .card::-webkit-scrollbar-track,html.auth-register[data-theme="light"] .register-card::-webkit-scrollbar-track{background:#eee1cf}
html.auth-register[data-theme="light"] .card::-webkit-scrollbar-thumb,html.auth-register[data-theme="light"] .register-card::-webkit-scrollbar-thumb{background:#ad9271}
html.auth-register[data-theme="light"] label{color:#625548}
html.auth-register[data-theme="light"] input,html.auth-register[data-theme="light"] .country-select{
 border-color:#bcae9b;
 background:#fffdf8;
 color:#26394b;
}
html.auth-register[data-theme="light"] .country-select option{
 background:#fffdf8;
 color:#26394b;
}
html.auth-register[data-theme="light"] input:focus,html.auth-register[data-theme="light"] .country-select:focus{
 border-color:#2b86ff;
 box-shadow:0 0 0 2px #2b86ff20;
}
html.auth-register[data-theme="light"] .hint{color:#667886}
html.auth-register[data-theme="light"] .status{color:#607685}
html.auth-register[data-theme="light"] .status.error{color:#b3261e}
html.auth-register[data-theme="light"] .status.success{color:#17743a}
html.auth-register[data-theme="light"] .login-link,html.auth-register[data-theme="light"] .login-row{
 border-top-color:#d8c6ac;
 color:#667886;
}
html.auth-register[data-theme="light"] .login-link button,html.auth-register[data-theme="light"] .login-row button{color:#8f5e0d}
html.auth-register[data-theme="light"] .login-link .privacy-link{color:#76551f}
html.auth-register[data-theme="light"] .login-link .privacy-link:hover{color:#8f5e0d}

/* friend-auth.html */
html.auth-friend,html.auth-friend *{box-sizing:border-box}
html.auth-friend,html.auth-friend body{margin:0;min-height:100%;font-family:Arial,Helvetica,sans-serif;background:#02070d;color:#f7e8c1}
html.auth-friend body{
 min-height:100dvh;
 overflow-x:hidden;
 background:radial-gradient(circle at 50% 28%,#0d2940 0,#061624 35%,#02070d 72%);
}
html.auth-friend .page{min-height:100dvh;width:100%;padding:18px;display:flex;flex-direction:column;align-items:center}
html.auth-friend .topbar{width:min(1180px,100%);display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px}
html.auth-friend .back-btn,html.auth-friend .lang-select{height:42px;border:1px solid #a87322;border-radius:10px;background:#07131e;color:#f4cd73;box-shadow:0 5px 18px #0007;font-weight:800}
html.auth-friend .back-btn{justify-self:start;padding:0 14px;cursor:pointer}
html.auth-friend .lang-wrap{justify-self:end}html.auth-friend .lang-select{padding:0 11px;outline:none;cursor:pointer}
html.auth-friend .brand{text-align:center;white-space:nowrap}html.auth-friend .brand .crown{display:block;color:#f4cd73;font-size:27px;line-height:22px;height:22px}
html.auth-friend .brand h1{margin:0;font-family:Georgia,serif;font-size:44px;letter-spacing:4px;color:#f4cd73;text-shadow:0 3px 10px #000}
html.auth-friend .brand p{margin:3px 0 0;font-size:11px;letter-spacing:4px;color:#dcae4f}
html.auth-friend .brand p:before,html.auth-friend .brand p:after{content:"◆";font-size:6px;margin:0 10px}
html.auth-friend .hero{width:min(760px,100%);margin:30px auto 0;text-align:center}
html.auth-friend .hero-icon{width:82px;height:82px;margin:0 auto 10px;border:1px solid #b57b25;border-radius:22px;background:linear-gradient(180deg,#12314a,#081824);display:flex;align-items:center;justify-content:center;font-size:46px;box-shadow:0 14px 30px #0008}
html.auth-friend .hero h2{margin:0;color:#f4cd73;font-family:Georgia,serif;font-size:34px;letter-spacing:1px}
html.auth-friend .hero p{margin:8px auto 0;color:#aebdca;font-size:14px;line-height:1.45;max-width:540px}
html.auth-friend .auth-card{width:min(560px,100%);margin:24px auto 0;padding:28px;border:1px solid #a87322;border-radius:22px;background:linear-gradient(180deg,#0b1c2a,#06111b);box-shadow:0 24px 70px #000b}
html.auth-friend .avatar{width:76px;height:76px;margin:0 auto 16px;border-radius:50%;border:1px solid #4d7893;background:linear-gradient(180deg,#4e9be2,#286eaa);position:relative;box-shadow:0 10px 24px #0008}
html.auth-friend .avatar:before{content:"";position:absolute;width:25px;height:25px;border-radius:50%;background:#164b76;top:15px;left:25px}
html.auth-friend .avatar:after{content:"";position:absolute;width:48px;height:24px;border-radius:30px 30px 18px 18px;background:#164b76;bottom:11px;left:13px}
html.auth-friend .auth-title{margin:0;text-align:center;color:#f4cd73;font-size:25px;font-weight:900}
html.auth-friend .auth-text{max-width:440px;margin:14px auto 22px;text-align:center;color:#aeb6be;font-size:15px;line-height:1.55}
html.auth-friend .providers{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 auto 20px}
html.auth-friend .provider{height:76px;border:1px solid #345266;border-radius:14px;background:#07131e;color:#f7e8c1;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;transition:.18s ease}
html.auth-friend .provider:hover{transform:translateY(-2px);border-color:#c48a31;background:#0b1b28}
html.auth-friend .provider.selected{border-color:#f4cd73;box-shadow:0 0 0 2px #f4cd7328;background:#102337}
html.auth-friend .provider-icon{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-size:21px;font-weight:900}
html.auth-friend .provider.google .provider-icon{background:#fff;color:#4285f4}html.auth-friend .provider.facebook .provider-icon{background:#1877f2;color:#fff}
html.auth-friend .provider.email .provider-icon,html.auth-friend .provider.guest .provider-icon{background:#142533;color:#f4cd73;border:1px solid #587287}
html.auth-friend .provider-label{font-size:11px;color:#b8c6d1}
html.auth-friend .provider.unavailable{position:relative;cursor:not-allowed;opacity:.72}
html.auth-friend .provider.unavailable:hover{transform:none;border-color:#345266;background:#07131e}
html.auth-friend .provider.unavailable .provider-label{display:block!important;font-size:9px;white-space:nowrap;color:#8fa4b4}
html.auth-friend .actions{display:grid;grid-template-columns:1fr 1.15fr;gap:12px;margin-top:8px}
html.auth-friend .btn{min-height:50px;border-radius:11px;font-size:15px;font-weight:900;cursor:pointer}
html.auth-friend .btn.cancel{border:1px solid #334c5e;background:#081620;color:#c9d4dc}
html.auth-friend .btn.login{border:1px solid #2b86ff;background:linear-gradient(#1467d8,#0750b4);color:#fff;box-shadow:0 6px 18px #003c9970}
html.auth-friend .register{margin:24px -28px -28px;padding:18px 24px 20px;border-top:1px solid #213847;text-align:center;color:#91a2ae}
html.auth-friend .register button{border:0;background:transparent;color:#f4cd73;font-size:16px;font-weight:900;cursor:pointer;padding:6px 10px}
html.auth-friend .register .legal-links{
 display:flex;
 flex-wrap:wrap;
 align-items:center;
 justify-content:center;
 gap:2px 7px;
 margin-top:5px;
}
html.auth-friend .register .privacy-link{
 display:inline-block;
 max-width:100%;
 margin:0;
 padding:4px 8px;
 color:#b8c6d1;
 font-size:11px;
 line-height:1.25;
 text-decoration:none;
}
html.auth-friend .register .privacy-link:hover{
 color:#f4cd73;
 text-decoration:underline;
}
html.auth-friend .register .privacy-link:focus-visible{
 outline:2px solid #2b86ff;
 outline-offset:2px;
 border-radius:3px;
}
html.auth-friend .status{min-height:18px;margin-top:10px;text-align:center;color:#8fa4b4;font-size:12px}

html.auth-friend .email-login{margin:0 0 16px;padding:14px;border:1px solid #2b4658;border-radius:12px;background:#06111b;display:grid;gap:12px}
html.auth-friend .email-login[hidden]{display:none}
html.auth-friend .email-field{display:grid;gap:6px}
html.auth-friend .email-field label{color:#d8c69f;font-size:12px;font-weight:800}
html.auth-friend .email-field input{width:100%;height:46px;padding:0 12px;border:1px solid #334c5e;border-radius:9px;outline:none;background:#07131e;color:#f7e8c1;font-size:14px}
html.auth-friend .email-field input:focus{border-color:#c58a31;box-shadow:0 0 0 2px #c58a3125}
html.auth-friend .guest-country{
 width:100%;
 height:clamp(35px,5.5vh,46px);
 padding:0 38px 0 12px;
 border:1px solid #334c5e;
 border-radius:9px;
 outline:none;
 background:#07131e;
 color:#f7e8c1;
 font-size:14px;
 cursor:pointer;
}
html.auth-friend .guest-country:focus{
 border-color:#c58a31;
 box-shadow:0 0 0 2px #c58a3125;
}

@media(max-width:700px){
 html.auth-friend .page{padding:10px 10px 18px}html.auth-friend .topbar{grid-template-columns:1fr auto 1fr;gap:6px}
 html.auth-friend .back-btn{height:38px;padding:0 9px;font-size:11px}html.auth-friend .lang-select{height:38px;max-width:118px;padding:0 7px;font-size:11px}
 html.auth-friend .brand .crown{display:none}html.auth-friend .brand h1{font-size:25px;letter-spacing:2px}html.auth-friend .brand p{display:none}
 html.auth-friend .hero{margin-top:22px}html.auth-friend .hero-icon{width:68px;height:68px;border-radius:18px;font-size:38px}html.auth-friend .hero h2{font-size:27px}html.auth-friend .hero p{font-size:13px;padding:0 12px}
 html.auth-friend .auth-card{margin-top:18px;padding:22px 16px;border-radius:18px}html.auth-friend .avatar{width:66px;height:66px}html.auth-friend .avatar:before{width:22px;height:22px;left:21px;top:13px}html.auth-friend .avatar:after{width:42px;height:21px;left:11px;bottom:9px}
 html.auth-friend .auth-title{font-size:22px}html.auth-friend .auth-text{font-size:14px;margin:12px auto 18px}
 html.auth-friend .providers{gap:7px}html.auth-friend .provider{height:68px;border-radius:12px}html.auth-friend .provider-icon{width:30px;height:30px;font-size:18px}html.auth-friend .provider-label{font-size:9px}
 html.auth-friend .actions{gap:8px}html.auth-friend .btn{min-height:48px;font-size:14px}html.auth-friend .register{margin:20px -16px -22px;padding:16px 14px 17px}html.auth-friend .register button{font-size:15px}
}
@media(max-width:390px){
 html.auth-friend .brand h1{font-size:22px}html.auth-friend .back-btn{font-size:10px;padding:0 7px}html.auth-friend .lang-select{max-width:102px;font-size:10px}
 html.auth-friend .provider-label{display:none}html.auth-friend .provider{height:58px}html.auth-friend .actions{grid-template-columns:1fr 1fr}
}


/* =========================================================
   CHESSORA FRIEND AUTH — FIXED VIEWPORT
   The browser page itself never scrolls.
   If the login form becomes taller (for example after Email
   is selected), only the authentication card can scroll.
   ========================================================= */

html.auth-friend,html.auth-friend body{
 width:100%;
 height:100%;
 min-height:0;
 overflow:hidden!important;
 overscroll-behavior:none;
}

html.auth-friend body{
 position:fixed;
 inset:0;
 min-height:0!important;
}

html.auth-friend .page{
 box-sizing:border-box;
 width:100%;
 height:100dvh;
 min-height:0!important;
 padding:clamp(7px,1.5vh,16px);
 display:grid;
 grid-template-rows:auto auto minmax(0,1fr);
 gap:clamp(7px,1.3vh,13px);
 align-items:stretch;
 overflow:hidden!important;
}

html.auth-friend .topbar{
 width:min(1180px,100%);
 margin:0 auto;
 flex:0 0 auto;
}

html.auth-friend .brand .crown{
 font-size:clamp(19px,2.7vh,27px);
 line-height:1;
 height:auto;
}

html.auth-friend .brand h1{
 font-size:clamp(27px,4.5vh,44px);
 line-height:1;
}

html.auth-friend .brand p{
 margin-top:2px;
}

html.auth-friend .hero{
 width:min(760px,100%);
 margin:0 auto;
 align-self:center;
}

html.auth-friend .hero-icon{
 width:clamp(50px,7.6vh,72px);
 height:clamp(50px,7.6vh,72px);
 margin:0 auto clamp(4px,.9vh,8px);
 border-radius:clamp(14px,2.3vh,20px);
 font-size:clamp(27px,4.5vh,39px);
}

html.auth-friend .hero h2{
 font-size:clamp(23px,3.7vh,32px);
 line-height:1.05;
}

html.auth-friend .hero p{
 margin-top:5px;
 font-size:clamp(10.5px,1.65vh,13.5px);
 line-height:1.3;
}

html.auth-friend .auth-card{
 box-sizing:border-box;
 width:min(560px,100%);
 height:100%;
 min-height:0;
 margin:0 auto!important;
 padding:clamp(14px,2vh,24px);
 border-radius:18px;
 overflow-y:auto;
 overflow-x:hidden;
 overscroll-behavior:contain;
 scrollbar-width:thin;
 scrollbar-color:#496171 #07131e;
}

html.auth-friend .auth-card::-webkit-scrollbar{
 width:7px;
}

html.auth-friend .auth-card::-webkit-scrollbar-track{
 background:#07131e;
 border-radius:99px;
}

html.auth-friend .auth-card::-webkit-scrollbar-thumb{
 background:#496171;
 border-radius:99px;
}

html.auth-friend .auth-card::-webkit-scrollbar-thumb:hover{
 background:#a87322;
}

html.auth-friend .avatar{
 width:clamp(54px,8vh,70px);
 height:clamp(54px,8vh,70px);
 margin-bottom:clamp(8px,1.3vh,14px);
}

html.auth-friend .avatar:before{
 transform:scale(.92);
 transform-origin:center;
}

html.auth-friend .avatar:after{
 transform:scale(.92);
 transform-origin:center;
}

html.auth-friend .auth-title{
 font-size:clamp(20px,3vh,24px);
}

html.auth-friend .auth-text{
 margin:clamp(7px,1.2vh,12px) auto clamp(10px,1.6vh,17px);
 font-size:clamp(11px,1.7vh,14px);
 line-height:1.35;
}

html.auth-friend .providers{
 gap:clamp(7px,1vw,11px);
 margin-bottom:clamp(9px,1.4vh,16px);
}

html.auth-friend .provider{
 height:clamp(58px,8.7vh,72px);
}

html.auth-friend .email-login{
 margin-bottom:clamp(9px,1.4vh,14px);
 padding:clamp(9px,1.4vh,13px);
 gap:clamp(8px,1.2vh,11px);
}

html.auth-friend .email-field input{
 height:clamp(38px,5.5vh,44px);
}

html.auth-friend .actions{
 gap:10px;
 margin-top:6px;
}

html.auth-friend .btn{
 min-height:clamp(40px,5.8vh,48px);
}

html.auth-friend .status{
 min-height:15px;
 margin-top:7px;
}

html.auth-friend .register{
 margin:
  clamp(13px,1.8vh,20px)
  calc(-1 * clamp(14px,2vh,24px))
  calc(-1 * clamp(14px,2vh,24px));
 padding:
  clamp(11px,1.5vh,16px)
  18px
  clamp(12px,1.6vh,17px);
}

/* Compact laptop screens */
@media(min-width:701px) and (max-height:760px){
 html.auth-friend .page{
  padding:6px 10px;
  gap:6px;
 }

 html.auth-friend .back-btn,html.auth-friend .lang-select{
  height:34px;
 }

 html.auth-friend .brand .crown,html.auth-friend .brand p{
  display:none;
 }

 html.auth-friend .brand h1{
  font-size:27px;
 }

 html.auth-friend .hero-icon{
  width:44px;
  height:44px;
  margin-bottom:3px;
  font-size:24px;
 }

 html.auth-friend .hero h2{
  font-size:21px;
 }

 html.auth-friend .hero p{
  margin-top:2px;
  font-size:10.5px;
 }

 html.auth-friend .auth-card{
  padding:10px 14px;
 }

 html.auth-friend .avatar{
  width:48px;
  height:48px;
  margin-bottom:6px;
 }

 html.auth-friend .avatar:before{
  width:18px;
  height:18px;
  top:9px;
  left:15px;
 }

 html.auth-friend .avatar:after{
  width:34px;
  height:17px;
  left:7px;
  bottom:7px;
 }

 html.auth-friend .auth-title{
  font-size:18px;
 }

 html.auth-friend .auth-text{
  margin:5px auto 8px;
  font-size:10.5px;
 }

 html.auth-friend .providers{
  margin-bottom:7px;
 }

 html.auth-friend .provider{
  height:50px;
 }

 html.auth-friend .provider-icon{
  width:26px;
  height:26px;
  font-size:16px;
 }

 html.auth-friend .provider-label{
  font-size:9px;
 }

 html.auth-friend .email-login{
  padding:7px 9px;
  gap:7px;
  margin-bottom:7px;
 }

 html.auth-friend .email-field input{
  height:34px;
 }

 html.auth-friend .btn{
  min-height:36px;
  font-size:12px;
 }

 html.auth-friend .register{
  margin:9px -14px -10px;
  padding:8px 12px 9px;
  font-size:11px;
 }

 html.auth-friend .register button{
  padding:4px 8px;
  font-size:13px;
 }
}

/* Mobile:
   page remains fixed; auth-card is the only scrollable area. */
@media(max-width:700px){
 html.auth-friend .page{
  padding:
   max(6px,env(safe-area-inset-top))
   7px
   max(6px,env(safe-area-inset-bottom));
  gap:6px;
 }

 html.auth-friend .topbar{
  width:100%;
  gap:5px;
 }

 html.auth-friend .back-btn{
  height:34px;
  padding:0 7px;
  font-size:9px;
 }

 html.auth-friend .lang-select{
  height:34px;
  max-width:104px;
  padding:0 5px;
  font-size:9px;
 }

 html.auth-friend .brand .crown,html.auth-friend .brand p{
  display:none;
 }

 html.auth-friend .brand h1{
  font-size:22px;
  letter-spacing:1.8px;
 }

 html.auth-friend .hero{
  width:100%;
 }

 html.auth-friend .hero-icon{
  width:42px;
  height:42px;
  margin-bottom:2px;
  border-radius:12px;
  font-size:22px;
 }

 html.auth-friend .hero h2{
  font-size:20px;
 }

 html.auth-friend .hero p{
  max-width:470px;
  margin-top:2px;
  padding:0 6px;
  font-size:9.5px;
  line-height:1.2;
 }

 html.auth-friend .auth-card{
  width:100%;
  padding:10px;
  border-radius:14px;
 }

 html.auth-friend .avatar{
  width:48px;
  height:48px;
  margin-bottom:6px;
 }

 html.auth-friend .avatar:before{
  width:18px;
  height:18px;
  top:9px;
  left:15px;
 }

 html.auth-friend .avatar:after{
  width:34px;
  height:17px;
  left:7px;
  bottom:7px;
 }

 html.auth-friend .auth-title{
  font-size:18px;
 }

 html.auth-friend .auth-text{
  margin:5px auto 9px;
  font-size:10.5px;
  line-height:1.25;
 }

 html.auth-friend .providers{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  margin-bottom:8px;
 }

 html.auth-friend .provider{
  height:52px;
  min-width:0;
  padding:4px 2px;
  border-radius:10px;
 }

 html.auth-friend .provider-icon{
  width:25px;
  height:25px;
  font-size:15px;
 }

 html.auth-friend .provider-label{
  font-size:8px;
  white-space:nowrap;
 }

 html.auth-friend .email-login{
  padding:7px;
  gap:7px;
  margin-bottom:7px;
 }

 html.auth-friend .email-field{
  gap:4px;
 }

 html.auth-friend .email-field label{
  font-size:10px;
 }

 html.auth-friend .email-field input{
  height:35px;
  font-size:12px;
 }

 html.auth-friend .actions{
  gap:6px;
 }

 html.auth-friend .btn{
  min-height:36px;
  font-size:11px;
 }

 html.auth-friend .status{
  min-height:12px;
  margin-top:4px;
  font-size:9px;
 }

 html.auth-friend .register{
  margin:8px -10px -10px;
  padding:8px 10px 9px;
  font-size:10px;
 }

 html.auth-friend .register button{
  padding:4px 6px;
  font-size:12px;
 }
}

@media(max-width:390px){
 html.auth-friend .topbar{
  grid-template-columns:auto 1fr auto;
 }

 html.auth-friend .back-btn{
  max-width:82px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
 }

 html.auth-friend .lang-select{
  max-width:88px;
 }

 html.auth-friend .brand h1{
  font-size:19px;
  letter-spacing:1.3px;
 }

 html.auth-friend .hero-icon{
  display:none;
 }

 html.auth-friend .hero h2{
  font-size:17px;
 }

 html.auth-friend .hero p{
  font-size:8.5px;
 }

 html.auth-friend .provider-label{
  display:none;
 }

 html.auth-friend .provider.unavailable .provider-label{
  display:block!important;
  font-size:7px;
 }

 html.auth-friend .provider{
  height:43px;
 }

 html.auth-friend .actions{
  grid-template-columns:1fr 1fr;
 }
}



/* CHESSORA FRIEND AUTH — LIGHT THEME (visual overrides only) */
html.auth-friend[data-theme="light"]{color-scheme:light}
html.auth-friend[data-theme="light"],html.auth-friend[data-theme="light"] body{
 background:#eadfcd;
 color:#25384a;
}
html.auth-friend[data-theme="light"] body{
 background:radial-gradient(circle at 50% 28%,#fffdf8 0,#f3eadc 44%,#dfcfb7 100%);
}
html.auth-friend[data-theme="light"] .back-btn,html.auth-friend[data-theme="light"] .lang-select{
 border-color:#b7812d;
 background:#fffaf2;
 color:#8a5b12;
 box-shadow:0 5px 18px #72522a24;
}
html.auth-friend[data-theme="light"] .lang-select option{
 background:#fffaf2;
 color:#26394b;
}
html.auth-friend[data-theme="light"] .brand .crown,html.auth-friend[data-theme="light"] .brand h1{
 color:#9b670f;
 text-shadow:0 2px 8px #ffffffa8;
}
html.auth-friend[data-theme="light"] .brand p{color:#a36c12}
html.auth-friend[data-theme="light"] .hero-icon{
 border-color:#b7812d;
 background:linear-gradient(180deg,#fffdf8,#f1e5d3);
 color:#8f5e0d;
 box-shadow:0 14px 30px #72522a2e;
}
html.auth-friend[data-theme="light"] .hero h2,html.auth-friend[data-theme="light"] .auth-title{color:#8f5e0d}
html.auth-friend[data-theme="light"] .hero p,html.auth-friend[data-theme="light"] .auth-text{color:#667886}
html.auth-friend[data-theme="light"] .auth-card{
 border-color:#b7812d;
 background:linear-gradient(180deg,#fffdf8,#f1e5d3);
 box-shadow:0 24px 70px #5a402c45;
 scrollbar-color:#ad9271 #eee1cf;
}
html.auth-friend[data-theme="light"] .auth-card::-webkit-scrollbar-track{background:#eee1cf}
html.auth-friend[data-theme="light"] .auth-card::-webkit-scrollbar-thumb{background:#ad9271}
html.auth-friend[data-theme="light"] .auth-card::-webkit-scrollbar-thumb:hover{background:#b7812d}
html.auth-friend[data-theme="light"] .avatar{
 border-color:#5f8fae;
 box-shadow:0 10px 24px #355a7130;
}
html.auth-friend[data-theme="light"] .provider{
 border-color:#bcae9b;
 background:#fffaf2;
 color:#26394b;
}
html.auth-friend[data-theme="light"] .provider:hover{
 border-color:#b7812d;
 background:#f7ecdc;
}
html.auth-friend[data-theme="light"] .provider.selected{
 border-color:#2b86ff;
 background:#eaf4ff;
 box-shadow:0 0 0 2px #2b86ff24;
}
html.auth-friend[data-theme="light"] .provider.unavailable:hover{
 border-color:#bcae9b;
 background:#fffaf2;
}
html.auth-friend[data-theme="light"] .provider.unavailable .provider-label{color:#71818d}
html.auth-friend[data-theme="light"] .provider.email .provider-icon,html.auth-friend[data-theme="light"] .provider.guest .provider-icon{
 border-color:#bca57d;
 background:#f3e7d5;
 color:#8f5e0d;
}
html.auth-friend[data-theme="light"] .provider-label{color:#526675}
html.auth-friend[data-theme="light"] .btn.cancel{
 border-color:#bcae9b;
 background:#fffaf2;
 color:#425564;
}
html.auth-friend[data-theme="light"] .register{
 border-top-color:#d8c6ac;
 color:#667886;
}
html.auth-friend[data-theme="light"] .register button{color:#8f5e0d}
html.auth-friend[data-theme="light"] .register .privacy-link{color:#76551f}
html.auth-friend[data-theme="light"] .register .privacy-link:hover{color:#8f5e0d}
html.auth-friend[data-theme="light"] .status{color:#607685}
html.auth-friend[data-theme="light"] .email-login{
 border-color:#c8b89f;
 background:#fffaf2;
}
html.auth-friend[data-theme="light"] .email-field label{color:#625548}
html.auth-friend[data-theme="light"] .email-field input{
 border-color:#bcae9b;
 background:#fffdf8;
 color:#26394b;
}
html.auth-friend[data-theme="light"] .email-field input:focus{
 border-color:#2b86ff;
 box-shadow:0 0 0 2px #2b86ff20;
}
html.auth-friend[data-theme="light"] .guest-country{
 border-color:#bcae9b;
 background:#fffdf8;
 color:#26394b;
}
html.auth-friend[data-theme="light"] .guest-country option{
 background:#fffdf8;
 color:#26394b;
}
html.auth-friend[data-theme="light"] .guest-country:focus{
 border-color:#2b86ff;
 box-shadow:0 0 0 2px #2b86ff20;
}

/* Centered authorization result */
html.auth-friend .status{display:none!important}
html.auth-friend .auth-notice{
 position:fixed;
 inset:0;
 z-index:300;
 display:flex;
 align-items:center;
 justify-content:center;
 padding:20px;
 background:rgba(1,8,14,.48);
 backdrop-filter:blur(4px);
 -webkit-backdrop-filter:blur(4px);
}
html.auth-friend .auth-notice[hidden]{display:none}
html.auth-friend .auth-notice-box{
 width:min(410px,90vw);
 min-height:170px;
 padding:26px 24px;
 border:1px solid rgba(196,139,49,.78);
 border-radius:20px;
 background:rgba(6,19,30,.91);
 box-shadow:0 24px 70px rgba(0,0,0,.7);
 display:flex;
 flex-direction:column;
 align-items:center;
 justify-content:center;
 gap:15px;
 text-align:center;
}
html.auth-friend .auth-notice-icon{
 width:64px;
 height:64px;
 border-radius:50%;
 display:flex;
 align-items:center;
 justify-content:center;
 color:#fff;
 font-size:42px;
 font-weight:900;
 line-height:1;
}
html.auth-friend .auth-notice-text{
 color:#f7e8c1;
 font-size:clamp(17px,4vw,22px);
 font-weight:850;
 line-height:1.35;
}
html.auth-friend .auth-notice.error .auth-notice-box{border-color:rgba(255,100,100,.82)}
html.auth-friend .auth-notice.error .auth-notice-icon{
 background:rgba(190,38,45,.9);
 box-shadow:0 0 24px rgba(255,67,74,.48);
}
html.auth-friend .auth-notice.success .auth-notice-box{border-color:rgba(74,215,119,.85)}
html.auth-friend .auth-notice.success .auth-notice-icon{
 background:rgba(31,169,82,.94);
 box-shadow:0 0 26px rgba(45,215,104,.55);
}
html.auth-friend .auth-notice.success .auth-notice-text{color:#dfffea}
html.auth-friend[data-theme="light"] .auth-notice{
 background:rgba(54,40,27,.32);
}
html.auth-friend[data-theme="light"] .auth-notice-box{
 background:rgba(255,250,242,.94);
 box-shadow:0 24px 70px rgba(70,48,30,.38);
}
html.auth-friend[data-theme="light"] .auth-notice-text{color:#26394b}
html.auth-friend[data-theme="light"] .auth-notice.success .auth-notice-text{color:#176a37}
