:root {
  --void: #030507;
  --cyan: #9aefff;
  --cyan-dim: rgba(154, 239, 255, 0.78);
  --amber: #f0c46a;
  --text: #f7fafc;
  --muted: rgba(236, 242, 250, 0.72);
  --glass: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--text);
  font-family: "IBM Plex Mono", "Sora", ui-monospace, monospace;
}
body {
  position: relative;
}
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed;
  inset: -40px;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 18% 8%, rgba(80, 180, 220, 0.12), transparent 42%),
    radial-gradient(90% 70% at 70% 100%, rgba(220, 140, 50, 0.16), transparent 48%),
    radial-gradient(circle at 50% 45%, transparent 20%, rgba(0, 0, 0, 0.55) 100%);
  transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 12px), 0);
  will-change: transform;
}
.topnav {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  animation: fadeUp 1.1s var(--ease) 0.2s both;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 10px 16px;
  transition: color 0.25s ease;
}
.topnav a:hover { color: var(--text); }
.topnav .sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}
.stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  transition: opacity 0.7s var(--ease);
}
.stage.is-booting {
  opacity: 0;
  pointer-events: none;
}
.center {
  width: min(560px, 100%);
  text-align: center;
  animation: fadeUp 1s var(--ease) both;
  will-change: transform;
  transition: transform 0.05s linear;
}
.cursor-ring {
  position: fixed;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1px solid rgba(126, 231, 255, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 8;
  left: calc(50% + var(--mx, 0) * 0px);
  top: calc(50% + var(--my, 0) * 0px);
  transform: translate3d(
    calc((var(--mx, 0) * 0.5 + 0.5) * 100vw - 50vw),
    calc((var(--my, 0) * 0.5 + 0.5) * 100vh - 50vh),
    0
  );
  opacity: 0.55;
  mix-blend-mode: screen;
  transition: opacity 0.3s ease;
}
.emblem {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 28px;
  overflow: hidden;
  border-radius: 50%;
  will-change: transform;
  animation: breathe 4.8s ease-in-out infinite;
  border: 1px solid rgba(232, 200, 140, 0.4);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 0 6px rgba(255, 255, 255, 0.04),
    0 0 36px rgba(232, 179, 90, 0.22);
}
.emblem .logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.18);
  transform-origin: center;
}
.hint {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.brand {
  margin: 0 0 10px;
  font-family: "Syne", "Sora", sans-serif;
  font-size: clamp(44px, 7vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.sub {
  margin: 0 0 40px;
  color: rgba(236, 242, 250, 0.78);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.7;
}
.panel {
  text-align: left;
  padding: 28px 28px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.04)),
    rgba(12, 18, 28, 0.42);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  transform: translate3d(calc(var(--mx, 0) * -6px), calc(var(--my, 0) * -6px), 0);
  transition: transform 0.12s linear;
  isolation: isolate;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(236, 242, 250, 0.7);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 13px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
}
.tab.is-on {
  color: #fff;
  background: rgba(154, 239, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(154, 239, 255, 0.35);
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  margin-bottom: 9px;
  color: rgba(236, 242, 250, 0.82);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.field input {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 15px 16px;
  border-radius: 14px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.field input::placeholder { color: rgba(236, 242, 250, 0.42); }
.field input:focus {
  border-color: rgba(154, 239, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(154, 239, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
}
.row-code,
.row-confirm,
.row-invite {
  display: none;
}
.is-register .row-code,
.is-register .row-confirm,
.is-register .row-invite,
.is-reset .row-code,
.is-reset .row-confirm {
  display: block;
}
.auth-links {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 4px;
  min-height: 20px;
}
.linkish {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.04em;
  color: rgba(196, 208, 220, 0.58);
  transition: color 0.2s ease;
}
.linkish:hover {
  color: rgba(154, 239, 255, 0.92);
}
.is-reset .tabs {
  opacity: 0.45;
  pointer-events: none;
}
.code-line {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.code-line input {
  flex: 1 1 auto;
  min-width: 0;
}
.ghost-code {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(236, 242, 250, 0.88);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  padding: 0 14px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.ghost-code:hover {
  background: rgba(154, 239, 255, 0.12);
  border-color: rgba(154, 239, 255, 0.4);
}
.ghost-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.invite-tip {
  display: none;
}
.field.is-locked input,
.field.is-locked input:focus {
  color: rgba(210, 220, 232, 0.55);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  caret-color: transparent;
}
.submit {
  width: 100%;
  margin-top: 10px;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #041018;
  padding: 16px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9aefff, #6ec8e8 40%, #e8b35a);
  box-shadow: 0 14px 40px rgba(126, 231, 255, 0.22);
  transition: transform 0.35s var(--ease), filter 0.25s ease, box-shadow 0.35s ease;
}
.submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 48px rgba(126, 231, 255, 0.3);
}
.submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: rgba(236, 242, 250, 0.68);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot a {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: none;
}
.foot a:hover { color: #fff; }
.status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--amber);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}
.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
.boot.is-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-inner {
  width: min(240px, 70vw);
  text-align: center;
}
.boot-code {
  display: block;
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
}
.boot-track {
  margin: 18px auto 0;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(126, 231, 255, 0.12);
  overflow: hidden;
}
.boot-track i {
  display: block;
  height: 100%;
  width: 1%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee7ff, #e8b35a);
  box-shadow: 0 0 12px rgba(126, 231, 255, 0.45);
  transition: width 0.18s linear;
}
.boot-tip {
  margin: 14px 0 0;
  color: rgba(126, 231, 255, 0.45);
  font-size: 10px;
  letter-spacing: 0.28em;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@media (max-width: 560px) {
  .topnav { top: 16px; right: 16px; }
  .center { width: min(100%, 100%); }
  .panel { padding: 22px 18px; }
  .brand { font-size: clamp(36px, 10vw, 48px); }
  .emblem { width: 132px; height: 132px; }
}
