:root {
  color-scheme: dark;
  --ink: #f8f7ff;
  --muted: #aaa9c4;
  --muted-strong: #c7c6da;
  --night: #070815;
  --night-soft: #0e1122;
  --panel: rgba(13, 15, 32, .76);
  --panel-strong: rgba(10, 12, 27, .9);
  --line: rgba(198, 194, 255, .16);
  --line-strong: rgba(198, 194, 255, .28);
  --violet: #8b75ff;
  --violet-bright: #aa7cff;
  --magenta: #d25cff;
  --cyan: #66dcff;
  --gold: #f5bd70;
  --danger: #ff829d;
  --success: #7ce8c4;
  --shadow: 0 30px 90px rgba(0, 0, 0, .52);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--night);
}

body.waifu-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: Inter, "Avenir Next", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.scene-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--night);
}

.scene-photo {
  position: absolute;
  inset: -2.5%;
  background-color: #090b1a;
  background-image: url('/ui/waifu-portal-bg-v1.webp');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  transform: scale(1.035);
  animation: scene-breathe 20s ease-in-out infinite alternate;
}

.scene-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 5, 14, .12) 0%, rgba(4, 5, 14, .04) 38%, rgba(4, 5, 14, .35) 68%, rgba(4, 5, 14, .68) 100%),
    linear-gradient(180deg, rgba(4, 5, 14, .12), rgba(4, 5, 14, .2) 58%, rgba(4, 5, 14, .7));
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 35% 45%, transparent 0, transparent 28%, rgba(6, 7, 17, .16) 60%, rgba(6, 7, 17, .64) 100%),
    linear-gradient(180deg, rgba(5, 6, 16, .35), transparent 22%, transparent 70%, rgba(5, 6, 16, .7));
}

.scene-aurora {
  position: absolute;
  width: 58vw;
  height: 58vw;
  min-width: 620px;
  min-height: 620px;
  left: 18%;
  top: 3%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 104, 255, .15), rgba(197, 83, 255, .06) 38%, transparent 68%);
  filter: blur(16px);
  mix-blend-mode: screen;
  animation: aurora-pulse 8s ease-in-out infinite alternate;
}

.scene-grain {
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0, rgba(255, 255, 255, .025) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0, rgba(255, 255, 255, .018) 1px, transparent 1px, transparent 4px);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.motes {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.motes span {
  --size: 4px;
  --left: 50%;
  --delay: 0s;
  --duration: 12s;
  position: absolute;
  left: var(--left);
  bottom: -28px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(137, 218, 255, .82);
  box-shadow: 0 0 10px rgba(105, 211, 255, .9), 0 0 22px rgba(139, 102, 255, .55);
  opacity: 0;
  animation: mote-rise var(--duration) linear var(--delay) infinite;
}

.motes span:nth-child(1) { --left: 8%; --size: 3px; --delay: -4s; --duration: 15s; }
.motes span:nth-child(2) { --left: 18%; --size: 5px; --delay: -11s; --duration: 18s; }
.motes span:nth-child(3) { --left: 31%; --size: 3px; --delay: -7s; --duration: 13s; }
.motes span:nth-child(4) { --left: 44%; --size: 4px; --delay: -2s; --duration: 17s; }
.motes span:nth-child(5) { --left: 57%; --size: 3px; --delay: -9s; --duration: 14s; }
.motes span:nth-child(6) { --left: 68%; --size: 4px; --delay: -5s; --duration: 19s; }
.motes span:nth-child(7) { --left: 79%; --size: 2px; --delay: -13s; --duration: 16s; }
.motes span:nth-child(8) { --left: 91%; --size: 5px; --delay: -8s; --duration: 20s; }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 84px;
  padding: 20px clamp(22px, 4.2vw, 72px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 15px rgba(135, 105, 255, .36));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-name em {
  color: #bcaeff;
  font-style: normal;
}

.brand-world {
  margin-top: 6px;
  color: rgba(230, 228, 255, .54);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(9, 11, 25, .56);
  box-shadow: inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.language-control:hover {
  border-color: var(--line-strong);
  background: rgba(14, 16, 34, .7);
}

.language-control:focus-within {
  border-color: rgba(153, 126, 255, .72);
  box-shadow: 0 0 0 3px rgba(127, 99, 255, .14);
}

.language-control svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: #c7bfff;
  pointer-events: none;
}

.language-control select {
  min-width: 112px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.language-control option {
  background: #111426;
  color: var(--ink);
}

.login-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.login-layout {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 470px);
  align-items: center;
  gap: clamp(42px, 7vw, 126px);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 32px clamp(22px, 6vw, 100px) 56px;
}

.hero-copy {
  align-self: end;
  max-width: 620px;
  padding: 0 0 clamp(22px, 8vh, 92px);
  text-shadow: 0 3px 28px rgba(4, 5, 14, .75);
  animation: reveal-up .9s var(--ease-out) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #c7baff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--violet-bright));
  box-shadow: 0 0 10px rgba(101, 219, 255, .7);
}

.hero-copy h1 {
  max-width: 590px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 74px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .98;
}

.hero-copy h1 span {
  color: #bcaaff;
  font-style: italic;
}

.hero-copy > p {
  max-width: 510px;
  margin: 22px 0 0;
  color: rgba(237, 235, 255, .72);
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.65;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 28px;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(229, 227, 249, .7);
  font-size: 12px;
  font-weight: 600;
}

.hero-point svg {
  width: 15px;
  height: 15px;
  color: var(--success);
  filter: drop-shadow(0 0 7px rgba(124, 232, 196, .35));
}

.auth-card {
  position: relative;
  align-self: center;
  width: 100%;
  padding: clamp(26px, 3.2vw, 40px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .065), transparent 28%),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .08);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  animation: reveal-card .9s .12s var(--ease-out) both;
  isolation: isolate;
}

.auth-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(102, 220, 255, .2), transparent 30%, transparent 70%, rgba(198, 87, 255, .2));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
  pointer-events: none;
}

.auth-card::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 220px;
  height: 220px;
  right: -82px;
  top: -78px;
  border-radius: 50%;
  background: rgba(139, 92, 246, .22);
  filter: blur(70px);
  pointer-events: none;
}

.auth-card.is-shaking {
  animation: card-shake .42s ease both;
}

.auth-kicker {
  margin: 0 0 10px;
  color: #b6a7ff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.auth-heading h2 {
  margin: 0;
  font-size: clamp(25px, 2.4vw, 31px);
  font-weight: 760;
  letter-spacing: -.035em;
}

.auth-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 26px 0 22px;
  padding: 5px;
  border: 1px solid rgba(196, 191, 255, .1);
  border-radius: 14px;
  background: rgba(5, 7, 18, .5);
}

.tabs button {
  position: relative;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: transparent;
  color: #85849e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: color .2s ease, background .25s ease, box-shadow .25s ease, transform .2s ease;
}

.tabs button:hover {
  color: #d4d1e8;
}

.tabs button:focus-visible {
  box-shadow: 0 0 0 2px rgba(133, 106, 255, .72);
}

.tabs button.active {
  background: linear-gradient(135deg, rgba(134, 104, 255, .28), rgba(175, 91, 255, .14));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 6px 22px rgba(84, 55, 184, .14);
  color: #f8f7ff;
}

.field {
  margin-top: 15px;
}

.field label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  color: #c5c2d8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}

.field-hint {
  color: #77758f;
  font-size: 10px;
  font-weight: 500;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: #76738f;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color .2s ease, filter .2s ease;
}

.input-wrap input {
  width: 100%;
  height: 49px;
  padding: 0 45px;
  border: 1px solid rgba(189, 185, 225, .13);
  border-radius: 13px;
  outline: 0;
  background: rgba(5, 7, 18, .58);
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  caret-color: var(--violet-bright);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.input-wrap input::placeholder {
  color: #5f5d74;
  font-weight: 500;
}

.input-wrap input:hover {
  border-color: rgba(189, 185, 225, .23);
}

.input-wrap input:focus {
  border-color: rgba(151, 121, 255, .72);
  background: rgba(7, 9, 22, .72);
  box-shadow: 0 0 0 3px rgba(126, 95, 255, .12), inset 0 1px 8px rgba(0, 0, 0, .15);
}

.input-wrap:focus-within .input-icon {
  color: #b19dff;
  filter: drop-shadow(0 0 6px rgba(154, 123, 255, .42));
}

.password-toggle {
  position: absolute;
  z-index: 3;
  right: 7px;
  top: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  outline: 0;
  background: transparent;
  color: #77758e;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .2s ease, background .2s ease;
}

.password-toggle:hover {
  background: rgba(139, 117, 255, .1);
  color: #c8bdff;
}

.password-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(139, 117, 255, .55);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

.password-toggle .eye-off,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-off {
  display: block;
}

.nick {
  animation: field-in .34s var(--ease-out) both;
}

.go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 23px;
  padding: 12px 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  outline: 0;
  background: linear-gradient(120deg, #6f5de7, #915ff1 52%, #b353e3);
  box-shadow: 0 12px 32px rgba(105, 75, 225, .3), inset 0 1px rgba(255, 255, 255, .28);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .2s ease, box-shadow .25s ease, filter .25s ease;
}

.go::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, .26) 44%, transparent 68%);
  transform: translateX(-130%);
  transition: transform .7s var(--ease-out);
}

.go:hover:not(:disabled) {
  box-shadow: 0 15px 38px rgba(116, 78, 238, .42), inset 0 1px rgba(255, 255, 255, .3);
  filter: saturate(115%) brightness(1.06);
  transform: translateY(-2px);
}

.go:hover:not(:disabled)::before {
  transform: translateX(130%);
}

.go:active:not(:disabled) {
  transform: translateY(0);
}

.go:focus-visible {
  box-shadow: 0 0 0 4px rgba(142, 113, 255, .23), 0 15px 38px rgba(116, 78, 238, .42);
}

.go:disabled {
  cursor: wait;
  filter: saturate(.75);
  opacity: .88;
}

.go svg,
.go-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.go-spinner {
  display: none;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.go.is-busy .go-spinner {
  display: block;
}

.go.is-busy .go-arrow {
  display: none;
}

.msg {
  display: flex;
  align-items: center;
  min-height: 21px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.msg:empty {
  margin-top: 6px;
  min-height: 0;
}

.msg.is-success {
  color: var(--success);
}

.auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
  color: #6f6d83;
  font-size: 10px;
  font-weight: 600;
}

.auth-footnote svg {
  width: 13px;
  height: 13px;
  color: #8f87b2;
}

.site-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 14px clamp(22px, 4.2vw, 72px) 24px;
  color: rgba(213, 210, 234, .42);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .035em;
}

.site-footer span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.site-footer span:last-child::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(124, 232, 196, .75);
}

.portal-transition {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(89, 75, 216, .24), transparent 34%),
    rgba(5, 6, 16, .94);
  opacity: 0;
  visibility: hidden;
  transition: opacity .42s ease, visibility .42s ease;
  pointer-events: none;
}

.portal-transition-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  color: rgba(241, 239, 255, .82);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: translateY(10px);
  transition: transform .6s var(--ease-out);
}

.portal-rune {
  position: relative;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(174, 151, 255, .28);
  border-radius: 50%;
  box-shadow: 0 0 42px rgba(114, 85, 255, .22), inset 0 0 28px rgba(84, 207, 255, .08);
  animation: spin 5s linear infinite;
}

.portal-rune::before,
.portal-rune::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(100, 219, 255, .45);
  border-radius: 50%;
  animation: spin 3.2s linear infinite reverse;
}

.portal-rune::after {
  inset: 29px;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 24px rgba(109, 118, 255, .8);
  transform: rotate(45deg);
  animation: rune-pulse 1.4s ease-in-out infinite alternate;
}

.is-authenticated .portal-transition {
  opacity: 1;
  visibility: visible;
}

.is-authenticated .portal-transition-inner {
  transform: translateY(0);
}

.is-authenticated .site-header,
.is-authenticated .login-layout,
.is-authenticated .site-footer {
  opacity: 0;
  transform: scale(.985);
  transition: opacity .32s ease, transform .45s var(--ease-out);
}

/* Game loading shell */
.game-page {
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

#game-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--night);
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--night);
  outline: 0;
}

.loading-screen {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity .8s ease, visibility .8s ease;
}

.loading-screen .scene-layer,
.loading-screen .motes {
  position: absolute;
}

.loading-screen .scene-photo::before {
  background:
    linear-gradient(90deg, rgba(4, 5, 14, .12) 0%, rgba(4, 5, 14, .03) 42%, rgba(4, 5, 14, .38) 67%, rgba(4, 5, 14, .72) 100%),
    linear-gradient(180deg, rgba(4, 5, 14, .08), rgba(4, 5, 14, .17) 60%, rgba(4, 5, 14, .75));
}

.loading-screen.is-ready {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-main {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  align-items: center;
  gap: clamp(38px, 7vw, 120px);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px clamp(22px, 6vw, 100px) 48px;
}

.loading-story {
  align-self: end;
  max-width: 520px;
  padding-bottom: clamp(28px, 8vh, 90px);
  text-shadow: 0 3px 26px rgba(3, 4, 12, .7);
}

.loading-story h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 4.6vw, 68px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1;
}

.loading-story h1 em {
  color: #bcaaff;
  font-style: italic;
}

.loading-story > p {
  max-width: 470px;
  margin: 18px 0 0;
  color: rgba(236, 233, 255, .68);
  font-size: 14px;
  line-height: 1.65;
}

.loading-card {
  position: relative;
  width: 100%;
  padding: clamp(28px, 3.4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .06), transparent 30%),
    rgba(10, 12, 28, .78);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, .07);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  animation: reveal-card .9s .08s var(--ease-out) both;
  isolation: isolate;
}

.loading-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(105, 218, 255, .25), transparent 34%, transparent 67%, rgba(205, 86, 255, .23));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.loading-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.loading-label {
  margin: 0 0 8px;
  color: #aca0ef;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.loading-status {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.loading-percent {
  min-width: 84px;
  color: #e8e4ff;
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 350;
  letter-spacing: -.065em;
  line-height: .95;
  text-align: right;
  text-shadow: 0 0 24px rgba(145, 113, 255, .28);
}

.loading-percent small {
  margin-left: 2px;
  color: #8e88ad;
  font-size: .4em;
  font-weight: 650;
  letter-spacing: 0;
}

.progress-track {
  position: relative;
  height: 9px;
  margin-top: 27px;
  overflow: hidden;
  border: 1px solid rgba(188, 183, 225, .11);
  border-radius: 999px;
  background: rgba(3, 5, 15, .72);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .34);
}

.progress-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5bcff5, #7875ff 46%, #c45bff 100%);
  box-shadow: 0 0 18px rgba(108, 119, 255, .7), 0 0 34px rgba(195, 86, 255, .35);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease-out;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  filter: blur(2px);
  animation: progress-shimmer 1.75s linear infinite;
}

.loading-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.loading-stage {
  position: relative;
  min-width: 0;
  padding-left: 17px;
  color: #656379;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .045em;
  line-height: 1.35;
  text-transform: uppercase;
  transition: color .25s ease;
}

.loading-stage::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 7px;
  height: 7px;
  border: 1px solid #565369;
  border-radius: 50%;
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}

.loading-stage.is-active {
  color: #c6c0e9;
}

.loading-stage.is-active::before {
  border-color: var(--violet-bright);
  background: var(--violet);
  box-shadow: 0 0 11px rgba(139, 117, 255, .85);
  animation: stage-pulse 1.2s ease-in-out infinite alternate;
}

.loading-stage.is-done {
  color: #8b88a0;
}

.loading-stage.is-done::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: 0 0 8px rgba(124, 232, 196, .5);
}

.loading-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 49px;
  margin-top: 26px;
  padding: 14px 15px;
  border: 1px solid rgba(190, 185, 228, .08);
  border-radius: 13px;
  background: rgba(4, 6, 16, .35);
  color: #868399;
  font-size: 10px;
  line-height: 1.5;
}

.loading-tip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--gold);
  filter: drop-shadow(0 0 7px rgba(245, 189, 112, .3));
}

.loading-tip b {
  display: block;
  margin-bottom: 2px;
  color: #bab5d0;
  font-size: 9px;
  letter-spacing: .12em;
}

.loading-error {
  margin-top: 23px;
  padding: 16px;
  border: 1px solid rgba(255, 119, 150, .2);
  border-radius: 14px;
  background: rgba(78, 19, 39, .2);
}

.loading-error strong {
  display: block;
  color: #ffc0ce;
  font-size: 12px;
}

.loading-error p {
  margin: 6px 0 13px;
  color: rgba(255, 201, 212, .68);
  font-size: 10px;
  line-height: 1.5;
}

.loading-error button {
  padding: 9px 14px;
  border: 1px solid rgba(255, 187, 204, .25);
  border-radius: 9px;
  background: rgba(127, 40, 65, .35);
  color: #ffe3ea;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.loading-footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(22px, 4.2vw, 72px) 22px;
  color: rgba(213, 210, 234, .35);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.loading-footer span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.loading-footer span:last-child::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(124, 232, 196, .7);
}

.game-toolbar {
  position: fixed;
  z-index: 24;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 36px);
  padding: 7px;
  border: 1px solid rgba(195, 191, 226, .16);
  border-radius: 16px;
  background: rgba(8, 10, 23, .72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  transition: opacity .35s ease, transform .45s var(--ease-out), background .3s ease;
}

.game-toolbar:hover {
  background: rgba(10, 12, 28, .88);
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border-right: 1px solid rgba(195, 191, 226, .11);
}

.player-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(176, 153, 255, .3);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(106, 91, 225, .38), rgba(184, 78, 225, .25));
  color: #dcd5ff;
}

.player-avatar svg {
  width: 13px;
  height: 13px;
}

.player-name {
  max-width: 120px;
  overflow: hidden;
  color: #d3d0e4;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-language {
  min-height: 38px;
  padding-left: 33px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.toolbar-language svg {
  left: 10px;
}

.toolbar-language select {
  min-width: 104px;
  font-size: 10px;
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  outline: 0;
  background: transparent;
  color: #aaa7bd;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.control-button:hover {
  background: rgba(139, 117, 255, .12);
  color: #eeeaff;
}

.control-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(139, 117, 255, .58);
}

.control-button:active {
  transform: scale(.96);
}

.control-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.audio-button .audio-icon-off {
  display: none;
}

.audio-button.is-muted {
  color: #8f8b9f;
}

.audio-button.is-muted .audio-icon-on {
  display: none;
}

.audio-button.is-muted .audio-icon-off {
  display: block;
}

.audio-button:not(.is-muted) {
  color: #c9bcff;
}

.audio-button:not(.is-muted) .audio-icon-on {
  filter: drop-shadow(0 0 5px rgba(139, 117, 255, .45));
}

.control-button.logout-button:hover {
  background: rgba(255, 107, 139, .12);
  color: #ffb1c2;
}

.game-ready .game-toolbar {
  padding: 5px;
  border-radius: 13px;
  transform: translateY(0);
}

.game-ready .control-label,
.game-ready .player-name {
  display: none;
}

.game-ready .player-chip {
  padding: 0 7px;
}

.game-ready .toolbar-language {
  width: 38px;
  padding: 0;
}

.game-ready .toolbar-language svg {
  left: 11px;
}

.game-ready .toolbar-language select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  opacity: 0;
}

.game-ready .control-button {
  width: 38px;
  padding: 0;
}

.kick-overlay {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 35%, rgba(116, 83, 222, .18), transparent 35%),
    rgba(6, 7, 17, .97);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.kick-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.kick-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.kick-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(255, 129, 157, .24);
  border-radius: 17px;
  background: rgba(116, 30, 52, .22);
  color: #ff9ab0;
}

.kick-icon svg {
  width: 25px;
  height: 25px;
}

.kick-card h2 {
  margin: 0;
  font-size: 22px;
}

.kick-card p {
  margin: 12px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.kick-card button {
  min-height: 43px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: linear-gradient(120deg, #6f5de7, #9b5fe9);
  box-shadow: 0 10px 26px rgba(104, 74, 220, .28);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

@keyframes scene-breathe {
  from { transform: scale(1.035) translate3d(0, 0, 0); }
  to { transform: scale(1.065) translate3d(-.35%, -.2%, 0); }
}

@keyframes aurora-pulse {
  from { opacity: .55; transform: scale(.94); }
  to { opacity: .95; transform: scale(1.07); }
}

@keyframes mote-rise {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.6); }
  12% { opacity: .75; }
  72% { opacity: .42; }
  100% { opacity: 0; transform: translate3d(34px, -108vh, 0) scale(1.25); }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-card {
  from { opacity: 0; transform: translateY(25px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes field-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rune-pulse {
  from { opacity: .68; transform: rotate(45deg) scale(.82); }
  to { opacity: 1; transform: rotate(45deg) scale(1.08); }
}

@keyframes progress-shimmer {
  from { left: -100px; }
  to { left: calc(100% + 30px); }
}

@keyframes stage-pulse {
  from { transform: scale(.86); opacity: .72; }
  to { transform: scale(1.12); opacity: 1; }
}

@media (max-width: 1020px) {
  .scene-photo {
    background-position: 36% center;
  }

  .scene-photo::before {
    background:
      linear-gradient(90deg, rgba(4, 5, 14, .22), rgba(4, 5, 14, .18) 38%, rgba(4, 5, 14, .62) 78%, rgba(4, 5, 14, .78)),
      linear-gradient(180deg, rgba(4, 5, 14, .16), rgba(4, 5, 14, .23) 60%, rgba(4, 5, 14, .78));
  }

  .login-layout,
  .loading-main {
    grid-template-columns: minmax(0, .8fr) minmax(380px, 460px);
    gap: 42px;
    padding-left: 34px;
    padding-right: 34px;
  }

  .hero-copy h1,
  .loading-story h1 {
    font-size: clamp(38px, 5.5vw, 57px);
  }
}

@media (max-width: 820px) {
  .site-header {
    min-height: 72px;
    padding: 15px 18px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand-world {
    display: none;
  }

  .language-control select {
    min-width: 100px;
  }

  .login-layout,
  .loading-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 18px 36px;
  }

  .hero-copy,
  .loading-story {
    display: none;
  }

  .auth-card,
  .loading-card {
    width: min(460px, 100%);
  }

  .scene-photo {
    inset: -4%;
    background-position: 32% center;
  }

  .scene-photo::before,
  .loading-screen .scene-photo::before {
    background:
      linear-gradient(90deg, rgba(4, 5, 14, .5), rgba(4, 5, 14, .34) 50%, rgba(4, 5, 14, .64)),
      linear-gradient(180deg, rgba(4, 5, 14, .35), rgba(4, 5, 14, .34) 55%, rgba(4, 5, 14, .82));
  }

  .site-footer,
  .loading-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: max(13px, env(safe-area-inset-top));
  }

  .brand-copy {
    display: none;
  }

  .language-control {
    min-height: 39px;
  }

  .login-layout,
  .loading-main {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 24px;
  }

  .auth-card,
  .loading-card {
    padding: 24px 20px;
    border-radius: 22px;
  }

  .auth-heading h2 {
    font-size: 25px;
  }

  .tabs {
    margin-top: 22px;
  }

  .input-wrap input {
    height: 48px;
    font-size: 16px;
  }

  .site-footer span:first-child,
  .loading-footer span:first-child {
    display: none;
  }

  .site-footer,
  .loading-footer {
    justify-content: center;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .loading-topline {
    gap: 12px;
  }

  .loading-status {
    font-size: 16px;
  }

  .loading-percent {
    min-width: 70px;
    font-size: 40px;
  }

  .loading-stages {
    gap: 6px;
  }

  .loading-stage {
    padding-left: 13px;
    font-size: 7px;
  }

  .loading-stage::before {
    width: 6px;
    height: 6px;
  }

  .game-toolbar {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 3px;
    max-width: calc(100vw - 20px);
  }

  .player-chip {
    padding: 0 6px;
  }

  .player-name {
    display: none;
  }

  .toolbar-language {
    width: 38px;
    padding: 0;
  }

  .toolbar-language svg {
    left: 11px;
  }

  .toolbar-language select {
    position: absolute;
    inset: 0;
    width: 100%;
    min-width: 0;
    opacity: 0;
  }

  .control-button {
    width: 38px;
    padding: 0;
  }

  .control-label {
    display: none;
  }
}

@media (max-height: 740px) and (min-width: 821px) {
  .site-header {
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .login-layout,
  .loading-main {
    padding-top: 8px;
    padding-bottom: 22px;
  }

  .auth-card,
  .loading-card {
    padding-top: 25px;
    padding-bottom: 25px;
  }

  .hero-copy,
  .loading-story {
    padding-bottom: 28px;
  }

  .hero-copy h1,
  .loading-story h1 {
    font-size: 47px;
  }

  .auth-heading > p:last-child {
    margin-top: 6px;
  }

  .tabs {
    margin-top: 18px;
    margin-bottom: 14px;
  }

  .field {
    margin-top: 11px;
  }

  .input-wrap input {
    height: 44px;
  }

  .go {
    min-height: 46px;
    margin-top: 17px;
  }

  .loading-tip {
    margin-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
