@font-face {
  font-family: "Rajdhani";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/critical/fonts/Rajdhani/Rajdhani-Bold.ttf") format("truetype");
}

@font-face {
  font-family: "Rajdhani";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/critical/fonts/Rajdhani/Rajdhani-SemiBold.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/critical/fonts/Inter/static/Inter_18pt-Medium.ttf") format("truetype");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/critical/fonts/JetBrains_Mono/JetBrainsMono-VariableFont_wght.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --ink: #edf4ee;
  --muted: #9faea7;
  --panel: rgba(10, 16, 20, 0.82);
  --panel-strong: rgba(12, 20, 25, 0.94);
  --line: rgba(255, 255, 255, 0.13);
  --accent: #7ee0b8;
  --accent-2: #e9b35f;
  --danger: #f07c63;
  --shadow: rgba(0, 0, 0, 0.35);
  --font-heading: "Rajdhani";
  --font-label: "Rajdhani";
  --font-copy: "Inter";
  --font-stat: "JetBrains Mono";
  --z-world: 1;
  --z-actors: 2;
  --z-hud: 10;
  --z-hud-raised: 11;
  --z-hud-panel: 12;
  --z-battle-canvas: 20;
  --z-auth: 40;
  --z-toast: 50;
  font-family: var(--font-copy);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #300f53;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: var(--ink);
  cursor: pointer;
}

.shell,
.game-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#gameCanvas,
#roamCanvas {
  /* position: absolute;
  inset: 0;
  z-index: var(--z-world); */
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #300f53;
}

#gameCanvasFront {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

/** Roam POC: draw tiles that sort in front of the Spine layer (trees, props). */
#roamCanvasFront {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.roam-hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  margin: 0;
  padding: 10px 14px;
  max-width: min(420px, 92vw);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted, #9fb5bc);
  background: rgba(8, 14, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  pointer-events: none;
}

.spine-layer {
  position: absolute;
  inset: 0;
  z-index: var(--z-actors);
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.battle-canvas-panel {
  position: absolute;
  inset: 0;
  z-index: var(--z-battle-canvas);
  display: none;
  align-items: center;
  justify-content: center;
  background: #020711;
}

.battle-canvas-panel.is-open {
  display: flex;
}

.math-challenge-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70%;
  z-index: var(--z-battle-canvas);
  background: linear-gradient(to top, rgba(13, 27, 30, 0.95), rgba(13, 27, 30, 0.7));
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-top: 3px solid var(--accent-2);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15), visibility 0s 0.5s;
}

.math-challenge-panel.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15), visibility 0s;
}

.math-challenge-shell {
  width: 100%;
  height: 100%;
  position: relative;
}

#mathWebappIframe {
  width: 100%;
  height: 100%;
  border: none;
}

.battle-canvas-shell {
  position: relative;
  width: min(100vw, calc(100vh * 3840 / 2160));
  aspect-ratio: 3840 / 2160;
  overflow: hidden;
  background: #020711;
}

#battleCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #020711;
}

.hud {
  position: absolute;
  z-index: var(--z-hud);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
  backdrop-filter: blur(14px);
}

.hud-top {
  top: 14px;
  left: 14px;
  right: auto;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  width: min(430px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid #d9fbff;
  border-radius: 50%;
  background: #0d1b1e url("/assets/critical/bootstrap/favicon_image.png") center/cover no-repeat;
  box-shadow: 0 0 26px rgba(126, 224, 184, 0.34);
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  letter-spacing: 0;
  font-size: 16px;
  line-height: 1.1;
}

.brand span:not(.brand-mark) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.player-chip {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.player-chip[hidden] {
  display: none;
}

.player-chip span {
  min-width: 0;
  overflow: hidden;
  color: #dce8e2;
  font-family: var(--font-stat);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-chip button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(126, 224, 184, 0.42);
  border-radius: 7px;
  background: rgba(126, 224, 184, 0.12);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.action-strip button,
.touch-pad button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.stat-panel {
  left: 14px;
  top: 96px;
  display: grid;
  width: 180px;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
}

.stat-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-panel div:last-child {
  border-bottom: 0;
}

.stat-panel span {
  color: var(--muted);
  font-size: 12px;
}

.stat-panel strong {
  max-width: 78px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-map-wrap {
  right: 14px;
  top: 96px;
  width: 172px;
  height: 172px;
  padding: 8px;
  border-radius: 8px;
}

#miniMap {
  display: block;
  width: 156px;
  height: 156px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d171a;
}

.action-strip {
  left: 50%;
  bottom: 18px;
  display: flex;
  align-items: center;
  min-width: min(520px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  min-height: 54px;
  transform: translateX(-50%);
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  pointer-events: none;
}

.action-strip span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #dce8e2;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-strip button {
  min-width: 104px;
  padding: 0 14px;
  color: #071014;
  border-color: rgba(233, 179, 95, 0.9);
  background: var(--accent-2);
  font-weight: 750;
  pointer-events: auto;
}

.action-strip button:disabled {
  color: #b6c0bc;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
  cursor: default;
}

.buddy-book-button {
  right: 14px;
  bottom: 18px;
  z-index: var(--z-hud-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 108px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.buddy-book-button {
  width: 96px;
  height: 96px;
}

.buddy-book-button[hidden] {
  display: none;
}

.buddy-book-button__icon {
  position: relative;
  width: 78px;
  height: 78px;
  border: 2px solid rgba(217, 251, 255, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 38%, #edf4ee 0 7px, transparent 8px),
    radial-gradient(circle at 61% 39%, #071014 0 5px, transparent 6px),
    linear-gradient(145deg, #7ee0b8, #4f826a 68%);
  box-shadow:
    inset -10px -10px 0 rgba(7, 16, 20, 0.18),
    0 9px 14px rgba(0, 0, 0, 0.36);
  flex: 0 0 auto;
}

.buddy-book-button__icon::after {
  position: absolute;
  top: -9px;
  left: 18px;
  width: 38px;
  height: 25px;
  border-radius: 50% 50% 38% 38%;
  background: linear-gradient(145deg, #d7f2a4, #6fb870);
  content: "";
  transform: rotate(-12deg);
}

.buddy-book-button:focus-visible {
  outline: 2px solid rgba(126, 224, 184, 0.78);
  outline-offset: -8px;
}

.buddy-book-button span:not(.buddy-book-button__icon),
.buddy-book-button strong {
  display: none;
}

.buddy-book-panel {
  right: 14px;
  bottom: 78px;
  z-index: var(--z-hud-panel);
  display: none;
  width: min(386px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 116px));
  overflow: hidden;
  border-radius: 8px;
  background: rgba(10, 16, 20, 0.94);
}

.buddy-book-panel.is-open {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.buddy-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.buddy-book-header span,
.buddy-book-summary span,
.buddy-entry__meta {
  color: var(--muted);
}

.buddy-book-header span {
  display: block;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.buddy-book-header h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0;
}

.buddy-book-header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 24px;
  line-height: 1;
}

.buddy-book-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.buddy-book-summary strong {
  font-size: 15px;
}

.buddy-book-summary span {
  font-size: 12px;
}

.buddy-book-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 14px 14px;
  scrollbar-color: rgba(126, 224, 184, 0.55) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.buddy-book-list:focus {
  outline: 1px solid rgba(126, 224, 184, 0.42);
  outline-offset: -2px;
}

.buddy-entry {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.buddy-entry {
  min-height: 150px;
}

.buddy-entry__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.buddy-entry__name {
  min-width: 0;
}

.buddy-entry__name strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.15;
}

.buddy-entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 5px;
  font-size: 11px;
  text-transform: uppercase;
}

.buddy-entry__resources {
  display: grid;
  gap: 8px;
}

.buddy-entry__resource {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.buddy-entry__resource span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.buddy-entry__resource div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.buddy-entry__resource i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ee0b8, #c6fbff);
}

.buddy-entry__resource button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(233, 179, 95, 0.65);
  border-radius: 7px;
  background: rgba(233, 179, 95, 0.18);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.buddy-entry__resource button:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  cursor: default;
}

.touch-pad {
  position: absolute;
  right: 14px;
  bottom: 88px;
  z-index: var(--z-hud-raised);
  display: none;
  grid-template-columns: 46px 46px 46px 46px;
  grid-template-rows: 46px 46px;
  gap: 8px;
}

.touch-pad button {
  color: #dce8e2;
  background: var(--panel-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.26);
  user-select: none;
  touch-action: none;
}

.touch-pad button[data-touch="up"] {
  grid-column: 2;
}

.touch-pad button[data-touch="left"] {
  grid-column: 1;
  grid-row: 2;
}

.touch-pad button[data-touch="down"] {
  grid-column: 2;
  grid-row: 2;
}

.touch-pad button[data-touch="right"] {
  grid-column: 3;
  grid-row: 2;
}

.touch-pad button[data-touch="action"] {
  grid-column: 4;
  grid-row: 2;
  color: #071014;
  background: var(--accent-2);
}

.auth-loading,
.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-auth);
  display: grid;
  place-items: center;
  background: rgba(3, 9, 16, 0.78);
  backdrop-filter: blur(10px);
}

.auth-loading[hidden],
.auth-backdrop[hidden] {
  display: none;
}

.auth-loading {
  gap: 12px;
  color: #dce8e2;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #141e52;
}

.login-page::before,
.login-page::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

.login-page::before {
  background:
    linear-gradient(90deg, #151f56 0%, rgba(21, 31, 86, 0.98) 47%, rgba(21, 31, 86, 0.5) 66%, rgba(21, 31, 86, 0.08) 100%),
    url("/assets/login/starborn-galaxy-cover.png") right center / auto 100% no-repeat,
    #151f56;
}

.login-page::after {
  background-image:
    radial-gradient(circle at 6% 10%, rgba(0, 199, 255, 0.95) 0 4px, transparent 5px),
    radial-gradient(circle at 19% 16%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 38% 22%, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 63% 8%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 31%, rgba(0, 199, 255, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 76%, rgba(255, 255, 255, 0.48) 0 1px, transparent 2px),
    radial-gradient(circle at 54% 84%, rgba(233, 179, 95, 0.58) 0 1px, transparent 2px);
  opacity: 0.86;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 58px;
  align-items: center;
  width: min(1220px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 54px;
}

.login-copy {
  display: grid;
  align-content: center;
  gap: 20px;
  max-width: 720px;
}

.login-overline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 0;
  color: #00c7ff;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-overline::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00c7ff;
  box-shadow: 0 0 18px rgba(0, 199, 255, 0.82);
  content: "";
  flex: 0 0 auto;
}

.login-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 126px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.82;
  text-wrap: balance;
}

.login-title span {
  color: #00c7ff;
  text-shadow: 0 0 20px rgba(0, 199, 255, 0.74);
}

.login-lede {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-copy);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.36;
}

.login-lede em {
  color: #00c7ff;
  font-family: var(--font-copy);
  font-size: 1em;
  font-style: italic;
}

.login-tagline {
  margin: 42px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-copy);
  font-size: 18px;
  font-style: italic;
  line-height: 1.3;
}

.login-panel {
  position: relative;
  z-index: 2;
  grid-column: 2;
  justify-self: end;
  display: grid;
  gap: 16px;
  width: min(430px, 100%);
  padding: 24px;
  border: 1px solid rgba(0, 199, 255, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 34%),
    rgba(10, 16, 38, 0.78);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 36px rgba(0, 199, 255, 0.12);
  backdrop-filter: blur(16px);
}

.login-panel::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, #00c7ff, #ff69d2, #e9b35f);
  content: "";
}

.login-panel h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
}

.auth-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: auth-spin 0.9s linear infinite;
}

.auth-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.auth-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.auth-backdrop.is-closing {
  opacity: 0;
}

.auth-dialog {
  display: grid;
  gap: 18px;
  width: min(420px, calc(100vw - 28px));
  padding: 24px;
  border: 1px solid rgba(217, 251, 255, 0.2);
  border-radius: 8px;
  background: rgba(8, 16, 23, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms ease;
}

.auth-backdrop.is-open .auth-dialog {
  transform: translateY(0) scale(1);
}

.auth-dialog__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00c7ff;
  font-family: var(--font-stat);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-dialog h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 34px;
  line-height: 1;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span {
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--font-stat);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.auth-password-control {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-control input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  border-color: rgba(0, 199, 255, 0.45);
  background: rgba(0, 199, 255, 0.11);
  color: var(--ink);
}

.auth-password-toggle__icon {
  position: relative;
  width: 21px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 999px / 680px;
}

.auth-password-toggle__icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.auth-password-toggle__icon::after {
  position: absolute;
  top: 50%;
  left: -4px;
  display: none;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: rotate(-38deg);
}

.auth-password-toggle.is-visible .auth-password-toggle__icon::after {
  display: block;
}

.auth-field input:focus {
  border-color: rgba(0, 199, 255, 0.78);
  box-shadow:
    0 0 0 3px rgba(0, 199, 255, 0.13),
    0 0 20px rgba(0, 199, 255, 0.08);
}

.auth-field input[aria-invalid="true"] {
  border-color: rgba(240, 124, 99, 0.9);
}

.auth-field small {
  min-height: 15px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.25;
  white-space: pre-line;
}

.auth-submit {
  position: relative;
  min-height: 48px;
  margin-top: 2px;
  border: 1px solid rgba(0, 199, 255, 0.92);
  border-radius: 7px;
  background: linear-gradient(135deg, #00c7ff, #54b9ea 48%, #e9b35f 155%);
  color: #071014;
  font-family: var(--font-stat);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 199, 255, 0.18);
}

.auth-submit.is-loading,
.signup-confirm__primary.is-loading {
  color: rgba(7, 16, 20, 0.58);
}

.auth-submit.is-loading::after,
.signup-confirm__primary.is-loading::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(7, 16, 20, 0.28);
  border-top-color: #071014;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
  animation: auth-button-spin 0.8s linear infinite;
}

.auth-submit:disabled,
.auth-toggle:disabled,
.signup-confirm__primary:disabled,
.signup-confirm__secondary:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-toggle {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: var(--z-toast);
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(7, 16, 26, 0.95);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.toast--success {
  border-left-color: var(--accent);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--warning {
  border-left-color: var(--accent-2);
}

.toast--info {
  border-left-color: #83b7e8;
}

.signup-confirm {
  position: fixed;
  inset: 0;
  z-index: var(--z-auth);
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
  overflow-y: auto;
  background: rgba(3, 9, 16, 0.74);
  backdrop-filter: blur(10px);
}

.signup-confirm[hidden] {
  display: none;
}

.signup-confirm__panel {
  display: grid;
  gap: 16px;
  width: min(430px, 100%);
  max-width: calc(100vw - 32px);
  padding: 24px;
  border: 1px solid rgba(0, 199, 255, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%),
    rgba(10, 16, 38, 0.97);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.48),
    0 0 32px rgba(0, 199, 255, 0.1);
}

.signup-confirm__panel h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.04;
  text-wrap: balance;
}

.signup-confirm__panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.signup-confirm__panel strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.signup-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.signup-confirm__primary,
.signup-confirm__secondary {
  flex: 0 1 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  font-family: var(--font-stat);
  font-weight: 800;
  white-space: nowrap;
}

.signup-confirm__primary {
  position: relative;
  min-width: 160px;
  border: 1px solid rgba(0, 199, 255, 0.92);
  background: linear-gradient(135deg, #00c7ff, #54b9ea 48%, #e9b35f 155%);
  color: #071014;
}

.signup-confirm__secondary {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

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

@keyframes auth-button-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .login-page::before {
    background:
      linear-gradient(90deg, #151f56 0%, rgba(21, 31, 86, 0.97) 54%, rgba(21, 31, 86, 0.5) 78%, rgba(21, 31, 86, 0.08) 100%),
      url("/assets/login/starborn-galaxy-cover.png") right center / auto 100% no-repeat,
      #151f56;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
    gap: 34px;
    padding: 36px;
  }

  .login-title {
    font-size: 96px;
  }

  .login-lede {
    font-size: 23px;
  }

  .login-tagline {
    margin-top: 24px;
    font-size: 17px;
  }
}

@media (max-width: 820px) {
  .login-page::before {
    background:
      linear-gradient(180deg, rgba(21, 31, 86, 0.58) 0%, #151f56 39%, #111946 100%),
      url("/assets/login/starborn-galaxy-cover.png") center top / cover no-repeat,
      #151f56;
  }

  .login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    align-content: safe center;
    justify-items: center;
    gap: 24px;
    width: min(680px, 100%);
    min-height: 100vh;
    min-height: 100svh;
    padding: 44px 28px 34px;
  }

  .login-copy {
    gap: 14px;
    max-width: 620px;
    text-align: center;
    justify-items: center;
  }

  .login-title {
    font-size: 82px;
    line-height: 0.88;
  }

  .login-lede {
    font-size: 21px;
    line-height: 1.35;
  }

  .login-tagline {
    margin-top: 10px;
    font-size: 16px;
  }

  .login-panel {
    grid-column: 1;
    justify-self: center;
    width: min(430px, 100%);
  }

  .hud-top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .brand {
    min-width: 0;
  }

  .stat-panel {
    top: auto;
    bottom: 88px;
    width: 156px;
  }

  .mini-map-wrap {
    display: none;
  }

  .touch-pad {
    display: grid;
  }

  .buddy-book-button {
    bottom: 196px;
  }

  .buddy-book-panel {
    right: 14px;
    bottom: 14px;
    max-height: calc(100vh - 28px);
  }

}

@media (max-width: 560px) {
  .hud-top {
    left: 8px;
    right: 8px;
    top: 8px;
    gap: 10px;
    padding: 8px;
  }

  .player-chip button {
    min-height: 32px;
    padding: 0 8px;
  }

  .brand span:not(.brand-mark) {
    display: none;
  }

  .stat-panel {
    left: 8px;
    bottom: 82px;
  }

  .action-strip {
    bottom: 10px;
    min-height: 50px;
  }

  .touch-pad {
    right: 8px;
    bottom: 76px;
    grid-template-columns: 42px 42px 42px 42px;
    grid-template-rows: 42px 42px;
    gap: 6px;
  }

  .buddy-book-button {
    right: 8px;
    bottom: 176px;
    width: 82px;
    height: 82px;
  }

  .buddy-book-button__icon {
    width: 66px;
    height: 66px;
  }

  .buddy-book-panel {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .buddy-book-list {
    padding: 10px;
  }

  .buddy-entry__resource {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .buddy-entry__resource button {
    grid-column: 1 / -1;
  }

  .auth-dialog {
    padding: 20px;
  }

  .auth-dialog h1 {
    font-size: 30px;
  }

  .login-page::before {
    background:
      linear-gradient(180deg, rgba(21, 31, 86, 0.48) 0%, #151f56 34%, #111946 100%),
      url("/assets/login/starborn-galaxy-cover.png") center top / auto 54vh no-repeat,
      #151f56;
  }

  .login-shell {
    align-content: center;
    align-content: safe center;
    align-items: center;
    gap: 18px;
    padding: 20px 16px;
  }

  .login-overline {
    font-size: 13px;
  }

  .login-title {
    font-size: 60px;
    line-height: 0.9;
  }

  .login-lede {
    font-size: 17px;
    max-width: 360px;
  }

  .login-tagline {
    margin-top: 4px;
    font-size: 15px;
  }

  .login-panel {
    width: 100%;
    padding: 18px;
  }

  .login-panel h2,
  .signup-confirm__panel h2 {
    font-size: 28px;
  }

  .signup-confirm {
    padding: 18px;
  }

  .signup-confirm__panel {
    width: min(430px, 100%);
    max-width: calc(100vw - 28px);
    padding: 20px;
    text-align: center;
    justify-items: center;
  }

  .signup-confirm__actions {
    display: flex;
    justify-content: center;
    width: 100%;
  }

}

@media (max-width: 420px) {
  .login-copy {
    gap: 9px;
  }

  .login-title {
    font-size: 54px;
  }

  .login-lede {
    font-size: 15px;
    line-height: 1.28;
  }

  .login-tagline {
    display: none;
  }

  .auth-dialog__brand,
  .auth-field span {
    font-size: 11px;
  }

  .auth-submit {
    font-size: 14px;
    min-height: 46px;
  }

  .signup-confirm__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .signup-confirm__primary,
  .signup-confirm__secondary {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .auth-form {
    gap: 12px;
  }

  .auth-field {
    gap: 6px;
  }

  .auth-field input {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .login-shell {
    gap: 14px;
    padding: 16px 12px;
  }

  .login-title {
    font-size: 48px;
  }

  .login-panel {
    padding: 16px 14px;
  }

  .signup-confirm {
    padding: 12px;
  }

  .signup-confirm__panel {
    max-width: calc(100vw - 24px);
    padding: 16px 14px;
  }

  .signup-confirm__panel h2 {
    font-size: 25px;
  }
}

@media (max-width: 420px) and (max-height: 700px) {
  .login-page::before {
    background:
      linear-gradient(180deg, rgba(21, 31, 86, 0.4) 0%, #151f56 30%, #111946 100%),
      url("/assets/login/starborn-galaxy-cover.png") center top / auto 46vh no-repeat,
      #151f56;
  }

  .login-shell {
    align-content: start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .login-lede {
    display: none;
  }

  .login-panel {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .signup-confirm {
    align-items: start;
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (min-width: 821px) and (max-height: 720px) {
  .login-shell {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .login-title {
    font-size: 94px;
  }

  .login-lede {
    font-size: 22px;
  }

  .login-tagline {
    margin-top: 16px;
  }
}
