/* ==========================================================================================
   screens/title.css — title screen: radar + ridgeline backdrop, dot-matrix emblem, big title,
   nickname console. Pure CSS/SVG art; an optional backdrop image fades in underneath.
   ========================================================================================== */

.title-screen { align-items: center; justify-content: center; }

/* Shared scan logic uses its own overlay; keep its typography in game scale. */
.game-official-scan .official-scan-dialog {
  --background-color: 13, 20, 17;
  --front-color: var(--text-hi, #edf6f1);
  --gray-color: var(--text-md, #b9c7c0);
  --primary-color: var(--mint-500, #4ed8af);
  --accent-color: var(--mint-500, #4ed8af);
  --secondary-color: #1c2a24;
  --panel-color: #17241e;
  width: min(440px, 100%);
  border-color: var(--line-2, #385145);
  border-radius: 3px;
  padding: 20px;
  font-size: 14px;
}
.game-official-scan .official-scan-heading { font-size: 20px; }
.game-official-scan .official-scan-note { font-size: 13px; }
.game-official-scan .official-scan-qr { width: 208px; height: 208px; border-radius: 2px; font-size: 13px; }
.game-official-scan .official-scan-link { font-size: 13px; }
.game-official-scan .official-scan-status { font-size: 13px; }
.game-official-scan .official-scan-timer { font-size: 12px; }
.game-official-scan .official-scan-roles legend { font-size: 13px; }
.game-official-scan .official-scan-role { border-radius: 2px; padding: 9px 12px; }
.game-official-scan .official-scan-role-name { font-size: 14px; }
.game-official-scan .official-scan-role-detail { font-size: 12px; }
.game-official-scan .official-scan-actions .btn { min-height: 34px; padding: 7px 14px; font-size: 13px; }
.game-official-scan .official-scan-close { border-radius: 2px; }
.title-official-login .title-auth-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-height: 500px) and (orientation: landscape) {
  .game-official-scan { padding: 10px; }
  .game-official-scan .official-scan-dialog { width: min(520px, 100%); max-height: calc(100dvh - 20px); padding: 14px 18px; }
  .game-official-scan .official-scan-content { grid-template-columns: 164px minmax(0, 1fr); gap: 8px 14px; margin-top: 12px; align-items: center; }
  .game-official-scan .official-scan-qr { width: 164px; height: 164px; grid-column: 1; grid-row: 1 / 4; padding: 8px; }
  .game-official-scan :is(.official-scan-link, .official-scan-status, .official-scan-timer) { grid-column: 2; }
  .game-official-scan .official-scan-roles { grid-column: 1 / -1; }
  .game-official-scan .official-scan-actions { margin-top: 12px; }
}

/* ---- backdrop ----------------------------------------------------------------------------------- */
.title-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.title-bg__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  object-position: center 30%;
  filter: saturate(.8) brightness(.9);
  transition: opacity 600ms ease;
}
.title-bg.has-art .title-bg__art { opacity: .8; }
/* The real backdrop already carries a radar + target point; keep only the sweep over it. */
.title-bg.has-art .title-bg__target { display: none; }
.title-bg.has-art .title-bg__radar { opacity: .35; }
.title-bg__ridge-art {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.1rem;
  height: 3.3rem;
  background-repeat: repeat-x;
  background-position: center bottom;
  background-size: auto 100%;
  opacity: 0;
  transition: opacity 600ms ease;
}
.title-bg.has-ridges .title-bg__ridge-art { opacity: 1; }
.title-bg__ridges { animation: fade-in 600ms ease backwards; }
@keyframes fade-in { from { opacity: 0; } }
.title-bg__glow {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 6rem;
  background:
    radial-gradient(48% 42% at 50% 78%, rgba(23, 249, 183, .40), rgba(23, 249, 183, .08) 62%, transparent 76%),
    radial-gradient(26% 26% at 50% 80%, rgba(120, 255, 215, .30), transparent 70%);
  filter: blur(6px);
  animation: glow-breathe 7s ease-in-out infinite;
}
@keyframes glow-breathe { 50% { opacity: .78; } }

.title-bg__radar {
  position: absolute;
  left: 17%;
  top: 40%;
  width: 5.6rem;
  height: 5.6rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 .05rem, rgba(78, 216, 175, .5) .05rem .065rem, transparent .065rem),
    repeating-radial-gradient(circle, transparent 0 .69rem, rgba(78, 216, 175, .16) .69rem .7rem),
    linear-gradient(rgba(78, 216, 175, .12), rgba(78, 216, 175, .12)) center / 100% 1px no-repeat,
    linear-gradient(rgba(78, 216, 175, .12), rgba(78, 216, 175, .12)) center / 1px 100% no-repeat;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%);
  mask-image: radial-gradient(circle, #000 55%, transparent 71%);
  opacity: .8;
}
.title-bg__sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* The bright edge must LEAD and the glow must trail BEHIND it. A conic gradient's angle grows
     clockwise from 0deg (12 o'clock), and radar-sweep rotates clockwise too — so the bright end has
     to sit at 100% (== 0deg) and fade counter-clockwise from there. Written the other way round
     (bright at 0% fading to 22%) the glow fans out AHEAD of the beam and the sweep reads backwards. */
  background: conic-gradient(from 0deg, transparent 0 78%, rgba(23, 249, 183, .28) 100%);
  animation: radar-sweep 6s linear infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }

.title-bg__target {
  position: absolute;
  right: 12%;
  top: 22%;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(246, 163, 41, .9) 0 .06rem, transparent .065rem),
    radial-gradient(circle, transparent 0 .2rem, rgba(246, 163, 41, .5) .2rem .215rem, transparent .215rem),
    radial-gradient(circle, transparent 0 .5rem, rgba(246, 163, 41, .22) .5rem .51rem, transparent .51rem),
    radial-gradient(circle, rgba(246, 163, 41, .18), transparent 70%);
  animation: target-pulse 3.2s ease-in-out infinite;
}
.title-bg__target::after {
  content: 'TARGET POINT';
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  padding: .02rem .08rem;
  border: 1px solid rgba(246, 163, 41, .35);
  font-family: var(--font-display);
  font-size: .1rem;
  letter-spacing: .2em;
  color: rgba(246, 163, 41, .7);
  white-space: nowrap;
}
@keyframes target-pulse { 50% { transform: scale(1.06); opacity: .75; } }

.title-bg__ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; }
.title-bg__ridges .ridge { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.title-bg__ridges .ridge--far { opacity: .95; }
.title-bg__haze {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 15, 14, .6) 0%, transparent 25%, transparent 70%, rgba(6, 8, 7, .7) 100%),
    radial-gradient(46% 42% at 50% 44%, rgba(10, 13, 12, .82), rgba(10, 13, 12, .4) 60%, transparent 80%);
}

/* ---- corners ------------------------------------------------------------------------------------- */
.title-corner { position: absolute; z-index: 2; display: flex; align-items: flex-start; gap: .12rem; line-height: 1.7; }
.title-corner--tl { left: .44rem; top: .38rem; }
.title-corner--tr { right: .44rem; top: .38rem; text-align: right; }
.title-corner__mark {
  width: .32rem;
  height: .32rem;
  margin-top: .02rem;
  border: 1px solid var(--mint-700);
  background:
    linear-gradient(var(--mint-500), var(--mint-500)) center / 40% 2px no-repeat,
    linear-gradient(var(--mint-500), var(--mint-500)) center / 2px 40% no-repeat;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}

/* ---- centre column ------------------------------------------------------------------------------- */
.title-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -.3rem;
}

.emblem { position: relative; display: flex; align-items: center; gap: .26rem; margin-bottom: .26rem; animation: rise-in 600ms var(--ease-out) backwards; }
.emblem__svg { width: 1.3rem; height: 1.4rem; overflow: visible; filter: drop-shadow(0 0 .12rem rgba(210, 255, 240, .25)); }
.emblem__svg circle { fill: #dfe6e2; animation: dot-twinkle 4.8s ease-in-out infinite; }
.emblem__svg circle.d1 { animation-delay: -.7s; }
.emblem__svg circle.d2 { animation-delay: -1.4s; }
.emblem__svg circle.d3 { animation-delay: -2.1s; }
.emblem__svg circle.d4 { animation-delay: -2.8s; }
.emblem__svg circle.d5 { animation-delay: -3.5s; }
.emblem__svg circle.d6 { animation-delay: -4.2s; }
.emblem__svg circle.is-accent { fill: var(--mint-glow); filter: drop-shadow(0 0 .04rem var(--mint-glow)); animation: none; }
@keyframes dot-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.emblem__bracket { width: .16rem; height: 1.7rem; border: 2px solid rgba(223, 230, 226, .45); }
.emblem__bracket--l { border-right: 0; }
.emblem__bracket--r { border-left: 0; }

.title-en {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .02rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 1;
  animation: rise-in 600ms 80ms var(--ease-out) backwards;
}
.title-en__a { font-size: .34rem; font-weight: 500; letter-spacing: .3em; padding-left: .3em; color: #cdd6d1; }
.title-en__b {
  font-size: .38rem;
  font-weight: 700;
  letter-spacing: .34em;
  padding-left: .34em;
  color: var(--mint-500);
  text-shadow: 0 0 .18rem rgba(23, 249, 183, .45);
}
.title-cn {
  margin-top: .14rem;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: .06em;
  color: #f4f6f5;
  text-shadow: 0 .04rem .2rem rgba(0, 0, 0, .7);
  animation: rise-in 600ms 140ms var(--ease-out) backwards;
}
.title-cn__colon { color: #f4f6f5; }
/* a title in an alphabetic script (English …; screens/title.js): the display face, smaller so "Stronghold Protocol: Alliance" fits one line */
.title-cn--latin { font-family: var(--font-display); font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.title-cn em { font-style: normal; color: var(--mint-500); text-shadow: 0 0 .26rem rgba(23, 249, 183, .45); }
.title-tag {
  margin-top: .12rem;
  font-size: calc(.19 * var(--utility-text, var(--t)));
  color: var(--text-lo);
  letter-spacing: .1em;
  animation: rise-in 600ms 200ms var(--ease-out) backwards;
}
@keyframes rise-in { from { opacity: 0; transform: translateY(.14rem); } }

.title-login {
  --bk-c: var(--mint-500);
  position: relative;
  width: 4.9rem;
  margin-top: .42rem;
  display: flex;
  flex-direction: column;
  gap: .16rem;
  padding: .24rem .28rem .2rem;
  background: linear-gradient(180deg, rgba(20, 25, 23, .82), rgba(10, 13, 12, .88));
  border: 1px solid var(--line-2);
  box-shadow: 0 .2rem .5rem rgba(0, 0, 0, .5), 0 0 .5rem rgba(23, 249, 183, .06);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: rise-in 600ms 260ms var(--ease-out) backwards;
}
.title-login::before {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--mint-500), transparent 60%);
}
.title-login .btn--xl { letter-spacing: .6em; padding-left: calc(.48rem + .3em); }
.title-login__submit { display: flex; align-items: stretch; gap: .12rem; }
.title-login__submit > .btn--primary { flex: 1; min-width: 0; }
.title-login__submit > .btn--secondary { flex: none; padding-inline: .2rem; }
.title-login__scan { width: 100%; justify-content: center; min-height: .42rem; }
.title-remember {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 44px;
  color: var(--text-md);
  font-size: max(12px, calc(.15 * var(--utility-text, var(--t))));
  cursor: pointer;
}
.title-remember input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mint-500);
  cursor: pointer;
}
.title-remember input:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 3px; }
.title-account { display: flex; align-items: center; gap: 12px; min-width: 0; grid-column: 1 / -1; padding: 4px 0 10px; }
.title-account > .avatar { flex: none; width: 44px; height: 44px; }
.title-account__identity { display: grid; gap: 5px; min-width: 0; flex: 1; text-align: left; }
.title-account__status { display: flex; align-items: center; gap: 6px; color: var(--text-lo); font-size: 12px; line-height: 1.3; }
.title-account__status .status-dot { width: 6px; height: 6px; flex: none; }
.title-account__name { color: var(--text-hi); font-size: 18px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-account__switch { flex: none; min-height: 40px; padding: 4px 6px; border: 0; background: transparent; color: var(--mint-400); font-size: 12px; cursor: pointer; transition: transform 120ms var(--ease-out); }
.title-account__switch:active { transform: scale(.97); }
.title-account__switch:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; }
.title-account__switch:disabled { opacity: .5; cursor: default; }
.screen.title-screen .title-login--remembered .title-login__submit { grid-column: 1 / -1; }
.title-auth-form { display: grid; gap: .18rem; }
.title-auth-note { margin: 0; color: var(--text-lo); font-size: calc(.16 * var(--utility-text, var(--t))); line-height: 1.6; }
.title-auth-error { margin: 0; color: var(--amber); font-size: calc(.15 * var(--utility-text, var(--t))); line-height: 1.6; overflow-wrap: anywhere; }
.title-auth-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .12rem; margin-top: .08rem; }
.title-name-feedback { margin: -.04rem 0 0; font-size: calc(.13 * var(--utility-text, var(--t))); line-height: 1.6; color: var(--text-dim); }
.title-name-feedback a { color: var(--mint-500); text-decoration: underline; text-underline-offset: .02rem; }
.title-invite {
  display: flex;
  align-items: center;
  gap: .08rem;
  padding: .08rem .12rem;
  background: rgba(246, 163, 41, .08);
  border: 1px solid rgba(246, 163, 41, .35);
  color: var(--amber);
  font-size: calc(.16 * var(--utility-text, var(--t)));
}
.title-invite .icon { width: .2rem; height: .2rem; }
.title-invite b { font-size: calc(.2 * var(--utility-text, var(--t))); letter-spacing: .2em; color: #ffd08a; }
.title-conn { display: flex; align-items: center; justify-content: center; gap: .1rem; min-height: .32rem; font-size: calc(.14 * var(--utility-text, var(--t))); color: var(--text-lo); }
/* 统计 (the local stats page) beside the language menu in the top-right corner */
.title-corner__tools { display: flex; align-items: center; justify-content: flex-end; gap: .1rem; margin-bottom: .1rem; }
.title-corner__tools .title-lang { margin-bottom: 0; }
.title-meta { display: flex; align-items: center; justify-content: center; gap: .2rem; }
.title-meta .title-conn { justify-content: flex-start; flex-wrap: wrap; min-width: 0; }
.title-tools { display: flex; align-items: center; flex: none; gap: .08rem; }
.title-tools > .fsbtn { width: max(.38rem, 28px); height: max(.38rem, 28px); margin: 0; }
.title-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .12rem; max-width: 4.9rem; margin-top: .12rem; }
.title-actions > .btn, .title-tools > .btn { min-width: 0; min-height: max(.38rem, 28px); height: auto; padding: .06rem .08rem; gap: .05rem; font-size: calc(.14 * var(--utility-text, var(--t))); letter-spacing: 0; white-space: normal; text-align: center; }
.title-actions > .btn .icon, .title-tools > .btn .icon { width: .16rem; height: .16rem; }
@media (max-width: 767px), (pointer: coarse) {
  .title-actions > .btn { min-height: 36px; }
  .title-tools > .fsbtn { width: 36px; height: 36px; }
  .title-meta { gap: .1rem; flex-wrap: wrap; }
}
.about-panel { max-width: calc(100vw - .4rem); }
.about-panel .modal__body { font-size: calc(.17 * var(--utility-text, var(--t))); line-height: 1.8; color: var(--text-md); }
.about-panel p { margin: 0 0 .16rem; }
.about-intro { color: var(--text-hi); font-size: calc(.22 * var(--utility-text, var(--t))); font-weight: 700; }
.about-intro .num { margin-left: .08rem; color: var(--mint-400); font-size: calc(.17 * var(--utility-text, var(--t))); }
.about-links { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .28rem; margin: .2rem 0 .24rem; }
.about-links div { min-width: 0; }
.about-links dt { color: var(--text-lo); font-size: calc(.15 * var(--utility-text, var(--t))); }
.about-links dd { margin: .04rem 0 0; }
.about-panel a { color: var(--mint-400); text-decoration: underline; overflow-wrap: anywhere; }
.about-panel a:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 3px; }
.about-section { margin-top: .22rem; padding-top: .18rem; border-top: 1px solid var(--line-2); }
.about-section h3 { margin: 0 0 .12rem; color: var(--text-hi); font-size: calc(.18 * var(--utility-text, var(--t))); }
.about-credits { display: flex; flex-direction: column; gap: .05rem; }
.about-credits h3 { margin-bottom: .04rem; }
@media (max-width: 600px) { .about-links { grid-template-columns: 1fr; } }
/* language menu (中文 | English | …, ui/lang.js) in the top-right corner; more than four languages make it a list.
   The height is max(design, 1.4em) so the buttons still hold their text at 设置 →「文字大小」 大 / 特大 (on a phone
   1rem is clamped at 40 px and .3rem is only 12 px, less than the enlarged label). */
.title-lang { display: inline-flex; margin-bottom: .1rem; }
.title-lang button { min-width: .74rem; height: max(.3rem, 1.4em); font-size: calc(.14 * var(--utility-text, var(--t))); cursor: pointer; }
.lang-select select { height: max(.38rem, 1.4em); min-width: 1.6rem; padding: 0 .12rem; background: #0a0d0c; border: 0; color: var(--text-hi); font-size: calc(.16 * var(--utility-text, var(--t))); cursor: pointer; }
.title-lang.lang-select select { height: max(.3rem, 1.4em); font-size: calc(.14 * var(--utility-text, var(--t))); }
html[data-script="alphabetic"] .title-login .btn--xl { letter-spacing: .3em; }
.title-conn .ping { height: max(.26rem, 1.6em); font-size: calc(.15 * var(--utility-text, var(--t))); }

.title-foot {
  position: absolute;
  z-index: 2;
  left: .44rem;
  right: .44rem;
  bottom: .3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: .12rem .2rem;
  font-size: calc(.13 * var(--utility-text, var(--t)));
  color: var(--text-dim);
}
.title-foot__meta { display: flex; align-items: flex-end; gap: .16rem; flex-wrap: wrap; justify-content: flex-end; }
.title-foot__actions { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem; }
.title-icp { flex: 0 0 100%; text-align: center; color: #999; font-size: 10px; line-height: 1.4; text-decoration: none; user-select: text; }
.title-icp:hover, .title-icp:focus-visible { color: #bbb; text-decoration: underline; }
.title-repo { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.title-management { text-decoration: none; text-shadow: none; }
.title-repo:hover, .title-repo:focus-visible { color: var(--text-hi); border-bottom-color: currentColor; }
/* a development build (shared/constants.js DEV_BUILD): an unmissable tag in the footer */
.title-dev {
  padding: .03rem .1rem;
  border: 1px solid #ff9f43;
  border-radius: .04rem;
  color: #ffb066;
  background: rgba(255, 159, 67, .14);
  font-weight: 700;
  letter-spacing: .02em;
}


/* East keeps its server directory, resource cache and announcement state. */
.title-server { display: flex; align-items: center; flex-wrap: wrap; gap: .08rem; }
.title-server select { flex: 1; min-width: 0; width: 100%; padding: .09rem .12rem; border: 1px solid var(--line-2); border-radius: .04rem; background: var(--bg-2, #141917); color: var(--text-hi, #eef5f1); font: inherit; font-size: .17rem; cursor: pointer; }
.title-server select:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }
.title-server select:disabled { opacity: .65; cursor: wait; }
.title-server__retry { background: transparent; border: 0; color: var(--mint-500); font: inherit; font-size: .15rem; cursor: pointer; }
.title-server__error { width: 100%; font-size: .13rem; color: var(--amber); }

.title-main { max-width: calc(100% - 32px); }
.title-login { width: min(5.25rem, calc(100vw - 32px)); }
.title-tag { max-width: min(8rem, calc(100vw - 40px)); text-align: center; }
.title-meta { flex-wrap: wrap; }
.title-meta .title-conn { justify-content: center; }
.title-foot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .12rem; }
.title-notice { position: relative; }
.title-actions .title-notice.is-unread::after { content: ''; position: absolute; inset: 3px 3px auto auto; width: 7px; height: 7px; background: #ef4444; border-radius: 50%; opacity: 1; transform: none; transition: none; }
.title-actions { margin-top: .12rem; }
@media (max-width: 600px) {
  .title-corner--tl { display: none; }
  .title-corner--tr { top: max(12px, var(--sa-t)); right: 12px; }
  .title-corner--tr > div > .micro, .title-corner--tr br { display: none; }
  .title-corner__tools .btn { min-height: 32px; padding: 4px 8px; font-size: 12px; }
  .title-cn { font-size: clamp(26px, 7.4vw, 1.02rem); }
  .title-foot { left: 12px; right: 12px; bottom: max(10px, var(--sa-b)); font-size: 10px; gap: 5px; }
}
@media (max-height: 720px) and (min-height: 461px) {
  .title-main .emblem { margin-bottom: .12rem; }
  .title-main .emblem__svg { width: .85rem; height: .92rem; }
  .title-main .emblem__bracket { height: 1.1rem; }
  .title-main .title-login { margin-top: .2rem; gap: .12rem; }
}
/* Short landscape screens keep the artwork beside the complete login console. */
@media (max-height: 460px) and (min-width: 560px) {
  .title-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 4.9rem);
    column-gap: .4rem;
    justify-items: center;
    width: calc(100% - 64px);
    max-width: 1000px;
    margin-top: 0;
  }
  .title-main > .emblem { margin-bottom: .12rem; }
  .title-main .emblem__svg { width: .9rem; height: .96rem; }
  .title-main .emblem__bracket { height: 1.1rem; }
  .title-main .title-en__a { font-size: .23rem; }
  .title-main .title-en__b { font-size: .27rem; }
  .title-main .title-cn { margin-top: .12rem; font-size: clamp(24px, 4.5vw, .85rem); }
  .title-main .title-tag { margin-top: .12rem; font-size: .17rem; text-align: center; }
  .title-main > .title-login {
    grid-column: 2;
    grid-row: 1 / 6;
    width: 100%;
    margin-top: 0;
    gap: .12rem;
    padding: .18rem;
  }
  .title-server select { min-height: 36px; font-size: max(12px, .17rem); }
  .title-invite { flex-wrap: wrap; }
}

@media (max-height: 460px) and (min-width: 560px) {
  .title-main > .title-actions { grid-column: 2; margin-top: .08rem; }
  .title-main .title-meta { gap: 4px; }
  .title-corner--tl { display: none; }
  .title-corner--tr { top: 8px; right: 12px; }
  .title-corner--tr > div > .micro, .title-corner--tr br { display: none; }
  .title-main > .title-login { grid-row: 1 / 5; }
  .title-foot { bottom: 6px; font-size: 9px; }
}

/* Keep the mobile title inside one screen. The form shares its remember/submit
   row; short landscape screens put the brand and secondary actions beside it. */
@media (max-width: 1000px), (max-height: 720px), (pointer: coarse) {
  .screen.title-screen { overflow: hidden; }
  .screen.title-screen > .title-corner--tl { display: none; }
  .screen.title-screen > .title-corner--tr {
    position: absolute;
    top: calc(8px + var(--sa-t, 0px));
    right: calc(16px + var(--sa-r, 0px));
    left: auto;
  }
  .screen.title-screen .title-corner__tools { margin: 0; }
  .screen.title-screen .title-corner--tr > div > .micro,
  .screen.title-screen .title-corner--tr br { display: none; }
  .screen.title-screen > .title-main {
    position: absolute;
    inset: calc(44px + var(--sa-t, 0px)) calc(16px + var(--sa-r, 0px))
      calc(56px + var(--sa-b, 0px)) calc(16px + var(--sa-l, 0px));
    flex: none;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  .screen.title-screen .emblem { flex: none; margin-bottom: 0; }
  .screen.title-screen .emblem__svg { width: 28px; height: 30px; }
  .screen.title-screen .emblem__bracket { height: 34px; }
  .screen.title-screen .title-en__a { font-size: 11px; }
  .screen.title-screen .title-en__b { font-size: 13px; }
  .screen.title-screen .title-cn { margin-top: 6px; font-size: 28px; }
  .screen.title-screen .title-cn--latin { font-size: 18px; }
  .screen.title-screen .title-tag { max-width: 340px; margin-top: 4px; font-size: 11px; line-height: 1.4; }
  .screen.title-screen .title-login {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    flex: none;
    width: min(360px, 100%);
    margin-top: 8px;
    padding: 8px;
    gap: 4px 8px;
  }
  .screen.title-screen .title-login > :is(.field, .title-invite, .title-server, .title-meta, .title-auth-error, .title-login__scan) { grid-column: 1 / -1; }
  .screen.title-screen .title-login .field { gap: 2px; }
  .screen.title-screen .title-login .field__label { font-size: 11px; }
  .screen.title-screen .title-login .field__hint { font-size: 10px; }
  .screen.title-screen .title-login .field__box { height: 36px; min-height: 36px; }
  .screen.title-screen .title-remember { grid-column: 1; white-space: nowrap; }
  .screen.title-screen .title-login__submit { grid-column: 2; gap: 6px; align-self: center; }
  .screen.title-screen .title-login__submit > .btn { min-height: 40px; height: 40px; padding: 4px 10px; font-size: 14px; letter-spacing: .08em; }
  .screen.title-screen .title-auth-error { order: 1; }
  .screen.title-screen .title-server select { min-height: 32px; padding: 4px 8px; font-size: 12px; }
  .screen.title-screen .title-meta { gap: 4px 8px; }
  .screen.title-screen .title-tools > :is(.btn, .fsbtn) { min-height: 32px; height: 32px; }
  .screen.title-screen .title-tools > .fsbtn { width: 32px; }
  .screen.title-screen .title-actions { flex: none; max-width: 100%; margin-top: 4px; }
  .screen.title-screen .title-actions > .btn { min-height: 44px; font-size: 12px; }
  .screen.title-screen > .title-foot {
    position: absolute;
    inset: auto calc(292px + var(--sa-r, 0px)) calc(8px + var(--sa-b, 0px)) calc(16px + var(--sa-l, 0px));
    width: auto;
    margin: 0;
    padding: 0;
    gap: 2px 8px;
    font-size: 9px;
  }
}
@media (max-height: 460px) and (min-width: 560px) {
  .screen.title-screen > .title-main {
    top: calc(12px + var(--sa-t, 0px));
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(300px, 1.15fr);
    grid-template-rows: repeat(5, max-content);
    align-content: center;
    column-gap: 16px;
  }
  .screen.title-screen > .title-corner--tr { left: calc(16px + var(--sa-l, 0px)); right: auto; width: calc(42% - 16px); justify-content: center; }
  .screen.title-screen .title-main > .emblem { margin-top: 36px; }
  .screen.title-screen .title-main > .title-login { grid-column: 2; grid-row: 1 / 6; margin: 0; width: 100%; align-self: center; }
  .screen.title-screen .title-main > .title-actions { grid-column: 1; grid-row: 5; }
  .screen.title-screen .title-tag { max-width: 100%; }
}
@media (max-width: 559px) {
  .screen.title-screen > .title-foot { right: calc(16px + var(--sa-r, 0px)); bottom: calc(52px + var(--sa-b, 0px)); }
  .screen.title-screen > .title-main {
    bottom: calc(102px + var(--sa-b, 0px));
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: repeat(5, max-content);
    align-content: center;
    justify-items: center;
    gap: 4px 10px;
  }
  .screen.title-screen .title-main > .emblem { grid-column: 1; grid-row: 1 / 3; }
  .screen.title-screen .title-main > .title-en { grid-column: 2; grid-row: 1; }
  .screen.title-screen .title-main > .title-cn { grid-column: 2; grid-row: 2; margin: 0; }
  .screen.title-screen .title-main > .title-tag { grid-column: 1 / -1; grid-row: 3; }
  .screen.title-screen .title-main > .title-login { grid-column: 1 / -1; grid-row: 4; }
  .screen.title-screen .title-main > .title-actions { grid-column: 1 / -1; grid-row: 5; }
}

/* Desktop rem scaling makes the complete password console taller than the old
   single-column title. Give the brand/actions and login their own columns. */
@media (min-width: 1001px) and (min-height: 721px) {
  .screen.title-screen > .title-main {
    position: absolute;
    inset: calc(max(.9rem, 54px) + var(--sa-t, 0px)) calc(48px + var(--sa-r, 0px))
      calc(max(1.05rem, 72px) + var(--sa-b, 0px)) calc(48px + var(--sa-l, 0px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 5.25rem);
    grid-template-rows: repeat(5, max-content);
    column-gap: .6rem;
    align-content: center;
    justify-items: center;
    width: auto;
    max-width: 1460px;
    margin: 0 auto;
  }
  .screen.title-screen .title-main > .title-login {
    grid-column: 2;
    grid-row: 1 / 6;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    margin: 0;
    align-self: center;
  }
  .screen.title-screen .title-login > :is(.field, .title-invite, .title-server, .title-meta, .title-auth-error) { grid-column: 1 / -1; }
  .screen.title-screen .title-remember { grid-column: 1; white-space: nowrap; }
  .screen.title-screen .title-login__submit { grid-column: 2; align-self: center; }
  .screen.title-screen .title-login__submit > .btn--xl { padding-inline: .18rem; letter-spacing: .12em; }
  .screen.title-screen .title-auth-error { order: 1; }
  .screen.title-screen .title-main > .title-actions { grid-column: 1; grid-row: 5; }
  .screen.title-screen .title-tag { max-width: 100%; }
}
