:root {
  color-scheme: dark;
  --ink: #f4f5ff;
  --surface: #080819;
  --cyan: #00cbff;
  --purple: #a734ff;
  --pink: #ff31d8;
  --orange: #ff8a00;
  --green: #45ff83;
  --muted: #c6c7df;
  --spectrum: conic-gradient(from 18deg, #492481, var(--pink), var(--cyan), var(--pink), var(--purple), var(--orange), #492481);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #03030d; color: var(--ink); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #aef7ff; outline-offset: 4px; }
.stage {
  position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 730px) minmax(0, .72fr);
  align-items: center; padding: 98px 24px 58px; overflow: hidden;
}
.scenery {
  position: absolute; z-index: -1; inset: 0;
  background: url("/assets/enigma-scene.webp") center / cover no-repeat,
    radial-gradient(ellipse at 15% 68%, #332073 0, transparent 47%),
    radial-gradient(ellipse at 91% 70%, #034252 0, transparent 30%), #03030d;
}
.panel {
  grid-column: 2; position: relative; min-width: 0; border: 2px solid transparent;
  border-radius: clamp(26px, 4vw, 52px); text-align: center;
  background: linear-gradient(150deg, rgba(18, 8, 34, .98), rgba(3, 7, 22, .98) 63%, rgba(15, 6, 40, .97)) padding-box, var(--spectrum) border-box;
  padding: 52px clamp(24px, 5vw, 76px) 42px;
  box-shadow: 0 0 20px #8631ff8a, inset 0 0 22px #8d38ff52, 0 18px 65px #000a;
}
.brand-mark { position: absolute; width: min(48%, 320px); top: 0; left: 50%; transform: translate(-50%, -53%); overflow: visible; }
.halo { filter: blur(10px); }
.wordmark {
  font-size: clamp(34px, 4.3vw, 69px); font-weight: 900; letter-spacing: .035em;
  line-height: 1.12; color: #ecf3ff; text-shadow: 0 0 10px #862bff, 0 2px 2px #1686c9;
  padding-bottom: 14px; border-bottom: 1px solid #536aa3;
}
h1 { font-size: clamp(21px, 2.1vw, 33px); margin: 18px 0; text-shadow: 0 0 12px #48a6ff80; }
.languages {
  display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 370px); margin: 0 auto 18px;
  border: 1px solid #77718f; border-radius: 999px; background: #050413;
}
.languages button { min-height: 44px; border: 1px solid transparent; background: transparent; border-radius: inherit; }
.languages button[aria-pressed="true"] {
  border-color: #70eaff; background: linear-gradient(180deg, #067dcc, #1734dd 60%, #008bd2);
  box-shadow: 0 0 12px #009fff, inset 0 0 8px #1cf3ff; font-weight: 700;
}
.field {
  display: flex; align-items: center; gap: 12px; padding-inline: 14px 8px; margin-bottom: 15px;
  min-height: 53px; border-radius: 16px; border: 1px solid #aaa3c6;
  background: linear-gradient(180deg, #1a1d36, #11152c); box-shadow: inset 0 0 10px #b1a5e233;
}
.field:focus-within { border-color: var(--cyan); box-shadow: 0 0 11px #00caff64; }
.field:has([aria-invalid="true"]) { border-color: #ff92b7; }
.field input { flex: 1; width: 0; min-height: 49px; background: transparent; border: 0; color: var(--ink); padding: 0 4px; }
.field input::placeholder { color: #e3e0f1; opacity: 1; }
svg:not(.brand-mark) { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eye, .text-button { border: 0; background: transparent; min-height: 44px; }
.eye { min-width: 44px; display: grid; place-items: center; }
.eye[aria-pressed="true"] { color: #65eaff; }
.text-button { padding: 5px 0; text-decoration: underline; text-underline-offset: 4px; }
.options { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: start; margin: 0 0 14px; font-size: .94rem; }
.options label { display: flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; }
.options input { inline-size: 21px; block-size: 21px; flex: none; accent-color: #146aff; }
.action {
  display: flex; align-items: center; justify-content: center; gap: 13px; width: 100%;
  min-height: 62px; border: 2px solid transparent; border-radius: 999px;
  font-weight: 700; padding: 9px 14px; line-height: 1.25;
}
.action:hover { filter: brightness(1.22); }
.action:disabled { opacity: .68; cursor: wait; }
.primary {
  font-size: clamp(1.12rem, 2.3vw, 1.8rem);
  background: linear-gradient(100deg,#032951,#230044,#380820) padding-box,
    linear-gradient(90deg,#39edff,#5874ff,#ff43eb,#ffe18f) border-box;
  box-shadow: -5px 0 15px #009eff90, 0 0 15px #f243e986, 5px 0 15px #ff7d0090;
}
.invite {
  background: linear-gradient(#022319,#03140e) padding-box, linear-gradient(#b8ffd0,#43ff73,#d5ffde) border-box;
  box-shadow: 0 0 14px #26ff6680, inset 0 0 9px #26ff6660;
}
.divider { display: flex; align-items: center; gap: 17px; color: var(--muted); margin: 16px 12px; }
.divider::before, .divider::after { content: ""; background: #9e9cb7; height: 1px; flex: 1; }
.back { margin-top: 14px; }
#error, #status { margin: 0 0 12px; text-align: start; font-size: .95rem; }
#error { color: #ffb5ce; }
#status { margin: 16px 0 0; color: #aaffd3; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 921px) and (max-width: 1200px) {
  .stage { grid-template-columns: minmax(120px, .9fr) minmax(460px, 1.45fr) minmax(0, .35fr); }
}
@media (max-width: 920px) {
  .stage { grid-template-columns: 1fr minmax(0, 560px) 1fr; padding: clamp(120px, 32vw, 205px) 16px 30px; }
  .scenery { background-position: left top, center, center; background-size: auto clamp(310px, 78vw, 560px), cover, cover; }
  .scenery::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 12%, #03030d 70%); }
  .panel { padding-top: 38px; }
}
@media (max-width: 380px) {
  .panel { padding-inline: 15px; }
  .options { font-size: .79rem; }
  .stage { padding-inline: 12px; }
}
@media (min-width: 1201px) and (min-height: 850px) {
  .panel { padding-top: 58px; padding-bottom: 47px; }
  .languages { margin-bottom: 20px; }
  .field { margin-bottom: 18px; }
  .action { min-height: 70px; }
  .divider { margin-block: 22px; }
}
@media (max-width: 600px) {
  .field input { font-size: 16px; }
}

/* ---- Huya adjustments ---- */
/* Compact single-language card, centred inside the neon arc of a smaller scene. */

/* Focus: the field's rounded glow only, no square outline on the input inside it. */
.field input:focus, .field input:focus-visible { outline: none; }
.field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 16px #00caff80; }
/* Autofill keeps the dark field */
.field input:-webkit-autofill, .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #151a31 inset; transition: background-color 9999s;
}

/* ---- scene: the artwork is drawn smaller and fades into the page instead of filling it ---- */
:root { --scene-w: min(96vw, 150vh, 1500px); }
.stage { display: grid; grid-template-columns: 1fr; place-items: center; padding: 64px 16px 24px; }
.scenery {
  inset: auto; left: 50%; top: 50%; width: var(--scene-w); aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
  background: url("/assets/enigma-scene.webp") center / cover no-repeat;
  /* fade only the outer edges so the picture blends into the page */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
                      linear-gradient(transparent, #000 4%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent),
                      linear-gradient(transparent, #000 4%, #000 86%, transparent);
          mask-composite: intersect;
}
.scenery::after { content: none; }

/* ---- compact card ---- */
.panel {
  grid-column: 1; width: min(100%, 420px);
  /* sit inside the arc: the arc's centre is ~6% right of the picture's centre */
  margin-left: calc(var(--scene-w) * .12);
  padding: 44px 30px 26px; border-radius: 28px;
}
.brand-mark { width: 180px; }
.wordmark { font-size: 34px; padding-bottom: 10px; }
.panel h1 { font-size: 20px; margin: 12px 0 14px; }
.languages { width: min(100%, 240px); margin-bottom: 16px; font-size: .9rem; }
.languages button { min-height: 34px; }
.field { min-height: 46px; margin-bottom: 12px; border-radius: 12px; gap: 10px; }
.field input { min-height: 44px; }
.field svg:not(.brand-mark) { width: 22px; height: 22px; }
.options { font-size: .88rem; margin-bottom: 10px; }
.options label { min-height: 36px; }
.options input { inline-size: 18px; block-size: 18px; }
.action { min-height: 48px; gap: 10px; }
.action svg { width: 22px; height: 22px; }
.primary { font-size: 1.15rem; }
.invite { font-size: .95rem; }
.divider { margin: 12px 8px; }
#error, #status { font-size: .88rem; }
@media (min-width: 1201px) and (min-height: 850px) {
  .panel { padding-top: 48px; padding-bottom: 28px; }
  .languages { margin-bottom: 16px; }
  .field { margin-bottom: 12px; }
  .action { min-height: 50px; }
  .divider { margin-block: 12px; }
}

/* Desktop: login-hooks.js scales the card down further if the window is short (sets --fit). */
@media (min-width: 921px) {
  .panel { zoom: var(--fit, 1); }
}

/* ---- phones and tablets: smaller artwork across the top, card below ---- */
@media (max-width: 920px) {
  :root { --scene-w: max(120vw, 560px); }
  .stage { grid-template-columns: 1fr; padding: calc(var(--scene-w) * 941 / 1672 * .42) 16px 24px; place-items: start center; }
  .scenery {
    top: 0; left: 0; transform: none;
    -webkit-mask-image: linear-gradient(#000 45%, transparent 85%);
            mask-image: linear-gradient(#000 45%, transparent 85%);
  }
  .panel { margin-left: 0; padding-top: 40px; }
}
@media (max-width: 380px) {
  .panel { padding-inline: 18px; }
}
