:root {
  --night: #101522;
  --night-deep: #090d14;
  --blue-ink: #1b2a34;
  --jade: #2d8c7c;
  --jade-deep: #15584f;
  --gold: #ddb963;
  --gold-soft: #fff0b8;
  --cinnabar: #b34634;
  --paper: #f3e3bd;
  --paper-deep: #c5a66e;
  --white: #fff7dd;
  --muted: rgba(255, 247, 221, 0.68);
  --line: rgba(255, 232, 165, 0.2);
  --glass: rgba(12, 17, 28, 0.58);
  --glass-strong: rgba(11, 15, 24, 0.78);
  --panel: rgba(14, 19, 31, 0.72);
  --panel-soft: rgba(255, 232, 165, 0.055);
  --line-strong: rgba(255, 232, 165, 0.28);
  --font-ui: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: rgba(0, 0, 0, 0.32);
  --shadow-xl: 0 28px 90px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(115deg, rgba(179, 70, 52, 0.14) 0 18%, transparent 42%),
    linear-gradient(245deg, rgba(45, 140, 124, 0.2) 0 24%, transparent 54%),
    linear-gradient(180deg, #10131f 0%, #14252c 56%, #3e3320 140%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.5;
}

.game-root {
  position: relative;
  z-index: 1;
  transition: filter 240ms ease, opacity 240ms ease;
}

body.auth-active {
  overflow: hidden;
}

body.auth-active .game-root,
body.auth-active .ai-drawer,
body.auth-active .encounter-dialog {
  filter: blur(8px);
  opacity: 0.32;
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(360px, 0.85fr);
  align-items: stretch;
  height: 100vh;
  min-height: 0;
  padding: clamp(18px, 4vw, 56px);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.auth-gate.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.auth-landscape {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px 0 0 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 42px 42px,
    radial-gradient(circle at 24% 20%, rgba(255, 232, 165, 0.22), transparent 20%),
    linear-gradient(180deg, rgba(14, 19, 32, 0.96), rgba(27, 45, 50, 0.92) 58%, rgba(94, 73, 39, 0.94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
}

.auth-landscape::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(45, 140, 124, 0.18), transparent 24%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 38%, rgba(0, 0, 0, 0.22));
}

.auth-moon {
  position: absolute;
  top: 72px;
  left: clamp(54px, 8vw, 118px);
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff6c9 0 35%, #d9ba70 64%, rgba(217, 186, 112, 0.16) 70%);
  box-shadow: 0 0 80px rgba(255, 232, 165, 0.38);
}

.auth-mountain {
  position: absolute;
  right: -8%;
  bottom: 0;
  left: -8%;
  height: 58%;
  clip-path: polygon(0 100%, 0 58%, 10% 48%, 21% 63%, 34% 30%, 47% 62%, 58% 38%, 70% 66%, 82% 34%, 100% 60%, 100% 100%);
}

.auth-mountain.far {
  bottom: 16%;
  opacity: 0.45;
  background: linear-gradient(180deg, rgba(45, 140, 124, 0.42), rgba(13, 22, 30, 0.92));
  animation: mistDrift 9s ease-in-out infinite alternate;
}

.auth-mountain.near {
  opacity: 0.82;
  background: linear-gradient(180deg, rgba(31, 58, 55, 0.9), rgba(8, 13, 18, 0.98));
}

.auth-river {
  position: absolute;
  right: 12%;
  bottom: 8%;
  width: 66%;
  height: 18%;
  border: 1px solid rgba(255, 232, 165, 0.2);
  border-radius: 50%;
  transform: rotate(-8deg);
  background: linear-gradient(90deg, transparent, rgba(255, 232, 165, 0.28), transparent);
  filter: blur(0.4px);
}

.auth-seal {
  position: absolute;
  right: clamp(30px, 6vw, 84px);
  bottom: clamp(32px, 5vw, 76px);
  z-index: 2;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.34);
  border-radius: 8px;
  color: var(--gold-soft);
  background: linear-gradient(145deg, rgba(179, 70, 52, 0.92), rgba(88, 28, 25, 0.96));
  box-shadow: 0 20px 60px rgba(179, 70, 52, 0.28), inset 0 0 0 3px rgba(255, 242, 190, 0.1);
  font-size: 4.8rem;
  font-weight: 900;
}

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vh, 22px);
  min-height: min(560px, calc(100vh - clamp(18px, 4vw, 56px) * 2));
  padding: clamp(22px, 4vw, 50px);
  overflow-y: auto;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(9, 13, 22, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(24px);
}

.auth-head h1 {
  margin-bottom: 10px;
  font-size: clamp(3rem, 6.5vw, 6.2rem);
}

.auth-head p,
.auth-message {
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.8;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.05);
}

.auth-route {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.045);
}

.auth-route span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.auth-route b,
.auth-route em {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.auth-route b {
  color: var(--gold-soft);
  font-size: 0.88rem;
}

.auth-route em {
  color: rgba(255, 247, 221, 0.56);
  font-size: 0.72rem;
}

.auth-route i {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 165, 0.5), transparent);
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 900;
}

.auth-tabs button.is-active {
  color: #2a1a0d;
  background: linear-gradient(135deg, #ffe89d, var(--gold));
}

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

.auth-form label {
  display: grid;
  gap: 8px;
  color: rgba(255, 247, 221, 0.72);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--white);
  outline: none;
  background: rgba(255, 255, 255, 0.065);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-form input:focus {
  border-color: rgba(255, 232, 165, 0.5);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(221, 185, 99, 0.12);
}

.auth-form[data-mode="login"] .auth-nickname {
  display: none;
}

.auth-message.is-error {
  color: #ffd0c6;
}

.auth-message.is-good {
  color: var(--gold-soft);
}

.game-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(190px, 0.74fr) minmax(290px, auto) minmax(480px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 8px clamp(14px, 3vw, 54px);
  border-bottom: 1px solid rgba(255, 234, 169, 0.12);
  background:
    linear-gradient(90deg, rgba(179, 70, 52, 0.12), transparent 28%, rgba(45, 140, 124, 0.12)),
    rgba(10, 13, 22, 0.86);
  backdrop-filter: blur(20px);
}

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

.brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 230, 165, 0.35);
  border-radius: 8px;
  color: var(--gold-soft);
  background: linear-gradient(145deg, var(--cinnabar), #68231e);
  box-shadow: 0 10px 28px rgba(179, 70, 52, 0.24), inset 0 0 0 2px rgba(255, 242, 190, 0.1);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
}

.game-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(56px, auto);
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(255, 232, 165, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.game-nav button,
.realm-tabs button,
.codex-filter button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.game-nav button {
  min-width: 56px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: normal;
  overflow: visible;
  white-space: nowrap;
}

.game-nav button span {
  display: block;
  min-height: 1.8em;
  padding: 0.22em 0 0.18em;
  line-height: 1.4;
  overflow: visible;
  transform: translateY(1px);
}

.game-nav button:hover,
.game-nav button.is-active {
  color: var(--gold-soft);
  border-color: rgba(255, 232, 165, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 232, 165, 0.12), rgba(45, 140, 124, 0.08)),
    rgba(255, 232, 165, 0.06);
}

.hud-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.hud-stats span {
  min-width: 62px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.hud-stats .account-chip {
  min-width: 118px;
  max-width: 154px;
}

.hud-stats .mode-chip {
  min-width: 68px;
}

.hud-stats em,
.hud-stats strong {
  display: block;
  font-style: normal;
}

.hud-stats em {
  color: rgba(255, 247, 221, 0.5);
  font-family: var(--font-ui);
  font-size: 0.68rem;
}

.hud-stats strong {
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.hud-action-button,
.logout-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 232, 165, 0.22);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(255, 232, 165, 0.055);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.4;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hud-action-button:hover,
.logout-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 232, 165, 0.38);
  background: rgba(255, 232, 165, 0.1);
}

.hud-action-button {
  color: #bdf6e8;
  border-color: rgba(45, 140, 124, 0.28);
  background: rgba(45, 140, 124, 0.1);
}

.guide-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(45, 140, 124, 0.28);
  border-radius: 8px;
  color: #bdf6e8;
  background: rgba(45, 140, 124, 0.1);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.guide-button:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 208, 195, 0.48);
  background: rgba(45, 140, 124, 0.16);
}

.realm-stage {
  width: min(1680px, 100%);
  min-height: calc(100vh - 70px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.42fr) minmax(320px, 0.86fr);
  align-items: start;
  gap: clamp(14px, 1.8vw, 26px);
  padding: clamp(18px, 3vw, 44px) clamp(14px, 3vw, 54px) 36px;
}

.hero-copy {
  max-width: 500px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 6px 0 6px 12px;
  border-left: 1px solid rgba(255, 232, 165, 0.16);
}

.hero-copy h1 {
  margin-bottom: 10px;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  letter-spacing: 0.06em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--gold-soft);
  font-size: clamp(4rem, 8vw, 7.6rem);
  line-height: 0.92;
  letter-spacing: 0.08em;
  text-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

h2 {
  margin-bottom: 0;
  color: var(--white);
  font-size: clamp(1.3rem, 2vw, 2rem);
  letter-spacing: 0.04em;
}

h3 {
  margin-bottom: 8px;
  color: var(--white);
  font-size: 1.05rem;
}

.hero-line,
.quest-story,
.encounter-story,
.scroll-text,
.ai-answer,
.codex-card p,
.studio-card p,
.realm-copy p {
  color: var(--muted);
  font-family: var(--font-ui);
  line-height: 1.8;
}

.hero-line {
  max-width: 460px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.gameplay-loop {
  max-width: 460px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
}

.loop-step {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 7px;
  padding: 7px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.06), rgba(45, 140, 124, 0.045)),
    rgba(0, 0, 0, 0.13);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.loop-step:hover,
.loop-step.is-current,
.loop-step.is-flashing {
  color: var(--white);
  border-color: rgba(255, 232, 165, 0.32);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.12), rgba(45, 140, 124, 0.08)),
    rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.loop-step b {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #211609;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  font-family: var(--font-ui);
  font-size: 0.74rem;
}

.loop-step span,
.loop-step em {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.loop-step span {
  color: var(--gold-soft);
  font-weight: 900;
}

.loop-step em {
  font-size: 0.68rem;
  color: rgba(255, 247, 221, 0.55);
}

.player-card {
  max-width: 440px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.055);
}

.avatar-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--gold-soft);
  background: linear-gradient(145deg, var(--jade-deep), #16252b);
  box-shadow: inset 0 0 0 1px rgba(255, 232, 165, 0.18);
  font-size: 1.2rem;
  font-weight: 900;
}

.player-card strong,
.player-card small {
  display: block;
}

.player-card strong {
  color: var(--white);
  font-size: 0.9rem;
}

.player-card small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.74rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-card b {
  padding: 5px 7px;
  border: 1px solid rgba(45, 140, 124, 0.34);
  border-radius: 999px;
  color: #bdf6e8;
  background: rgba(45, 140, 124, 0.12);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.76rem;
}

.war-room {
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}

.war-room span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 6px 7px;
  border: 1px solid rgba(45, 140, 124, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(45, 140, 124, 0.09), rgba(179, 70, 52, 0.04)),
    rgba(0, 0, 0, 0.1);
}

.war-room em,
.war-room strong {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.war-room em {
  color: rgba(255, 247, 221, 0.5);
  font-size: 0.66rem;
}

.war-room strong {
  color: #bdf6e8;
  font-size: 0.82rem;
}

.resource-ledger {
  max-width: 440px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}

.resource-ledger span {
  min-width: 0;
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 5px 7px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 232, 165, 0.07), rgba(0, 0, 0, 0.08)),
    rgba(255, 232, 165, 0.04);
}

.resource-ledger b {
  grid-row: 1 / 3;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-size: 0.9rem;
}

.resource-ledger strong,
.resource-ledger em {
  display: block;
  min-width: 0;
  font-family: "Noto Sans SC", sans-serif;
  font-style: normal;
}

.resource-ledger strong {
  color: var(--white);
  font-size: 0.86rem;
  line-height: 1;
}

.resource-ledger em {
  overflow: hidden;
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.68rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gold-button,
.line-button {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.gold-button {
  border: 1px solid rgba(255, 230, 165, 0.32);
  color: #2a1a0d;
  background: linear-gradient(135deg, #ffe89d, var(--gold) 58%, #b77834);
  box-shadow: 0 15px 40px rgba(221, 185, 99, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.line-button {
  border: 1px solid rgba(255, 232, 165, 0.24);
  color: var(--gold-soft);
  background: rgba(255, 232, 165, 0.055);
}

.gold-button:hover,
.line-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.gold-button:disabled {
  cursor: not-allowed;
  color: rgba(255, 247, 221, 0.52);
  border-color: rgba(255, 232, 165, 0.16);
  background: linear-gradient(135deg, rgba(255, 232, 165, 0.14), rgba(255, 232, 165, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  filter: none;
  opacity: 1;
  transform: none;
}

.wide {
  width: 100%;
}

.chapter-meter {
  max-width: 420px;
  display: grid;
  gap: 5px;
  font-size: 0.82rem;
  color: rgba(255, 247, 221, 0.68);
  font-family: "Noto Sans SC", sans-serif;
}

.chapter-meter i {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.chapter-meter b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  transition: width 360ms ease;
}

.game-scene {
  position: relative;
  height: min(650px, calc(100vh - 116px));
  min-height: 560px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(10, 14, 24, 0.18), rgba(10, 14, 24, 0.62)),
    url("./assets/ink-bg.png") center / cover;
  box-shadow: var(--shadow-xl), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.slg-scene-head {
  position: absolute;
  z-index: 9;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.58);
  backdrop-filter: blur(14px);
}

.slg-scene-head strong,
.slg-scene-head span {
  font-family: "Noto Sans SC", sans-serif;
}

.slg-scene-head strong {
  display: block;
  color: var(--gold-soft);
  font-size: 1.08rem;
  letter-spacing: 0.08em;
}

.slg-scene-head .eyebrow {
  margin-bottom: 3px;
}

.slg-scene-head > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(45, 140, 124, 0.34);
  border-radius: 999px;
  color: #bdf6e8;
  background: rgba(45, 140, 124, 0.12);
  font-size: 0.82rem;
  font-weight: 900;
}

.campaign-ribbon {
  position: absolute;
  z-index: 9;
  top: 86px;
  left: 14px;
  right: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.5);
  backdrop-filter: blur(12px);
}

.campaign-ribbon span {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.045);
}

.campaign-ribbon b,
.campaign-ribbon em {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.campaign-ribbon b {
  color: var(--gold-soft);
  font-size: 0.82rem;
}

.campaign-ribbon em {
  color: rgba(255, 247, 221, 0.5);
  font-size: 0.66rem;
}

.game-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 238, 172, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(12, 17, 28, 0.08), rgba(10, 13, 18, 0.72));
  pointer-events: none;
}

.game-scene::after {
  content: "";
  position: absolute;
  z-index: 8;
  inset: 72px 18px 92px;
  border: 1px solid rgba(255, 232, 165, 0.11);
  border-radius: 8px;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.scene-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.moon {
  position: absolute;
  right: 11%;
  top: 9%;
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 184, 0.82), rgba(255, 240, 184, 0.13) 64%, transparent 70%);
  filter: blur(0.2px);
}

.mist {
  position: absolute;
  z-index: 2;
  width: 260px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 249, 225, 0.2);
  filter: blur(8px);
  animation: mistDrift 18s ease-in-out infinite alternate;
}

.mist::before,
.mist::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: inherit;
}

.mist::before {
  width: 140px;
  height: 88px;
  left: 52px;
  top: -42px;
}

.mist::after {
  width: 170px;
  height: 70px;
  right: 30px;
  top: -24px;
}

.mist-a {
  left: 12%;
  top: 24%;
}

.mist-b {
  right: 8%;
  bottom: 21%;
  animation-duration: 24s;
}

.mountain-layer {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 0;
  height: 58%;
  opacity: 0.72;
  clip-path: polygon(0 82%, 8% 64%, 17% 70%, 27% 42%, 39% 68%, 50% 34%, 64% 72%, 76% 38%, 88% 62%, 100% 28%, 100% 100%, 0 100%);
}

.mountain-layer.far {
  bottom: 22%;
  background: rgba(122, 145, 122, 0.24);
  filter: blur(3px);
}

.mountain-layer.mid {
  bottom: 8%;
  background: rgba(72, 105, 92, 0.38);
}

.mountain-layer.near {
  background: rgba(31, 58, 54, 0.62);
}

.river-line,
.route-line {
  position: absolute;
  z-index: 3;
  left: 9%;
  right: 7%;
  bottom: 18%;
  height: 28%;
  border-radius: 50%;
  transform: rotate(-6deg);
}

.river-line {
  border-bottom: 22px solid rgba(106, 173, 168, 0.22);
  filter: blur(3px);
}

.route-line {
  border-bottom: 4px dashed rgba(221, 185, 99, 0.55);
  animation: routeMove 10s linear infinite;
}

.scene-command-strip {
  position: absolute;
  z-index: 10;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.66);
  backdrop-filter: blur(16px);
}

.scene-command-strip button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.07), rgba(45, 140, 124, 0.05)),
    rgba(255, 232, 165, 0.035);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.scene-command-strip button:hover,
.scene-command-strip button.is-flashing {
  transform: translateY(-2px);
  border-color: rgba(255, 232, 165, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.12), rgba(45, 140, 124, 0.08)),
    rgba(255, 232, 165, 0.06);
}

.scene-command-strip span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #17221c;
  background: linear-gradient(145deg, #a8f1df, var(--jade));
  font-weight: 900;
}

.scene-command-strip strong,
.scene-command-strip em {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scene-command-strip strong {
  color: var(--gold-soft);
  font-size: 0.84rem;
}

.scene-command-strip em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.68rem;
}

.player-avatar {
  position: fixed;
  z-index: 12;
  left: 22px;
  bottom: 24px;
  width: 174px;
  height: 286px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: grab;
  transform-origin: 50% 100%;
  touch-action: none;
  perspective: 900px;
  transform-style: preserve-3d;
  user-select: none;
  -webkit-user-drag: none;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --drag-lean: 0deg;
  --qi-color: rgba(126, 208, 195, 0.72);
}

.player-avatar:hover {
  filter:
    drop-shadow(0 0 18px rgba(126, 208, 195, 0.28))
    drop-shadow(0 0 26px rgba(255, 232, 165, 0.28));
}

.player-avatar:focus {
  outline: none;
}

.player-avatar:focus-visible {
  filter:
    drop-shadow(0 0 20px rgba(126, 208, 195, 0.32))
    drop-shadow(0 0 30px rgba(255, 232, 165, 0.32));
}

.player-avatar.free-dragging {
  z-index: 60;
  cursor: grabbing;
  filter: drop-shadow(0 0 28px rgba(255, 232, 165, 0.42));
}

.character-ground {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 1%;
  width: 82%;
  height: 20%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 232, 165, 0.3), rgba(126, 208, 195, 0.16) 42%, transparent 72%),
    radial-gradient(circle, rgba(0, 0, 0, 0.32), transparent 68%);
  filter: blur(4px);
  transform: translateX(-50%);
  animation: cultivationShadowPulse 4.8s ease-in-out infinite;
}

.character-aura {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 4%;
  width: 98%;
  height: 70%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 238, 174, 0.2), rgba(126, 208, 195, 0.14) 44%, transparent 72%);
  filter: blur(1px);
  transform: translateX(-50%);
  animation: xianAuraBreath 5.8s ease-in-out infinite;
}

.player-avatar.is-casting .character-aura,
.player-avatar.is-patrolling .character-aura {
  animation: xianAuraBreath 1.2s ease-in-out infinite, xianQiBurst 1.2s ease both;
}

.character-aura::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7%;
  width: 86%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.34), transparent 72%);
  filter: blur(8px);
  transform: translateX(-50%);
}

.cultivation-wheel {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  pointer-events: none;
  transform-style: preserve-3d;
  transform: translateX(-50%) rotateX(68deg);
}

.cultivation-wheel::before,
.cultivation-wheel::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 232, 165, 0.32);
  box-shadow:
    0 0 18px rgba(255, 232, 165, 0.18),
    inset 0 0 18px rgba(126, 208, 195, 0.12);
}

.cultivation-wheel::after {
  inset: 24px;
  border-style: dashed;
  border-color: rgba(126, 208, 195, 0.36);
}

.cultivation-wheel i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 232, 165, 0.82);
  box-shadow: 0 0 16px rgba(255, 232, 165, 0.74);
  transform-origin: 0 0;
}

.cultivation-wheel i:nth-child(1) {
  transform: rotate(18deg) translateX(56px);
}

.cultivation-wheel i:nth-child(2) {
  transform: rotate(142deg) translateX(50px);
}

.cultivation-wheel i:nth-child(3) {
  transform: rotate(268deg) translateX(60px);
}

.wheel-back {
  z-index: 2;
  opacity: 0.68;
  animation: cultivationWheelSpin 12s linear infinite, cultivationWheelBreath 4.8s ease-in-out infinite;
}

.wheel-front {
  z-index: 6;
  bottom: 1%;
  width: 136px;
  height: 136px;
  opacity: 0.42;
  animation: cultivationWheelSpinReverse 9s linear infinite, cultivationWheelBreath 4.8s 900ms ease-in-out infinite;
}

.energy-silk {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 16%;
  width: 164px;
  height: 246px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.58;
  filter: blur(0.2px) drop-shadow(0 0 12px rgba(126, 208, 195, 0.26));
  transform-origin: 50% 70%;
}

.energy-silk::before,
.energy-silk::after {
  content: "";
  position: absolute;
  inset: 18px 20px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-left-color: rgba(126, 208, 195, 0.52);
  border-top-color: rgba(255, 232, 165, 0.28);
}

.energy-silk::after {
  inset: 42px 32px;
  border-left-color: rgba(255, 232, 165, 0.42);
  border-top-color: rgba(126, 208, 195, 0.28);
}

.silk-a {
  transform: translateX(-50%) rotate(-18deg);
  animation: energySilkOrbit 6.6s ease-in-out infinite;
}

.silk-b {
  transform: translateX(-50%) rotate(26deg) scaleX(-1);
  animation: energySilkOrbit 7.4s 600ms ease-in-out infinite reverse;
}

.player-avatar.is-casting .cultivation-wheel,
.player-avatar:focus .cultivation-wheel,
.player-avatar:focus-visible .cultivation-wheel {
  animation-duration: 2.4s, 1.05s;
  opacity: 0.9;
}

.player-avatar.is-casting .energy-silk,
.player-avatar:focus .energy-silk,
.player-avatar:focus-visible .energy-silk {
  animation: energySilkCast 1.15s ease both;
}

.character-body {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 96%;
  transform-style: preserve-3d;
  animation: xianBodyIdle 5.8s ease-in-out infinite;
}

.mentor-3d-stage {
  display: grid;
  place-items: center;
}

.mentor-3d-canvas {
  position: relative;
  z-index: 2;
  width: 134%;
  height: 126%;
  margin-left: -17%;
  margin-top: -15%;
  display: block;
  pointer-events: none;
  filter:
    drop-shadow(0 22px 18px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 16px rgba(255, 237, 172, 0.18));
}

.mentor-model-shadow {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 4%;
  width: 62%;
  height: 13%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.16) 42%, transparent 72%);
  filter: blur(6px);
  transform: translateX(-50%);
}

.character-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transform-origin: 50% 100%;
  transition: opacity 220ms ease, transform 260ms ease, filter 220ms ease;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter:
    drop-shadow(0 18px 16px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 8px rgba(255, 237, 172, 0.16));
  animation: spriteClothFloat 4.6s ease-in-out infinite;
}

.player-avatar[data-facing="front"] .character-sprite.view-front {
  opacity: 0;
  filter:
    drop-shadow(0 18px 16px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 8px rgba(255, 237, 172, 0.12));
}

.player-avatar[data-facing="side"] .character-sprite.view-side,
.player-avatar[data-facing="back"] .character-sprite.view-back {
  opacity: 1;
}

.portrait-layer {
  position: absolute;
  z-index: 5;
  display: none;
  overflow: hidden;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 214px 344px;
  background-image: var(--portrait-image);
  background-position: var(--portrait-x, 0) var(--portrait-y, 0);
  will-change: transform, filter, opacity;
}

.player-avatar[data-facing="front"][data-gender="female"] .portrait-female,
.player-avatar[data-facing="front"][data-gender="male"] .portrait-male {
  display: block;
}

.portrait-female {
  --portrait-image: url("./assets/characters/female-front.png");
}

.portrait-male {
  --portrait-image: url("./assets/characters/male-front.png");
}

.portrait-full {
  inset: 0;
  z-index: 4;
  opacity: 1;
  background-position: center bottom;
  background-size: contain;
  filter:
    drop-shadow(0 20px 17px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 12px rgba(255, 237, 172, 0.18));
  transform-origin: 50% 88%;
  animation: portraitWholeIdle 5.6s ease-in-out infinite;
}

.portrait-hair {
  left: 49px;
  top: 0;
  width: 120px;
  height: 154px;
  --portrait-x: -49px;
  --portrait-y: 0;
  transform-origin: 50% 12%;
  animation: portraitHairFloat 4.6s ease-in-out infinite;
}

.portrait-sleeve-left {
  left: 5px;
  top: 77px;
  width: 98px;
  height: 198px;
  --portrait-x: -5px;
  --portrait-y: -77px;
  transform-origin: 82% 16%;
  animation: portraitSleeveLeftFloat 4.8s ease-in-out infinite;
}

.portrait-sleeve-right {
  left: 109px;
  top: 77px;
  width: 98px;
  height: 198px;
  --portrait-x: -109px;
  --portrait-y: -77px;
  transform-origin: 18% 16%;
  animation: portraitSleeveRightFloat 4.8s ease-in-out infinite;
}

.portrait-hem {
  left: 21px;
  top: 168px;
  width: 174px;
  height: 164px;
  --portrait-x: -21px;
  --portrait-y: -168px;
  transform-origin: 50% 8%;
  animation: portraitHemFloat 4.2s ease-in-out infinite;
}

.player-avatar.is-casting .portrait-full,
.player-avatar:focus .portrait-full,
.player-avatar:focus-visible .portrait-full {
  animation: portraitWholeCast 1.15s cubic-bezier(0.18, 0.76, 0.22, 1) both;
}

.player-avatar.is-casting .portrait-hair,
.player-avatar:focus .portrait-hair,
.player-avatar:focus-visible .portrait-hair {
  animation: portraitHairCast 1.15s ease both;
}

.player-avatar.is-casting .portrait-sleeve-left,
.player-avatar:focus .portrait-sleeve-left,
.player-avatar:focus-visible .portrait-sleeve-left {
  animation: portraitSleeveLeftCast 1.15s ease both;
}

.player-avatar.is-casting .portrait-sleeve-right,
.player-avatar:focus .portrait-sleeve-right,
.player-avatar:focus-visible .portrait-sleeve-right {
  animation: portraitSleeveRightCast 1.15s ease both;
}

.player-avatar.free-dragging .portrait-full {
  animation: portraitWholeGlide 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .portrait-hair {
  animation: portraitHairGlide 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .portrait-sleeve-left {
  animation: portraitSleeveLeftGlide 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .portrait-sleeve-right {
  animation: portraitSleeveRightGlide 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .portrait-hem {
  animation: portraitHemGlide 820ms ease-in-out infinite;
}

.rig-layer {
  position: absolute;
  z-index: 5;
  display: none;
  overflow: hidden;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: 214px 344px;
  background-image: var(--rig-image);
  background-position: var(--part-bg-x) var(--part-bg-y);
  filter:
    drop-shadow(0 18px 16px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 8px rgba(255, 237, 172, 0.12));
  will-change: transform;
}

.player-avatar[data-facing="front"][data-gender="female"] .rig-female,
.player-avatar[data-facing="front"][data-gender="male"] .rig-male {
  display: none;
}

.rig-female {
  --rig-image: url("./assets/characters/female-front.png");
}

.rig-male {
  --rig-image: url("./assets/characters/male-front.png");
}

.rig-head {
  left: 68px;
  top: 7px;
  width: 50px;
  height: 61px;
  --part-bg-x: -68px;
  --part-bg-y: -7px;
  transform-origin: 50% 84%;
  animation: xianHeadFloat 4.6s ease-in-out infinite;
}

.rig-hair {
  left: 48px;
  top: 0;
  width: 92px;
  height: 118px;
  --part-bg-x: -48px;
  --part-bg-y: 0;
  transform-origin: 50% 16%;
  animation: xianHairDrift 4.2s ease-in-out infinite;
}

.rig-torso {
  left: 54px;
  top: 63px;
  width: 76px;
  height: 116px;
  --part-bg-x: -54px;
  --part-bg-y: -63px;
  transform-origin: 50% 94%;
  animation: xianTorsoBreath 4.8s ease-in-out infinite;
}

.rig-robe {
  left: 28px;
  top: 118px;
  width: 130px;
  height: 164px;
  --part-bg-x: -28px;
  --part-bg-y: -118px;
  transform-origin: 50% 5%;
  animation: xianRobeFloat 4.4s ease-in-out infinite;
}

.rig-left-sleeve {
  left: 15px;
  top: 69px;
  width: 66px;
  height: 148px;
  --part-bg-x: -15px;
  --part-bg-y: -69px;
  transform-origin: 76% 16%;
  animation: xianLeftSleeveDrift 4.4s ease-in-out infinite;
}

.rig-right-sleeve {
  left: 104px;
  top: 68px;
  width: 66px;
  height: 150px;
  --part-bg-x: -104px;
  --part-bg-y: -68px;
  transform-origin: 24% 16%;
  animation: xianRightSleeveDrift 4.4s ease-in-out infinite;
}

.rig-left-foot {
  left: 59px;
  top: 255px;
  width: 34px;
  height: 31px;
  --part-bg-x: -59px;
  --part-bg-y: -255px;
  transform-origin: 50% 100%;
}

.rig-right-foot {
  left: 91px;
  top: 255px;
  width: 34px;
  height: 31px;
  --part-bg-x: -91px;
  --part-bg-y: -255px;
  transform-origin: 50% 100%;
}

.rig-ribbons {
  left: 22px;
  top: 53px;
  width: 142px;
  height: 142px;
  --part-bg-x: -22px;
  --part-bg-y: -53px;
  transform-origin: 50% 8%;
  animation: xianRibbonFloat 3.8s ease-in-out infinite;
}

.player-avatar.is-casting .rig-head,
.player-avatar:focus-visible .rig-head,
.player-avatar:focus .rig-head {
  animation: rigHeadCast 1.1s ease both;
}

.player-avatar.is-casting .rig-left-sleeve,
.player-avatar:focus-visible .rig-left-sleeve,
.player-avatar:focus .rig-left-sleeve {
  animation: rigLeftSleeveCast 1.1s ease both;
}

.player-avatar.is-casting .rig-right-sleeve,
.player-avatar:focus-visible .rig-right-sleeve,
.player-avatar:focus .rig-right-sleeve {
  animation: rigRightSleeveCast 1.1s ease both;
}

.player-avatar.free-dragging .rig-head {
  animation: xianGlideHead 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-hair,
.player-avatar.free-dragging .rig-ribbons {
  animation: xianGlideHair 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-torso,
.player-avatar.is-patrolling .rig-torso {
  animation: xianGlideTorso 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-left-sleeve,
.player-avatar.is-patrolling .rig-left-sleeve {
  animation: xianGlideLeftSleeve 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-right-sleeve,
.player-avatar.is-patrolling .rig-right-sleeve {
  animation: xianGlideRightSleeve 820ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-left-foot,
.player-avatar.is-patrolling .rig-left-foot {
  animation: rigLeftFootWalk 520ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-right-foot,
.player-avatar.is-patrolling .rig-right-foot {
  animation: rigRightFootWalk 520ms ease-in-out infinite;
}

.player-avatar.free-dragging .rig-robe,
.player-avatar.is-patrolling .rig-robe {
  animation: xianGlideRobe 820ms ease-in-out infinite;
}

.player-avatar[data-gender="female"][data-facing="front"] .sprite-female.view-front,
.player-avatar[data-gender="female"][data-facing="side"] .sprite-female.view-side,
.player-avatar[data-gender="female"][data-facing="back"] .sprite-female.view-back,
.player-avatar[data-gender="male"][data-facing="front"] .sprite-male.view-front,
.player-avatar[data-gender="male"][data-facing="side"] .sprite-male.view-side,
.player-avatar[data-gender="male"][data-facing="back"] .sprite-male.view-back {
  opacity: 1;
}

.player-avatar[data-facing="front"][data-gender="female"] .sprite-female.view-front,
.player-avatar[data-facing="front"][data-gender="male"] .sprite-male.view-front {
  opacity: 0;
}

.player-avatar[data-facing="front"] .character-sprite {
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(22px) scale(1);
}

.player-avatar[data-facing="side"] .character-sprite {
  transform: rotateX(var(--tilt-x)) rotateY(calc(var(--tilt-y) + 10deg)) translateX(2px) translateZ(16px) scale(1.03);
}

.player-avatar[data-facing="back"] .character-sprite {
  transform: rotateX(var(--tilt-x)) rotateY(calc(var(--tilt-y) + 4deg)) translateZ(10px) scale(1.02);
}

.player-avatar.is-patrolling .character-body {
  animation: characterPatrolStep 1.45s cubic-bezier(0.2, 0.82, 0.24, 1) both;
}

.player-avatar.free-dragging .character-body {
  animation: xianGlideBody 820ms ease-in-out infinite;
}

.player-avatar.is-casting .character-body,
.player-avatar.is-talking .character-body,
.player-avatar:focus-visible .character-body,
.player-avatar:focus .character-body {
  animation: characterCastBody 1.15s cubic-bezier(0.18, 0.76, 0.22, 1) both;
}

.player-avatar.is-landing .character-body {
  animation: characterLand 420ms ease both;
}

.player-avatar.is-dragging-left .character-sprite,
.player-avatar.is-looking-left .character-sprite {
  filter:
    drop-shadow(-12px 18px 16px rgba(0, 0, 0, 0.36))
    drop-shadow(0 0 10px rgba(255, 237, 172, 0.18));
}

.player-avatar.is-dragging-right .character-sprite,
.player-avatar.is-looking-right .character-sprite {
  filter:
    drop-shadow(12px 18px 16px rgba(0, 0, 0, 0.36))
    drop-shadow(0 0 10px rgba(255, 237, 172, 0.18));
}

.character-trail,
.character-step,
.character-scroll,
.character-glyph {
  pointer-events: none;
  user-select: none;
}

.character-trail {
  position: absolute;
  z-index: 2;
  left: 10%;
  width: 54%;
  height: 8px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 165, 0.62), rgba(126, 208, 195, 0.24), transparent);
  filter: blur(1px);
}

.trail-a {
  bottom: 28%;
  transform: rotate(-16deg);
}

.trail-b {
  bottom: 16%;
  transform: rotate(10deg);
}

.player-avatar.is-patrolling .trail-a,
.player-avatar.free-dragging .trail-a {
  animation: characterTrailSweep 720ms ease-out infinite;
}

.player-avatar.is-patrolling .trail-b,
.player-avatar.free-dragging .trail-b {
  animation: characterTrailSweep 720ms 120ms ease-out infinite reverse;
}

.character-step {
  position: absolute;
  z-index: 3;
  bottom: 6.5%;
  width: 36px;
  height: 13px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 232, 165, 0.48), rgba(126, 208, 195, 0.18) 38%, transparent 72%);
  filter: blur(1px);
}

.step-a {
  left: 34%;
}

.step-b {
  right: 30%;
}

.player-avatar.is-patrolling .step-a,
.player-avatar.free-dragging .step-a {
  animation: characterStepDust 650ms ease-out infinite;
}

.player-avatar.is-patrolling .step-b,
.player-avatar.free-dragging .step-b {
  animation: characterStepDust 650ms 180ms ease-out infinite;
}

.character-scroll {
  position: absolute;
  z-index: 6;
  right: 1%;
  top: 26%;
  width: 46px;
  height: 76px;
  border: 1px solid rgba(120, 70, 28, 0.34);
  border-radius: 8px;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(117, 61, 29, 0.22), transparent 14%, transparent 86%, rgba(117, 61, 29, 0.22)),
    linear-gradient(180deg, #fff2c4, #d9bc73);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transform: translate3d(18px, 22px, 88px) rotate(-18deg) scale(0.68);
}

.character-scroll::before,
.character-scroll::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  height: 5px;
  border-radius: 999px;
  background: #7f4a26;
}

.character-scroll::before {
  top: -4px;
}

.character-scroll::after {
  bottom: -4px;
}

.character-scroll {
  animation: characterScrollLoop 7.2s ease-in-out infinite;
}

.player-avatar.is-casting .character-scroll,
.player-avatar.is-talking .character-scroll,
.player-avatar:focus-visible .character-scroll,
.player-avatar:focus .character-scroll {
  animation: characterScrollCast 1.15s ease both;
}

.character-glyph {
  position: absolute;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 232, 165, 0.28);
  border-radius: 50%;
  opacity: 0;
  color: var(--gold-soft);
  background: rgba(8, 12, 20, 0.42);
  box-shadow: 0 0 18px rgba(221, 185, 99, 0.24);
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
}

.glyph-a {
  left: 58%;
  top: 18%;
}

.glyph-b {
  left: 72%;
  top: 36%;
}

.glyph-c {
  left: 46%;
  top: 34%;
}

.player-avatar.is-casting .glyph-a,
.player-avatar.is-talking .glyph-a,
.player-avatar:focus-visible .glyph-a,
.player-avatar:focus .glyph-a {
  animation: characterGlyphRise 1.05s ease both;
}

.glyph-a {
  animation: characterGlyphLoop 7.2s ease-in-out infinite;
}

.player-avatar.is-casting .glyph-b,
.player-avatar.is-talking .glyph-b,
.player-avatar:focus-visible .glyph-b,
.player-avatar:focus .glyph-b {
  animation: characterGlyphRise 1.05s 100ms ease both;
}

.glyph-b {
  animation: characterGlyphLoop 7.2s 120ms ease-in-out infinite;
}

.player-avatar.is-casting .glyph-c,
.player-avatar.is-talking .glyph-c,
.player-avatar:focus-visible .glyph-c,
.player-avatar:focus .glyph-c {
  animation: characterGlyphRise 1.05s 190ms ease both;
}

.glyph-c {
  animation: characterGlyphLoop 7.2s 240ms ease-in-out infinite;
}

.character-panel {
  display: none;
}

.gender-controls {
  display: flex;
  gap: 5px;
}

.character-panel button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 50%;
  color: var(--gold-soft);
  background: rgba(255, 232, 165, 0.055);
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
}

.character-panel button.is-active,
.character-panel button:hover {
  color: #211609;
  border-color: transparent;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
}

.map-stronghold {
  position: absolute;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 5px;
  transform: translate(-50%, -50%);
  color: var(--gold-soft);
  font-family: "Noto Sans SC", sans-serif;
  pointer-events: none;
}

.map-stronghold b {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(179, 70, 52, 0.9), rgba(82, 28, 25, 0.96)),
    rgba(0, 0, 0, 0.24);
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.28), 0 0 0 7px rgba(179, 70, 52, 0.08);
}

.map-stronghold span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.62);
  color: rgba(255, 247, 221, 0.78);
  font-size: 0.72rem;
  white-space: nowrap;
}

.map-stronghold.academy {
  left: 18%;
  top: 72%;
}

.map-stronghold.pass {
  left: 54%;
  top: 48%;
}

.map-stronghold.archive {
  left: 82%;
  top: 28%;
}

.encounter-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
}

.level-node {
  position: absolute;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.38);
  border-radius: 50%;
  color: var(--night-deep);
  background: radial-gradient(circle at 32% 25%, #fff0b8 0 12%, transparent 13%), linear-gradient(145deg, #f4d98b, #a76b31);
  box-shadow: 0 0 0 8px rgba(221, 185, 99, 0.1), 0 15px 36px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.level-node span,
.level-node em {
  display: block;
  font-family: "Noto Sans SC", sans-serif;
  font-style: normal;
  line-height: 1;
}

.level-node span {
  font-size: 1rem;
  font-weight: 900;
}

.level-node em {
  margin-top: -7px;
  opacity: 0.72;
  font-size: 0.6rem;
  font-weight: 900;
}

.level-node:hover,
.level-node.is-selected {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 10px rgba(45, 140, 124, 0.14), 0 0 36px rgba(221, 185, 99, 0.22);
}

.level-node.is-selected {
  animation: nodePulse 2.2s ease-in-out infinite;
}

.level-node.is-complete {
  color: #06221f;
  background: radial-gradient(circle at 32% 25%, #fff0b8 0 12%, transparent 13%), linear-gradient(145deg, #7de2c8, var(--jade));
}

.level-node.is-locked {
  width: 42px;
  height: 42px;
  color: rgba(255, 247, 221, 0.58);
  background: linear-gradient(145deg, #5b6470, #242b36);
  filter: grayscale(0.5);
  opacity: 0.58;
}

.level-node.is-locked:hover {
  opacity: 0.86;
}

.level-node.is-distant {
  width: 16px;
  height: 16px;
  color: transparent;
  border-color: rgba(255, 232, 165, 0.18);
  background: radial-gradient(circle, rgba(255, 232, 165, 0.72), rgba(255, 232, 165, 0.12) 62%, transparent 66%);
  box-shadow: 0 0 14px rgba(255, 232, 165, 0.14);
  opacity: 0.5;
}

.level-node.is-distant span,
.level-node.is-distant em {
  display: none;
}

.level-node.is-distant:hover {
  color: transparent;
  opacity: 0.64;
  transform: translateY(-2px) scale(1.12);
}

.level-node.is-next {
  opacity: 0.82;
  border-color: rgba(255, 232, 165, 0.32);
}

.level-node::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  top: 66px;
  width: 120px;
  transform: translateX(-50%);
  color: rgba(255, 247, 221, 0.78);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.level-node.is-selected::after,
.level-node.is-complete::after,
.level-node:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.level-node.is-locked::after {
  opacity: 0;
}

.quest-panel,
.showcase-band,
.codex-band,
.studio-band,
.ai-drawer,
.encounter-dialog {
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 23, 35, 0.76), rgba(12, 17, 28, 0.64));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.quest-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  height: min(650px, calc(100vh - 116px));
  max-height: calc(100vh - 116px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(221, 185, 99, 0.45) rgba(255, 232, 165, 0.06);
}

.quest-panel::-webkit-scrollbar {
  width: 8px;
}

.quest-panel::-webkit-scrollbar-track {
  background: rgba(255, 232, 165, 0.06);
}

.quest-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(221, 185, 99, 0.45);
}

.panel-head,
.band-head,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quest-type {
  padding: 6px 10px;
  border: 1px solid rgba(45, 140, 124, 0.38);
  border-radius: 999px;
  color: #a8f1df;
  background: rgba(45, 140, 124, 0.12);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 800;
}

.quest-story {
  min-height: 76px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 232, 165, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.055), rgba(45, 140, 124, 0.035)),
    rgba(0, 0, 0, 0.1);
}

.operation-timeline {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.operation-timeline button {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.operation-timeline button:hover,
.operation-timeline button.is-active,
.operation-timeline button.is-flashing {
  color: var(--white);
  border-color: rgba(255, 232, 165, 0.22);
  background: rgba(255, 232, 165, 0.06);
  transform: translateX(2px);
}

.operation-timeline b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #211609;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  font-family: var(--font-ui);
  font-size: 0.72rem;
}

.operation-timeline span,
.operation-timeline em,
.operation-timeline small {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.operation-timeline span {
  color: var(--gold-soft);
  font-weight: 900;
  font-size: 0.82rem;
}

.operation-timeline em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.7rem;
}

.operation-timeline small {
  padding: 4px 7px;
  border: 1px solid rgba(45, 140, 124, 0.28);
  border-radius: 999px;
  color: #a8f1df;
  background: rgba(45, 140, 124, 0.1);
  font-size: 0.66rem;
}

.quest-objectives {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.quest-objectives span {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.quest-objectives b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17221c;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
}

.quest-objectives .is-active {
  border-color: rgba(255, 232, 165, 0.28);
  color: var(--white);
  box-shadow: inset 0 0 22px rgba(221, 185, 99, 0.05);
}

.academy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.academy-building {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 3px 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.075), rgba(45, 140, 124, 0.045)),
    rgba(0, 0, 0, 0.08);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.academy-building:hover {
  transform: translateY(-2px);
  border-color: rgba(221, 185, 99, 0.34);
  background: rgba(255, 232, 165, 0.08);
}

.academy-building b {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-size: 1rem;
}

.academy-building span,
.academy-building em {
  min-width: 0;
  display: block;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.academy-building span {
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 900;
}

.academy-building em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.7rem;
}

.academy-building.is-locked {
  filter: grayscale(0.8);
  opacity: 0.56;
}

.dispatch-panel {
  margin-bottom: 0;
  padding: 11px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.dispatch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  font-family: var(--font-ui);
}

.dispatch-head span {
  color: var(--gold-soft);
  font-weight: 900;
}

.dispatch-head strong {
  padding: 4px 8px;
  border: 1px solid rgba(45, 140, 124, 0.3);
  border-radius: 999px;
  color: #bdf6e8;
  background: rgba(45, 140, 124, 0.1);
  font-size: 0.74rem;
}

.agent-list {
  display: grid;
  gap: 8px;
}

.agent-card {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 232, 165, 0.045);
  cursor: grab;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.agent-card:hover {
  transform: translateX(3px);
  border-color: rgba(221, 185, 99, 0.34);
}

.agent-card b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #10231f;
  background: linear-gradient(145deg, #a8f1df, var(--jade));
}

.agent-card strong,
.agent-card em {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.agent-card strong {
  color: var(--white);
  font-size: 0.84rem;
}

.agent-card em {
  margin-top: 2px;
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.7rem;
}

.agent-card.is-locked {
  cursor: default;
  filter: grayscale(0.9);
  opacity: 0.48;
}

.action-wheel {
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(221, 185, 99, 0.18) 0 26%, transparent 27%),
    conic-gradient(from 45deg, rgba(45, 140, 124, 0.18), transparent 20%, rgba(179, 70, 52, 0.18), transparent 62%, rgba(221, 185, 99, 0.18));
  box-shadow: inset 0 0 30px rgba(221, 185, 99, 0.08);
  transition: transform 180ms ease, border-color 180ms ease;
}

.action-wheel.is-over {
  transform: scale(1.04);
  border-color: rgba(255, 232, 165, 0.5);
}

.wheel-core {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-weight: 900;
}

.action-wheel i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(221, 185, 99, 0.65);
}

.action-wheel i:nth-child(2) {
  top: 26px;
}

.action-wheel i:nth-child(3) {
  right: 29px;
  bottom: 44px;
}

.action-wheel i:nth-child(4) {
  left: 29px;
  bottom: 44px;
}

.action-deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 0;
}

.action-token {
  min-width: 0;
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 232, 165, 0.06);
  cursor: grab;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.action-token:hover {
  transform: translateY(-3px);
  border-color: rgba(221, 185, 99, 0.38);
  background: rgba(255, 232, 165, 0.095);
}

.action-token span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #16221d;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  font-weight: 900;
}

.action-token strong {
  font-family: var(--font-ui);
  font-size: 0.8rem;
}

.quest-feed {
  min-height: 66px;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.14);
  font-family: var(--font-ui);
  line-height: 1.7;
}

.quest-feed strong {
  color: var(--gold-soft);
}

.inventory-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
}

.inventory-strip span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 232, 165, 0.045);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-strip b {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #211609;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
}

.showcase-band,
.codex-band,
.studio-band {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto 28px;
  padding: clamp(18px, 3vw, 34px);
}

.feature-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 28px;
  align-items: stretch;
  margin-top: 26px;
}

.realm-tabs,
.codex-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.realm-tabs button,
.codex-filter button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  border-color: rgba(255, 232, 165, 0.14);
  background: rgba(255, 232, 165, 0.045);
  font-family: "Noto Sans SC", sans-serif;
}

.realm-tabs button.is-active,
.codex-filter button.is-active {
  color: #17221c;
  border-color: transparent;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
}

.realm-copy {
  min-height: 320px;
  padding: 22px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.045);
}

.realm-copy ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
}

.realm-copy li {
  padding-left: 18px;
  position: relative;
}

.realm-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.device-frame {
  min-height: 360px;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 232, 165, 0.11), rgba(0, 0, 0, 0.18));
}

.character-sheet,
.mentor-model-card {
  min-width: 0;
  min-height: 360px;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 232, 165, 0.1), rgba(0, 0, 0, 0.16)),
    rgba(255, 232, 165, 0.04);
}

.character-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-family: "Noto Sans SC", sans-serif;
}

.character-sheet-head span {
  color: rgba(255, 247, 221, 0.58);
  font-size: 0.78rem;
}

.character-sheet-head strong {
  color: var(--gold-soft);
}

.character-sheet img {
  width: 100%;
  height: calc(100% - 34px);
  min-height: 300px;
  display: block;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: #f3e3bd;
}

.mentor-showcase-stage {
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(126, 208, 195, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(255, 247, 221, 0.06), rgba(8, 12, 20, 0.3)),
    rgba(8, 12, 20, 0.44);
}

.mentor-showcase-canvas {
  width: 100%;
  height: 310px;
  display: block;
}

.mentor-model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.mentor-model-tags span {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 999px;
  color: rgba(255, 247, 221, 0.72);
  background: rgba(255, 232, 165, 0.045);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 800;
}

.mini-map {
  height: 100%;
  min-height: 330px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 70% 14%, rgba(255, 238, 172, 0.2), transparent 26%),
    linear-gradient(180deg, rgba(14, 30, 34, 0.96), rgba(9, 13, 18, 0.98));
  position: relative;
}

.mini-map::before {
  content: "";
  position: absolute;
  inset: auto -18% 0;
  height: 70%;
  clip-path: polygon(0 85%, 12% 58%, 24% 72%, 36% 35%, 48% 68%, 62% 28%, 76% 70%, 90% 44%, 100% 62%, 100% 100%, 0 100%);
  background: rgba(45, 140, 124, 0.32);
}

.mini-node {
  position: absolute;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b1208;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 26px rgba(221, 185, 99, 0.22);
}

.codex-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.codex-card,
.studio-card {
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.055);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.codex-card {
  min-height: 176px;
  padding: 16px;
  cursor: grab;
  position: relative;
  overflow: hidden;
}

.codex-card::before {
  content: "";
  position: absolute;
  inset: -36px -28px auto auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(221, 185, 99, 0.1);
}

.codex-card.is-locked {
  filter: grayscale(0.86);
  opacity: 0.58;
}

.codex-glyph {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.18);
  font-size: 1.6rem;
}

.codex-type,
.studio-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #a8f1df;
  background: rgba(45, 140, 124, 0.12);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.codex-card h3,
.studio-card h3 {
  margin: 0 0 6px;
}

.codex-card p,
.studio-card p {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.studio-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.studio-column {
  min-height: 260px;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.11);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.035);
}

.studio-column.is-over {
  border-color: rgba(221, 185, 99, 0.48);
  background: rgba(221, 185, 99, 0.08);
}

.studio-card {
  padding: 13px;
  margin-bottom: 10px;
  cursor: grab;
}

.ai-drawer {
  position: fixed;
  z-index: 30;
  top: 86px;
  right: 18px;
  width: min(370px, calc(100vw - 36px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 18px;
  transform: translateX(calc(100% + 28px));
  transition: transform 240ms ease;
}

.ai-drawer.is-open {
  transform: translateX(0);
}

.mentor-quick-panel {
  position: fixed;
  inset: 0;
  z-index: 72;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 7, 12, 0.16);
  transition: opacity 160ms ease, visibility 160ms ease;
}

.mentor-quick-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.mentor-quick-card {
  position: fixed;
  left: 214px;
  bottom: 28px;
  width: min(390px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 232, 165, 0.22);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.1), rgba(45, 140, 124, 0.08)),
    rgba(9, 13, 21, 0.96);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
  transform: translateY(10px) scale(0.98);
  transform-origin: 0 100%;
  transition: transform 180ms ease;
}

.mentor-quick-panel.is-open .mentor-quick-card {
  transform: translateY(0) scale(1);
}

.mentor-quick-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.mentor-quick-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.3);
  border-radius: 8px;
  color: var(--gold-soft);
  background: linear-gradient(145deg, var(--cinnabar), #68231e);
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
}

.mentor-quick-head h2 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.mentor-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mentor-quick-grid button {
  min-width: 0;
  min-height: 78px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 232, 165, 0.045);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.mentor-quick-grid button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 232, 165, 0.34);
  background: rgba(126, 208, 195, 0.08);
}

.mentor-quick-grid b {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #17221c;
  background: linear-gradient(145deg, #a8f1df, var(--jade));
}

.mentor-quick-grid span,
.mentor-quick-grid em {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-ui);
  font-style: normal;
}

.mentor-quick-grid span {
  color: var(--gold-soft);
  font-size: 0.86rem;
  font-weight: 900;
}

.mentor-quick-grid em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.68rem;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-color: rgba(255, 232, 165, 0.16);
  color: var(--gold-soft);
  background: rgba(255, 232, 165, 0.055);
  font-size: 1.2rem;
}

.term-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.term-cloud button {
  min-height: 34px;
  border: 1px solid rgba(45, 140, 124, 0.28);
  border-radius: 999px;
  color: #a8f1df;
  background: rgba(45, 140, 124, 0.12);
  cursor: pointer;
  padding: 0 12px;
  font-family: "Noto Sans SC", sans-serif;
}

.ai-input {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
}

.ai-input input {
  min-height: 44px;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
}

.ai-answer {
  min-height: 150px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.encounter-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  color: var(--white);
}

.encounter-dialog::backdrop {
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.encounter-shell {
  position: relative;
  display: grid;
  grid-template-columns: 0.62fr 1.38fr;
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
}

.dialog-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
}

.encounter-visual {
  min-height: 560px;
  padding: 18px 16px 18px 18px;
}

.encounter-bg {
  position: sticky;
  top: 18px;
  height: calc(100vh - 94px);
  max-height: 640px;
  min-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 62% 22%, rgba(255, 238, 172, 0.24), transparent 24%),
    url("./assets/ink-bg.png") center / cover;
}

.encounter-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 24, 0.08), rgba(8, 10, 14, 0.7));
}

.npc-figure {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16%;
  width: 150px;
  height: 190px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 232, 165, 0.28);
  border-radius: 80px 80px 24px 24px;
  color: var(--gold-soft);
  background: linear-gradient(180deg, rgba(38, 63, 61, 0.95), rgba(12, 20, 22, 0.95));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.34);
  font-size: 4rem;
}

.floating-scroll {
  position: absolute;
  z-index: 3;
  right: 12%;
  top: 22%;
  width: 72px;
  height: 116px;
  border: 1px solid rgba(255, 232, 165, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #f5e0ac, #9e7841);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  animation: floatScroll 3.8s ease-in-out infinite;
}

.floating-scroll.small {
  right: auto;
  left: 16%;
  top: 34%;
  width: 54px;
  height: 88px;
  animation-duration: 4.6s;
}

.encounter-play {
  padding: 30px 24px 24px 4px;
}

.encounter-story {
  margin: 14px 0;
}

.operation-brief {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(221, 185, 99, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(221, 185, 99, 0.12), rgba(45, 140, 124, 0.06)),
    rgba(0, 0, 0, 0.12);
}

.operation-brief span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #1e1609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.operation-brief p {
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.7;
}

.encounter-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.encounter-steps span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 232, 165, 0.04);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.encounter-steps b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(255, 247, 221, 0.72);
  background: rgba(255, 232, 165, 0.1);
}

.encounter-steps .is-active {
  color: var(--gold-soft);
  border-color: rgba(221, 185, 99, 0.38);
  background: rgba(221, 185, 99, 0.1);
}

.encounter-steps .is-done {
  color: #b4f4df;
  border-color: rgba(45, 140, 124, 0.34);
  background: rgba(45, 140, 124, 0.1);
}

.encounter-steps .is-done b {
  color: #11221e;
  background: linear-gradient(145deg, #a8f1df, var(--jade));
}

.loadout-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-family: "Noto Sans SC", sans-serif;
}

.subhead span {
  color: var(--gold-soft);
  font-size: 0.86rem;
  font-weight: 900;
}

.subhead em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.72rem;
  font-style: normal;
}

.encounter-agents,
.strategy-slots {
  display: grid;
  gap: 8px;
}

.loadout-agent,
.strategy-card,
.scout-point,
.advisor-card {
  min-width: 0;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 232, 165, 0.045);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.loadout-agent,
.strategy-card {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.loadout-agent:hover,
.strategy-card:hover,
.scout-point:hover,
.advisor-card:hover {
  transform: translateY(-2px);
  border-color: rgba(221, 185, 99, 0.34);
  background: rgba(255, 232, 165, 0.075);
}

.loadout-agent.is-selected,
.strategy-card.is-selected,
.advisor-card.is-selected {
  border-color: rgba(45, 140, 124, 0.42);
  background: rgba(45, 140, 124, 0.12);
  box-shadow: inset 0 0 28px rgba(45, 140, 124, 0.08);
}

.loadout-agent:disabled,
.strategy-card:disabled,
.scout-point:disabled,
.advisor-card:disabled,
.sort-card button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.82);
  opacity: 0.48;
  transform: none;
}

.loadout-agent b,
.strategy-card b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
}

.loadout-agent strong,
.loadout-agent em,
.strategy-card strong,
.strategy-card em {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-family: "Noto Sans SC", sans-serif;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.loadout-agent strong,
.strategy-card strong {
  color: var(--white);
  font-size: 0.82rem;
}

.loadout-agent em,
.strategy-card em {
  margin-top: 2px;
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.68rem;
}

.npc-dialogue {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 232, 165, 0.045);
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.65;
}

.npc-dialogue strong {
  color: var(--gold-soft);
  white-space: nowrap;
}

.scroll-text {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.scroll-text strong {
  color: var(--gold-soft);
}

.mission-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.scout-board,
.clue-sort-board,
.advisor-board {
  margin-bottom: 12px;
  padding: 11px;
  border: 1px solid rgba(255, 232, 165, 0.11);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.13);
}

.scout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scout-point {
  min-height: 62px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
}

.scout-point b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-size: 0.78rem;
}

.scout-point span {
  min-width: 0;
  overflow: hidden;
  color: var(--white);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scout-point.is-done {
  border-color: rgba(45, 140, 124, 0.38);
  background: rgba(45, 140, 124, 0.11);
}

.sort-grid {
  display: grid;
  gap: 8px;
}

.sort-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 232, 165, 0.1);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.035);
}

.sort-card.is-sorted {
  border-color: rgba(45, 140, 124, 0.28);
}

.sort-card p {
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
}

.sort-card div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.sort-card button {
  min-height: 30px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 232, 165, 0.045);
  cursor: pointer;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
}

.sort-card button.is-selected {
  color: #17221c;
  border-color: transparent;
  background: linear-gradient(145deg, #a8f1df, var(--jade));
}

.advisor-list {
  display: grid;
  gap: 8px;
}

.advisor-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px 10px;
  text-align: left;
}

.advisor-card strong {
  color: var(--gold-soft);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.8rem;
  white-space: nowrap;
}

.advisor-card span {
  color: var(--muted);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.78rem;
  line-height: 1.55;
}

.riddle-board {
  display: grid;
  grid-template-columns: 1fr 136px;
  gap: 12px;
  align-items: stretch;
}

.clue-rack {
  display: grid;
  gap: 10px;
}

.clue-card {
  min-height: 64px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 232, 165, 0.13);
  border-radius: 8px;
  color: var(--white);
  background: rgba(255, 232, 165, 0.055);
  cursor: grab;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.clue-card:hover {
  transform: translateY(-2px);
  border-color: rgba(221, 185, 99, 0.42);
}

.rune-plate {
  min-height: 210px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 165, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(221, 185, 99, 0.16), transparent 42%),
    conic-gradient(from 45deg, transparent, rgba(45, 140, 124, 0.18), transparent, rgba(179, 70, 52, 0.16), transparent);
}

.rune-plate.is-over {
  border-color: rgba(221, 185, 99, 0.55);
  box-shadow: inset 0 0 34px rgba(221, 185, 99, 0.08);
}

.rune-plate span {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b1208;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  font-size: 2rem;
  font-weight: 900;
}

.encounter-feedback {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.16);
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.7;
}

.encounter-feedback.is-good {
  color: #b4f4df;
  border-color: rgba(45, 140, 124, 0.34);
  background: rgba(45, 140, 124, 0.1);
}

.encounter-feedback.is-bad {
  color: #ffd5c9;
  border-color: rgba(179, 70, 52, 0.34);
  background: rgba(179, 70, 52, 0.1);
}

.reward-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(221, 185, 99, 0.22);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(221, 185, 99, 0.1), rgba(45, 140, 124, 0.08));
  font-family: "Noto Sans SC", sans-serif;
}

.reward-preview span {
  color: rgba(255, 247, 221, 0.56);
  font-size: 0.76rem;
}

.reward-preview strong {
  color: var(--gold-soft);
  font-size: 0.88rem;
  text-align: right;
}

.battle-report {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 232, 165, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 140, 124, 0.11), rgba(179, 70, 52, 0.08)),
    rgba(0, 0, 0, 0.14);
  overflow: hidden;
  font-family: "Noto Sans SC", sans-serif;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 232, 165, 0.1);
}

.report-head span {
  color: rgba(255, 247, 221, 0.64);
  font-size: 0.78rem;
}

.report-head strong {
  color: var(--gold-soft);
  letter-spacing: 0.12em;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-grid span {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid rgba(255, 232, 165, 0.08);
}

.report-grid span:last-child {
  border-right: 0;
}

.report-grid em,
.report-grid b {
  display: block;
  overflow: hidden;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.report-grid em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.68rem;
}

.report-grid b {
  margin-top: 4px;
  color: var(--white);
  font-size: 0.84rem;
}

.mentor-select {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 38px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(179, 70, 52, 0.18), transparent 28%),
    radial-gradient(circle at 76% 16%, rgba(45, 140, 124, 0.18), transparent 30%),
    rgba(4, 7, 12, 0.76);
  backdrop-filter: blur(18px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.mentor-select.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.mentor-select-panel {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255, 232, 165, 0.26);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.1), rgba(45, 140, 124, 0.08)),
    linear-gradient(180deg, rgba(14, 20, 30, 0.98), rgba(7, 10, 16, 0.98));
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 247, 221, 0.04);
}

.mentor-select-head {
  max-width: 680px;
  margin-bottom: 20px;
}

.mentor-select-head h2 {
  margin: 2px 0 8px;
  color: var(--gold-soft);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.12;
}

.mentor-select-head span {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.75;
}

.mentor-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mentor-choice-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 232, 165, 0.18);
  border-radius: 8px;
  color: var(--white);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 232, 165, 0.12), transparent 34%),
    rgba(255, 232, 165, 0.045);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mentor-choice-card:hover,
.mentor-choice-card.is-active {
  transform: translateY(-3px);
  border-color: rgba(255, 232, 165, 0.48);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 232, 165, 0.18), transparent 38%),
    rgba(126, 208, 195, 0.07);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 232, 165, 0.08);
}

.mentor-choice-views {
  min-height: 330px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 221, 0.08), transparent 42%),
    radial-gradient(circle at 50% 24%, rgba(126, 208, 195, 0.18), transparent 46%),
    rgba(8, 12, 20, 0.42);
}

.mentor-choice-canvas {
  width: 100%;
  height: 330px;
  display: block;
  filter:
    drop-shadow(0 16px 16px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 8px rgba(255, 237, 172, 0.14));
}

.mentor-choice-canvas {
  height: 300px;
}

.mentor-choice-card strong {
  color: var(--gold-soft);
  font-size: 1.28rem;
}

.mentor-choice-card span {
  min-height: 3.2em;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.62;
}

.mentor-choice-card em {
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  justify-self: start;
  padding: 0 14px;
  border: 1px solid rgba(255, 232, 165, 0.2);
  border-radius: 8px;
  color: #211609;
  background: linear-gradient(145deg, #fff0b8, var(--gold));
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 900;
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 7, 12, 0.58);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.guide-overlay.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.guide-spotlight {
  position: fixed;
  left: 0;
  top: 0;
  width: 120px;
  height: 80px;
  border: 1px solid rgba(255, 232, 165, 0.72);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.04);
  box-shadow:
    0 0 0 9999px rgba(4, 7, 12, 0.58),
    0 0 32px rgba(255, 232, 165, 0.28),
    inset 0 0 22px rgba(126, 208, 195, 0.12);
  pointer-events: none;
  transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease;
}

.guide-panel {
  position: fixed;
  z-index: 82;
  left: 18px;
  top: 18px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(255, 232, 165, 0.24);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(145deg, rgba(255, 232, 165, 0.09), rgba(45, 140, 124, 0.07)),
    rgba(10, 14, 23, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
  transition: left 220ms ease, top 220ms ease;
}

.guide-panel h2 {
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: 1.35rem;
}

.guide-mentor-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid rgba(255, 232, 165, 0.12);
  border-radius: 8px;
  background: rgba(255, 232, 165, 0.045);
}

.guide-mentor-line img {
  width: 44px;
  height: 54px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.42);
}

.guide-mentor-line strong,
.guide-mentor-line em {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-ui);
  font-style: normal;
}

.guide-mentor-line strong {
  color: var(--gold-soft);
  font-size: 0.88rem;
}

.guide-mentor-line em {
  color: rgba(255, 247, 221, 0.52);
  font-size: 0.72rem;
}

.guide-panel p:not(.eyebrow) {
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-ui);
  line-height: 1.7;
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.guide-progress span {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 232, 165, 0.16);
}

.guide-progress span.is-active {
  background: linear-gradient(90deg, var(--jade), var(--gold));
  box-shadow: 0 0 14px rgba(221, 185, 99, 0.32);
}

.guide-progress span.is-done {
  background: rgba(126, 208, 195, 0.42);
}

.guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.guide-actions button {
  min-height: 38px;
  padding: 0 14px;
}

.guide-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.guide-target {
  position: relative;
  z-index: 81 !important;
  filter: drop-shadow(0 0 18px rgba(255, 232, 165, 0.32));
}

.toast-stack {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 232, 165, 0.22);
  border-radius: 8px;
  color: var(--white);
  background: rgba(9, 12, 18, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  font-family: "Noto Sans SC", sans-serif;
  animation: toastIn 220ms ease both;
}

.drag-ghost {
  opacity: 0.38;
}

.free-dragging {
  z-index: 20;
  cursor: grabbing;
}

@keyframes mistDrift {
  from {
    transform: translateX(-28px);
  }
  to {
    transform: translateX(46px);
  }
}

@keyframes routeMove {
  to {
    filter: hue-rotate(20deg);
  }
}

@keyframes floatScroll {
  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }
  50% {
    transform: translateY(-14px) rotate(3deg);
  }
}

@keyframes nodePulse {
  0%,
  100% {
    box-shadow: 0 0 0 8px rgba(221, 185, 99, 0.1), 0 15px 36px rgba(0, 0, 0, 0.32);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(221, 185, 99, 0.04), 0 0 42px rgba(221, 185, 99, 0.26);
  }
}

@keyframes characterBreathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.012);
  }
}

@keyframes xianBodyIdle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
  38% {
    transform: translate3d(0, -9px, 28px) rotateZ(-0.6deg) scale(1.012);
  }
  68% {
    transform: translate3d(0, -4px, 18px) rotateZ(0.45deg) scale(1.006);
  }
}

@keyframes xianGlideBody {
  0%,
  100% {
    transform: translate3d(0, -4px, 20px) rotateZ(calc(var(--drag-lean, 0deg) * 0.42)) scale(1.012);
  }
  50% {
    transform: translate3d(calc(var(--walk-x, 1) * 4px), -13px, 42px) rotateZ(calc(var(--drag-lean, 0deg) * 0.74)) scale(1.026);
  }
}

@keyframes portraitWholeIdle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(1);
    filter:
      drop-shadow(0 20px 17px rgba(0, 0, 0, 0.34))
      drop-shadow(0 0 10px rgba(255, 237, 172, 0.16));
  }
  46% {
    transform: translate3d(0, -8px, 26px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) scale(1.012);
    filter:
      drop-shadow(0 23px 20px rgba(0, 0, 0, 0.3))
      drop-shadow(0 0 16px rgba(126, 208, 195, 0.2));
  }
}

@keyframes portraitWholeCast {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    filter:
      drop-shadow(0 20px 17px rgba(0, 0, 0, 0.34))
      drop-shadow(0 0 10px rgba(255, 237, 172, 0.16));
  }
  34% {
    transform: translate3d(0, 8px, 8px) scale(0.992);
  }
  68% {
    transform: translate3d(0, -18px, 44px) scale(1.035);
    filter:
      drop-shadow(0 26px 22px rgba(0, 0, 0, 0.26))
      drop-shadow(0 0 24px rgba(255, 232, 165, 0.34));
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes portraitWholeGlide {
  0%,
  100% {
    transform: translate3d(0, -4px, 22px) rotateZ(calc(var(--drag-lean, 0deg) * 0.36)) scale(1.006);
  }
  50% {
    transform: translate3d(calc(var(--walk-x, 1) * 4px), -12px, 42px) rotateZ(calc(var(--drag-lean, 0deg) * 0.62)) scale(1.018);
  }
}

@keyframes portraitHairFloat {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg) skewX(0deg);
  }
  50% {
    transform: translateX(5px) translateY(-5px) rotate(1.2deg) skewX(-3deg);
  }
}

@keyframes portraitHairCast {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  60% {
    transform: translateX(8px) translateY(-14px) rotate(4deg) skewX(-6deg);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
}

@keyframes portraitHairGlide {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -8px)) translateY(-2px) rotate(calc(var(--walk-x, 1) * -2deg)) skewX(calc(var(--walk-x, 1) * -3deg));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -15px)) translateY(-9px) rotate(calc(var(--walk-x, 1) * -5deg)) skewX(calc(var(--walk-x, 1) * -7deg));
  }
}

@keyframes portraitSleeveLeftFloat {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-4deg) translate(-3px, -6px);
  }
}

@keyframes portraitSleeveRightFloat {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(4deg) translate(3px, -6px);
  }
}

@keyframes portraitSleeveLeftCast {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  68% {
    transform: rotate(-24deg) translate(-10px, -18px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes portraitSleeveRightCast {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  68% {
    transform: rotate(24deg) translate(10px, -18px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes portraitSleeveLeftGlide {
  0%,
  100% {
    transform: rotate(calc(var(--walk-x, 1) * -5deg)) translate(calc(var(--walk-x, 1) * -4px), -3px);
  }
  50% {
    transform: rotate(calc(var(--walk-x, 1) * -14deg)) translate(calc(var(--walk-x, 1) * -10px), -10px);
  }
}

@keyframes portraitSleeveRightGlide {
  0%,
  100% {
    transform: rotate(calc(var(--walk-x, 1) * 5deg)) translate(calc(var(--walk-x, 1) * -3px), -3px);
  }
  50% {
    transform: rotate(calc(var(--walk-x, 1) * 14deg)) translate(calc(var(--walk-x, 1) * -10px), -10px);
  }
}

@keyframes portraitHemFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scaleX(1);
  }
  50% {
    transform: translateY(-6px) rotate(1.5deg) scaleX(1.025);
  }
}

@keyframes portraitHemGlide {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -5px)) translateY(-2px) rotate(calc(var(--walk-x, 1) * -2deg)) scaleX(1.03);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -13px)) translateY(-9px) rotate(calc(var(--walk-x, 1) * -6deg)) scaleX(1.065);
  }
}

@keyframes cultivationShadowPulse {
  0%,
  100% {
    opacity: 0.7;
    transform: translateX(-50%) scaleX(1);
  }
  50% {
    opacity: 0.38;
    transform: translateX(-50%) scaleX(0.78);
  }
}

@keyframes xianAuraBreath {
  0%,
  100% {
    opacity: 0.66;
    transform: translateX(-50%) scale(0.96);
    filter: blur(1px) brightness(1);
  }
  50% {
    opacity: 0.92;
    transform: translateX(-50%) scale(1.08);
    filter: blur(0.4px) brightness(1.2);
  }
}

@keyframes xianQiBurst {
  0% {
    filter: blur(1px) brightness(1);
  }
  44% {
    filter: blur(0.2px) brightness(1.55);
  }
  100% {
    filter: blur(1px) brightness(1.08);
  }
}

@keyframes cultivationWheelSpin {
  from {
    transform: translateX(-50%) rotateX(68deg) rotateZ(0deg);
  }
  to {
    transform: translateX(-50%) rotateX(68deg) rotateZ(360deg);
  }
}

@keyframes cultivationWheelSpinReverse {
  from {
    transform: translateX(-50%) rotateX(68deg) rotateZ(360deg);
  }
  to {
    transform: translateX(-50%) rotateX(68deg) rotateZ(0deg);
  }
}

@keyframes cultivationWheelBreath {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(126, 208, 195, 0.18));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 232, 165, 0.3));
  }
}

@keyframes energySilkOrbit {
  0%,
  100% {
    opacity: 0.42;
    transform: translateX(-50%) rotate(-18deg) translateY(0) scale(0.96);
  }
  50% {
    opacity: 0.82;
    transform: translateX(-50%) rotate(14deg) translateY(-12px) scale(1.04);
  }
}

@keyframes energySilkCast {
  0% {
    opacity: 0.35;
    transform: translateX(-50%) rotate(-24deg) scale(0.88);
  }
  45% {
    opacity: 0.95;
    transform: translateX(-50%) rotate(18deg) translateY(-18px) scale(1.16);
  }
  100% {
    opacity: 0.5;
    transform: translateX(-50%) rotate(62deg) translateY(-34px) scale(0.92);
  }
}

@keyframes characterGroundPulse {
  0%,
  100% {
    opacity: 0.78;
    transform: translateX(-50%) scaleX(1);
  }
  50% {
    opacity: 0.48;
    transform: translateX(-50%) scaleX(0.88);
  }
}

@keyframes characterBodyIdle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
  35% {
    transform: translate3d(0, -4px, 14px) rotateZ(-0.5deg) scale(1.008);
  }
  70% {
    transform: translate3d(0, -1px, 8px) rotateZ(0.4deg) scale(1.004);
  }
}

@keyframes characterBodyActionLoop {
  0%,
  15%,
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
  24% {
    transform: translate3d(0, -5px, 16px) rotateZ(-0.8deg) scale(1.01);
  }
  36% {
    transform: translate3d(16px, -24px, 58px) rotateZ(3.4deg) scale(1.065);
  }
  47% {
    transform: translate3d(30px, -8px, 36px) rotateZ(-2deg) scale(1.02);
  }
  58% {
    transform: translate3d(8px, -14px, 42px) rotateZ(2deg) scale(1.035);
  }
  68% {
    transform: translate3d(0, 8px, 0) rotateZ(0deg) scale(0.985, 1.012);
  }
  78% {
    transform: translate3d(0, -2px, 12px) rotateZ(-0.4deg) scale(1.006);
  }
}

@keyframes characterPatrolStep {
  0% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
  18% {
    transform: translate3d(13px, -16px, 42px) rotateZ(-3deg) scale(1.04);
  }
  42% {
    transform: translate3d(34px, -7px, 34px) rotateZ(2deg) scale(1.015);
  }
  66% {
    transform: translate3d(15px, -13px, 34px) rotateZ(2.6deg) scale(1.035);
  }
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes characterDragWalk {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotateZ(calc(var(--walk-x, 1) * -1.2deg)) scale(1.01);
  }
  25% {
    transform: translate3d(calc(var(--walk-x, 1) * 5px), -8px, 26px) rotateZ(calc(var(--walk-x, 1) * 2.4deg)) scale(1.035);
  }
  50% {
    transform: translate3d(calc(var(--walk-x, 1) * 9px), -1px, 20px) rotateZ(calc(var(--walk-x, 1) * 1.1deg)) scale(1.018);
  }
  75% {
    transform: translate3d(calc(var(--walk-x, 1) * 3px), -7px, 22px) rotateZ(calc(var(--walk-x, 1) * -2.2deg)) scale(1.03);
  }
}

@keyframes characterCastBody {
  0% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
  18% {
    transform: translate3d(0, 10px, 12px) rotateZ(-1.4deg) scale(0.985);
  }
  42% {
    transform: translate3d(0, -24px, 58px) rotateZ(3.2deg) scale(1.065);
  }
  66% {
    transform: translate3d(0, -14px, 38px) rotateZ(-2deg) scale(1.035);
  }
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg) scale(1);
  }
}

@keyframes characterLand {
  0% {
    transform: translate3d(0, -10px, 22px) scale(1.035);
  }
  48% {
    transform: translate3d(0, 7px, 0) scale(0.985, 1.012);
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes characterTrailSweep {
  0% {
    opacity: 0;
    transform: translateX(-24px) rotate(-14deg) scaleX(0.35);
  }
  35% {
    opacity: 0.78;
  }
  100% {
    opacity: 0;
    transform: translateX(38px) rotate(-14deg) scaleX(1.15);
  }
}

@keyframes characterStepDust {
  0% {
    opacity: 0.68;
    transform: translateY(0) scale(0.35);
  }
  100% {
    opacity: 0;
    transform: translateY(8px) scale(1.5);
  }
}

@keyframes characterScrollCast {
  0% {
    opacity: 0;
    transform: translate3d(18px, 22px, 88px) rotate(-18deg) scale(0.68);
  }
  28% {
    opacity: 1;
    transform: translate3d(-4px, -8px, 96px) rotate(8deg) scale(0.95);
  }
  72% {
    opacity: 1;
    transform: translate3d(-20px, -42px, 108px) rotate(22deg) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate3d(-34px, -62px, 80px) rotate(42deg) scale(0.7);
  }
}

@keyframes characterScrollLoop {
  0%,
  24%,
  76%,
  100% {
    opacity: 0;
    transform: translate3d(18px, 22px, 88px) rotate(-18deg) scale(0.68);
  }
  36% {
    opacity: 1;
    transform: translate3d(-2px, -8px, 96px) rotate(8deg) scale(0.95);
  }
  52% {
    opacity: 0.94;
    transform: translate3d(-20px, -38px, 108px) rotate(22deg) scale(1.06);
  }
  68% {
    opacity: 0;
    transform: translate3d(-34px, -62px, 80px) rotate(42deg) scale(0.72);
  }
}

@keyframes characterGlyphRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 90px) rotate(-18deg) scale(0.2);
  }
  28% {
    opacity: 1;
    transform: translate3d(0, -5px, 96px) rotate(0deg) scale(1);
  }
  72% {
    opacity: 0.82;
    transform: translate3d(16px, -42px, 112px) rotate(18deg) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate3d(28px, -68px, 100px) rotate(40deg) scale(0.45);
  }
}

@keyframes characterGlyphLoop {
  0%,
  30%,
  78%,
  100% {
    opacity: 0;
    transform: translate3d(0, 18px, 90px) rotate(-18deg) scale(0.2);
  }
  42% {
    opacity: 1;
    transform: translate3d(0, -5px, 96px) rotate(0deg) scale(1);
  }
  58% {
    opacity: 0.82;
    transform: translate3d(16px, -42px, 112px) rotate(18deg) scale(1.08);
  }
  72% {
    opacity: 0;
    transform: translate3d(28px, -68px, 100px) rotate(40deg) scale(0.45);
  }
}

@keyframes characterAuraAction {
  0% {
    filter: blur(1px) brightness(1);
  }
  45% {
    filter: blur(0.5px) brightness(1.35);
  }
  100% {
    filter: blur(1px) brightness(1);
  }
}

@keyframes rigHeadMove {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  45% {
    transform: translateY(-2px) rotate(-1.2deg);
  }
  70% {
    transform: translateY(-1px) rotate(0.8deg);
  }
}

@keyframes xianHeadFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  42% {
    transform: translateY(-3px) rotate(-0.8deg);
  }
  72% {
    transform: translateY(-1px) rotate(0.6deg);
  }
}

@keyframes rigHeadCast {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  35% {
    transform: translateY(4px) rotate(-2deg);
  }
  70% {
    transform: translateY(-5px) rotate(3deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes rigHeadWalk {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -1px)) translateY(1px) rotate(calc(var(--drag-lean, 0deg) * 0.45));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 2px)) translateY(-4px) rotate(calc(var(--drag-lean, 0deg) * 0.7));
  }
}

@keyframes xianGlideHead {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -1px)) translateY(-1px) rotate(calc(var(--drag-lean, 0deg) * 0.36));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 2px)) translateY(-5px) rotate(calc(var(--drag-lean, 0deg) * 0.58));
  }
}

@keyframes rigHairFlow {
  0%,
  100% {
    transform: translateX(0) skewX(0deg);
  }
  50% {
    transform: translateX(2px) skewX(-2deg);
  }
}

@keyframes xianHairDrift {
  0%,
  100% {
    transform: translateX(0) translateY(0) skewX(0deg);
  }
  50% {
    transform: translateX(4px) translateY(-3px) skewX(-3deg);
  }
}

@keyframes rigHairDrag {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -5px)) rotate(calc(var(--drag-lean, 0deg) * -0.55)) skewX(calc(var(--walk-x, 1) * -2deg));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -10px)) rotate(calc(var(--drag-lean, 0deg) * -0.85)) skewX(calc(var(--walk-x, 1) * -5deg));
  }
}

@keyframes xianGlideHair {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -7px)) translateY(-1px) rotate(calc(var(--drag-lean, 0deg) * -0.5)) skewX(calc(var(--walk-x, 1) * -3deg));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -13px)) translateY(-7px) rotate(calc(var(--drag-lean, 0deg) * -0.85)) skewX(calc(var(--walk-x, 1) * -6deg));
  }
}

@keyframes rigTorsoBreathe {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-2px) rotate(-0.8deg) scale(1.012);
  }
}

@keyframes xianTorsoBreath {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  48% {
    transform: translateY(-4px) rotate(-0.55deg) scale(1.01);
  }
}

@keyframes rigTorsoWalk {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(calc(var(--drag-lean, 0deg) - 1deg));
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 3px)) translateY(-5px) rotate(calc(var(--drag-lean, 0deg) + 2deg));
  }
}

@keyframes xianGlideTorso {
  0%,
  100% {
    transform: translateX(0) translateY(-2px) rotate(calc(var(--drag-lean, 0deg) * 0.75)) scale(1.006);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 3px)) translateY(-8px) rotate(calc(var(--drag-lean, 0deg) * 0.95)) scale(1.018);
  }
}

@keyframes rigRobeSway {
  0%,
  100% {
    transform: rotate(0deg) scaleX(1);
  }
  50% {
    transform: rotate(1.2deg) scaleX(1.018);
  }
}

@keyframes xianRobeFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scaleX(1);
  }
  50% {
    transform: translateY(-5px) rotate(1.4deg) scaleX(1.018);
  }
}

@keyframes rigRobeWalk {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -2px)) rotate(-2deg) scaleX(1.02);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 4px)) rotate(2deg) scaleX(0.98);
  }
}

@keyframes xianGlideRobe {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -5px)) translateY(-2px) rotate(calc(var(--walk-x, 1) * -2deg)) scaleX(1.025);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -12px)) translateY(-8px) rotate(calc(var(--walk-x, 1) * -5deg)) scaleX(1.06);
  }
}

@keyframes rigLeftSleeveIdle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-2.8deg) translateY(-3px);
  }
}

@keyframes xianLeftSleeveDrift {
  0%,
  100% {
    transform: rotate(-1deg) translateY(0);
  }
  50% {
    transform: rotate(-6deg) translate(-2px, -6px);
  }
}

@keyframes rigRightSleeveIdle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(2.8deg) translateY(-3px);
  }
}

@keyframes xianRightSleeveDrift {
  0%,
  100% {
    transform: rotate(1deg) translateY(0);
  }
  50% {
    transform: rotate(6deg) translate(2px, -6px);
  }
}

@keyframes rigLeftSleeveWalk {
  0%,
  100% {
    transform: rotate(9deg) translateY(0);
  }
  50% {
    transform: rotate(-14deg) translateY(-5px);
  }
}

@keyframes xianGlideLeftSleeve {
  0%,
  100% {
    transform: rotate(calc(var(--walk-x, 1) * -8deg)) translate(calc(var(--walk-x, 1) * -3px), -2px);
  }
  50% {
    transform: rotate(calc(var(--walk-x, 1) * -18deg)) translate(calc(var(--walk-x, 1) * -8px), -8px);
  }
}

@keyframes rigRightSleeveWalk {
  0%,
  100% {
    transform: rotate(-10deg) translateY(-4px);
  }
  50% {
    transform: rotate(15deg) translateY(1px);
  }
}

@keyframes xianGlideRightSleeve {
  0%,
  100% {
    transform: rotate(calc(var(--walk-x, 1) * 8deg)) translate(calc(var(--walk-x, 1) * -2px), -3px);
  }
  50% {
    transform: rotate(calc(var(--walk-x, 1) * 18deg)) translate(calc(var(--walk-x, 1) * -8px), -9px);
  }
}

@keyframes rigLeftSleeveCast {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  35% {
    transform: rotate(10deg) translate(-1px, 3px);
  }
  72% {
    transform: rotate(-28deg) translate(-8px, -18px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes rigRightSleeveCast {
  0% {
    transform: rotate(0deg) translateY(0);
  }
  35% {
    transform: rotate(-10deg) translate(1px, 3px);
  }
  72% {
    transform: rotate(30deg) translate(8px, -18px);
  }
  100% {
    transform: rotate(0deg) translateY(0);
  }
}

@keyframes rigLeftFootWalk {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * -2px)) translateY(1px) rotate(-3deg);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * 8px)) translateY(-8px) rotate(10deg);
  }
}

@keyframes rigRightFootWalk {
  0%,
  100% {
    transform: translateX(calc(var(--walk-x, 1) * 7px)) translateY(-7px) rotate(9deg);
  }
  50% {
    transform: translateX(calc(var(--walk-x, 1) * -2px)) translateY(2px) rotate(-4deg);
  }
}

@keyframes rigRibbonFlow {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(4px) rotate(2deg);
  }
}

@keyframes xianRibbonFloat {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(7px) translateY(-7px) rotate(3deg);
  }
}

@keyframes spriteClothFloat {
  0%,
  100% {
    object-position: center bottom;
  }
  50% {
    object-position: calc(50% + 2px) bottom;
  }
}

@keyframes modelFrontIdle {
  0%,
  70%,
  92%,
  100% {
    opacity: 1;
  }
  78%,
  84% {
    opacity: 0.16;
  }
}

@keyframes modelSideIdle {
  0%,
  70%,
  92%,
  100% {
    opacity: 0;
  }
  78%,
  84% {
    opacity: 0.96;
  }
}

@keyframes modelSleeveBreath {
  0%,
  100% {
    transform: translateY(0) scaleX(1);
  }
  50% {
    transform: translateY(-2px) scaleX(1.018);
  }
}

@keyframes sleeveLeftFloat {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-2deg) translateY(-3px);
  }
}

@keyframes sleeveRightFloat {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-3px);
  }
}

@keyframes ribbonFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.4deg);
  }
}

@keyframes hairInkFloat {
  0%,
  100% {
    transform: skewX(0deg) translateY(0);
  }
  50% {
    transform: skewX(-1.6deg) translateY(-2px);
  }
}

@keyframes auraPulse {
  0%,
  100% {
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    opacity: 0.62;
    transform: scale(1.035);
  }
}

@keyframes charmGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(126, 208, 195, 0));
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(126, 208, 195, 0.62));
    transform: translateY(-2px);
  }
}

@keyframes modelHeadFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.5px);
  }
}

@keyframes characterNod {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-8px) scale(1.03) rotate(-1deg);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .auth-gate {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .auth-landscape {
    min-height: 300px;
    border-radius: 8px 8px 0 0;
  }

  .auth-panel {
    min-height: auto;
    border-left: 1px solid rgba(255, 232, 165, 0.18);
    border-top: 0;
    border-radius: 0 0 8px 8px;
  }

  .auth-seal {
    width: 90px;
    height: 90px;
    font-size: 3.2rem;
  }

  .game-topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .game-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hud-stats {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .game-topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .realm-stage {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
    max-width: none;
    display: block;
    padding: 0;
    border-left: 0;
  }

  .gameplay-loop {
    max-width: none;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .game-scene {
    min-height: 620px;
  }

  .feature-showcase {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  }

  .character-sheet {
    grid-column: 1 / -1;
  }

  .quest-panel {
    max-width: none;
    max-height: none;
  }

  .codex-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .auth-gate {
    padding: 10px;
  }

  .auth-landscape {
    min-height: 220px;
  }

  .auth-panel {
    padding: 22px;
  }

  .auth-route {
    grid-template-columns: 1fr;
  }

  .auth-route i {
    display: none;
  }

  .auth-head h1 {
    font-size: clamp(3rem, 16vw, 4.8rem);
  }

  .realm-stage,
  .showcase-band,
  .codex-band,
  .studio-band {
    width: calc(100vw - 18px);
    padding-left: 12px;
    padding-right: 12px;
  }

  .realm-stage {
    padding-top: 18px;
  }

  h1 {
    font-size: clamp(3.2rem, 18vw, 5.4rem);
  }

  .game-scene {
    min-height: 560px;
  }

  .gameplay-loop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-panel {
    width: calc(100vw - 28px) !important;
  }

  .mentor-select-panel {
    padding: 16px;
  }

  .mentor-choice-grid {
    grid-template-columns: 1fr;
  }

  .mentor-choice-views {
    min-height: 260px;
  }

  .mentor-choice-canvas {
    height: 260px;
  }

  .mentor-showcase-canvas {
    height: 280px;
  }

  .player-avatar {
    width: 142px;
    height: 236px;
    left: 12px;
    bottom: 16px;
  }

  .mentor-quick-card {
    left: 12px;
    bottom: 262px;
  }

  .mentor-quick-grid {
    grid-template-columns: 1fr;
  }

  .guide-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .guide-actions #nextGuide {
    grid-column: 1 / -1;
  }

  .scene-command-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scene-command-strip button {
    min-height: 52px;
  }

  .character-panel {
    display: none;
  }

  .feature-showcase,
  .studio-board,
  .encounter-shell,
  .riddle-board,
  .loadout-board,
  .sort-card,
  .advisor-card {
    grid-template-columns: 1fr;
  }

  .resource-ledger,
  .war-room,
  .academy-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .slg-scene-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .campaign-ribbon {
    top: 130px;
    grid-template-columns: 1fr;
  }

  .map-stronghold span {
    display: none;
  }

  .encounter-play {
    padding: 0 18px 18px;
  }

  .encounter-visual {
    min-height: 360px;
  }

  .encounter-bg {
    min-height: 340px;
    height: 340px;
  }

  .codex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-deck {
    grid-template-columns: repeat(2, 1fr);
  }

  .operation-timeline button {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .operation-timeline small {
    grid-column: 2;
    justify-self: start;
  }

  .player-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .player-card b {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .inventory-strip,
  .encounter-steps {
    grid-template-columns: 1fr;
  }

  .scout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sort-card div {
    justify-content: flex-start;
  }

  .npc-dialogue,
  .reward-preview {
    display: grid;
    grid-template-columns: 1fr;
  }

  .reward-preview strong {
    text-align: left;
  }
}
