/* ============================================================
   Шёлковый свиток — styles
   YAOSHI brand system, extended for the game cabinet
   ============================================================ */

:root {
  --bg: #fbf7f0;
  --bg-soft: #f5efe4;
  --bg-deep: #f0e8d8;
  --surface: #fffdf9;
  --surface-warm: #fdf9f2;
  --ink: #2a2520;
  --ink-deep: #1a1613;
  --ink-soft: #4a4238;
  --muted: #6e6457;
  --muted-soft: #a79b8b;
  --line: #eae0ce;
  --line-strong: #d8cbb4;
  --red: #c8312d;
  --red-deep: #a82723;
  --red-soft: rgba(200, 49, 45, 0.08);
  --jade: #4e7c6d;
  --jade-deep: #3d5a4c;
  --jade-soft: rgba(78, 124, 109, 0.1);
  --gold: #b8975a;
  --gold-light: #d4b96a;
  --gold-soft: rgba(184, 151, 90, 0.12);
  --wood: #6b4c2f;
  --wood-deep: #3d2a18;
  --night: #151b17;
  --night-2: #1f2923;

  --radius: 24px;
  --radius-sm: 14px;
  --radius-lg: 32px;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", system-ui, -apple-system, sans-serif;
  --font-han: "Ma Shan Zheng", "Noto Serif SC", "KaiTi", "STKaiti", serif;
  --font-han-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(42, 37, 32, 0.04), 0 6px 16px -10px rgba(42, 37, 32, 0.12);
  --shadow-md: 0 4px 12px -4px rgba(42, 37, 32, 0.06), 0 20px 44px -24px rgba(42, 37, 32, 0.18);
  --shadow-lg: 0 8px 28px -8px rgba(42, 37, 32, 0.08), 0 34px 80px -36px rgba(42, 37, 32, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
  overflow-anchor: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-anchor: none;
  background:
    radial-gradient(ellipse at 82% 8%, rgba(200, 49, 45, 0.04), transparent 46%),
    radial-gradient(ellipse at 8% 52%, rgba(78, 124, 109, 0.045), transparent 48%),
    radial-gradient(ellipse at 50% 100%, rgba(184, 151, 90, 0.055), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html,
body,
#app,
#app * {
  overflow-anchor: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

body.overlay-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: var(--red);
  text-decoration: none;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
p,
blockquote {
  margin: 0;
}

::selection {
  background: rgba(200, 49, 45, 0.18);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(184, 151, 90, 0.32);
  border: 3px solid var(--bg);
  border-radius: 999px;
}

.ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
}

.noscript {
  padding: 40px;
  text-align: center;
}

/* ============================================================
   Layout shell
   ============================================================ */
.app,
.shell {
  min-height: 100vh;
}

.shell {
  display: block;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 22px 15px 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(248, 241, 229, 0.94)),
    var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.65);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  text-align: left;
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--red), var(--red-deep));
  color: #fff9f2;
  border-radius: 7px;
  font-family: var(--font-han);
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.16) inset, 0 6px 14px -6px rgba(168, 39, 35, 0.55);
  transform: rotate(-2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.1;
}

.brand-text small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.brand-light {
  color: #f6eddc;
}
.brand-light .brand-text small {
  color: rgba(246, 237, 220, 0.62);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.nav-item .ico {
  width: 19px;
  height: 19px;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.nav-item:hover .ico {
  color: var(--ink-soft);
}

.nav-item.is-active {
  background: var(--surface);
  color: var(--red);
  box-shadow: var(--shadow-sm);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--red);
}

.nav-item.is-active .ico {
  color: var(--red);
}

.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff9f2;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 800;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-scroll {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.66);
}

.sidebar-scroll-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-scroll-head span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sidebar-scroll-head .ico {
  width: 14px;
  height: 14px;
  color: var(--red);
}
.sidebar-scroll-head em {
  font-style: normal;
  color: var(--ink-soft);
}

.mini-slots {
  display: flex;
  gap: 4px;
  margin: 10px 0 8px;
}

.mini-slot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-family: var(--font-han);
  font-size: 13px;
  color: var(--muted-soft);
}
.mini-slot.is-on {
  border-style: solid;
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.sidebar-progress,
.bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.sidebar-progress span,
.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), #d65146);
  transition: width 0.6s var(--ease);
}
.bar-thin {
  height: 4px;
}
.bar-jade {
  background: linear-gradient(90deg, var(--jade-deep), var(--jade)) !important;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-left: 4px;
}
.sidebar-abc {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}
.sidebar-abc .ico {
  width: 11px;
  height: 11px;
}
.sidebar-note .ico {
  width: 13px;
  height: 13px;
}

.main {
  margin-left: 238px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(251, 247, 240, 0.84);
  border-bottom: 1px solid rgba(234, 224, 206, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-brandmark {
  display: none;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(150deg, var(--red), var(--red-deep));
  color: #fff9f2;
  font-family: var(--font-han);
  font-size: 20px;
  line-height: 1;
  transform: rotate(-2deg);
  box-shadow: 0 4px 10px -6px rgba(168, 39, 35, 0.6);
}
.topbar-title span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hud-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.8);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.hud-chip:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.hud-chip > .ico {
  width: 17px;
  height: 17px;
  color: var(--red);
}
.hud-chip > span:not(.level-ring) {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}
.hud-chip strong {
  font-size: 12.5px;
  font-weight: 800;
}
.hud-chip em {
  font-size: 8.5px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.hud-streak > .ico {
  color: #d06a34;
}
.hud-ink > .ico {
  color: var(--jade);
}
.hud-level {
  padding-left: 7px;
  gap: 7px;
}
.hud-level em {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.level-ring {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: conic-gradient(var(--red) var(--p), var(--line) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.level-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--surface);
}
.level-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn .ico {
  width: 18px;
  height: 18px;
}
.icon-btn:hover {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--ink);
}

.content {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px 32px 64px;
  flex: 1;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 32px 26px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.mobile-nav {
  display: none;
}

/* ============================================================
   Shared typography / components
   ============================================================ */
.screen {
  animation: screenIn 0.5s var(--ease) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}
.eyebrow .ico {
  width: 14px;
  height: 14px;
  color: var(--red);
}
.eyebrow-line {
  width: 26px;
  height: 1.5px;
  flex: 0 0 26px;
  background: var(--red);
  border-radius: 2px;
}
.eyebrow-light {
  color: rgba(246, 237, 220, 0.65);
}
.eyebrow-light .eyebrow-line {
  background: var(--gold-light);
}
.eyebrow-light .ico {
  color: var(--gold-light);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 26px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 8px;
}
.page-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--red);
}

.page-sub {
  margin-top: 10px;
  max-width: 640px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

.page-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 3px;
}

.day-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.8);
  box-shadow: var(--shadow-sm);
}
.day-chip .ico {
  width: 18px;
  height: 18px;
  color: var(--red);
}
.day-chip > span {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}
.day-chip strong {
  font-size: 12px;
  font-weight: 800;
}
.day-chip em {
  font-size: 8.5px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.day-chip-soft {
  background: transparent;
  box-shadow: none;
}
.day-chip-soft .ico {
  color: #d06a34;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 21px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn .ico {
  width: 16px;
  height: 16px;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: linear-gradient(155deg, #d23b34, var(--red));
  color: #fff9f2;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 10px 22px -12px rgba(200, 49, 45, 0.7);
}
.btn-primary:hover {
  background: linear-gradient(155deg, var(--red), var(--red-deep));
  box-shadow: 0 14px 28px -14px rgba(200, 49, 45, 0.8);
}
.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(42, 37, 32, 0.03);
}
.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: var(--gold);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.btn-danger {
  background: var(--red);
  color: #fff9f2;
}
.btn-danger-ghost {
  background: transparent;
  color: var(--red);
  border-color: rgba(200, 49, 45, 0.28);
}
.btn-danger-ghost:hover {
  background: var(--red-soft);
}
.btn-lg {
  min-height: 54px;
  padding: 0 27px;
  font-size: 14px;
}
.btn-small {
  min-height: 34px;
  padding: 0 13px;
  font-size: 11.5px;
  gap: 5px;
}
.btn-small .ico {
  width: 14px;
  height: 14px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  color: var(--red);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.text-link .ico {
  width: 14px;
  height: 14px;
}
.text-link:hover {
  border-color: var(--red);
}
.text-link.center {
  margin: 10px auto 0;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.chip .ico {
  width: 13px;
  height: 13px;
}
.chip-xp {
  color: var(--gold);
  border-color: rgba(184, 151, 90, 0.3);
  background: var(--gold-soft);
}
.chip-ink {
  color: var(--jade-deep);
  border-color: rgba(78, 124, 109, 0.25);
  background: var(--jade-soft);
}
.chip-soft {
  color: var(--muted);
  background: var(--bg-soft);
}
.chip-perfect {
  color: var(--red);
  border-color: rgba(200, 49, 45, 0.22);
  background: var(--red-soft);
}

.fineprint {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-soft);
}

.ring {
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  flex: 0 0 var(--ring-size);
  display: inline-grid;
  place-items: center;
}
.ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  stroke: var(--line);
}
.ring-fill {
  stroke: var(--red);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
}
.ring-label {
  font-family: var(--font-display);
  font-size: calc(var(--ring-size) * 0.24);
  font-weight: 700;
  color: var(--ink);
}

.progress-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
}
.progress-dot.is-on {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(200, 49, 45, 0.12);
}

.medallion {
  position: relative;
  width: var(--m-size);
  height: var(--m-size);
  flex: 0 0 var(--m-size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #f8efdd;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(150deg, #7b5a39, #3d2a18);
  box-shadow: 0 0 0 1px rgba(61, 42, 24, 0.2), 0 8px 18px -10px rgba(61, 42, 24, 0.5);
}
.medallion-jade {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.25), transparent 38%),
    linear-gradient(150deg, #6d9987, #335545);
}
.medallion-ink {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(150deg, #3b443e, #161c18);
}
.medallion-pattern {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(246, 237, 220, 0.28);
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 7px, rgba(246, 237, 220, 0.08) 8px 9px);
}
.medallion-han {
  position: relative;
  z-index: 1;
  font-family: var(--font-han);
  font-size: calc(var(--m-size) * 0.46);
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.medallion-dot {
  position: absolute;
  right: 7%;
  bottom: 9%;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8fb59d;
  border: 2px solid #f8efdd;
}

.game-shell,
.game-shell *,
.shell .btn,
.shell .hud-chip,
.shell .nav-item,
.shell .answer-tile,
.shell .match-card,
.shell .map-node {
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   Landing
   ============================================================ */
.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--night);
  color: #f6eddc;
}

.landing-art,
.onboarding-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.landing-art .scene-svg,
.onboarding-art .scene-svg {
  width: 100%;
  height: 100%;
}

.landing-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 15, 12, 0.96) 0%, rgba(11, 15, 12, 0.78) 36%, rgba(11, 15, 12, 0.24) 72%, rgba(11, 15, 12, 0.55) 100%),
    linear-gradient(0deg, rgba(11, 15, 12, 0.92) 0%, transparent 42%),
    linear-gradient(180deg, rgba(11, 15, 12, 0.48), transparent 28%);
}

.landing-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 42px;
}

.mvp-chip {
  padding: 8px 14px;
  border: 1px solid rgba(246, 237, 220, 0.22);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.68);
  backdrop-filter: blur(8px);
}

.landing-main {
  position: relative;
  z-index: 3;
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 42px 42px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: center;
  gap: 44px;
}

.landing-copy {
  max-width: 660px;
}

.landing-title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(74px, 9.4vw, 138px);
  font-weight: 700;
  line-height: 0.83;
  letter-spacing: -0.045em;
  color: #fdf6e8;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}
.landing-title em {
  font-style: italic;
  font-weight: 600;
  color: #d64b40;
}

.landing-lead {
  margin-top: 24px;
  max-width: 540px;
  font-size: 16.5px;
  line-height: 1.7;
  color: rgba(246, 237, 220, 0.74);
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.landing-note {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.48);
}

.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(246, 237, 220, 0.14);
}
.landing-features span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.52);
}
.landing-features .ico {
  width: 13px;
  height: 13px;
  color: var(--gold-light);
}

.landing-object {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}

.scroll-piece {
  position: relative;
  width: min(370px, 100%);
  transform: rotate(2.2deg);
  filter: drop-shadow(0 34px 50px rgba(0, 0, 0, 0.35));
  animation: float 8s ease-in-out infinite;
}

.scroll-rod {
  display: block;
  height: 15px;
  margin: 0 -14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8f6038, #3d2a18 55%, #2a1d16);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.15) inset;
  position: relative;
  z-index: 2;
}
.scroll-rod::before,
.scroll-rod::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: linear-gradient(160deg, #c49a63, #6b4527);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.scroll-rod::before {
  left: -8px;
}
.scroll-rod::after {
  right: -8px;
}

.scroll-paper {
  position: relative;
  margin: -4px 0;
  padding: 42px 34px 32px;
  background:
    linear-gradient(90deg, rgba(184, 151, 90, 0.14), transparent 14%, transparent 86%, rgba(184, 151, 90, 0.14)),
    linear-gradient(180deg, #f9f0de, #f0e0c6);
  border-top: 1px solid #d9c7a6;
  border-bottom: 1px solid #d9c7a6;
  color: var(--ink);
  min-height: 360px;
}

.scroll-big {
  display: block;
  font-family: var(--font-han);
  font-size: 94px;
  line-height: 0.9;
  color: rgba(42, 37, 32, 0.82);
}

.scroll-caption {
  margin-top: 10px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.landing-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}
.landing-slot {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(200, 49, 45, 0.38);
  border-radius: 50%;
  font-family: var(--font-han);
  font-size: 18px;
  color: rgba(200, 49, 45, 0.4);
}

.scroll-stamp {
  position: absolute;
  right: 26px;
  bottom: 28px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff9f2;
  font-family: var(--font-han);
  font-size: 27px;
  border-radius: 4px;
  transform: rotate(-4deg);
  box-shadow: 0 4px 10px rgba(168, 39, 35, 0.26);
  opacity: 0.9;
}

.landing-vertical {
  position: absolute;
  top: -10px;
  right: -22px;
  writing-mode: vertical-rl;
  font-family: var(--font-han);
  font-size: 54px;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: rgba(246, 237, 220, 0.13);
}

.landing-foot {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 42px 26px;
  border-top: 1px solid rgba(246, 237, 220, 0.14);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.4);
}

.dust {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.dust i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-light);
  opacity: 0;
  animation: dustFloat 10s linear infinite;
}
.dust i:nth-child(1) { left: 12%; top: 68%; animation-delay: 0s; animation-duration: 11s; }
.dust i:nth-child(2) { left: 24%; top: 82%; animation-delay: 1.2s; animation-duration: 9s; }
.dust i:nth-child(3) { left: 38%; top: 74%; animation-delay: 2.4s; animation-duration: 13s; }
.dust i:nth-child(4) { left: 46%; top: 88%; animation-delay: 0.6s; animation-duration: 10s; }
.dust i:nth-child(5) { left: 58%; top: 64%; animation-delay: 3.1s; animation-duration: 12s; }
.dust i:nth-child(6) { left: 67%; top: 80%; animation-delay: 1.8s; animation-duration: 9.5s; }
.dust i:nth-child(7) { left: 76%; top: 58%; animation-delay: 4s; animation-duration: 14s; }
.dust i:nth-child(8) { left: 84%; top: 76%; animation-delay: 2.2s; animation-duration: 11.5s; }
.dust i:nth-child(9) { left: 18%; top: 46%; animation-delay: 5s; animation-duration: 12.5s; }
.dust i:nth-child(10) { left: 31%; top: 38%; animation-delay: 3.4s; animation-duration: 10.5s; }
.dust i:nth-child(11) { left: 53%; top: 44%; animation-delay: 6.1s; animation-duration: 13.5s; }
.dust i:nth-child(12) { left: 71%; top: 36%; animation-delay: 0.8s; animation-duration: 9.2s; }
.dust i:nth-child(13) { left: 89%; top: 42%; animation-delay: 4.6s; animation-duration: 11.8s; }
.dust i:nth-child(14) { left: 8%; top: 30%; animation-delay: 2.8s; animation-duration: 10.2s; }
.dust i:nth-child(15) { left: 62%; top: 24%; animation-delay: 5.5s; animation-duration: 12.8s; }
.dust i:nth-child(16) { left: 94%; top: 22%; animation-delay: 1.5s; animation-duration: 9.8s; }

/* ============================================================
   Onboarding
   ============================================================ */
.onboarding {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--night);
  color: #f6eddc;
}

.onboarding-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 74% 36%, rgba(200, 49, 45, 0.12), transparent 40%),
    linear-gradient(90deg, rgba(10, 14, 11, 0.94) 0%, rgba(10, 14, 11, 0.7) 50%, rgba(10, 14, 11, 0.45) 100%),
    linear-gradient(0deg, rgba(10, 14, 11, 0.9), transparent 52%);
}

.onboarding-top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
}

.onboarding-step {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.48);
}

.identity-wrap {
  position: relative;
  z-index: 3;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 22px 54px;
}

.identity-card {
  width: 100%;
  max-width: 610px;
  padding: 40px 42px 32px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(248, 240, 228, 0.98)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.7);
  color: var(--ink);
  animation: cardIn 0.6s var(--ease) both;
}

.identity-card h1 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.identity-card h1 em {
  color: var(--red);
  font-style: italic;
  font-weight: 600;
}

.identity-lead {
  margin-top: 9px;
  max-width: 430px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.field {
  display: block;
  margin-top: 24px;
}
.field > span {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder {
  color: var(--muted-soft);
  font-weight: 400;
}
.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 49, 45, 0.1);
}

.seal-label {
  margin: 22px 0 9px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.seal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.seal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 13px 6px 11px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.seal-option:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.seal-option.is-selected {
  border-color: var(--red);
  background: linear-gradient(180deg, #fff9f2, var(--red-soft));
  box-shadow: 0 10px 22px -16px rgba(200, 49, 45, 0.55);
  transform: translateY(-2px);
}
.seal-option-han {
  font-family: var(--font-han);
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.seal-option.is-selected .seal-option-han {
  color: var(--red);
}
.seal-option-name {
  font-size: 11.5px;
  font-weight: 800;
}
.seal-option-epithet {
  font-size: 8.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.seal-perk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 11px;
  background: var(--jade-soft);
  color: var(--jade-deep);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}
.seal-perk .ico {
  width: 15px;
  height: 15px;
}

.identity-submit {
  width: 100%;
  margin-top: 18px;
}
.identity-card .fineprint {
  text-align: center;
  margin-top: 11px;
}

.prologue {
  justify-content: space-between;
}
.prologue-main {
  position: relative;
  z-index: 3;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  animation: prologueIn 0.7s var(--ease) both;
}
.prologue-main h1 {
  margin-top: 16px;
  max-width: 680px;
  font-family: var(--font-display);
  font-size: clamp(46px, 6.5vw, 78px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: #fdf6e8;
}
.prologue-text {
  margin-top: 24px;
  max-width: 590px;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(246, 237, 220, 0.75);
}
.prologue-actions {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.prologue-dots {
  display: flex;
  gap: 7px;
}
.prologue-dots .progress-dot {
  border-color: rgba(246, 237, 220, 0.28);
}
.prologue-dots .progress-dot.is-on {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(212, 185, 106, 0.12);
}
.prologue-watermark {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--font-han);
  font-size: 340px;
  line-height: 1;
  color: rgba(246, 237, 220, 0.055);
  pointer-events: none;
}
.skip-link-btn {
  padding: 7px 13px;
  border: 1px solid rgba(246, 237, 220, 0.22);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.55);
  transition: border-color 0.2s, color 0.2s;
}
.skip-link-btn:hover {
  border-color: rgba(246, 237, 220, 0.5);
  color: #f6eddc;
}

/* ============================================================
   Map
   ============================================================ */
.map-screen .page-head {
  margin-bottom: 22px;
}

.mobile-quest-bar {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(184, 151, 90, 0.26);
  border-radius: 16px;
  color: #f6eddc;
  text-align: left;
  background:
    radial-gradient(ellipse at 86% 10%, rgba(200, 49, 45, 0.22), transparent 48%),
    linear-gradient(145deg, #252e28, #151b17);
  box-shadow: 0 12px 26px -20px rgba(20, 26, 22, 0.8);
}
.mqb-num {
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1;
}
.mqb-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mqb-copy strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mqb-copy em {
  font-size: 8.5px;
  font-style: normal;
  color: rgba(246, 237, 220, 0.48);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mqb-pct {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-light);
}
.mobile-quest-bar > .ico {
  width: 16px;
  height: 16px;
  color: var(--red);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 326px;
  gap: 18px;
  align-items: start;
}

.map-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.map-card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px 14px;
}

.map-kicker {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.map-card-head h2 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 3px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
  white-space: nowrap;
}
.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.is-done {
  background: var(--jade);
}
.legend-dot.is-current {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(200, 49, 45, 0.14);
}
.legend-dot.is-locked {
  border: 1px solid var(--muted-soft);
}

.map-scroll {
  overflow-x: auto;
  padding: 0 14px 6px;
  scrollbar-width: thin;
}

.map-canvas {
  position: relative;
  min-width: 640px;
  aspect-ratio: 1000 / 620;
  border-radius: 18px;
  overflow: hidden;
  background: #f4e8d2;
  box-shadow: 0 0 0 1px rgba(184, 151, 90, 0.22) inset;
}

.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-seg {
  fill: none;
  stroke-linecap: round;
  transition: stroke 0.4s, opacity 0.4s;
}
.route-seg.is-done {
  stroke: var(--jade-deep);
  stroke-width: 3;
  opacity: 0.9;
}
.route-seg.is-current {
  stroke: var(--red);
  stroke-width: 3;
  stroke-dasharray: 8 7;
  animation: routeDash 1.4s linear infinite;
  opacity: 0.95;
}
.route-seg.is-locked {
  stroke: #b8a98d;
  stroke-width: 1.6;
  stroke-dasharray: 3 8;
  opacity: 0.55;
}

.map-plaque {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px 7px 7px;
  border: 1px solid rgba(216, 203, 180, 0.9);
  border-radius: 11px;
  background: rgba(251, 247, 240, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.plaque-seal {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--red);
  color: #fff9f2;
  font-family: var(--font-han);
  font-size: 19px;
  transform: rotate(-3deg);
}
.map-plaque strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}
.map-plaque em {
  display: block;
  font-family: var(--font-han-serif);
  font-size: 9px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.map-cloud {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.8), transparent 68%);
  filter: blur(14px);
  opacity: 0.5;
  pointer-events: none;
}
.map-cloud-a {
  width: 190px;
  height: 60px;
  right: 12%;
  top: 9%;
  animation: cloudDrift 28s ease-in-out infinite alternate;
}
.map-cloud-b {
  width: 140px;
  height: 48px;
  left: 27%;
  top: 18%;
  animation: cloudDrift 34s ease-in-out infinite alternate-reverse;
}

.map-nodes {
  position: absolute;
  inset: 0;
}

.map-node {
  position: absolute;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 4;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.map-node:hover {
  z-index: 8;
}

.node-disc {
  position: relative;
  z-index: 3;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fbf7f0;
  border: 1.5px solid rgba(107, 76, 47, 0.45);
  box-shadow: 0 8px 18px -10px rgba(61, 42, 24, 0.5), 0 0 0 4px rgba(251, 247, 240, 0.45);
  font-family: var(--font-han-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--wood);
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
}
.map-node:hover .node-disc {
  transform: scale(1.08);
}

.node-halo {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid rgba(184, 151, 90, 0.25);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.map-node.is-selected .node-halo {
  opacity: 1;
  border-color: rgba(184, 151, 90, 0.6);
  transform: scale(1.1);
}

.node-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid var(--red);
  opacity: 0;
}

.map-node.is-current .node-disc {
  background: linear-gradient(155deg, #d23b34, var(--red-deep));
  border-color: var(--red-deep);
  color: #fff9f2;
  box-shadow: 0 0 0 5px rgba(200, 49, 45, 0.12), 0 10px 22px -10px rgba(168, 39, 35, 0.7);
}
.map-node.is-current .node-pulse {
  animation: nodePulse 2.4s var(--ease) infinite;
}
.map-node.is-current .node-halo {
  border-style: dashed;
  border-color: rgba(200, 49, 45, 0.35);
  opacity: 1;
  animation: spin 32s linear infinite;
}

.map-node.is-done .node-disc {
  background: #fbf7f0;
  border-color: var(--jade);
  color: var(--jade-deep);
  box-shadow: 0 0 0 4px rgba(78, 124, 109, 0.1), 0 8px 18px -10px rgba(61, 90, 76, 0.45);
}

.map-node.is-locked .node-disc {
  background: #eee2cf;
  border-style: dashed;
  border-color: rgba(110, 100, 87, 0.4);
  color: rgba(110, 100, 87, 0.45);
  box-shadow: none;
}
.map-node.is-soon .node-disc {
  background: #f7eddb;
  border-color: var(--gold);
  color: var(--gold);
  border-style: dashed;
}
.map-node.is-mystery .node-disc {
  background: #26312a;
  border-color: rgba(184, 151, 90, 0.45);
  color: var(--gold-light);
  border-style: dashed;
}

.node-badge {
  position: absolute;
  z-index: 4;
  right: -2px;
  top: -1px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.node-badge .ico {
  width: 10px;
  height: 10px;
}
.node-badge-done {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff9f2;
}

.node-tag {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(216, 203, 180, 0.85);
  background: rgba(251, 247, 240, 0.92);
  backdrop-filter: blur(4px);
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 10px -6px rgba(61, 42, 24, 0.3);
  pointer-events: none;
}
.node-tag strong {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
}
.node-tag em {
  display: block;
  font-size: 7.5px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
  line-height: 1.3;
}
.label-top .node-tag {
  top: auto;
  bottom: calc(100% + 7px);
}
.label-left .node-tag {
  top: 50%;
  right: calc(100% + 10px);
  left: auto;
  transform: translateY(-50%);
}
.map-node.is-current .node-tag {
  border-color: rgba(200, 49, 45, 0.35);
}
.map-node.is-current .node-tag em {
  color: var(--red);
  font-weight: 800;
}

.map-node.is-locked .node-tag,
.map-node.is-mystery .node-tag {
  opacity: 0.72;
}

.map-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px 15px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.map-card-foot span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-card-foot .ico {
  width: 14px;
  height: 14px;
  color: var(--gold);
}
.map-hint {
  color: var(--muted-soft);
  font-weight: 500;
}

.map-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selection-card {
  position: relative;
  overflow: hidden;
  color: #f6eddc;
  background:
    radial-gradient(ellipse at 82% 12%, rgba(200, 49, 45, 0.22), transparent 45%),
    radial-gradient(ellipse at 12% 90%, rgba(184, 151, 90, 0.12), transparent 50%),
    linear-gradient(155deg, #232c26, #141a16 72%);
  border-color: rgba(184, 151, 90, 0.24);
  box-shadow: 0 22px 44px -28px rgba(20, 26, 22, 0.7);
}
.selection-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(246, 237, 220, 0.08);
  border-radius: 14px;
  pointer-events: none;
}

.selection-card .rail-card-head {
  position: relative;
  z-index: 1;
}

.chapter-numeral {
  font-family: var(--font-display);
  font-size: 27px;
  font-style: italic;
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(246, 237, 220, 0.2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.65);
}
.status-pill.status-current {
  color: #efb2a9;
  border-color: rgba(200, 49, 45, 0.45);
  background: rgba(200, 49, 45, 0.14);
}
.status-pill.status-done {
  color: #a9cfb9;
  border-color: rgba(78, 124, 109, 0.5);
  background: rgba(78, 124, 109, 0.18);
}
.status-pill.status-soon {
  color: var(--gold-light);
  border-color: rgba(212, 185, 106, 0.35);
  background: rgba(184, 151, 90, 0.1);
}
.status-pill.status-mystery {
  color: #cfc4ad;
}

.selection-city {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}
.selection-city h3 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.selection-city p {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.48);
}
.city-han {
  font-family: var(--font-han);
  font-size: 33px;
  line-height: 1;
  color: rgba(212, 185, 106, 0.55);
  white-space: nowrap;
}

.selection-card .rail-copy {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(246, 237, 220, 0.62);
}

.quest-name {
  position: relative;
  z-index: 1;
  margin-top: 13px;
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
  color: var(--gold-light);
}

.selection-progress {
  position: relative;
  z-index: 1;
  margin-top: 14px;
}
.selection-card .bar {
  background: rgba(246, 237, 220, 0.14);
}
.selection-card .bar > span {
  background: linear-gradient(90deg, var(--red), #d96354);
}
.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(246, 237, 220, 0.48);
}
.bar-meta strong {
  color: rgba(246, 237, 220, 0.8);
  font-weight: 800;
}

.next-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 9px;
  border: 1px solid rgba(246, 237, 220, 0.1);
  border-radius: 9px;
  background: rgba(246, 237, 220, 0.04);
  font-size: 9.5px;
  color: rgba(246, 237, 220, 0.55);
}
.next-step .ico {
  width: 12px;
  height: 12px;
  color: var(--gold-light);
}
.next-step strong {
  color: rgba(246, 237, 220, 0.82);
}

.rail-rewards {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.selection-card .chip {
  border-color: rgba(246, 237, 220, 0.13);
  background: rgba(246, 237, 220, 0.06);
  color: rgba(246, 237, 220, 0.72);
}
.selection-card .chip-xp {
  color: var(--gold-light);
  border-color: rgba(212, 185, 106, 0.25);
}
.selection-card .chip-ink {
  color: #a9cfb9;
  border-color: rgba(78, 124, 109, 0.35);
}

.rail-cta {
  position: relative;
  z-index: 1;
  margin-top: 15px;
}
.rail-cta .btn {
  min-height: 42px;
  font-size: 12px;
}
.rail-cta .text-link {
  display: flex;
  margin-top: 9px;
  justify-content: center;
  color: rgba(246, 237, 220, 0.55);
  font-size: 10px;
}
.rail-cta .text-link:hover {
  color: var(--gold-light);
  border-color: transparent;
}

.rail-npc {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(246, 237, 220, 0.1);
}
.rail-npc > div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.rail-npc strong {
  font-size: 11px;
  font-weight: 700;
  color: rgba(246, 237, 220, 0.82);
}
.rail-npc span {
  font-size: 8.5px;
  color: rgba(246, 237, 220, 0.4);
}
.rail-npc em {
  margin-left: auto;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--gold-light);
  white-space: nowrap;
}

.soon-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 10px;
  border: 1px dashed rgba(212, 185, 106, 0.32);
  border-radius: 10px;
  color: var(--gold-light);
  font-size: 10.5px;
  font-weight: 700;
}
.soon-card .ico {
  width: 15px;
  height: 15px;
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.rail-title .ico {
  width: 15px;
  height: 15px;
  color: var(--red);
}
.rail-count {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted-soft);
  white-space: nowrap;
}

.scroll-slots-row {
  display: flex;
  gap: 5px;
  margin: 12px 0 9px;
}
.scroll-slot {
  width: 35px;
  height: 35px;
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  font-family: var(--font-han);
  font-size: 17px;
  color: var(--muted-soft);
  background: var(--bg);
}
.scroll-slot.is-on {
  border-style: solid;
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}
.scroll-mini-card .text-link {
  margin-top: 10px;
  font-size: 10.5px;
}

.daily-card {
  background: linear-gradient(180deg, #fffdf9, #fbf5e9);
}
.daily-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}
.goal-dots {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}
.goal-dots .progress-dot {
  width: 7px;
  height: 7px;
}
.daily-note {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
}
.daily-card .btn {
  margin-top: 10px;
  min-height: 38px;
  font-size: 11px;
}
.daily-card.is-claimed {
  border-color: rgba(78, 124, 109, 0.32);
  background: linear-gradient(180deg, #fbfdf9, var(--jade-soft));
}
.daily-card.is-claimed .goal-dots .progress-dot.is-on {
  background: var(--jade);
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(78, 124, 109, 0.12);
}

.path-strip {
  margin-top: 40px;
}
.section-head {
  margin-bottom: 14px;
}
.section-head h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.path-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.path-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.path-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.path-numeral {
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  font-weight: 600;
  color: var(--muted-soft);
  min-width: 18px;
}
.path-han {
  font-family: var(--font-han);
  font-size: 25px;
  color: var(--muted);
  line-height: 1;
}
.path-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.path-body strong {
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.path-body em {
  font-size: 8.5px;
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.path-status {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.path-icon {
  margin-left: auto;
  color: var(--muted-soft);
}
.path-icon .ico {
  width: 16px;
  height: 16px;
}
.path-card.is-current {
  border-color: rgba(200, 49, 45, 0.32);
  background: linear-gradient(180deg, #fffdf9, var(--red-soft));
}
.path-card.is-current .path-numeral,
.path-card.is-current .path-icon,
.path-card.is-current .path-han {
  color: var(--red);
}
.path-card.is-current .path-status {
  color: var(--red);
}
.path-card.is-done {
  border-color: rgba(78, 124, 109, 0.28);
}
.path-card.is-done .path-numeral,
.path-card.is-done .path-icon {
  color: var(--jade);
}
.path-card.is-soon {
  border-style: dashed;
  border-color: rgba(184, 151, 90, 0.4);
}
.path-card.is-mystery {
  background: #f3eadc;
  border-style: dashed;
  opacity: 0.8;
}

/* ============================================================
   Chapter
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.back-link .ico {
  width: 14px;
  height: 14px;
}
.back-link:hover {
  color: var(--red);
}

.chapter-hero {
  position: relative;
  min-height: 330px;
  border-radius: 28px;
  overflow: hidden;
  color: #f6eddc;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.chapter-hero .scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.chapter-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(14, 18, 15, 0.78), transparent 62%),
    linear-gradient(0deg, rgba(14, 18, 15, 0.8), transparent 58%);
}
.chapter-hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 42px;
  max-width: 680px;
}
.chapter-hero-content h1 {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 76px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: #fdf6e8;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.24);
}
.chapter-city {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.62);
}
.chapter-city span {
  font-family: var(--font-han);
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  text-transform: none;
}
.chapter-lead {
  margin-top: 13px;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(246, 237, 220, 0.7);
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.hero-chips span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(246, 237, 220, 0.18);
  border-radius: 999px;
  background: rgba(246, 237, 220, 0.06);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(246, 237, 220, 0.68);
  backdrop-filter: blur(6px);
}
.hero-chips .ico {
  width: 13px;
  height: 13px;
  color: var(--gold-light);
}

.chapter-stamp {
  position: absolute;
  z-index: 3;
  top: 28px;
  right: 30px;
  width: 72px;
  height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(200, 49, 45, 0.9);
  color: #fff7ea;
  border-radius: 5px;
  transform: rotate(3deg);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 247, 234, 0.18) inset;
  opacity: 0.92;
}
.chapter-stamp span {
  font-family: var(--font-han);
  font-size: 39px;
  line-height: 1;
}
.chapter-stamp em {
  font-family: var(--font-display);
  font-size: 11px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.chapter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.chapter-main,
.chapter-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.npc-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.npc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.npc-person {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.npc-id p {
  margin-bottom: 2px;
}
.npc-id h3 {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}
.npc-id > span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.npc-rep {
  width: 128px;
  flex: 0 0 128px;
}
.npc-rep > span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--jade-deep);
}
.npc-rep .ico {
  width: 12px;
  height: 12px;
  color: var(--red);
}

.dialogue {
  position: relative;
  margin-top: 16px;
  padding: 20px 22px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(184, 151, 90, 0.08), transparent 46%),
    var(--bg-soft);
}
.dialogue::before {
  content: "“";
  position: absolute;
  right: 16px;
  top: 2px;
  font-family: var(--font-display);
  font-size: 58px;
  line-height: 1;
  color: rgba(184, 151, 90, 0.18);
  pointer-events: none;
}
.dialogue.is-narrator {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(78, 124, 109, 0.07), transparent 46%),
    #f2eee3;
  border-color: #ddd2bf;
}
.dialogue.is-completed {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(78, 124, 109, 0.09), transparent 46%),
    var(--bg-soft);
}
.dialogue-speaker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}
.dialogue-speaker em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted-soft);
  letter-spacing: 0.04em;
}
.speaker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.speaker-narrator {
  background: var(--gold);
}
.speaker-yu {
  background: var(--jade);
}
.speaker-lin {
  background: var(--wood);
}
.dialogue-text {
  min-height: 72px;
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  position: relative;
}
.dialogue.is-narrator .dialogue-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
}
.dialogue-text.is-typing::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--red);
  animation: blink 0.9s steps(2) infinite;
}
.dialogue-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 203, 180, 0.6);
}
.dialogue-step {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.dialogue-foot .btn {
  min-height: 38px;
  font-size: 11.5px;
}
.chapter-complete-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--jade-deep);
  font-size: 10.5px;
  font-weight: 700;
}
.chapter-complete-strip > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.chapter-complete-strip .ico {
  width: 14px;
  height: 14px;
}

.quest-steps-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.quest-steps-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.quest-steps-head h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.quest-steps-head p:not(.eyebrow) {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.quest-steps-progress {
  width: 115px;
  flex: 0 0 115px;
  text-align: right;
}
.quest-steps-progress strong {
  display: block;
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--red);
}
.quest-locked-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 10.5px;
  font-weight: 600;
}
.quest-locked-note .ico {
  width: 14px;
  height: 14px;
}
.quest-step-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}
.quest-step {
  display: grid;
  grid-template-columns: 28px 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.quest-step.is-current {
  border-color: rgba(200, 49, 45, 0.36);
  background: linear-gradient(90deg, rgba(200, 49, 45, 0.07), rgba(255, 253, 249, 0.8));
  box-shadow: 0 10px 22px -18px rgba(200, 49, 45, 0.5);
}
.quest-step.is-done {
  background: rgba(78, 124, 109, 0.035);
  border-color: rgba(78, 124, 109, 0.2);
}
.quest-step.is-locked {
  opacity: 0.62;
}
.step-index {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 600;
  color: var(--muted-soft);
  text-align: center;
}
.step-index .ico {
  width: 17px;
  height: 17px;
  margin: auto;
  color: var(--jade);
}
.step-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.step-icon .ico {
  width: 15px;
  height: 15px;
}
.quest-step.is-current .step-icon {
  border-color: rgba(200, 49, 45, 0.35);
  color: var(--red);
  background: var(--red-soft);
}
.step-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.step-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.step-top strong {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-top em {
  font-size: 7.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  white-space: nowrap;
}
.quest-step.is-current .step-top em {
  color: var(--red);
}
.quest-step.is-done .step-top em {
  color: var(--jade);
}
.step-sub {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.step-char {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--font-han);
  font-size: 15px;
  line-height: 1;
}
.quest-step.is-done .step-char {
  background: var(--jade-soft);
  color: var(--jade-deep);
}
.step-rewards {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.step-rewards .chip {
  padding: 3px 6px;
  font-size: 8.5px;
}
.step-rewards .chip .ico {
  width: 10px;
  height: 10px;
}
.step-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.step-action .btn {
  min-height: 31px;
  padding: 0 10px;
  font-size: 10px;
}
.step-seal {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #fff9f2;
}
.step-seal .ico {
  width: 14px;
  height: 14px;
}
.step-lock {
  color: var(--muted-soft);
}
.step-lock .ico {
  width: 15px;
  height: 15px;
}
.quest-steps-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--muted-soft);
}
.quest-steps-foot span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.quest-steps-foot .ico {
  width: 12px;
  height: 12px;
}

.side-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.side-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-card-head > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.side-card-head .ico {
  width: 14px;
  height: 14px;
  color: var(--red);
}
.side-card-head em {
  font-style: normal;
  font-weight: 700;
  color: var(--muted-soft);
}
.progress-side-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 12px;
}
.progress-side-body strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}
.progress-side-body p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
}
.progress-side .ring-label {
  font-size: 24px;
}
.side-reward {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.side-reward > span {
  display: block;
  margin-bottom: 6px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.side-reward > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.npc-side-person {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0 8px;
}
.npc-side-person > div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.npc-side-person strong {
  font-size: 11.5px;
  font-weight: 800;
}
.npc-side-person span {
  font-size: 8.5px;
  color: var(--muted);
}
.npc-side-person em {
  margin-left: auto;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--jade-deep);
}
.npc-side .bar {
  margin-bottom: 8px;
}
.npc-memory {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--muted);
}
.npc-memory .ico {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  color: var(--gold);
}

.quote-card {
  position: relative;
  padding: 20px 18px 17px;
  border: 1px solid rgba(184, 151, 90, 0.25);
  border-left: 2px solid var(--gold);
  border-radius: 4px 16px 16px 4px;
  background: linear-gradient(120deg, var(--gold-soft), rgba(255, 253, 249, 0.6));
}
.quote-mark {
  position: absolute;
  top: -4px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  color: rgba(184, 151, 90, 0.25);
}
.quote-card p {
  position: relative;
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  line-height: 1.35;
  color: var(--ink-soft);
}
.quote-card cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.teaser-panel {
  max-width: 700px;
  margin: -28px auto 0;
  position: relative;
  z-index: 4;
  padding: 38px 40px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.teaser-lock {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(200, 49, 45, 0.22);
}
.teaser-lock .ico {
  width: 26px;
  height: 26px;
}
.teaser-panel .eyebrow {
  justify-content: center;
}
.teaser-panel h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}
.teaser-panel > p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.teaser-panel blockquote {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  text-align: left;
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  line-height: 1.4;
  color: var(--wood);
}
.teaser-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ============================================================
   Inventory
   ============================================================ */
.bonus-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 28px;
  border-radius: 24px;
  overflow: hidden;
  color: #f6eddc;
  background:
    radial-gradient(ellipse at 84% 6%, rgba(200, 49, 45, 0.26), transparent 46%),
    linear-gradient(145deg, #252f28, #151b17);
  border: 1px solid rgba(184, 151, 90, 0.24);
  box-shadow: var(--shadow-md);
}
.bonus-banner::after {
  content: "藏";
  position: absolute;
  right: 220px;
  top: -30px;
  font-family: var(--font-han);
  font-size: 170px;
  line-height: 1;
  color: rgba(246, 237, 220, 0.04);
  pointer-events: none;
}
.bonus-banner-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
}
.bonus-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(184, 151, 90, 0.14);
  border: 1px solid rgba(212, 185, 106, 0.28);
  color: var(--gold-light);
}
.bonus-icon .ico {
  width: 22px;
  height: 22px;
}
.bonus-banner-copy h3 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}
.bonus-banner-copy p:not(.eyebrow) {
  margin-top: 3px;
  font-size: 10.5px;
  color: rgba(246, 237, 220, 0.52);
}
.bonus-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 24px;
}
.bonus-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.bonus-stats strong {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-light);
}
.bonus-stats span {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(246, 237, 220, 0.45);
  text-align: right;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.artifact-card {
  position: relative;
  min-height: 300px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.artifact-card:not(.is-locked):hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.artifact-card.rarity-uncommon {
  background: radial-gradient(circle at 94% 3%, rgba(184, 151, 90, 0.15), transparent 42%), var(--surface);
}
.artifact-card.rarity-rare {
  background: radial-gradient(circle at 94% 3%, rgba(78, 124, 109, 0.14), transparent 42%), var(--surface);
}
.artifact-card.rarity-epic {
  background:
    radial-gradient(circle at 94% 3%, rgba(200, 49, 45, 0.14), transparent 38%),
    radial-gradient(circle at 6% 96%, rgba(184, 151, 90, 0.12), transparent 40%),
    var(--surface);
}

.artifact-rarity {
  align-self: flex-start;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft);
}
.rarity {
  display: inline-block;
}
.rarity-common {
  color: var(--muted);
}
.rarity-uncommon {
  color: var(--gold);
  border-color: rgba(184, 151, 90, 0.35) !important;
  background: var(--gold-soft) !important;
}
.rarity-rare {
  color: var(--jade-deep);
  border-color: rgba(78, 124, 109, 0.35) !important;
  background: var(--jade-soft) !important;
}
.rarity-epic {
  color: var(--red);
  border-color: rgba(200, 49, 45, 0.32) !important;
  background: var(--red-soft) !important;
}

.artifact-art {
  height: 168px;
  display: grid;
  place-items: center;
}
.artifact-svg {
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 14px 18px rgba(61, 42, 24, 0.16));
  transition: transform 0.35s var(--ease);
}
.artifact-card:hover .artifact-svg {
  transform: translateY(-3px) scale(1.035);
}
.artifact-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.artifact-han {
  margin-top: 2px;
  font-family: var(--font-han);
  font-size: 17px;
  color: var(--muted);
  line-height: 1;
}
.artifact-bonus {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--jade-deep);
}
.artifact-bonus .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.artifact-card.is-locked {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  background: #f4ecdf;
  color: var(--muted);
}
.artifact-locked-art {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  color: var(--muted-soft);
}
.artifact-locked-art .ico {
  width: 22px;
  height: 22px;
}
.artifact-card.is-locked .artifact-rarity {
  display: none;
}
.artifact-card.is-locked strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-soft);
}
.artifact-card.is-locked p {
  margin-top: 5px;
  max-width: 220px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-soft);
}

.empty-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}
.empty-tip .ico {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--gold);
}
.empty-tip p {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ============================================================
   Scroll collection
   ============================================================ */
.scroll-hero {
  display: flex;
  align-items: stretch;
  margin: 4px 0 16px;
  filter: drop-shadow(0 22px 34px rgba(61, 42, 24, 0.12));
}
.scroll-roll {
  width: 22px;
  flex: 0 0 22px;
  border-radius: 11px;
  background: linear-gradient(90deg, #6b4c2f, #a77743 45%, #5c3d22);
  box-shadow: 0 0 0 1px rgba(61, 42, 24, 0.35) inset;
  position: relative;
  z-index: 2;
}
.scroll-roll::before,
.scroll-roll::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #c49a63, #6b4527);
}
.scroll-roll::before {
  top: -5px;
}
.scroll-roll::after {
  bottom: -5px;
}
.scroll-roll-left {
  margin-right: -3px;
}
.scroll-roll-right {
  margin-left: -3px;
}
.scroll-hero-paper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 36px;
  border-top: 1px solid #d9c7a6;
  border-bottom: 1px solid #d9c7a6;
  background:
    repeating-linear-gradient(90deg, rgba(184, 151, 90, 0.05) 0 1px, transparent 1px 78px),
    linear-gradient(90deg, #f5ead6, #fbf3e4 35%, #f3e5cc);
  overflow: hidden;
}
.scroll-hero-paper::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(184, 151, 90, 0.16);
  pointer-events: none;
}
.scroll-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 280px;
}
.scroll-hero-copy h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.scroll-hero-copy p:not(.eyebrow) {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}
.scroll-seals {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.scroll-seal {
  width: 64px;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1.5px dashed rgba(184, 151, 90, 0.48);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.32);
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.scroll-seal.is-on {
  border-style: solid;
  border-color: rgba(200, 49, 45, 0.5);
  background: rgba(255, 253, 249, 0.74);
  box-shadow: 0 8px 16px -12px rgba(61, 42, 24, 0.4);
}
.scroll-seal.is-on:hover {
  transform: translateY(-3px);
  border-color: var(--red);
}
.scroll-seal-index {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted-soft);
}
.scroll-seal-han {
  font-family: var(--font-han);
  font-size: 30px;
  line-height: 1;
  color: var(--muted-soft);
}
.scroll-seal.is-on .scroll-seal-han {
  color: var(--red);
}
.scroll-seal-pinyin {
  font-size: 7.5px;
  font-weight: 700;
  color: var(--muted-soft);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scroll-seal.is-on .scroll-seal-pinyin {
  color: var(--muted);
}
.scroll-hero-stamp {
  position: absolute;
  right: 22px;
  top: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff9f2;
  border-radius: 3px;
  font-family: var(--font-han);
  font-size: 22px;
  transform: rotate(-4deg);
  opacity: 0.72;
}

.collection-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 18px;
}
.collection-stats > div {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.collection-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}
.collection-stats span {
  display: block;
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.char-card {
  position: relative;
  min-height: 228px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: left;
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.char-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.char-big {
  font-family: var(--font-han);
  font-size: 74px;
  line-height: 1;
  color: var(--ink);
  transition: color 0.2s, transform 0.25s var(--ease);
}
.char-card:hover .char-big {
  color: var(--red);
  transform: translateX(2px);
}
.char-pinyin {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--red);
}
.char-meaning {
  margin-top: 1px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.char-chapter {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.char-memory {
  width: 100%;
  margin-top: auto;
  padding-top: 13px;
}
.char-memory-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--muted);
}
.char-memory-label em {
  font-style: normal;
}
.char-memory-label strong {
  color: var(--jade-deep);
  font-weight: 800;
}
.char-open {
  position: absolute;
  right: 15px;
  bottom: 15px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
}
.char-open .ico {
  width: 13px;
  height: 13px;
}
.char-card.is-locked {
  border-style: dashed;
  background: #f5ede0;
  color: var(--muted);
}
.char-card.is-locked:hover {
  transform: none;
  box-shadow: none;
}
.char-card.is-locked .char-big {
  color: var(--muted-soft);
  font-family: var(--font-display);
  font-size: 64px;
}
.char-lock {
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--muted-soft);
}
.char-lock .ico {
  width: 16px;
  height: 16px;
}
.char-card.is-locked .char-meaning {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--muted);
}

/* ============================================================
   Training
   ============================================================ */
.training-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 32px 38px;
  border-radius: 26px;
  overflow: hidden;
  color: #f6eddc;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(200, 49, 45, 0.22), transparent 42%),
    radial-gradient(ellipse at 20% 100%, rgba(184, 151, 90, 0.13), transparent 46%),
    linear-gradient(145deg, #242e27, #141a16);
  border: 1px solid rgba(184, 151, 90, 0.22);
  box-shadow: var(--shadow-md);
}
.training-hero::before {
  content: "";
  position: absolute;
  right: 26%;
  top: -40%;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(212, 185, 106, 0.12);
  border-radius: 50%;
}
.training-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.training-hero-copy h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.2vw, 50px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: #fdf6e8;
}
.training-hero-copy > p:not(.eyebrow) {
  margin-top: 10px;
  max-width: 520px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(246, 237, 220, 0.62);
}
.training-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 19px;
}
.training-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(246, 237, 220, 0.48);
}
.training-reward .ico {
  width: 12px;
  height: 12px;
  color: var(--gold-light);
}
.training-orbit {
  position: relative;
  z-index: 1;
  width: 156px;
  height: 156px;
  flex: 0 0 156px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(212, 185, 106, 0.36);
  border-radius: 50%;
  animation: slowSpin 40s linear infinite;
}
.training-orbit::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(246, 237, 220, 0.1);
  border-radius: 50%;
}
.orbit-seal {
  font-family: var(--font-han);
  font-size: 58px;
  line-height: 1;
  color: var(--gold-light);
  animation: slowSpinBack 40s linear infinite;
}
.orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 49, 45, 0.14);
}
.orbit-dot-a {
  top: 12px;
  left: 34px;
}
.orbit-dot-b {
  right: 0;
  top: 50%;
  background: var(--gold-light);
}
.orbit-dot-c {
  bottom: 21px;
  left: 20px;
  width: 5px;
  height: 5px;
  background: var(--jade);
}

.training-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 14px 0;
}
.training-stats > div {
  display: flex;
  flex-direction: column;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  position: relative;
}
.training-stats > div > span {
  position: absolute;
  right: 13px;
  top: 12px;
  color: var(--gold);
}
.training-stats .ico {
  width: 16px;
  height: 16px;
}
.training-stats strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.training-stats em {
  margin-top: 2px;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted-soft);
}

.training-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}
.memory-card,
.method-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.memory-list {
  margin-top: 8px;
}
.memory-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 11px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  text-align: left;
  transition: background 0.2s;
}
.memory-row:first-child {
  border-top: 0;
}
.memory-row:hover {
  background: var(--bg-soft);
}
.memory-han {
  font-family: var(--font-han);
  font-size: 31px;
  line-height: 1;
}
.memory-info {
  min-width: 0;
}
.memory-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 800;
}
.memory-info strong em {
  margin-left: 4px;
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}
.memory-info .bar {
  display: block;
  max-width: 190px;
}
.memory-due {
  font-size: 8px;
  font-weight: 600;
  color: var(--muted-soft);
  white-space: nowrap;
}
.memory-row > .ico {
  width: 14px;
  height: 14px;
  color: var(--muted-soft);
}
.method-card h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.05;
}
.method-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.method-steps > div {
  display: flex;
  gap: 10px;
}
.method-steps > div > span {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
  padding-top: 2px;
}
.method-steps p {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}
.method-steps strong {
  display: block;
  margin-bottom: 1px;
  font-size: 11.5px;
  color: var(--ink);
}
.method-card .text-link {
  font-size: 10px;
}

.empty-state {
  max-width: 620px;
  margin: 20px auto;
  padding: 50px 36px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 151, 90, 0.1), transparent 50%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.empty-seal {
  display: block;
  font-family: var(--font-han);
  font-size: 100px;
  line-height: 1;
  color: rgba(200, 49, 45, 0.8);
}
.empty-state .eyebrow {
  justify-content: center;
  margin-top: 13px;
}
.empty-state h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}
.empty-state > p:not(.eyebrow) {
  margin: 10px auto 20px;
  max-width: 400px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ============================================================
   Profile
   ============================================================ */
.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(200px, 0.55fr);
  align-items: center;
  gap: 30px;
  padding: 32px 36px;
  border-radius: 26px;
  overflow: hidden;
  color: #f6eddc;
  background:
    radial-gradient(ellipse at 78% 12%, rgba(200, 49, 45, 0.2), transparent 46%),
    radial-gradient(ellipse at 8% 96%, rgba(78, 124, 109, 0.16), transparent 44%),
    linear-gradient(145deg, #252e28, #141a16);
  border: 1px solid rgba(184, 151, 90, 0.22);
  box-shadow: var(--shadow-md);
}
.profile-hero::after {
  content: "道";
  position: absolute;
  right: 24%;
  top: -38%;
  font-family: var(--font-han);
  font-size: 300px;
  line-height: 1;
  color: rgba(246, 237, 220, 0.035);
  pointer-events: none;
}
.profile-seal {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 146px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(155deg, var(--seal-color), color-mix(in srgb, var(--seal-color), #1a1613 30%));
  color: #fff9f2;
  transform: rotate(-2deg);
  box-shadow: 0 20px 38px -20px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(255, 249, 242, 0.12) inset;
}
.profile-seal-pattern {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(255, 249, 242, 0.25);
  border-radius: 4px;
}
.profile-seal-han {
  font-family: var(--font-han);
  font-size: 68px;
  line-height: 1;
  margin-top: 4px;
}
.profile-seal em {
  margin-top: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}
.profile-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.profile-copy h1 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.6vw, 68px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #fdf6e8;
}
.profile-copy > p:not(.eyebrow) {
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.5);
}
.profile-xp {
  max-width: 420px;
  margin-top: 16px;
}
.profile-xp-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 5px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(246, 237, 220, 0.55);
}
.profile-xp-head em {
  font-style: normal;
  color: rgba(246, 237, 220, 0.72);
}
.profile-hero .bar {
  height: 6px;
  background: rgba(246, 237, 220, 0.14);
}
.profile-hero .bar > span {
  background: linear-gradient(90deg, var(--red), #d96354);
}
.profile-quote {
  position: relative;
  z-index: 1;
  padding-left: 18px;
  border-left: 1px solid rgba(246, 237, 220, 0.16);
}
.profile-quote > span {
  font-family: var(--font-display);
  font-size: 46px;
  line-height: 0.6;
  color: rgba(212, 185, 106, 0.45);
}
.profile-quote p {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.4;
  color: rgba(246, 237, 220, 0.68);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 14px 0;
}
.profile-stats > div {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.profile-stats > div > span {
  position: absolute;
  top: 13px;
  right: 14px;
  color: var(--gold);
}
.profile-stats .ico {
  width: 17px;
  height: 17px;
}
.profile-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 700;
  line-height: 1;
}
.profile-stats em {
  display: block;
  margin-top: 3px;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted-soft);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}
.profile-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.profile-npcs {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 14px;
}
.profile-npc {
  display: flex;
  align-items: center;
  gap: 11px;
}
.profile-npc-body {
  flex: 1;
  min-width: 0;
}
.profile-npc-body > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.profile-npc-body strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}
.profile-npc-body span {
  font-size: 8.5px;
  color: var(--muted);
}
.profile-npc-rep {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 4px;
  font-size: 8px;
  font-weight: 700;
  color: var(--jade-deep);
}
.profile-npc-rep em {
  font-style: normal;
  color: var(--muted-soft);
}
.profile-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted-soft);
}
.profile-note .ico {
  width: 13px;
  height: 13px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 14px;
}
.achievement {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
}
.achievement-icon {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted-soft);
}
.achievement-icon .ico {
  width: 15px;
  height: 15px;
}
.achievement strong {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}
.achievement > span:last-child {
  font-size: 8px;
  line-height: 1.3;
  color: var(--muted-soft);
}
.achievement.is-unlocked {
  border-color: rgba(184, 151, 90, 0.3);
  background: linear-gradient(120deg, var(--gold-soft), var(--surface));
}
.achievement.is-unlocked .achievement-icon {
  background: var(--red);
  color: #fff9f2;
}
.achievement.is-locked {
  opacity: 0.58;
}

.settings-card {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.settings-row:first-of-type {
  margin-top: 10px;
}
.settings-row > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.settings-row strong {
  font-size: 11.5px;
  font-weight: 800;
}
.settings-row span {
  font-size: 9.5px;
  color: var(--muted);
}
.toggle {
  width: 44px;
  height: 25px;
  flex: 0 0 44px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s;
}
.toggle span {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(42, 37, 32, 0.2);
  transition: transform 0.2s var(--ease);
}
.toggle.is-on {
  background: var(--red);
}
.toggle.is-on span {
  transform: translateX(19px);
}
.settings-card .fineprint {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   NPC portraits
   ============================================================ */
.npc-avatar {
  width: var(--a-size);
  height: var(--a-size);
  flex: 0 0 var(--a-size);
  display: inline-block;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 12%, rgba(184, 151, 90, 0.18), transparent 55%),
    var(--bg-soft);
  box-shadow: 0 5px 14px -8px rgba(42, 37, 32, 0.35);
}
.npc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 3%;
  transform: scale(1.03);
}

.hero-npc {
  position: absolute;
  z-index: 2;
  right: 58px;
  bottom: -8px;
  height: 108%;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}
.hero-npc img {
  height: 100%;
  width: auto;
  max-width: 290px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, 0.4));
  -webkit-mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 86%, transparent 100%);
  animation: heroNpcIn 0.7s var(--ease) both;
}

/* ============================================================
   Zero-level tutorial
   ============================================================ */
.tutorial {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: #f6eddc;
}
.tutorial-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tutorial-art .scene-svg {
  width: 100%;
  height: 100%;
}
.tutorial-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 72% 32%, rgba(200, 49, 45, 0.12), transparent 38%),
    linear-gradient(90deg, rgba(8, 12, 9, 0.96) 0%, rgba(8, 12, 9, 0.82) 44%, rgba(8, 12, 9, 0.34) 100%),
    linear-gradient(0deg, rgba(8, 12, 9, 0.92), transparent 52%);
}
.tutorial-top {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 34px;
}
.tutorial-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}
.tutorial-step {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(246, 237, 220, 0.34);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.tutorial-step b {
  font-family: var(--font-display);
  font-size: 12px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}
.tutorial-step em {
  font-style: normal;
}
.tutorial-step.is-done {
  color: rgba(246, 237, 220, 0.55);
}
.tutorial-step.is-done b {
  color: #a9cfb9;
}
.tutorial-step.is-active {
  color: var(--gold-light);
  border-color: rgba(212, 185, 106, 0.24);
  background: rgba(184, 151, 90, 0.12);
}
.tutorial-step.is-active b {
  color: var(--gold-light);
}
.tutorial-main {
  position: relative;
  z-index: 3;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 38px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.68fr);
  align-items: center;
  gap: 26px;
}
.tutorial-panel {
  position: relative;
  width: 100%;
  max-width: 690px;
  justify-self: center;
  padding: 34px 38px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(184, 151, 90, 0.08), transparent 42%),
    var(--surface);
  color: var(--ink);
  box-shadow: 0 44px 100px -44px rgba(0, 0, 0, 0.8);
  animation: cardIn 0.55s var(--ease) both;
}
.tutorial-panel h1 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(40px, 5.2vw, 60px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
}
.tutorial-panel h1 em {
  font-style: italic;
  font-weight: 600;
  color: var(--red);
}
.tutorial-lead {
  margin-top: 10px;
  max-width: 520px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}
.tutorial-quote {
  margin-top: 17px;
  padding: 13px 16px;
  border-left: 2px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--bg-soft);
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  line-height: 1.42;
  color: var(--ink-soft);
}
.tutorial-quote cite {
  display: block;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.tutorial-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}
.tutorial-chips span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--muted);
}
.tutorial-chips .ico {
  width: 12px;
  height: 12px;
  color: var(--gold);
}
.tutorial-copy > .btn,
.tutorial-parable > .btn,
.tutorial-done > .btn,
.tutorial-bricks > .btn,
.tutorial-writing > .btn,
.tutorial-speak > .btn {
  margin-top: 18px;
}
.tutorial-copy .fineprint {
  margin-top: 9px;
}
.tutorial-guard {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tutorial-guard-glow {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 390px;
  height: 390px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 49, 45, 0.2), rgba(184, 151, 90, 0.09) 45%, transparent 70%);
  filter: blur(10px);
}
.tutorial-guard > img {
  position: relative;
  z-index: 1;
  max-height: 74vh;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 32px 40px rgba(0, 0, 0, 0.58));
  -webkit-mask-image: linear-gradient(180deg, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 88%, transparent 100%);
  animation: float 9s ease-in-out infinite;
}
.tutorial-guard-tag {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 13px;
  border: 1px solid rgba(246, 237, 220, 0.2);
  border-radius: 999px;
  background: rgba(13, 18, 14, 0.58);
  backdrop-filter: blur(8px);
  text-align: center;
  white-space: nowrap;
}
.tutorial-guard-tag strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}
.tutorial-guard-tag em {
  display: block;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.42);
}
.tutorial-mobile-guard {
  display: none;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.tutorial-mobile-guard img {
  width: 36px;
  height: 44px;
  object-fit: cover;
  object-position: 50% 2%;
  border-radius: 10px;
  background: var(--bg-soft);
}
.tutorial-mobile-guard span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.tutorial-mobile-guard strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.tutorial-mobile-guard em {
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.tutorial-foot {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 34px 19px;
  border-top: 1px solid rgba(246, 237, 220, 0.12);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.34);
}

/* Tutorial writing */
.tutorial-writing-board {
  width: 100%;
  max-width: 346px;
  margin: 14px auto 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-soft);
}
.tianzige.tutorial-tianzige {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.tutorial-writing .write-note {
  text-align: center;
}
.recall-badge {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: -1px auto 10px;
  padding: 6px 10px;
  border: 1px solid rgba(184, 151, 90, 0.32);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 9px;
  font-weight: 700;
}
.recall-badge .ico {
  width: 12px;
  height: 12px;
  color: var(--gold);
}
.tutorial-writing-board.is-mistake {
  animation: shake 0.34s ease;
}

/* Tutorial success */
.tutorial-success {
  text-align: center;
  padding: 8px 0 4px;
}
.tutorial-success .eyebrow {
  justify-content: center;
}
.tutorial-success-char {
  margin-top: 2px;
  font-family: var(--font-han);
  font-size: clamp(130px, 18vw, 190px);
  line-height: 0.9;
  color: var(--red);
  animation: successChar 0.7s var(--ease) both;
}
.tutorial-pinyin {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
}
.tutorial-success h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.tutorial-success > p:not(.eyebrow):not(.tutorial-pinyin) {
  max-width: 420px;
  margin: 10px auto 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.tutorial-success-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}
.tutorial-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* Tutorial speaking */
.speak-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(230px, 1.1fr);
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}
.speak-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 26%, rgba(184, 151, 90, 0.1), transparent 60%),
    var(--bg-soft);
  text-align: center;
}
.speak-han {
  font-family: var(--font-han);
  font-size: 116px;
  line-height: 0.9;
  color: var(--ink);
}
.speak-pinyin {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--red);
}
.speak-meaning {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.speak-card .audio-btn {
  margin-top: 9px;
}
.speak-audio-note {
  margin-top: 7px;
  max-width: 190px;
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted-soft);
}
.speak-mic-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  text-align: center;
}
.mic-orb {
  position: relative;
  width: 104px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  background: linear-gradient(155deg, #d23b34, var(--red-deep));
  color: #fff9f2;
  box-shadow: 0 18px 34px -18px rgba(200, 49, 45, 0.8);
  transition: transform 0.2s var(--ease);
}
.mic-orb:hover {
  transform: scale(1.03);
}
.mic-orb .ico {
  width: 29px;
  height: 29px;
}
.mic-orb em {
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}
.mic-orb.is-listening {
  animation: orbPulse 0.9s var(--ease) infinite;
}
.mic-ring {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(200, 49, 45, 0.3);
  border-radius: 50%;
  pointer-events: none;
}
.mic-ring-a {
  animation: ripple 2.8s ease-out infinite;
}
.mic-ring-b {
  animation: ripple 2.8s ease-out 1.4s infinite;
}
.mic-label {
  margin-top: 10px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
}
.mic-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 6px 0 2px;
  max-width: 230px;
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted-soft);
}
.mic-note .ico {
  width: 12px;
  height: 12px;
  color: var(--gold);
}
.speak-mic-panel .btn-small {
  margin-top: 7px;
}
.speak-mic-panel .text-link {
  margin-top: 5px;
  font-size: 9px;
  color: var(--muted);
}
.mic-success {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mic-success-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #fff9f2;
  box-shadow: 0 12px 25px -14px rgba(78, 124, 109, 0.7);
}
.mic-success-icon .ico {
  width: 26px;
  height: 26px;
}
.mic-success h3 {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.mic-success p {
  margin-top: 4px;
  max-width: 200px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.mic-success .btn {
  margin-top: 11px;
}
.tutorial-speak > .fineprint {
  margin-top: 12px;
  text-align: center;
}

/* Tutorial parable */
.tutorial-parable {
  text-align: center;
}
.tutorial-parable .eyebrow {
  justify-content: center;
}
.parable-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 2px;
}
.parable-figure {
  width: 110px;
  height: 145px;
  color: var(--gold);
  opacity: 0.65;
}
.parable-han {
  font-family: var(--font-han);
  font-size: 128px;
  line-height: 0.9;
  color: var(--red);
}
.parable-text {
  max-width: 500px;
  margin: 6px auto 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.tutorial-parable .tutorial-quote {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.tutorial-parable > .btn {
  margin-top: 16px;
}

/* Tutorial bricks */
.bricks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 14px;
}
.brick-card {
  position: relative;
  min-height: 146px;
  padding: 8px 6px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.brick-card:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--gold);
  background: var(--surface);
}
.brick-card:disabled {
  cursor: default;
}
.brick-pictogram {
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted-soft);
}
.tutorial-glyph {
  width: 48px;
  height: 48px;
}
.brick-han {
  font-family: var(--font-han);
  font-size: 35px;
  line-height: 1;
  margin-top: 1px;
}
.brick-pinyin {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
}
.brick-meaning {
  font-size: 9px;
  color: var(--muted);
}
.brick-state {
  margin-top: auto;
  padding-top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.brick-state .ico {
  width: 11px;
  height: 11px;
}
.brick-card.is-collected {
  border-color: rgba(78, 124, 109, 0.38);
  background: linear-gradient(180deg, #fbfdf9, var(--jade-soft));
}
.brick-card.is-collected .brick-pictogram {
  color: var(--jade);
}
.brick-card.is-collected .brick-han {
  color: var(--jade-deep);
}
.brick-card.is-collected .brick-state {
  color: var(--jade-deep);
}
.bricks-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.bricks-progress .bar {
  flex: 1;
}
.bricks-progress em {
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted-soft);
  white-space: nowrap;
}
.bricks-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 9px;
  color: var(--muted-soft);
}
.bricks-hint .ico {
  width: 13px;
  height: 13px;
}
.combine-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(184, 151, 90, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 151, 90, 0.16), transparent 60%),
    var(--bg-soft);
  text-align: center;
  animation: fadeUp 0.4s var(--ease) both;
}
.combine-panel .eyebrow {
  justify-content: center;
}
.combine-panel h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}
.combine-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}
.combine-tile {
  width: 74px;
  height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.3s var(--ease);
}
.combine-tile:hover {
  border-color: var(--red);
}
.combine-tile span {
  font-family: var(--font-han);
  font-size: 35px;
  line-height: 1;
}
.combine-tile em {
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  color: var(--red);
}
.combine-tile small {
  font-size: 7.5px;
  color: var(--muted);
}
.combine-plus,
.combine-eq {
  font-family: var(--font-display);
  font-size: 27px;
  color: var(--muted-soft);
}
.combine-unknown {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 29px;
  color: var(--muted-soft);
}
.combine-panel.is-combining .combine-tile:first-child {
  transform: translateX(12px) rotate(-4deg);
}
.combine-panel.is-combining .combine-tile:nth-of-type(2) {
  transform: translateX(-8px) rotate(3deg);
}
.combine-panel.is-done {
  border-color: rgba(78, 124, 109, 0.38);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(78, 124, 109, 0.16), transparent 60%),
    var(--jade-soft);
}
.combine-result {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin: 5px 0 3px;
}
.combine-result span {
  font-family: var(--font-han);
  font-size: 76px;
  line-height: 0.9;
  color: var(--jade-deep);
  animation: successChar 0.7s var(--ease) both;
}
.combine-result em {
  font-family: var(--font-display);
  font-size: 23px;
  font-style: normal;
  font-weight: 600;
  color: var(--red);
}
.combine-result strong {
  font-size: 17px;
  color: var(--jade-deep);
}
.combine-panel > p:not(.eyebrow) {
  max-width: 430px;
  margin: 5px auto 8px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Tutorial finish */
.tutorial-done {
  text-align: center;
  padding: 4px 0;
}
.tutorial-done .eyebrow {
  justify-content: center;
}
.tutorial-gate-seal {
  width: 92px;
  height: 100px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--red);
  color: #fff9f2;
  font-family: var(--font-han);
  font-size: 51px;
  line-height: 1;
  transform: rotate(-3deg);
  box-shadow: 0 16px 30px -18px rgba(168, 39, 35, 0.65);
  animation: stampIn 0.6s var(--ease) both;
}
.done-chars {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 15px 0 4px;
}
.done-char {
  width: 59px;
  height: 77px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}
.done-char span {
  font-family: var(--font-han);
  font-size: 31px;
  line-height: 1;
  color: var(--ink);
}
.done-char em {
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  color: var(--red);
}
.done-char small {
  font-size: 7px;
  color: var(--muted-soft);
}
.done-char i {
  margin-top: 2px;
  font-size: 6px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--jade-deep);
}
.done-mastery-note {
  max-width: 470px;
  margin: 8px auto 2px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--muted-soft);
}
.tutorial-reward-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 2px;
}
.tutorial-done .fineprint {
  margin-top: 9px;
}

/* First bricks in the scroll */
.first-bricks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
  padding: 17px 20px;
  border: 1px solid rgba(184, 151, 90, 0.25);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 92% 0%, rgba(200, 49, 45, 0.07), transparent 42%),
    linear-gradient(120deg, var(--gold-soft), var(--surface));
  box-shadow: var(--shadow-sm);
}
.first-bricks-copy h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
}
.first-bricks-copy p:not(.eyebrow) {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
}
.first-bricks-row {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
.first-brick {
  width: 55px;
  height: 71px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.first-brick > span {
  font-family: var(--font-han);
  font-size: 29px;
  line-height: 1;
  color: var(--red);
}
.first-brick em {
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}
.first-brick small {
  font-size: 6.5px;
  color: var(--muted-soft);
}
.first-brick i {
  margin-top: 1px;
  font-size: 5.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--jade-deep);
}

/* Calligraphy master guest */
.write-master {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.write-master > div {
  min-width: 0;
}
.write-master strong {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.25;
}
.write-master span {
  display: block;
  font-size: 8px;
  color: var(--muted-soft);
}
.write-master p {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  line-height: 1.25;
  color: var(--wood);
}

/* Beginner word preview in game briefing */
.word-preview {
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(184, 151, 90, 0.1), transparent 46%),
    var(--bg);
}
.word-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wood);
}
.word-preview-head span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.word-preview-head .ico {
  width: 12px;
  height: 12px;
  color: var(--red);
}
.word-preview-head em {
  font-style: normal;
  color: var(--muted-soft);
}
.word-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.word-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 7px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.18s;
}
.word-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.wp-audio {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--muted-soft);
}
.wp-audio .ico {
  width: 11px;
  height: 11px;
}
.wp-han {
  font-family: var(--font-han);
  font-size: 31px;
  line-height: 1;
  color: var(--ink);
}
.wp-pinyin {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--red);
}
.wp-meaning {
  font-size: 8.5px;
  color: var(--muted);
}
.word-preview-note {
  margin-top: 6px;
  text-align: center;
  font-size: 8px;
  color: var(--muted-soft);
}

/* ============================================================
   NPC gallery
   ============================================================ */
.npc-gallery {
  margin-top: 34px;
}
.npc-gallery-scroll {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 3px 2px 9px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.npc-gallery-card {
  position: relative;
  flex: 0 0 184px;
  height: 280px;
  overflow: hidden;
  border: 1px solid rgba(184, 151, 90, 0.28);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 72% 12%, rgba(200, 49, 45, 0.18), transparent 44%),
    linear-gradient(155deg, #252e28, #141a16);
  color: #f6eddc;
  text-align: left;
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.npc-gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(10, 14, 11, 0.94) 4%, rgba(10, 14, 11, 0.18) 48%, transparent 72%);
  pointer-events: none;
}
.npc-gallery-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 185, 106, 0.5);
}
.npc-gallery-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.npc-gallery-art img {
  height: 89%;
  width: auto;
  max-width: 94%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.5));
  transition: transform 0.35s var(--ease);
}
.npc-gallery-card:hover .npc-gallery-art img {
  transform: translateY(-3px) scale(1.02);
}
.npc-gallery-copy {
  position: absolute;
  z-index: 2;
  left: 13px;
  right: 13px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.npc-gallery-copy strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
}
.npc-gallery-copy em {
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.48);
}
.npc-gallery-copy > span {
  margin-top: 3px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-light);
}

/* NPC modal */
.modal-npc {
  max-width: 940px;
}
.npc-modal {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}
.npc-modal-art {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 151, 90, 0.18), transparent 60%),
    linear-gradient(150deg, #252e28, #121713);
}
.npc-modal-halo {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 49, 45, 0.18), transparent 68%);
  filter: blur(8px);
}
.npc-modal-art img {
  position: relative;
  z-index: 1;
  max-height: 540px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, 0.5));
}
.npc-modal-copy {
  padding: 40px 38px 30px;
}
.npc-modal-copy h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.npc-modal-role {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.npc-modal-copy blockquote {
  margin-top: 17px;
  padding-left: 13px;
  border-left: 2px solid var(--gold);
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-soft);
}
.npc-modal-memory {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  font-size: 10px;
  color: var(--muted);
}
.npc-modal-memory .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.npc-modal-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 15px 0 18px;
  padding: 7px 11px;
  border: 1px solid rgba(78, 124, 109, 0.25);
  border-radius: 999px;
  background: var(--jade-soft);
  color: var(--jade-deep);
  font-size: 9px;
  font-weight: 700;
}
.npc-modal-status .ico {
  width: 13px;
  height: 13px;
}

/* ============================================================
   Overlays / game shell
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 18, 15, 0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  overflow-y: auto;
  animation: overlayIn 0.3s ease both;
}

.game-overlay {
  background:
    radial-gradient(ellipse at 20% 12%, rgba(200, 49, 45, 0.1), transparent 40%),
    radial-gradient(ellipse at 82% 84%, rgba(78, 124, 109, 0.12), transparent 42%),
    rgba(14, 18, 15, 0.8);
}

.game-shell {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalIn 0.42s var(--ease) both;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.game-title .eyebrow {
  font-size: 8px;
}
.game-title h2 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.game-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.game-progress-text {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--red);
  color: #fff9f2;
  font-size: 10px;
  font-weight: 800;
  animation: comboPop 0.35s var(--ease);
}
.combo-chip .ico {
  width: 12px;
  height: 12px;
}
.btn-hint {
  color: var(--wood);
  border: 1px solid rgba(184, 151, 90, 0.3);
  background: var(--gold-soft);
}
.btn-hint:hover {
  background: rgba(184, 151, 90, 0.18);
}
.btn-hint .ico {
  color: var(--gold);
}
.game-close {
  color: var(--muted);
  background: var(--bg-soft);
  border-color: var(--line);
}
.game-close:hover {
  color: var(--red);
}

.game-progress {
  height: 3px;
  background: var(--line);
  flex: 0 0 3px;
}
.game-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), #d96354);
  transition: width 0.4s var(--ease);
}

.game-body {
  padding: 26px 30px 30px;
  overflow-y: auto;
  flex: 1;
}

.game-stage {
  width: 100%;
  max-width: 710px;
  margin: 0 auto;
  animation: stageIn 0.35s var(--ease) both;
}
.game-stage-head {
  text-align: center;
  margin-bottom: 18px;
}
.game-stage-head .eyebrow {
  justify-content: center;
}
.game-stage-head h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.game-stage-head > p:not(.eyebrow) {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.game-stage-head strong {
  color: var(--red);
}

/* Game brief */
.game-brief {
  max-width: 560px;
  margin: 10px auto;
  padding: 6px 0;
  text-align: center;
}
.brief-orbit {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(184, 151, 90, 0.45);
  border-radius: 50%;
  position: relative;
}
.brief-orbit::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.brief-orbit span {
  font-family: var(--font-han);
  font-size: 43px;
  color: var(--red);
  line-height: 1;
}
.game-brief .eyebrow {
  justify-content: center;
}
.game-brief h3 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.brief-lead {
  margin: 10px auto 0;
  max-width: 470px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}
.brief-npc {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 13px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  text-align: left;
}
.brief-npc blockquote {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-soft);
}
.brief-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0 18px;
}
.game-brief .btn {
  min-width: 220px;
}
.game-brief .fineprint {
  margin-top: 10px;
  text-align: center;
}
.game-brief.has-word-preview {
  margin: 0 auto;
  padding: 0;
}
.game-brief.has-word-preview .brief-orbit {
  width: 64px;
  height: 64px;
  margin-bottom: 7px;
}
.game-brief.has-word-preview .brief-orbit::before {
  inset: 6px;
}
.game-brief.has-word-preview .brief-orbit span {
  font-size: 31px;
}
.game-brief.has-word-preview h3 {
  margin-top: 3px;
  font-size: 33px;
}
.game-brief.has-word-preview .brief-lead {
  margin-top: 6px;
  font-size: 11.5px;
}
.game-brief.has-word-preview .brief-npc {
  margin: 9px 0 8px;
  padding: 8px 12px;
  gap: 9px;
}
.game-brief.has-word-preview .brief-npc blockquote {
  font-size: 15px;
}
.game-brief.has-word-preview .word-preview {
  margin-top: 8px;
  padding: 8px 10px;
}
.game-brief.has-word-preview .word-preview-grid {
  margin-top: 6px;
}
.game-brief.has-word-preview .word-preview-card {
  padding: 5px 4px 4px;
}
.game-brief.has-word-preview .wp-han {
  font-size: 27px;
}
.game-brief.has-word-preview .brief-meta {
  margin: 8px 0 10px;
}
.game-brief.has-word-preview .btn {
  min-height: 44px;
}
.game-brief.has-word-preview .fineprint {
  margin-top: 6px;
}

/* Listening */
.listen-orb {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 10px auto 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 50%;
  background: linear-gradient(155deg, #d23b34, var(--red-deep));
  color: #fff9f2;
  box-shadow: 0 18px 36px -18px rgba(200, 49, 45, 0.8), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.listen-orb:hover {
  transform: scale(1.035);
}
.listen-orb .ico {
  width: 30px;
  height: 30px;
}
.listen-orb em {
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.7;
}
.listen-orb.is-playing {
  animation: orbPulse 0.9s var(--ease);
}
.listen-orb.is-muted {
  opacity: 0.72;
}
.orb-ring {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(200, 49, 45, 0.28);
  border-radius: 50%;
  pointer-events: none;
}
.orb-ring-a {
  animation: ripple 2.7s ease-out infinite;
}
.orb-ring-b {
  animation: ripple 2.7s ease-out 1.35s infinite;
}
.listen-note {
  text-align: center;
  font-size: 9.5px;
  color: var(--muted-soft);
  min-height: 15px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 16px;
}
.answer-grid-three {
  grid-template-columns: repeat(3, 1fr);
}
.answer-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  gap: 10px;
}
.warmup-stage {
  max-width: 640px;
}
.warmup-stage .game-stage-head h3 em {
  color: var(--red);
  font-style: italic;
  font-weight: 600;
}
.warmup-tile {
  min-height: 132px;
  padding-bottom: 18px;
}
.warmup-tile .tile-han {
  font-size: 58px;
}
.warmup-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 151, 90, 0.12), transparent 60%),
    var(--bg-soft);
}
.warmup-meaning {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.warmup-study {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px 0;
}
.warmup-study-char {
  font-family: var(--font-han);
  font-size: 118px;
  line-height: 0.9;
  color: var(--ink);
}
.warmup-study-pinyin {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--red);
}
.warmup-study-meaning {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.warmup-study-mnemonic {
  max-width: 410px;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  line-height: 1.35;
  color: var(--wood);
}
.warmup-study-tone {
  max-width: 440px;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
}
.warmup-study-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}
.warmup-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 560px;
  margin: 12px auto 0;
  padding: 10px 13px;
  border: 1px solid rgba(184, 151, 90, 0.4);
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: left;
}
.warmup-hint .ico {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: var(--gold);
}
.warmup-hint b {
  font-size: 12px;
}
.retry-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 600px;
  margin: 12px auto 0;
  padding: 10px 13px;
  border: 1px solid rgba(184, 151, 90, 0.4);
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: left;
}
.retry-hint .ico {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 1px;
  color: var(--gold);
}
.retry-hint b {
  font-size: 12px;
}
.feedback.is-retry {
  border-style: dashed;
}
.warmup-summary {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
}
.warmup-summary .game-stage-head {
  margin-bottom: 12px;
}
.warmup-word-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 10px;
}
.warmup-word {
  width: 108px;
  padding: 11px 7px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  transition: transform 0.18s var(--ease), border-color 0.18s;
}
.warmup-word:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.warmup-word-han {
  font-family: var(--font-han);
  font-size: 42px;
  line-height: 1;
  color: var(--red);
}
.warmup-word-pinyin {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 800;
  color: var(--ink);
}
.warmup-word-meaning {
  font-size: 8.5px;
  color: var(--muted);
}
.warmup-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  max-width: 500px;
  margin: 4px auto 16px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--muted-soft);
  text-align: left;
}
.warmup-note .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--gold);
}
.answer-tile {
  position: relative;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 18px 12px 13px;
  border: 1.5px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.answer-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.answer-tile .tile-key {
  position: absolute;
  top: 7px;
  left: 9px;
  font-size: 8px;
  font-weight: 700;
  color: var(--muted-soft);
}
.tile-han {
  font-family: var(--font-han);
  font-size: 44px;
  line-height: 1;
  transition: color 0.2s;
}
.tile-meta {
  font-size: 8.5px;
  color: var(--muted);
  font-weight: 600;
}
.tile-ru {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.answer-tile.answer-meaning {
  min-height: 72px;
}
.answer-tile.is-correct {
  border-color: var(--jade);
  background: var(--jade-soft);
  box-shadow: 0 0 0 1px rgba(78, 124, 109, 0.16) inset;
}
.answer-tile.is-correct .tile-han,
.answer-tile.is-correct .tile-ru {
  color: var(--jade-deep);
}
.answer-tile.is-correct::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 9px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #fff9f2;
  font-size: 10px;
  font-weight: 800;
}
.answer-tile.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  animation: shake 0.34s ease;
}
.answer-tile.is-eliminated {
  opacity: 0.24;
  text-decoration: line-through;
  pointer-events: none;
}
.answer-tile:disabled {
  cursor: default;
}

.hint-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--wood);
}
.hint-note .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  animation: fadeUp 0.3s var(--ease) both;
}
.feedback.is-ok {
  border-color: rgba(78, 124, 109, 0.3);
  background: var(--jade-soft);
}
.feedback.is-bad {
  border-color: rgba(200, 49, 45, 0.26);
  background: var(--red-soft);
}
.feedback-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--jade-deep);
  border: 1px solid var(--line);
}
.feedback.is-bad .feedback-icon {
  color: var(--red);
}
.feedback-icon .ico {
  width: 16px;
  height: 16px;
}
.feedback-copy {
  min-width: 0;
  flex: 1;
}
.feedback-copy strong {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--jade-deep);
}
.feedback.is-bad .feedback-copy strong {
  color: var(--red);
}
.feedback-copy p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted);
}
.feedback-copy p b {
  color: var(--ink);
  font-family: var(--font-han-serif);
  font-size: 13px;
}
.feedback-gain {
  display: inline-block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 800;
  color: var(--gold);
}
.feedback-gain-neutral {
  color: var(--muted-soft);
  font-weight: 500;
}
.feedback .btn {
  flex: 0 0 auto;
  min-height: 34px;
  font-size: 10.5px;
}

/* Context */
.context-card {
  position: relative;
  padding: 30px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(184, 151, 90, 0.09) 31px 32px),
    var(--bg-soft);
  text-align: center;
  overflow: hidden;
}
.context-card::before,
.context-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(200, 49, 45, 0.12);
}
.context-card::before {
  left: 33%;
}
.context-card::after {
  right: 33%;
}
.context-sentence {
  position: relative;
  z-index: 1;
  font-family: var(--font-han-serif);
  font-size: clamp(27px, 4vw, 37px);
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.context-sentence mark {
  background: transparent;
  color: var(--red);
  position: relative;
}
.context-sentence mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--red);
  border-radius: 2px;
}
.context-sentence .blank {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 44px;
  margin: 0 4px;
  border-bottom: 2px solid var(--red);
  color: var(--red);
  font-family: var(--font-han);
  font-size: 32px;
  vertical-align: -4px;
  background: rgba(200, 49, 45, 0.04);
}
.context-ru {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted);
}
.context-card .audio-btn {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.audio-btn .ico {
  width: 13px;
  height: 13px;
}
.audio-btn:hover {
  border-color: var(--red);
  color: var(--red);
}
.audio-btn.circle {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}
.audio-btn.dark {
  border-color: rgba(246, 237, 220, 0.22);
  background: rgba(246, 237, 220, 0.06);
  color: rgba(246, 237, 220, 0.7);
}

/* Match */
.match-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  max-width: 590px;
  margin: 6px auto 0;
}
.match-card {
  aspect-ratio: 1 / 1.08;
  perspective: 900px;
  border-radius: 15px;
  padding: 0;
}
.match-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  transition: transform 0.42s var(--ease);
  border-radius: 15px;
}
.match-card.is-flipped .match-inner {
  transform: rotateY(180deg);
}
.match-back,
.match-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 15px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.match-back {
  border: 1px solid rgba(184, 151, 90, 0.35);
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 11px, rgba(246, 237, 220, 0.055) 12px 13px),
    linear-gradient(150deg, #2b352e, #18201b);
  color: var(--gold-light);
  box-shadow: 0 10px 20px -14px rgba(20, 26, 22, 0.7);
}
.match-back .ico {
  width: 26px;
  height: 26px;
  opacity: 0.72;
}
.match-back em {
  font-family: var(--font-display);
  font-size: 16px;
  font-style: italic;
  opacity: 0.45;
}
.match-face {
  transform: rotateY(180deg);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  padding: 10px;
}
.match-han {
  font-family: var(--font-han);
  font-size: 43px;
  line-height: 1;
  color: var(--ink);
}
.match-meaning {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
}
.match-pinyin {
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
}
.match-kind {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.match-card.is-matched .match-face {
  border-color: rgba(78, 124, 109, 0.45);
  background: var(--jade-soft);
  animation: matchedGlow 0.5s var(--ease);
}
.match-card.is-matched .match-han,
.match-card.is-matched .match-meaning {
  color: var(--jade-deep);
}
.match-card:disabled {
  cursor: default;
}
.match-note {
  min-height: 18px;
  margin-top: 13px;
  text-align: center;
  font-size: 10px;
  color: var(--muted-soft);
}
.match-note.is-ok {
  color: var(--jade-deep);
  font-weight: 700;
}
.match-note.is-bad {
  color: var(--red);
}
.match-complete {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--jade-deep);
  font-size: 11px;
  font-weight: 700;
}
.match-complete .ico {
  width: 15px;
  height: 15px;
}

/* Meaning */
.meaning-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 auto 4px;
  padding: 4px 20px 9px;
  color: var(--ink);
  transition: transform 0.2s var(--ease);
}
.meaning-char:hover {
  transform: scale(1.02);
}
.meaning-char > span {
  font-family: var(--font-han);
  font-size: 105px;
  line-height: 1;
}
.meaning-char em {
  font-size: 9px;
  font-style: normal;
  color: var(--muted-soft);
}
.meaning-char .ico {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  color: var(--red);
}
.answer-grid-meaning {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Writing */
.write-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(240px, 1.05fr);
  gap: 24px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
}
.writing-board {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-soft);
}
.tianzige {
  position: relative;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(200, 49, 45, 0.48);
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(200, 49, 45, 0.25) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), rgba(200, 49, 45, 0.25) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(25% - 0.5px), rgba(200, 49, 45, 0.1) 25%, transparent calc(25% + 0.5px)),
    linear-gradient(90deg, transparent calc(75% - 0.5px), rgba(200, 49, 45, 0.1) 75%, transparent calc(75% + 0.5px)),
    linear-gradient(0deg, transparent calc(25% - 0.5px), rgba(200, 49, 45, 0.1) 25%, transparent calc(25% + 0.5px)),
    linear-gradient(0deg, transparent calc(75% - 0.5px), rgba(200, 49, 45, 0.1) 75%, transparent calc(75% + 0.5px)),
    #fffdf9;
  border-radius: 4px;
  overflow: hidden;
}
.tianzige::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(200, 49, 45, 0.16);
  pointer-events: none;
}
.tianzige canvas {
  position: relative;
  z-index: 1;
  max-width: 100%;
  height: auto !important;
}
.writing-toolbar {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.writing-toolbar .btn {
  min-height: 31px;
  padding: 0 10px;
  font-size: 9.5px;
}
.writing-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  font-size: 9px;
  color: var(--muted);
}
.writing-progress strong {
  color: var(--ink);
  font-weight: 800;
}
.mistake-count strong {
  color: var(--red);
}
.writing-board.is-mistake {
  animation: shake 0.34s ease;
}
.writer-fallback {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.writer-fallback > span {
  font-family: var(--font-han);
  font-size: 140px;
  line-height: 1;
  color: rgba(42, 37, 32, 0.14);
}
.writer-fallback p {
  font-size: 9px;
  color: var(--muted-soft);
}
.write-info {
  padding: 8px 0;
}
.write-char-line {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 3px;
}
.write-char-line span {
  font-family: var(--font-han);
  font-size: 78px;
  line-height: 0.9;
  color: var(--red);
}
.write-char-line em {
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 7px;
}
.write-meaning {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}
.write-hint {
  margin-top: 9px;
  max-width: 340px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.write-info .audio-btn {
  margin-top: 11px;
}
.write-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--muted-soft);
}
.write-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.write-legend .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.write-quest {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 11px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}
.write-quest .ico {
  width: 13px;
  height: 13px;
}
.write-note {
  margin-top: 16px;
  text-align: center;
  font-size: 9px;
  color: var(--muted-soft);
}
.write-note .ico {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 3px;
  vertical-align: -2px;
}
.write-done {
  text-align: center;
  max-width: 520px;
  padding: 10px 0;
}
.write-done-seal {
  width: 98px;
  height: 106px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--red);
  color: #fff9f2;
  transform: rotate(-3deg);
  box-shadow: 0 14px 28px -18px rgba(168, 39, 35, 0.65);
  animation: stampIn 0.6s var(--ease) both;
}
.write-done-seal span {
  font-family: var(--font-han);
  font-size: 56px;
  line-height: 1;
}
.write-done .eyebrow {
  justify-content: center;
}
.write-done h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}
.write-done > p:not(.eyebrow) {
  max-width: 400px;
  margin: 9px auto 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.write-done .brief-meta {
  margin: 14px 0 16px;
}

/* Summary */
.game-summary {
  max-width: 540px;
  margin: 0 auto;
  padding: 8px 0;
  text-align: center;
}
.summary-ring {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.game-summary .eyebrow {
  justify-content: center;
  margin-top: 6px;
}
.game-summary h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.game-summary > p:not(.eyebrow) {
  margin: 8px auto 0;
  max-width: 420px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 18px 0 12px;
}
.summary-stats div {
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.summary-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.summary-stats strong em {
  font-family: var(--font-ui);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  color: var(--muted-soft);
}
.summary-stats span {
  display: block;
  margin-top: 3px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.summary-note {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin: 0 auto 16px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--gold-soft);
  font-size: 9px;
  font-weight: 600;
  color: var(--wood);
}
.summary-note .ico {
  width: 12px;
  height: 12px;
  color: var(--red);
}
.practice-seal {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(200, 49, 45, 0.3);
  background: var(--red-soft);
  color: var(--red);
  font-family: var(--font-han);
  font-size: 50px;
}

/* Confirm exit */
.confirm-exit {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 26, 22, 0.55);
  backdrop-filter: blur(6px);
}
.confirm-exit-card {
  width: min(380px, 100%);
  padding: 25px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-exit-card h3 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.confirm-exit-card > p:not(.eyebrow) {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.confirm-exit-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
}

/* ============================================================
   Reveal
   ============================================================ */
.reveal-overlay,
.finale-overlay {
  background:
    radial-gradient(ellipse at 24% 26%, rgba(200, 49, 45, 0.18), transparent 45%),
    radial-gradient(ellipse at 80% 74%, rgba(184, 151, 90, 0.14), transparent 45%),
    #101511;
  color: #f6eddc;
  scrollbar-width: none;
}
.reveal-overlay::-webkit-scrollbar,
.finale-overlay::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.reveal-shell {
  position: relative;
  width: min(1080px, 100%);
  margin: auto;
  padding: 36px 30px;
}
.reveal-progress {
  position: absolute;
  top: 18px;
  left: 32px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.42);
}
.reveal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 237, 220, 0.2);
  border-radius: 50%;
  color: rgba(246, 237, 220, 0.6);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.reveal-close:hover {
  border-color: rgba(246, 237, 220, 0.5);
  color: #f6eddc;
  background: rgba(246, 237, 220, 0.08);
}
.reveal-close .ico {
  width: 16px;
  height: 16px;
}
.reveal-stage {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 42px;
  min-height: 580px;
}
.reveal-visual {
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(212, 185, 106, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 46%, rgba(184, 151, 90, 0.12), transparent 56%),
    rgba(246, 237, 220, 0.025);
  overflow: hidden;
}
.reveal-visual::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(246, 237, 220, 0.07);
  border-radius: 14px;
  pointer-events: none;
}
.reveal-halo {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 185, 106, 0.16), transparent 65%);
  animation: haloPulse 5s ease-in-out infinite;
}
.reveal-watermark {
  position: absolute;
  font-family: var(--font-han);
  font-size: 330px;
  line-height: 1;
  color: rgba(246, 237, 220, 0.03);
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.reveal-writer {
  position: relative;
  z-index: 1;
  width: 250px;
  height: 250px;
  display: grid;
  place-items: center;
}
.reveal-fallback-han {
  font-family: var(--font-han);
  font-size: 190px;
  line-height: 1;
  color: #f6eddc;
}
.reveal-pinyin {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  color: var(--gold-light);
}
.reveal-pinyin em {
  font-family: var(--font-ui);
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.4);
  margin-left: 4px;
}
.reveal-visual .audio-btn {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}
.reveal-copy {
  position: relative;
  z-index: 1;
}
.reveal-copy h2 {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: clamp(46px, 5vw, 62px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fdf6e8;
}
.reveal-mnemonic {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  line-height: 1.35;
  color: var(--gold-light);
}
.reveal-copy blockquote {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(212, 185, 106, 0.4);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(246, 237, 220, 0.64);
}
.reveal-example {
  margin-top: 17px;
  padding: 13px 15px;
  border: 1px solid rgba(246, 237, 220, 0.1);
  border-radius: 13px;
  background: rgba(246, 237, 220, 0.04);
}
.reveal-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.reveal-example-head > span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.38);
}
.reveal-example-head .audio-btn {
  padding: 4px 8px;
  font-size: 8px;
}
.reveal-example-zh {
  font-family: var(--font-han-serif);
  font-size: 19px;
  line-height: 1.5;
  color: #f6eddc;
}
.reveal-example-pinyin {
  margin-top: 1px;
  font-size: 10px;
  color: rgba(246, 237, 220, 0.45);
}
.reveal-example-ru {
  margin-top: 3px;
  font-size: 10.5px;
  color: rgba(246, 237, 220, 0.65);
}
.reveal-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 15px;
}
.reveal-overlay .chip {
  border-color: rgba(246, 237, 220, 0.15);
  background: rgba(246, 237, 220, 0.05);
  color: rgba(246, 237, 220, 0.7);
}
.reveal-overlay .chip-xp {
  color: var(--gold-light);
  border-color: rgba(212, 185, 106, 0.28);
}
.reveal-overlay .chip-ink {
  color: #a9cfb9;
  border-color: rgba(78, 124, 109, 0.4);
}
.reveal-overlay .chip-soft {
  color: rgba(246, 237, 220, 0.55);
}
.reveal-overlay .chip-perfect {
  color: #efb2a9;
  border-color: rgba(200, 49, 45, 0.4);
  background: rgba(200, 49, 45, 0.12);
}
.reveal-copy .btn {
  margin-top: 17px;
}
.reveal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}
.reveal-actions .btn {
  margin-top: 0;
}

.artifact-reveal-shell {
  max-width: 600px;
  text-align: center;
  padding: 38px 30px 24px;
}
.artifact-glow {
  position: relative;
  width: 264px;
  height: 264px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(212, 185, 106, 0.2);
  background:
    radial-gradient(circle at 50% 46%, rgba(212, 185, 106, 0.26), rgba(246, 237, 220, 0.035) 52%, transparent 70%);
  box-shadow: 0 0 90px rgba(184, 151, 90, 0.12);
  animation: haloPulse 4s ease-in-out infinite;
}
.artifact-glow::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(246, 237, 220, 0.08);
  border-radius: 50%;
}
.artifact-glow .artifact-svg {
  width: 208px;
  height: 208px;
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.5)) brightness(1.14);
}
.artifact-glow.rarity-epic {
  background: radial-gradient(circle at 50% 46%, rgba(200, 49, 45, 0.3), rgba(246, 237, 220, 0.035) 52%, transparent 70%);
  border-color: rgba(200, 49, 45, 0.28);
}
.artifact-reveal-shell h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.2vw, 46px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #fdf6e8;
}
.artifact-reveal-han {
  margin-top: 2px;
  font-family: var(--font-han);
  font-size: 21px;
  color: var(--gold-light);
}
.artifact-reveal-lore {
  max-width: 440px;
  margin: 9px auto 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: rgba(246, 237, 220, 0.62);
}
.artifact-reveal-bonus {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin: 11px auto 13px;
  padding: 6px 11px;
  border: 1px solid rgba(78, 124, 109, 0.4);
  border-radius: 999px;
  background: rgba(78, 124, 109, 0.14);
  color: #a9cfb9;
  font-size: 9.5px;
  font-weight: 700;
}
.artifact-reveal-bonus .ico {
  width: 13px;
  height: 13px;
}

/* ============================================================
   Finale
   ============================================================ */
.finale-shell {
  position: relative;
  width: min(980px, 100%);
  margin: auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.5s var(--ease) both;
}
.finale-reward-shell {
  max-width: 620px;
  padding: 52px 34px 38px;
  text-align: center;
  border: 1px solid rgba(212, 185, 106, 0.28);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(200, 49, 45, 0.22), transparent 52%),
    linear-gradient(160deg, #252e28, #121713);
}
.finale-reward-shell .eyebrow {
  justify-content: center;
}
.finale-stamp {
  width: 118px;
  height: 128px;
  margin: 20px auto 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff9f2;
  transform: rotate(-3deg);
  box-shadow: 0 24px 50px -26px rgba(200, 49, 45, 0.7);
  animation: stampIn 0.7s var(--ease) both;
}
.finale-stamp span {
  font-family: var(--font-han);
  font-size: 64px;
  line-height: 1;
}
.finale-stamp em {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  opacity: 0.7;
}
.finale-reward-shell h2 {
  font-family: var(--font-display);
  font-size: clamp(50px, 6vw, 70px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: #fdf6e8;
}
.finale-sub {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 237, 220, 0.45);
}
.finale-copy {
  max-width: 400px;
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(246, 237, 220, 0.6);
}
.finale-rewards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 17px 0 20px;
}
.finale-reward-shell .chip {
  border-color: rgba(246, 237, 220, 0.16);
  background: rgba(246, 237, 220, 0.05);
  color: rgba(246, 237, 220, 0.7);
}
.finale-reward-shell .chip-xp {
  color: var(--gold-light);
}
.finale-reward-shell .chip-ink {
  color: #a9cfb9;
}

.finale-story-shell {
  min-height: 600px;
  color: #f6eddc;
  background: #141a16;
}
.finale-scene {
  position: absolute;
  inset: 0;
}
.finale-scene .scene-svg {
  width: 100%;
  height: 100%;
}
.finale-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 11, 0.94) 0%, rgba(10, 14, 11, 0.76) 48%, rgba(10, 14, 11, 0.3) 100%),
    linear-gradient(0deg, rgba(10, 14, 11, 0.88), transparent 52%);
}
.finale-story {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 50px 44px 38px;
}
.finale-story h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: #fdf6e8;
}
.finale-lines {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 22px;
}
.finale-line {
  opacity: 0;
  transform: translateY(10px);
  animation: finaleLine 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 0.18s + 0.25s);
}
.finale-speaker {
  display: block;
  margin-bottom: 2px;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.finale-line p {
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(246, 237, 220, 0.7);
}
.finale-line:nth-child(odd) p {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
  color: rgba(246, 237, 220, 0.82);
}
.next-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 21px;
  padding: 12px 14px;
  border: 1px solid rgba(212, 185, 106, 0.28);
  border-radius: 13px;
  background: rgba(246, 237, 220, 0.055);
  backdrop-filter: blur(8px);
}
.next-chapter-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(200, 49, 45, 0.16);
  color: var(--gold-light);
  border: 1px solid rgba(212, 185, 106, 0.24);
}
.next-chapter-icon .ico {
  width: 17px;
  height: 17px;
}
.next-chapter strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: #f6eddc;
}
.next-chapter p {
  margin-top: 1px;
  font-size: 9px;
  color: rgba(246, 237, 220, 0.45);
}
.finale-cliff {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  line-height: 1.4;
  color: var(--gold-light);
}
.finale-story .btn {
  margin-top: 18px;
}
.finale-story .fineprint {
  margin-top: 9px;
  color: rgba(246, 237, 220, 0.3);
}

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  z-index: 200;
  background: rgba(14, 18, 15, 0.68);
}
.modal {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.7);
  overflow-y: auto;
  animation: modalIn 0.36s var(--ease) both;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.82);
  backdrop-filter: blur(6px);
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover {
  color: var(--red);
  border-color: var(--red);
}
.modal-close .ico {
  width: 16px;
  height: 16px;
}

.modal-artifact {
  max-width: 880px;
}
.artifact-modal {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}
.artifact-modal-art {
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 50% 48%, rgba(184, 151, 90, 0.18), transparent 60%),
    linear-gradient(150deg, #252e28, #121713);
  min-height: 420px;
}
.artifact-modal-art .artifact-svg {
  width: 250px;
  height: 250px;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.4));
}
.artifact-modal-art.rarity-epic {
  background:
    radial-gradient(circle at 50% 48%, rgba(200, 49, 45, 0.2), transparent 60%),
    linear-gradient(150deg, #2b2522, #151211);
}
.artifact-modal-copy {
  padding: 40px 38px 32px;
}
.artifact-modal-copy h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.artifact-modal-han {
  margin-top: 3px;
  font-family: var(--font-han);
  font-size: 18px;
  color: var(--muted);
}
.artifact-modal-lore {
  margin-top: 13px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.artifact-modal-bonus {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(78, 124, 109, 0.25);
  border-radius: 10px;
  background: var(--jade-soft);
  color: var(--jade-deep);
  font-size: 10.5px;
  font-weight: 700;
}
.artifact-modal-bonus .ico {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.modal-char {
  max-width: 980px;
}
.char-modal {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
}
.char-modal-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  padding: 30px;
  color: #f6eddc;
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 151, 90, 0.14), transparent 58%),
    linear-gradient(150deg, #252e28, #121713);
  overflow: hidden;
}
.char-modal-watermark {
  position: absolute;
  font-family: var(--font-han);
  font-size: 390px;
  line-height: 1;
  color: rgba(246, 237, 220, 0.035);
}
.char-modal-han {
  position: relative;
  z-index: 1;
  font-family: var(--font-han);
  font-size: 200px;
  line-height: 1;
  color: #f6eddc;
  text-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.char-modal-pinyin {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  color: var(--gold-light);
}
.char-modal-pinyin em {
  font-family: var(--font-ui);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}
.char-modal-pinyin + .audio-btn {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}
.char-modal-copy {
  padding: 38px 36px 30px;
}
.char-modal-copy h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.char-modal-mnemonic {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: 21px;
  font-style: italic;
  line-height: 1.35;
  color: var(--red);
}
.char-modal-etymology {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}
.char-example {
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-soft);
}
.char-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.char-example-head > span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.char-example-head .audio-btn {
  padding: 4px 8px;
  font-size: 8px;
}
.char-example-zh {
  font-family: var(--font-han-serif);
  font-size: 19px;
  line-height: 1.5;
}
.char-example-pinyin {
  font-size: 9.5px;
  color: var(--muted-soft);
}
.char-example-ru {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-soft);
}
.char-modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 13px;
  font-size: 9px;
  color: var(--muted);
}
.char-modal-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.char-modal-stats .ico {
  width: 12px;
  height: 12px;
  color: var(--gold);
}
.char-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 17px;
}

.locked-char-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px 36px;
  min-height: 420px;
  justify-content: center;
}
.locked-char-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px dashed var(--line-strong);
  background: var(--bg-soft);
  color: var(--muted-soft);
}
.locked-char-icon .ico {
  width: 24px;
  height: 24px;
}
.locked-char-modal h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
}
.locked-char-modal > p:not(.eyebrow) {
  max-width: 380px;
  margin: 10px auto 18px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.help-modal,
.reset-modal,
.teaser-modal {
  max-width: 570px;
  padding: 38px 38px 30px;
  text-align: center;
}
.help-modal h2,
.reset-modal h2,
.teaser-modal h2 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.help-modal .eyebrow,
.reset-modal .eyebrow,
.teaser-modal .eyebrow {
  justify-content: center;
}
.help-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}
.help-steps > div {
  display: flex;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.help-steps > div > span {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
}
.help-steps p {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted);
}
.help-steps strong {
  display: block;
  font-size: 11.5px;
  color: var(--ink);
}
.help-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 9px;
  color: var(--muted-soft);
}
.help-note .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.reset-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}
.reset-icon .ico {
  width: 25px;
  height: 25px;
}
.reset-modal > p:not(.eyebrow) {
  margin: 10px auto 0;
  max-width: 390px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.reset-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
}
.teaser-modal {
  max-width: 520px;
}
.teaser-modal .teaser-lock {
  margin-bottom: 12px;
}
.teaser-modal > p:not(.eyebrow) {
  margin-top: 9px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}
.teaser-modal .teaser-hint {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 10px;
  font-weight: 600;
}

/* ============================================================
   Toasts / FX
   ============================================================ */
.toast-root {
  position: fixed;
  z-index: 300;
  top: 18px;
  right: 18px;
  width: min(360px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.97);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.36s var(--ease) both;
}
.toast.is-out {
  animation: toastOut 0.3s ease both;
}
.toast-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
}
.toast-icon .ico {
  width: 15px;
  height: 15px;
}
.toast-copy {
  min-width: 0;
  flex: 1;
}
.toast-copy strong {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
}
.toast-copy span {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--muted);
}
.toast-close {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: var(--muted-soft);
  border-radius: 50%;
}
.toast-close:hover {
  color: var(--ink);
}
.toast-close .ico {
  width: 11px;
  height: 11px;
}
.toast-achievement {
  border-left-color: var(--gold);
  background: linear-gradient(120deg, #fffaf0, var(--surface));
}
.toast-achievement .toast-icon {
  background: var(--gold);
  color: #fff9f2;
}
.toast-level {
  border-left-color: var(--red);
  background: linear-gradient(120deg, #fff8f4, var(--surface));
}
.toast-level .toast-icon {
  background: var(--red);
  color: #fff9f2;
}
.toast-daily,
.toast-success {
  border-left-color: var(--jade);
}
.toast-daily .toast-icon,
.toast-success .toast-icon {
  background: var(--jade);
  color: #fff9f2;
}
.toast-unlock {
  border-left-color: var(--red);
  background: linear-gradient(120deg, #fff7ed, var(--surface));
}
.toast-unlock .toast-icon {
  background: var(--red);
  color: #fff9f2;
}
.toast-error {
  border-left-color: var(--red);
}
.toast-error .toast-icon {
  background: var(--red-soft);
  color: var(--red);
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  overflow: hidden;
}
.fx-petal {
  position: absolute;
  width: 7px;
  height: 12px;
  border-radius: 50% 0 50% 0;
  background: var(--c);
  opacity: 0.85;
  animation: petalBurst 1.35s var(--ease) forwards;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroNpcIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes successChar {
  from { opacity: 0; transform: scale(0.82) rotate(-3deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes prologueIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes stageIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes finaleLine {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.6) rotate(-9deg); }
  55% { opacity: 1; transform: scale(0.94) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-3deg); }
}
@keyframes routeDash {
  to { stroke-dashoffset: -30; }
}
@keyframes nodePulse {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(1.85); opacity: 0; }
  100% { transform: scale(1.85); opacity: 0; }
}
@keyframes ripple {
  0% { transform: scale(0.92); opacity: 0.8; }
  75% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes orbPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  82% { transform: translateX(3px); }
}
@keyframes matchedGlow {
  0% { box-shadow: 0 0 0 0 rgba(78, 124, 109, 0.35); }
  100% { box-shadow: 0 0 0 10px rgba(78, 124, 109, 0); }
}
@keyframes comboPop {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes slowSpin {
  to { transform: rotate(360deg); }
}
@keyframes slowSpinBack {
  to { transform: rotate(-360deg); }
}
@keyframes float {
  0%, 100% { transform: rotate(2.2deg) translateY(0); }
  50% { transform: rotate(1.6deg) translateY(-10px); }
}
@keyframes haloPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.07); opacity: 1; }
}
@keyframes cloudDrift {
  from { transform: translateX(-12px); }
  to { transform: translateX(22px); }
}
@keyframes dustFloat {
  0% { transform: translateY(20px) translateX(0); opacity: 0; }
  15% { opacity: 0.55; }
  80% { opacity: 0.3; }
  100% { transform: translateY(-110px) translateX(26px); opacity: 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(18px); }
}
@keyframes petalBurst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.3); }
}

/* ============================================================
   Responsive
   ============================================================ */
/* ============================================================
   Beginner primer: tones, graphemes, assembly
   ============================================================ */
.primer-stage {
  max-width: 760px;
  margin: 0 auto;
}
.primer-stage .game-stage-head {
  text-align: center;
}
.primer-stage .game-stage-head p {
  margin-left: auto;
  margin-right: auto;
}
.primer-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--muted-soft);
  text-align: left;
}
.primer-note .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--gold);
}
.primer-actions {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}
.primer-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

/* Tones */
.tone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.tone-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 15px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
}
.tone-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 14px 24px -18px rgba(42, 37, 32, 0.4);
}
.tone-num {
  position: absolute;
  top: 8px;
  left: 9px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}
.tone-contour {
  width: 100%;
  height: 38px;
  overflow: visible;
}
.tone-contour path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
}
.tone-card strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.tone-example {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-han);
  font-size: 24px;
  line-height: 1;
}
.tone-example em {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}
.tone-example-meaning {
  font-size: 8.5px;
  color: var(--muted);
  text-align: center;
}
.tone-audio {
  position: absolute;
  top: 7px;
  right: 8px;
  color: var(--gold);
}
.tone-audio .ico {
  width: 13px;
  height: 13px;
}
.tone-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 360px;
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 151, 90, 0.12), transparent 60%),
    var(--bg-soft);
}
.tone-question-char {
  font-family: var(--font-han);
  font-size: 78px;
  line-height: 1;
  color: var(--ink);
}
.tone-question-pinyin {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
}
.tone-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
}
.tone-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.tone-option:hover {
  border-color: var(--gold);
}
.tone-option b {
  font-size: 11px;
  color: var(--muted);
}
.tone-option .tone-contour {
  height: 30px;
}
.tone-option span {
  font-size: 8.5px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}
.tone-option.is-correct {
  border-color: var(--jade);
  background: var(--jade-soft);
}
.tone-option.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
}
.tone-option.is-hinted {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(184, 151, 90, 0.18);
}
.tone-option.is-disabled {
  cursor: default;
}

/* Grapheme study */
.brick-study {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.brick-study-char {
  font-family: var(--font-han);
  font-size: 124px;
  line-height: 1;
  color: var(--ink);
}
.brick-study-pinyin {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
}
.brick-study-pinyin em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.brick-study-meaning {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.brick-study-hint {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--wood);
}
.brick-study-mnemonic {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  line-height: 1.35;
  color: var(--muted);
}
.brick-study-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* Extra bricks */
.extra-bricks-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.extra-brick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.18s;
}
.extra-brick:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.extra-brick-han {
  font-family: var(--font-han);
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.extra-brick-pinyin {
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
}
.extra-brick-meaning {
  font-size: 8.5px;
  line-height: 1.25;
  text-align: center;
  color: var(--muted);
}

/* Assembly */
.assemble-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 4px auto 12px;
}
.assemble-target-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.assemble-target-meaning {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.assemble-slots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
}
.assemble-slot {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--bg-soft);
  font-family: var(--font-han);
  font-size: 44px;
  line-height: 1;
  color: var(--muted-soft);
}
.assemble-slot.is-filled {
  border-style: solid;
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}
.assemble-bank {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}
.assemble-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s;
}
.assemble-tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.assemble-tile.is-selected {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(200, 49, 45, 0.1);
}
.assemble-tile-han {
  font-family: var(--font-han);
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.assemble-tile-pinyin {
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
}
.assemble-tile-meaning {
  font-size: 8.5px;
  line-height: 1.25;
  text-align: center;
  color: var(--muted);
}
.assemble-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 420px;
  margin: 10px auto 12px;
  padding: 18px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184, 151, 90, 0.22), transparent 65%),
    var(--gold-soft);
  animation: stampIn 0.6s var(--ease) both;
}
.assemble-result-parts {
  font-family: var(--font-han);
  font-size: 26px;
  line-height: 1;
  color: var(--wood);
}
.assemble-equals {
  font-size: 16px;
  color: var(--muted);
}
.assemble-result-char {
  font-family: var(--font-han);
  font-size: 94px;
  line-height: 1;
  color: var(--red);
}
.assemble-result-pinyin {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
}
.assemble-result-meaning {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

/* Primer summary */
.primer-done-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.primer-done-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.primer-done-han {
  font-family: var(--font-han);
  font-size: 40px;
  line-height: 1;
  color: var(--ink);
}
.primer-done-pinyin {
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
}
.primer-done-meaning {
  font-size: 8.5px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}
.primer-done-state {
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 8px;
  font-weight: 700;
}

/* ============================================================
   Face-up pairs (no guessing)
   ============================================================ */
.pair-preview {
  max-width: 620px;
  margin: 0 auto 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}
.pair-preview-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.pair-preview-title .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.pair-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pair-preview-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.pair-preview-item b {
  font-family: var(--font-han);
  font-size: 20px;
  line-height: 1;
}
.pair-preview-item em {
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  color: var(--red);
}
.pair-preview-item span {
  font-size: 8.5px;
  color: var(--muted);
}
.pair-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  max-width: 620px;
  margin: 0 auto;
}
.pair-tile {
  position: relative;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border: 1.5px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.pair-tile:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
}
.pair-tile.is-selected {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(200, 49, 45, 0.1);
}
.pair-tile.is-matched {
  border-color: rgba(78, 124, 109, 0.5);
  background: var(--jade-soft);
  opacity: 0.78;
}
.pair-tile.is-hinted {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 151, 90, 0.2);
}
.pair-tile:disabled {
  cursor: default;
}
.pair-han {
  font-family: var(--font-han);
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
}
.pair-meaning {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
}
.pair-pinyin {
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
}
.pair-kind {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.pair-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #fff;
}
.pair-check .ico {
  width: 11px;
  height: 11px;
}

/* ============================================================
   Glossed phrase breakdown
   ============================================================ */
.context-breakdown {
  max-width: 680px;
  margin: 12px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.context-breakdown-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.context-breakdown-head .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.context-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.context-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 54px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.context-token .ct-zh {
  font-family: var(--font-han);
  font-size: 24px;
  line-height: 1.1;
  color: var(--ink);
}
.context-token .ct-pinyin {
  font-size: 9px;
  font-weight: 800;
  color: var(--red);
}
.context-token .ct-ru {
  font-size: 8.5px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}
.context-token.is-blank {
  border-style: dashed;
  border-color: var(--red);
  background: var(--red-soft);
}
.context-token.is-blank .ct-zh {
  color: var(--red);
}

/* ============================================================
   Stroke directions
   ============================================================ */
.write-directions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.write-directions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.write-directions-head span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.write-directions-head .ico {
  width: 13px;
  height: 13px;
  color: var(--gold);
}
.write-directions-head em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.write-directions ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 7px;
  margin: 7px 0 0;
  padding: 0;
}
.write-direction {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  font-size: 8.5px;
  color: var(--muted);
}
.write-direction b {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 8px;
}
.write-direction .dir-arrow {
  width: 14px;
  text-align: center;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}
.write-direction em {
  font-style: normal;
  line-height: 1.2;
}
.write-direction.is-active {
  background: var(--gold-soft);
  color: var(--wood);
  font-weight: 700;
}
.write-direction.is-active b {
  background: var(--gold);
  color: #fff;
}
.write-direction.is-done {
  opacity: 0.5;
}
.tutorial-direction-lead {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin-top: 8px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--muted);
}
.tutorial-direction-lead .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--gold);
}
.tutorial-direction-lead b {
  color: var(--wood);
}

/* ============================================================
   Warmup two-way recall
   ============================================================ */
.warmup-prompt-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
.warmup-form-char {
  font-family: var(--font-han);
  font-size: 84px;
  line-height: 1;
  color: var(--ink);
}
.warmup-form-pinyin {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
}
.warmup-answer-meanings {
  max-width: 600px;
}
.warmup-meaning-tile {
  min-height: 104px;
}
.warmup-meaning-tile .tile-ru {
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.warmup-step-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  max-width: 520px;
  margin: 14px auto 0;
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted-soft);
  text-align: left;
}
.warmup-step-note .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--gold);
}
.tile-pinyin {
  display: block;
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--red);
}
.answer-tile.is-hinted {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(184, 151, 90, 0.18);
}

/* Met vs learned */
.char-card.is-met {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.char-card.is-met .char-big {
  color: var(--wood);
}
.char-met-label {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--wood);
}
.mini-slot.is-met,
.scroll-slot.is-met {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--wood);
  opacity: 0.85;
}
.char-modal-met-note {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--wood);
  font-size: 10px;
  line-height: 1.45;
}
.char-modal-met-note .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
}

/* Chapter key note */
.brief-plan {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 520px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: left;
}
.brief-plan .ico {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  color: var(--gold);
}
.key-note {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 151, 90, 0.4);
  border-radius: 12px;
  background: var(--gold-soft);
  text-align: left;
}
.key-note-han {
  font-family: var(--font-han);
  font-size: 40px;
  line-height: 1;
  color: var(--red);
}
.key-note-pinyin {
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
}
.key-note p {
  margin-top: 2px;
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--wood);
}

@media (max-width: 1220px) {
  .sidebar {
    width: 210px;
  }
  .main {
    margin-left: 210px;
  }
  .content {
    padding-left: 24px;
    padding-right: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .map-rail {
    gap: 10px;
  }
  .rail-card {
    padding: 15px;
  }
  .hud-level em {
    display: none;
  }
}

@media (max-width: 1150px) {
  .hero-npc {
    display: none;
  }
}

@media (max-width: 1080px) {
  .tutorial-main {
    grid-template-columns: 1fr;
    max-width: 780px;
  }
  .tutorial-guard {
    display: none;
  }
  .tutorial-mobile-guard {
    display: flex;
  }
  .tutorial-step em {
    display: none;
  }
  .tutorial-step {
    padding: 5px 7px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .map-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
  .selection-card {
    min-height: 100%;
  }
  .chapter-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .chapter-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .chapter-side .scroll-mini-card {
    grid-column: span 1;
  }
  .quote-card {
    grid-column: span 2;
  }
  .path-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .profile-quote {
    grid-column: span 2;
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid rgba(246, 237, 220, 0.14);
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .training-grid {
    grid-template-columns: 1fr;
  }
  .training-orbit {
    width: 130px;
    height: 130px;
    flex-basis: 130px;
  }
  .orbit-seal {
    font-size: 48px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    min-height: 66px;
    padding: 0 18px;
  }
  .topbar-brandmark {
    display: grid;
  }
  .content {
    padding: 20px 18px 98px;
  }
  .app-footer {
    display: none;
  }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    gap: 2px;
    padding: 7px 6px;
    border: 1px solid rgba(216, 203, 180, 0.8);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 -10px 30px -18px rgba(42, 37, 32, 0.3), var(--shadow-md);
  }
  .mobile-nav-item {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color 0.2s, background 0.2s;
  }
  .mobile-nav-item .ico {
    width: 20px;
    height: 20px;
  }
  .mobile-nav-item.is-active {
    color: var(--red);
    background: var(--red-soft);
  }
  .mobile-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 19px);
    min-width: 15px;
    height: 15px;
    font-size: 8px;
  }
  .topbar-actions .hud-level {
    display: none;
  }
  .landing-main {
    grid-template-columns: 1fr;
    padding: 24px 24px 26px;
    gap: 10px;
  }
  .landing-object {
    display: none;
  }
  .landing-title {
    font-size: clamp(66px, 14vw, 104px);
  }
  .landing-top {
    padding: 20px 24px;
  }
  .landing-foot {
    padding: 18px 24px 22px;
  }
  .mvp-chip {
    display: none;
  }
  .map-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .selection-card {
    grid-column: span 2;
  }
  .artifact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .char-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .training-hero {
    padding: 26px;
  }
  .training-orbit {
    display: none;
  }
  .profile-hero {
    padding: 26px;
    gap: 22px;
  }
  .profile-seal {
    width: 104px;
    height: 120px;
  }
  .profile-seal-han {
    font-size: 55px;
  }
  .profile-stats,
  .training-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .scroll-hero-paper {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .scroll-seals {
    justify-content: flex-start;
  }
  .collection-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .reveal-stage {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: 0;
  }
  .reveal-visual {
    min-height: 320px;
  }
  .reveal-writer {
    width: 210px;
    height: 210px;
  }
  .reveal-shell {
    padding: 50px 20px 26px;
  }
  .game-shell {
    max-height: calc(100vh - 20px);
  }
  .overlay {
    padding: 10px;
  }
  .write-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .writing-board {
    max-width: 390px;
    margin: 0 auto;
    width: 100%;
  }
  .write-info {
    max-width: 390px;
    margin: 0 auto;
    text-align: center;
  }
  .write-char-line {
    justify-content: center;
  }
  .write-hint {
    margin-left: auto;
    margin-right: auto;
  }
  .write-legend {
    justify-content: center;
  }
  .write-quest {
    justify-content: center;
  }
  .char-modal {
    grid-template-columns: 1fr;
  }
  .char-modal-visual {
    min-height: 300px;
  }
  .char-modal-han {
    font-size: 150px;
  }
  .artifact-modal {
    grid-template-columns: 1fr;
  }
  .artifact-modal-art {
    min-height: 280px;
  }
  .artifact-modal-art .artifact-svg {
    width: 190px;
    height: 190px;
  }
}

@media (max-width: 700px) {
  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .mobile-quest-bar {
    display: flex;
  }
  .tutorial-top {
    padding: 13px 16px;
    gap: 8px;
  }
  .tutorial-top .brand {
    padding-bottom: 0;
  }
  .tutorial-top .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 22px;
  }
  .tutorial-top .brand-text small {
    display: none;
  }
  .tutorial-step {
    padding: 4px 5px;
    font-size: 0;
  }
  .tutorial-step b {
    font-size: 11px;
  }
  .tutorial-main {
    padding: 8px 13px 16px;
  }
  .tutorial-panel {
    padding: 24px 18px;
    border-radius: 22px;
  }
  .tutorial-panel h1 {
    font-size: clamp(34px, 9vw, 44px);
  }
  .tutorial-quote {
    font-size: 17px;
  }
  .tutorial-lead {
    font-size: 12.5px;
  }
  .tutorial-guard-tag {
    display: none;
  }
  .tutorial-foot {
    padding: 12px 18px 16px;
    font-size: 7px;
  }
  .tutorial-writing-board {
    max-width: 320px;
    padding: 10px;
  }
  .tianzige.tutorial-tianzige {
    max-width: 280px;
  }
  .speak-grid {
    grid-template-columns: 1fr;
  }
  .speak-card {
    padding: 14px;
  }
  .speak-han {
    font-size: 90px;
  }
  .bricks-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .brick-card {
    min-height: 145px;
  }
  .combine-row {
    gap: 5px;
  }
  .combine-tile {
    width: 64px;
    height: 82px;
  }
  .combine-tile span {
    font-size: 30px;
  }
  .combine-unknown {
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
  .done-char {
    width: 52px;
    height: 68px;
  }
  .done-char span {
    font-size: 27px;
  }
  .first-bricks {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .first-bricks-row {
    flex-wrap: wrap;
  }
  .word-preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .word-preview-card {
    padding: 6px 3px 5px;
  }
  .wp-han {
    font-size: 27px;
  }
  .wp-meaning {
    font-size: 7.5px;
  }
  .npc-gallery-card {
    flex-basis: 158px;
    height: 245px;
  }
  .npc-gallery-copy strong {
    font-size: 18px;
  }
  .npc-modal {
    grid-template-columns: 1fr;
  }
  .npc-modal-art {
    min-height: 300px;
  }
  .npc-modal-art img {
    max-height: 300px;
  }
  .npc-modal-copy {
    padding: 26px 20px 24px;
  }
  .page-head-side {
    padding-bottom: 0;
  }
  .page-title {
    font-size: clamp(38px, 10vw, 48px);
  }
  .topbar-title span {
    display: none;
  }
  .topbar-title strong {
    font-size: 18px;
  }
  .topbar-actions {
    gap: 4px;
  }
  .hud-chip {
    height: 36px;
    padding: 0 8px;
    gap: 6px;
    border-radius: 10px;
  }
  .hud-chip > .ico {
    width: 15px;
    height: 15px;
  }
  .hud-chip em {
    display: none;
  }
  .hud-level .level-ring {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }
  .hud-level strong {
    font-size: 11px;
  }
  .topbar-actions > .icon-btn {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .map-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .map-card-head h2 {
    font-size: 22px;
  }
  .map-legend {
    padding-bottom: 0;
  }
  .map-rail {
    grid-template-columns: 1fr;
  }
  .selection-card {
    grid-column: span 1;
  }
  .map-card-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .map-hint {
    display: none;
  }
  .chapter-hero {
    min-height: 300px;
  }
  .chapter-hero-content {
    padding: 28px 24px;
  }
  .chapter-stamp {
    top: 18px;
    right: 18px;
    width: 56px;
    height: 66px;
  }
  .chapter-stamp span {
    font-size: 30px;
  }
  .chapter-layout {
    margin-top: 12px;
  }
  .npc-head {
    align-items: flex-start;
  }
  .npc-rep {
    width: 95px;
    flex-basis: 95px;
  }
  .dialogue {
    padding: 17px;
  }
  .dialogue-text {
    font-size: 14.5px;
  }
  .dialogue.is-narrator .dialogue-text {
    font-size: 19px;
  }
  .dialogue-foot {
    flex-direction: column;
    align-items: flex-start;
  }
  .dialogue-foot .btn {
    width: 100%;
  }
  .quest-steps-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .quest-steps-progress {
    width: 100%;
    text-align: left;
  }
  .quest-steps-progress strong {
    font-size: 16px;
  }
  .quest-step {
    grid-template-columns: 26px 30px minmax(0, 1fr);
  }
  .step-action {
    grid-column: 2 / span 2;
    justify-content: flex-start;
  }
  .step-action .btn {
    width: 100%;
    justify-content: center;
  }
  .step-lock,
  .step-seal {
    display: none;
  }
  .quest-steps-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .chapter-side {
    grid-template-columns: 1fr;
  }
  .quote-card {
    grid-column: span 1;
  }
  .path-cards {
    grid-template-columns: 1fr;
  }
  .artifact-grid {
    grid-template-columns: 1fr;
  }
  .artifact-card {
    min-height: 270px;
  }
  .bonus-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 22px;
  }
  .bonus-stats {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  .bonus-stats div {
    align-items: flex-start;
  }
  .bonus-stats span {
    text-align: left;
  }
  .bonus-banner::after {
    display: none;
  }
  .char-grid {
    grid-template-columns: 1fr;
  }
  .char-card {
    min-height: 200px;
  }
  .scroll-hero-paper {
    padding: 24px 20px;
  }
  .scroll-seals {
    gap: 5px;
  }
  .scroll-seal {
    width: 48px;
    height: 70px;
  }
  .scroll-seal-han {
    font-size: 24px;
  }
  .scroll-seal-pinyin {
    font-size: 6.5px;
  }
  .scroll-roll {
    width: 14px;
    flex-basis: 14px;
  }
  .scroll-roll::before,
  .scroll-roll::after {
    width: 12px;
    height: 12px;
  }
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .profile-seal {
    width: 88px;
    height: 102px;
  }
  .profile-seal-han {
    font-size: 46px;
  }
  .profile-quote {
    grid-column: span 1;
  }
  .profile-copy h1 {
    font-size: 48px;
  }
  .achievement-grid {
    grid-template-columns: 1fr;
  }
  .settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .settings-row .btn,
  .settings-row .toggle {
    align-self: flex-start;
  }
  .training-hero {
    padding: 22px;
  }
  .training-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }
  .training-stats,
  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }
  .game-body {
    padding: 20px 16px 24px;
  }
  .game-top {
    padding: 14px 15px 12px;
    gap: 10px;
  }
  .game-title h2 {
    font-size: 21px;
  }
  .game-title .eyebrow {
    font-size: 7.5px;
  }
  .game-meta {
    gap: 4px;
  }
  .game-progress-text {
    display: none;
  }
  .game-meta .btn-hint {
    padding: 0 8px;
    font-size: 9px;
  }
  .game-meta .btn-hint .ico {
    width: 12px;
    height: 12px;
  }
  .game-stage-head h3 {
    font-size: 29px;
  }
  .game-brief h3 {
    font-size: 34px;
  }
  .answer-grid-three {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .answer-grid-two {
    gap: 7px;
  }
  .warmup-tile {
    min-height: 104px;
  }
  .warmup-tile .tile-han {
    font-size: 46px;
  }
  .warmup-meaning {
    font-size: 26px;
  }
  .warmup-study-char {
    font-size: 96px;
  }
  .warmup-study-meaning {
    font-size: 28px;
  }
  .warmup-study-mnemonic {
    font-size: 16px;
  }
  .warmup-prompt {
    margin-bottom: 12px;
    padding: 11px 12px;
  }
  .warmup-word {
    width: 88px;
    padding: 9px 5px 7px;
  }
  .warmup-word-han {
    font-size: 34px;
  }
  .answer-tile {
    min-height: 82px;
    padding: 16px 6px 10px;
  }
  .tile-han {
    font-size: 36px;
  }
  .context-card {
    padding: 22px 14px;
  }
  .context-sentence {
    font-size: clamp(23px, 7vw, 31px);
  }
  .feedback {
    flex-wrap: wrap;
  }
  .feedback .btn {
    width: 100%;
  }
  .match-grid {
    gap: 6px;
  }
  .match-han {
    font-size: 34px;
  }
  .match-meaning {
    font-size: 11px;
  }
  .meaning-char > span {
    font-size: 84px;
  }
  .write-char-line span {
    font-size: 64px;
  }
  .tianzige {
    max-width: 290px;
  }
  .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .reveal-visual {
    min-height: 280px;
  }
  .char-modal-copy,
  .artifact-modal-copy {
    padding: 26px 20px 24px;
  }
  .char-modal-visual {
    min-height: 250px;
  }
  .char-modal-han {
    font-size: 130px;
  }
  .artifact-modal-art {
    min-height: 240px;
  }
  .help-modal,
  .reset-modal,
  .teaser-modal {
    padding: 30px 20px 24px;
  }
  .help-modal h2,
  .reset-modal h2,
  .teaser-modal h2 {
    font-size: 32px;
  }
  .finale-story {
    padding: 44px 22px 28px;
  }
  .finale-line p {
    font-size: 11.5px;
  }
  .finale-line:nth-child(odd) p {
    font-size: 16px;
  }
  .finale-story-shell {
    min-height: 560px;
  }
  .finale-shade {
    background:
      linear-gradient(90deg, rgba(10, 14, 11, 0.92), rgba(10, 14, 11, 0.58)),
      linear-gradient(0deg, rgba(10, 14, 11, 0.92), transparent 55%);
  }
  .identity-card {
    padding: 28px 22px 24px;
  }
  .seal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .seal-option {
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px;
    text-align: left;
  }
  .seal-option-han {
    font-size: 30px;
  }
  .seal-option-epithet {
    display: none;
  }
  .onboarding-top {
    padding: 18px 20px;
  }
  .prologue-main {
    padding: 36px 22px;
  }
  .prologue-text {
    font-size: 16px;
  }
  .prologue-watermark {
    font-size: 220px;
    right: -30px;
  }
  .landing-lead {
    font-size: 15px;
  }
  .landing-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }
  .landing-features {
    gap: 12px;
  }
  .landing-foot {
    flex-direction: column;
    gap: 6px;
  }
  .toast-root {
    top: 10px;
    right: 10px;
    width: min(340px, calc(100vw - 20px));
  }
}

@media (max-width: 480px) {
  .tutorial-top .brand-text {
    display: none;
  }
  .tutorial-progress {
    gap: 1px;
  }
  .tutorial-step b {
    font-size: 10px;
  }
  .tutorial-panel {
    padding: 20px 14px;
  }
  .tutorial-panel h1 {
    font-size: 32px;
  }
  .tutorial-text,
  .tutorial-lead {
    font-size: 12px;
  }
  .tutorial-success-char {
    font-size: 118px;
  }
  .speak-han {
    font-size: 78px;
  }
  .parable-han {
    font-size: 100px;
  }
  .parable-figure {
    width: 82px;
    height: 110px;
  }
  .done-char {
    width: 46px;
    height: 62px;
  }
  .done-char span {
    font-size: 24px;
  }
  .npc-gallery-card {
    flex-basis: 148px;
    height: 230px;
  }
  .topbar {
    min-height: 60px;
    padding: 0 13px;
  }
  .content {
    padding: 16px 13px 92px;
  }
  .topbar-title strong {
    font-size: 16px;
  }
  .hud-streak {
    display: none;
  }
  .map-card {
    border-radius: 20px;
  }
  .map-card-head {
    padding: 15px 15px 10px;
  }
  .map-scroll {
    padding: 0 8px;
  }
  .map-canvas {
    min-width: 660px;
  }
  .map-plaque {
    top: 10px;
    left: 10px;
  }
  .map-rail {
    gap: 9px;
  }
  .rail-card {
    border-radius: 16px;
    padding: 14px;
  }
  .chapter-hero {
    border-radius: 20px;
    min-height: 270px;
  }
  .chapter-hero-content h1 {
    font-size: 44px;
  }
  .chapter-lead {
    display: none;
  }
  .chapter-stamp {
    width: 46px;
    height: 56px;
    top: 14px;
    right: 14px;
  }
  .chapter-stamp span {
    font-size: 25px;
  }
  .npc-head {
    flex-direction: column;
    gap: 10px;
  }
  .npc-rep {
    width: 100%;
    flex-basis: auto;
  }
  .quest-steps-card,
  .npc-card {
    padding: 15px;
    border-radius: 18px;
  }
  .step-rewards {
    display: none;
  }
  .answer-tile {
    min-height: 74px;
  }
  .tile-han {
    font-size: 32px;
  }
  .match-card {
    aspect-ratio: 1 / 1.15;
  }
  .match-back .ico {
    width: 20px;
    height: 20px;
  }
  .match-han {
    font-size: 30px;
  }
  .match-meaning {
    font-size: 10px;
  }
  .game-title h2 {
    font-size: 18px;
  }
  .game-meta .combo-chip {
    padding: 4px 7px;
    font-size: 9px;
  }
  .brief-npc {
    flex-direction: column;
    text-align: left;
  }
  .writing-board {
    padding: 9px;
  }
  .modal {
    border-radius: 20px;
  }
  .scroll-hero {
    margin-left: -4px;
    margin-right: -4px;
  }
  .scroll-hero-copy h2 {
    font-size: 28px;
  }
  .collection-stats {
    gap: 6px;
  }
  .collection-stats > div {
    padding: 10px;
  }
  .collection-stats strong {
    font-size: 23px;
  }
  .training-stats,
  .profile-stats {
    gap: 6px;
  }
  .training-stats > div,
  .profile-stats > div {
    padding: 11px;
  }
  .training-stats strong,
  .profile-stats strong {
    font-size: 24px;
  }
  .profile-npc-body > div:first-child {
    flex-direction: column;
    gap: 0;
  }
  .achievement {
    padding: 8px;
  }
  .game-summary h3 {
    font-size: 34px;
  }
  .summary-stats strong {
    font-size: 21px;
  }
}

@media (max-width: 700px) {
  .tone-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .tone-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .extra-bricks-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .pair-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .primer-done-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .brick-study-char {
    font-size: 104px;
  }
  .tone-question-char {
    font-size: 68px;
  }
  .tone-card {
    padding: 13px 8px 10px;
  }
  .tone-card strong {
    font-size: 12px;
  }
  .tone-contour {
    height: 32px;
  }
  .assemble-bank {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .primer-stage .game-stage-head h3 {
    font-size: 27px;
  }
  .tone-grid {
    gap: 6px;
  }
  .tone-card {
    padding: 12px 6px 9px;
  }
  .tone-card strong {
    font-size: 11px;
  }
  .tone-contour {
    height: 28px;
  }
  .tone-example {
    font-size: 21px;
  }
  .tone-audio {
    display: none;
  }
  .tone-options {
    gap: 6px;
  }
  .tone-option {
    padding: 8px 4px;
  }
  .tone-option .tone-contour {
    height: 23px;
  }
  .tone-option span {
    font-size: 7.5px;
  }
  .brick-study-char {
    font-size: 92px;
  }
  .brick-study-meaning {
    font-size: 27px;
  }
  .brick-study-mnemonic {
    font-size: 15px;
  }
  .extra-bricks-grid {
    gap: 6px;
  }
  .extra-brick {
    padding: 9px 4px;
  }
  .extra-brick-han {
    font-size: 32px;
  }
  .assemble-slot {
    width: 68px;
    height: 68px;
    font-size: 36px;
  }
  .assemble-bank {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .assemble-tile-han {
    font-size: 32px;
  }
  .assemble-result-char {
    font-size: 78px;
  }
  .primer-done-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .primer-done-han {
    font-size: 33px;
  }
  .pair-preview {
    padding: 9px 10px;
  }
  .pair-preview-item {
    padding: 4px 7px;
  }
  .pair-grid {
    gap: 6px;
  }
  .pair-tile {
    min-height: 92px;
    padding: 8px 5px;
  }
  .pair-han {
    font-size: 34px;
  }
  .pair-meaning {
    font-size: 12px;
  }
  .context-breakdown {
    padding: 10px;
  }
  .context-tokens {
    gap: 4px;
  }
  .context-token {
    min-width: 46px;
    padding: 5px 6px;
  }
  .context-token .ct-zh {
    font-size: 21px;
  }
  .context-token .ct-ru {
    font-size: 8px;
  }
  .write-directions ol {
    grid-template-columns: 1fr;
  }
  .write-direction {
    font-size: 9px;
  }
  .warmup-form-char {
    font-size: 72px;
  }
  .key-note-han {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
