/* ==========================================================================================
   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.
   ========================================================================================== */

/* --login-w: the login box's width (touch screens widen it, devices.css), also read by the 「添加到主屏幕」 note beside it */
.title-screen { --login-w: 4.9rem; align-items: center; justify-content: center; }

/* ---- 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; }
/* Official night/dusk scene (ui/allianceScene.js): its own frame replaces the old haze, radar, target, glow and reticles.
   The film's logo and the login box sit outside this layer. */
.title-bg.has-alliance .title-bg__haze,
.title-bg.has-alliance .title-bg__radar,
.title-bg.has-alliance .title-bg__target,
.title-bg.has-alliance .title-bg__glow,
.title-bg.has-alliance .cross {
  display: none;
}
/* A later season's own hub (ui/seasonArt.js): the event's composed backdrop, darkened under the login box and at the top
   edge so the corners and the logo stay readable; it replaces the same layers as the 盟约 scene. */
.title-bg.has-season .title-bg__haze,
.title-bg.has-season .title-bg__radar,
.title-bg.has-season .title-bg__target,
.title-bg.has-season .title-bg__glow,
.title-bg.has-season .cross {
  display: none;
}
.title-bg__season {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.title-bg.has-season::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 55% at 50% 72%, rgba(0, 0, 0, .55), transparent 70%),
    linear-gradient(to bottom, rgba(0, 0, 0, .25), transparent 30%, rgba(0, 0, 0, .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; }
/* a later season's logo as the title (screens/title.js; the words above the login box are hidden then) */
.title-logo {
  display: block;
  height: min(44vh, 28vw);
  width: auto;
  margin-bottom: .1rem;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6));
  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: .19rem;
  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: var(--login-w);
  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); }
/* the invite card: the heading with the room code, then the hint — each kept whole; the hint takes its own line when
   both do not fit (Korean / English) */
.title-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .02rem .1rem;
  padding: .08rem .12rem;
  background: rgba(246, 163, 41, .08);
  border: 1px solid rgba(246, 163, 41, .35);
  color: var(--amber);
  font-size: .16rem;
}
.title-invite__head { display: inline-flex; align-items: center; gap: .08rem; white-space: nowrap; }
.title-invite .icon { flex: none; width: .2rem; height: .2rem; }
.title-invite b { font-size: .2rem; letter-spacing: .2em; color: #ffd08a; }
.title-invite__hint { min-width: min(100%, max-content); font-size: .15rem; }
/* an invitation of a room of another season than the picked one: its season, the card's last line (ui/season.js InviteSeason) */
.title-invite__season { flex-basis: 100%; font-size: max(.14rem, 11px); color: var(--gold); }
/* the connection row: the status dot with the ping, then the buttons — two groups that never break inside, side by side
   on one line in Chinese and Korean (the 在线 count is the lobby's alone, the status words show only while not online;
   a touch screen's bigger buttons widen the box, devices.css); a longer language still takes two lines */
.title-conn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .06rem .16rem; min-height: .32rem; font-size: .14rem; color: var(--text-lo); }
.title-conn__status, .title-conn__tools { display: inline-flex; flex: none; align-items: center; gap: .1rem; white-space: nowrap; }
/* 统计 (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; }
/* language menu (中文 | English | …, ui/lang.js) in the top-right corner; more than four languages make it a list */
.title-lang { display: inline-flex; margin-bottom: .1rem; }
.title-lang button { min-width: .74rem; height: .3rem; font-size: .14rem; cursor: pointer; }
.lang-select select { height: .38rem; min-width: 1.6rem; padding: 0 .12rem; background: #0a0d0c; border: 0; color: var(--text-hi); font-size: .16rem; cursor: pointer; }
.title-lang.lang-select select { height: .3rem; font-size: .14rem; }
html[data-script="alphabetic"] .title-login .btn--xl { letter-spacing: .3em; }
.title-conn .ping { height: .26rem; font-size: .15rem; }
/* the text buttons under the login box (服务器信息: the licence notice, ui/about.js), like the Chinese fork servers' row
   under theirs; outside the box, so the connection row keeps its one line; right-aligned with the box while it is one */
.title-links { width: var(--login-w); display: flex; justify-content: flex-end; gap: .2rem; margin-top: .1rem; animation: rise-in 600ms 320ms var(--ease-out) backwards; }
.title-link { padding: .04rem 0 .04rem .1rem; background: none; border: 0; color: var(--text-lo); font-size: max(.14rem, 9px); cursor: pointer; transition: color var(--t-fast); }
.title-link:hover, .title-link:focus-visible { color: var(--mint-400); }
/* the notice itself */
.about__sec + .about__sec { margin-top: .14rem; }
.about__head { margin-bottom: .04rem; font-size: max(.17rem, 13px); font-weight: 700; color: var(--text-hi); }
.about .modal__text { font-size: max(.16rem, 12px); line-height: 1.6; }
.about__src { display: flex; flex-wrap: wrap; gap: .04rem .12rem; margin-top: .18rem; font-size: max(.15rem, 12px); }
.about__src a { color: var(--mint-400); overflow-wrap: anywhere; }
.about__copy { margin-top: .06rem; font-size: max(.13rem, 11px); color: var(--text-dim); }
/* iPhone Safari's 「添加到主屏幕」 note (title.js fsNote): the free bottom-right corner beside the login box, above the
   footer — under the login box it ran off a landscape phone's screen */
.title-fsnote { position: absolute; z-index: 2; right: .44rem; bottom: .62rem; width: min(260px, calc(50% - var(--login-w) / 2 - .44rem - .16rem)); display: flex; align-items: flex-start; gap: .08rem; padding: .08rem .1rem .08rem .12rem; background: rgba(8, 11, 10, .72); border: 1px solid var(--line-2); border-left: 2px solid var(--mint-700); color: var(--text-md); font-size: max(.13rem, 12px); line-height: 1.45; text-align: left; }
.title-fsnote > .icon { flex: none; width: max(.18rem, 14px); height: max(.18rem, 14px); margin-top: .02rem; color: var(--mint-400); }
.title-fsnote > span { flex: 1; }
.title-fsnote__close { flex: none; display: grid; place-items: center; width: max(.24rem, 20px); height: max(.24rem, 20px); padding: 0; background: none; border: 0; color: var(--text-lo); cursor: pointer; }
.title-fsnote__close .icon { width: max(.14rem, 12px); height: max(.14rem, 12px); }

.title-foot {
  position: absolute;
  z-index: 2;
  left: .44rem;
  right: .44rem;
  bottom: .3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: .13rem;
  color: var(--text-dim);
}
/* 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;
}
