/* ============================================================
   登录 / 注册界面
   ------------------------------------------------------------
   为什么用 DOM 而不是用游戏引擎画？
     ① 引擎里没有原生的文本输入框，密码框、光标、选中文字都得手搓；
     ② 手机上要弹出系统键盘 —— 只有真正的 <input> 才能触发；
     ③ 浏览器自带的密码管理器、自动填充也才能用上。
   配色和游戏内保持一致（深蓝 + 青绿），不会显得是两个东西。
   ============================================================ */

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;                       /* 要盖住旋转提示(50)和启动遮罩 */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 14, 21, .88);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  overflow-y: auto;                  /* 手机弹键盘时能滚 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#auth-overlay.is-on { display: flex; }

.auth-box {
  position: relative;
  width: min(360px, 100%);
  margin: auto;
  padding: 26px 24px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, #16293a, #101f2c);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  color: #e8f1f8;
  font-size: 14px;
  line-height: 1.6;
}

#auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #b9cfe0;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
#auth-close:active { background: rgba(255, 255, 255, .18); }

.auth-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #eaf6ff;
  text-align: center;
}
.auth-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8fb3cf;
  text-align: center;
}

/* ---- 登录 / 注册 切换 ---- */
.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .26);
}
.auth-tab {
  flex: 1;
  padding: 9px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9fbdd4;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.auth-tab.is-on {
  background: #2b5878;
  color: #eaf6ff;
  font-weight: 700;
}

/* ---- 输入框 ---- */
.auth-field {
  display: block;
  margin-bottom: 13px;
}
.auth-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #9fbdd4;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .3);
  color: #eaf6ff;
  font: inherit;
  font-size: 15px;                   /* 小于 16px 时 iOS 会自动放大页面，这里紧跟 15 但配 viewport 已禁用缩放 */
  outline: none;
}
.auth-field input:focus {
  border-color: #4a90c2;
  background: rgba(0, 0, 0, .42);
}
.auth-field input::placeholder { color: #6b8aa3; }

/* ---- 提示 / 按钮 ---- */
.auth-msg {
  min-height: 20px;
  margin: 4px 0 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #ff9d95;
  text-align: center;
}
.auth-msg.is-ok { color: #9fe0b4; }

.auth-primary {
  display: block;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-radius: 11px;
  background: #3d8a5d;
  color: #f2fff7;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
}
.auth-primary:active { background: #2f6f4a; }
.auth-primary[disabled] {
  opacity: .55;
  cursor: default;
}
.auth-danger { background: #8a4444; }
.auth-danger:active { background: #6f3636; }

.auth-note {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: #7c9bb2;
  text-align: center;
}

/* ---- 已登录视图 ---- */
#auth-account { text-align: center; }
.acc-name {
  color: #9fe0b4;
  font-weight: 700;
}
#acc-status {
  margin-bottom: 20px;
}
.acc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #6fe08a;
  vertical-align: middle;
}
.acc-dot.off { background: #c98a4a; }
