/* =========================================================
   数境 · 必修二远征
   Handcrafted visual system — ink, starlight, brass & jade
   ========================================================= */

:root {
  --bg: #070b15;
  --bg-soft: #0b1221;
  --panel: rgba(15, 24, 43, 0.76);
  --panel-solid: #101a2e;
  --panel-raised: rgba(22, 34, 58, 0.9);
  --line: rgba(172, 194, 225, 0.14);
  --line-strong: rgba(183, 205, 235, 0.25);
  --text: #edf3fb;
  --text-soft: #c9d5e7;
  --muted: #8f9fb9;
  --faint: #63738d;
  --gold: #e2bd7b;
  --gold-deep: #a97c3f;
  --jade: #67d8c4;
  --jade-deep: #258f82;
  --coral: #ff9078;
  --violet: #b19cff;
  --danger: #ff6f7d;
  --success: #6fe0a8;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.22);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --math: "Cambria Math", "STIX Two Math", "Times New Roman", "Songti SC", serif;
  --topbar-h: 76px;
  --page-max: 1360px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.has-modal,
body.battle-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, p, figure {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

::selection {
  color: #08111f;
  background: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #080e19;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #080e19;
  border-radius: 99px;
  background: #293b58;
}

::-webkit-scrollbar-thumb:hover {
  background: #3d5378;
}

/* ---------- atmosphere ---------- */

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

.atmo-glow {
  position: absolute;
  width: 58vw;
  height: 58vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
}

.atmo-glow--one {
  top: -28vw;
  right: -12vw;
  background: radial-gradient(circle, rgba(50, 132, 138, 0.65), transparent 68%);
}

.atmo-glow--two {
  bottom: -34vw;
  left: -20vw;
  background: radial-gradient(circle, rgba(91, 71, 145, 0.5), transparent 68%);
}

.atmo-grid {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(145, 171, 209, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 171, 209, 0.08) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 34%, #000 18%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 34%, #000 18%, transparent 82%);
}

.atmo-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ---------- primitives ---------- */

.math {
  font-family: var(--math);
  font-size: 1.04em;
  letter-spacing: 0.01em;
}

.math i,
.var {
  font-family: var(--math);
  font-style: italic;
  font-weight: 500;
}

.vec {
  position: relative;
  display: inline-block;
  padding: 0 0.08em;
  font-family: var(--math);
  font-style: italic;
  white-space: nowrap;
}

.vec::after {
  content: "";
  position: absolute;
  top: -0.34em;
  left: 7%;
  right: 10%;
  height: 1px;
  background: currentColor;
  opacity: 0.72;
}

.vec::before {
  content: "";
  position: absolute;
  top: -0.42em;
  right: 6%;
  width: 0.27em;
  height: 0.27em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  opacity: 0.78;
  transform: rotate(45deg);
}

.ovl {
  text-decoration: overline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0;
}

.hl {
  color: var(--gold);
}

.hl-jade {
  color: var(--jade);
}

.hl-coral {
  color: var(--coral);
}

.mono {
  font-family: var(--math);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

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

.is-hidden {
  display: none !important;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.eyebrow--plain::before {
  display: none;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-title h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.section-title p {
  max-width: 480px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: right;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 24%, transparent 76%, rgba(226, 189, 123, 0.04));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
  opacity: 0.4;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}

.chip--gold {
  border-color: rgba(226, 189, 123, 0.28);
  color: var(--gold);
  background: rgba(226, 189, 123, 0.08);
}

.chip--jade {
  border-color: rgba(103, 216, 196, 0.24);
  color: var(--jade);
  background: rgba(103, 216, 196, 0.075);
}

.chip--coral {
  border-color: rgba(255, 144, 120, 0.24);
  color: var(--coral);
  background: rgba(255, 144, 120, 0.08);
}

.chip--danger {
  border-color: rgba(255, 111, 125, 0.26);
  color: #ff9ca5;
  background: rgba(255, 111, 125, 0.08);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.25s;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.btn--primary:disabled {
  border-color: var(--line);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.btn--primary {
  border-color: rgba(239, 206, 143, 0.5);
  color: #10131b;
  background: linear-gradient(135deg, #f3dcae, #dcb36f 52%, #c3944e);
  box-shadow: 0 10px 30px rgba(201, 158, 85, 0.2), inset 0 1px rgba(255, 255, 255, 0.55);
}

.btn--primary:hover {
  border-color: rgba(255, 238, 198, 0.85);
  background: linear-gradient(135deg, #ffe9bf, #e7c281 52%, #d2a45d);
  box-shadow: 0 14px 36px rgba(201, 158, 85, 0.3), inset 0 1px rgba(255, 255, 255, 0.65);
}

.btn--jade {
  border-color: rgba(103, 216, 196, 0.34);
  color: #071612;
  background: linear-gradient(135deg, #a6f0e2, #63d5c1 58%, #3eaf9c);
  box-shadow: 0 10px 28px rgba(67, 186, 166, 0.18);
}

.btn--jade:hover {
  background: linear-gradient(135deg, #c1fff4, #77e4d1 58%, #50c0ad);
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
}

.btn--danger {
  border-color: rgba(255, 111, 125, 0.3);
  color: #ffb5bc;
  background: rgba(255, 111, 125, 0.09);
}

.btn--danger:hover {
  border-color: rgba(255, 111, 125, 0.5);
  background: rgba(255, 111, 125, 0.15);
}

.btn--wide {
  width: 100%;
}

.btn--sm {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 12px;
}

.btn--lg {
  min-height: 54px;
  padding: 13px 28px;
  border-radius: 14px;
  font-size: 15px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  transition: 0.25s;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.icon-btn .icon {
  width: 18px;
  height: 18px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

.bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-a, #b68d4e), var(--bar-b, #f0d39d));
  box-shadow: 0 0 18px color-mix(in srgb, var(--bar-b, #f0d39d) 24%, transparent);
  transition: width 0.8s var(--ease);
}

.bar--jade {
  --bar-a: #2b9c8d;
  --bar-b: #7ce7d5;
}

.bar--coral {
  --bar-a: #bb5d4d;
  --bar-b: #ff9d84;
}

.bar--thin {
  height: 4px;
}

.stars {
  display: inline-flex;
  gap: 3px;
  color: var(--faint);
  line-height: 1;
}

.stars .is-on {
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(226, 189, 123, 0.38));
}

.stars .icon {
  width: 14px;
  height: 14px;
}

.avatar {
  --a-main: #67d8c4;
  --a-deep: #1c655d;
  --a-soft: #c7fff4;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--a-main) 42%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--a-main) 25%, #101a2b), #0b1321 74%);
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--a-main) 18%, transparent), 0 0 30px color-mix(in srgb, var(--a-main) 10%, transparent);
}

.avatar svg {
  width: 100%;
  height: 100%;
}

.avatar--xs { width: 34px; height: 34px; }
.avatar--sm { width: 48px; height: 48px; }
.avatar--md { width: 72px; height: 72px; }
.avatar--lg { width: 110px; height: 110px; }
.avatar--xl { width: 168px; height: 168px; border-width: 1px; }
.avatar--hero { width: min(260px, 30vw); height: min(260px, 30vw); }

.avatar-bg { fill: rgba(9, 16, 29, 0.72); }
.avatar-orbit { fill: none; stroke: var(--a-main); stroke-opacity: 0.22; stroke-width: 1; }
.avatar-ring { fill: none; stroke: var(--a-main); stroke-opacity: 0.55; stroke-width: 1.5; stroke-dasharray: 2 7; }
.avatar-robe { fill: var(--a-deep); }
.avatar-robe-light { fill: var(--a-main); fill-opacity: 0.2; }
.avatar-collar { fill: var(--a-soft); fill-opacity: 0.65; }
.avatar-neck { fill: #d8b397; }
.avatar-face { fill: #f0cfb7; }
.avatar-face-shadow { fill: #d8ad90; opacity: 0.4; }
.avatar-hair { fill: #141c2b; }
.avatar-hair-light { fill: var(--a-deep); opacity: 0.75; }
.avatar-eye { fill: #1b2638; }
.avatar-brow { fill: none; stroke: #4b3429; stroke-width: 1.8; stroke-linecap: round; opacity: 0.65; }
.avatar-mouth { fill: none; stroke: #a6645e; stroke-width: 1.5; stroke-linecap: round; opacity: 0.7; }
.avatar-blush { fill: var(--a-main); opacity: 0.22; }
.avatar-accent { fill: var(--a-main); }
.avatar-accent-stroke { fill: none; stroke: var(--a-main); stroke-width: 1.6; stroke-linecap: round; }
.avatar-seal { fill: var(--a-main); fill-opacity: 0.16; stroke: var(--a-main); stroke-opacity: 0.36; stroke-width: 0.8; }
.avatar-glyph { fill: var(--a-soft); font-family: var(--serif); font-size: 8px; font-weight: 700; text-anchor: middle; }
.avatar-star { fill: var(--a-soft); opacity: 0.9; }

/* ---------- boot ---------- */

.boot-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  min-height: 100vh;
  color: var(--muted);
  font-family: var(--serif);
  letter-spacing: 0.18em;
}

.boot-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
}

.boot-sigil span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(226, 189, 123, 0.35);
  border-radius: 50%;
  animation: spin 8s linear infinite;
}

.boot-sigil span:nth-child(2) {
  inset: 10px;
  border-style: dashed;
  border-color: rgba(103, 216, 196, 0.3);
  animation-direction: reverse;
  animation-duration: 6s;
}

.boot-sigil span:nth-child(3) {
  inset: 24px;
  border-color: rgba(226, 189, 123, 0.18);
  animation-duration: 4s;
}

.boot-sigil b {
  font-size: 32px;
  color: var(--gold);
  font-weight: 500;
}

.boot-screen p {
  font-size: 13px;
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: #0b1221;
  text-align: center;
}

/* =========================================================
   ONBOARDING
   ========================================================= */

.onboarding {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 34px clamp(22px, 5vw, 78px) 24px;
  overflow: hidden;
}

.onboarding::before {
  content: "";
  position: absolute;
  top: -18vw;
  left: 48%;
  width: 52vw;
  height: 52vw;
  border: 1px solid rgba(226, 189, 123, 0.09);
  border-radius: 50%;
  box-shadow:
    0 0 0 7vw rgba(226, 189, 123, 0.018),
    0 0 0 14vw rgba(103, 216, 196, 0.01);
  pointer-events: none;
}

.onboarding-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 20px;
}

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

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226, 189, 123, 0.4);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle, rgba(226, 189, 123, 0.13), transparent 68%);
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: 0 0 24px rgba(226, 189, 123, 0.08);
}

.brand__mark::before,
.brand__mark::after {
  content: "";
  position: absolute;
  background: rgba(226, 189, 123, 0.38);
}

.brand__mark::before {
  width: 54px;
  height: 1px;
}

.brand__mark::after {
  width: 1px;
  height: 54px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__text b {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.brand__text span {
  margin-top: 3px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.onboarding-nav__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.onboarding-nav__meta .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 9px var(--jade);
}

.onboarding-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(380px, 0.84fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  width: 100%;
  max-width: 1340px;
  min-height: calc(100vh - 176px);
  margin: 0 auto;
  padding: 30px 0 46px;
}

.onboarding-copy {
  position: relative;
  padding: 12px 0;
}

.onboarding-copy .eyebrow {
  margin-bottom: 22px;
}

.onboarding-title {
  max-width: 780px;
  font-family: var(--serif);
  font-size: clamp(44px, 5.6vw, 82px);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.15;
}

.onboarding-title span {
  display: block;
  margin-top: 5px;
  color: transparent;
  background: linear-gradient(100deg, #f8e5bc 5%, #dfb56d 43%, #72d9c8 98%);
  -webkit-background-clip: text;
  background-clip: text;
}

.onboarding-title em {
  position: relative;
  font-style: normal;
}

.onboarding-title em::after {
  content: "";
  position: absolute;
  left: 1%;
  right: -2%;
  bottom: 0.04em;
  z-index: -1;
  height: 0.24em;
  background: linear-gradient(90deg, rgba(226, 189, 123, 0.22), rgba(103, 216, 196, 0.04));
  transform: skewX(-9deg);
}

.onboarding-lead {
  max-width: 585px;
  margin-top: 27px;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.9;
  letter-spacing: 0.035em;
}

.onboarding-lead b {
  color: var(--gold);
  font-weight: 600;
}

.onboarding-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 27px;
}

.onboarding-tags .chip {
  min-height: 32px;
  padding: 5px 13px;
  background: rgba(14, 25, 42, 0.66);
  font-size: 11.5px;
  backdrop-filter: blur(8px);
}

.onboarding-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 34px;
}

.metric__num {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

.metric__num small {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.metric__label {
  margin-top: 6px;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

.onboarding-art {
  position: absolute;
  top: 50%;
  right: -6%;
  z-index: -1;
  width: 48vw;
  max-width: 660px;
  transform: translateY(-50%);
  opacity: 0.8;
  pointer-events: none;
}

.onboarding-art__orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(226, 189, 123, 0.08);
  border-radius: 50%;
  animation: spin 60s linear infinite;
}

.onboarding-art__orbit::before,
.onboarding-art__orbit::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(226, 189, 123, 0.75);
}

.onboarding-art__orbit::before { top: 15%; left: 9%; }
.onboarding-art__orbit::after { right: 15%; bottom: 10%; background: var(--jade); box-shadow: 0 0 18px rgba(103, 216, 196, 0.7); }

.onboarding-art__glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38%;
  transform: translate(-50%, -50%);
  color: rgba(226, 189, 123, 0.46);
  filter: drop-shadow(0 0 30px rgba(226, 189, 123, 0.16));
}

.onboarding-art__glyph svg {
  width: 100%;
  height: auto;
}

.onboarding-account {
  position: relative;
  padding: clamp(24px, 3.6vw, 38px);
  border: 1px solid rgba(183, 205, 235, 0.17);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 34%),
    linear-gradient(320deg, rgba(37, 95, 104, 0.12), transparent 40%),
    rgba(12, 21, 38, 0.84);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.44), inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.onboarding-account::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 189, 123, 0.65), transparent);
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.account-head h2 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.account-head p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.account-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(226, 189, 123, 0.28);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
  background: rgba(226, 189, 123, 0.055);
  transform: rotate(8deg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field > label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.field > label span,
.field-label span {
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.text-input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(183, 205, 235, 0.18);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(5, 11, 21, 0.55);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.06em;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.text-input::placeholder {
  color: #52627a;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.text-input:focus {
  border-color: rgba(226, 189, 123, 0.6);
  background: rgba(8, 15, 27, 0.8);
  box-shadow: 0 0 0 4px rgba(226, 189, 123, 0.07);
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.avatar-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 11px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.022);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: 0.25s;
}

.avatar-choice:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.avatar-choice.is-selected {
  border-color: color-mix(in srgb, var(--choice-color, var(--gold)) 62%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--choice-color, var(--gold)) 10%, rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--choice-color, var(--gold)) 12%, transparent), inset 0 0 24px color-mix(in srgb, var(--choice-color, var(--gold)) 7%, transparent);
}

.avatar-choice .avatar {
  width: 50px;
  height: 50px;
}

.avatar-choice.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #08101b;
  background: var(--choice-color, var(--gold));
  font-size: 9px;
  font-weight: 900;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 7px;
}

.account-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.7;
}

.account-note .icon {
  width: 13px;
  height: 13px;
  margin-top: 2px;
}

.onboarding-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid rgba(172, 194, 225, 0.08);
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.onboarding-foot span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.onboarding-foot .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}

/* existing save */

.save-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.save-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), rgba(103, 216, 196, 0.025));
}

.save-hero__info {
  min-width: 0;
  flex: 1;
}

.save-hero__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.save-hero__name .chip {
  min-height: 21px;
  padding: 1px 7px;
  font-size: 9px;
}

.save-hero__title {
  margin-top: 3px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.save-hero__level {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.save-hero__level b {
  color: var(--text);
  font-family: var(--math);
  font-size: 18px;
  font-weight: 500;
}

.save-progress {
  display: grid;
  gap: 8px;
}

.save-progress__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
}

.save-progress__row b {
  color: var(--text-soft);
  font-weight: 600;
}

.save-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.save-stat {
  padding: 10px 8px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.018);
}

.save-stat b {
  display: block;
  color: var(--text);
  font-family: var(--math);
  font-size: 18px;
  font-weight: 500;
}

.save-stat span {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.save-actions {
  display: grid;
  gap: 9px;
}

.save-foot-note {
  color: var(--faint);
  font-size: 10px;
  text-align: center;
}

/* =========================================================
   APP SHELL
   ========================================================= */

.game-shell {
  min-height: 100vh;
  padding-bottom: 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 30px;
  height: var(--topbar-h);
  padding: 0 clamp(18px, 3.4vw, 50px);
  border-bottom: 1px solid rgba(172, 194, 225, 0.09);
  background: linear-gradient(180deg, rgba(7, 12, 22, 0.92), rgba(7, 12, 22, 0.72));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 10%;
  bottom: -1px;
  left: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226, 189, 123, 0.16), transparent);
}

.topbar .brand {
  flex: 0 0 auto;
}

.topbar .brand__mark {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.topbar .brand__mark::before { width: 46px; }
.topbar .brand__mark::after { height: 46px; }

.topbar .brand__text b {
  font-size: 17px;
}

.topbar .brand__text span {
  font-size: 7.5px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: 0.22s;
}

.nav-item .icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.is-active {
  color: var(--gold);
  background: rgba(226, 189, 123, 0.07);
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 2px;
  left: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.top-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(172, 194, 225, 0.11);
  border-radius: 9px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--math);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.top-stat .icon {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.top-stat--streak .icon {
  color: var(--coral);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 4px 11px 4px 5px;
  border: 1px solid rgba(172, 194, 225, 0.12);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  transition: 0.22s;
}

.profile-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.profile-chip__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 110px;
  line-height: 1.25;
}

.profile-chip__text b {
  max-width: 110px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chip__text span {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.topbar__settings {
  width: 36px;
  height: 36px;
}

.app-main {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 34px clamp(18px, 3.4vw, 50px) 30px;
}

.view {
  animation: view-in 0.55s var(--ease) both;
}

.mobile-nav {
  display: none;
}

/* =========================================================
   HUB
   ========================================================= */

.hub-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.hub-head h1 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 43px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.hub-head h1 em {
  color: var(--gold);
  font-style: normal;
}

.hub-head__right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.hub-head__right .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 10px var(--jade);
  animation: pulse 2.4s infinite;
}

.hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: start;
}

.hub-main {
  min-width: 0;
}

.hub-side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
}

.hero-quest {
  position: relative;
  min-height: 276px;
  overflow: hidden;
  padding: clamp(26px, 3.4vw, 42px);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 65% 100% at 92% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    linear-gradient(115deg, rgba(17, 29, 50, 0.95), rgba(10, 18, 32, 0.92));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.05);
  isolation: isolate;
}

.hero-quest::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -88%;
  right: -12%;
  width: 62%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 17%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 34px color-mix(in srgb, var(--accent) 3%, transparent),
    0 0 0 70px color-mix(in srgb, var(--accent) 2%, transparent);
}

.hero-quest::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 3%;
  bottom: -70%;
  width: 46%;
  aspect-ratio: 1;
  border: 1px dashed color-mix(in srgb, var(--accent) 17%, transparent);
  border-radius: 50%;
  animation: spin 80s linear infinite;
}

.hero-quest__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 30px;
}

.hero-quest__copy {
  flex: 1;
  min-width: 0;
}

.hero-quest__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 15px;
}

.hero-quest__chapter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-quest__chapter::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
}

.hero-quest h2 {
  max-width: 580px;
  font-family: var(--serif);
  font-size: clamp(29px, 3.8vw, 52px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.18;
}

.hero-quest h2 span {
  color: var(--accent);
}

.hero-quest__desc {
  max-width: 520px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.hero-quest__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 23px;
}

.hero-quest__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.hero-meta .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.hero-meta b {
  color: var(--text-soft);
  font-weight: 600;
}

.hero-quest__sigil {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(160px, 20vw, 235px);
  aspect-ratio: 1;
  color: var(--accent);
}

.hero-quest__sigil::before,
.hero-quest__sigil::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.hero-quest__sigil::before {
  inset: 4%;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  box-shadow: inset 0 0 42px color-mix(in srgb, var(--accent) 5%, transparent);
}

.hero-quest__sigil::after {
  inset: 18%;
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, transparent);
  animation: spin 50s linear infinite reverse;
}

.hero-quest__sigil svg {
  width: 58%;
  height: 58%;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 28%, transparent));
  opacity: 0.9;
}

.hero-quest__glyph-label {
  position: absolute;
  bottom: 5%;
  left: 50%;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.24em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.progress-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 12px;
}

.world-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.world-mini__dot {
  width: 14px;
  height: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
}

.world-mini.is-done .world-mini__dot { background: var(--jade); box-shadow: 0 0 8px rgba(103, 216, 196, 0.5); }
.world-mini.is-current { color: var(--text-soft); }
.world-mini.is-current .world-mini__dot { background: var(--gold); box-shadow: 0 0 8px rgba(226, 189, 123, 0.5); }

.worlds-section {
  margin-top: 32px;
}

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

.world-card {
  --accent: #67d8c4;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 268px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid rgba(172, 194, 225, 0.12);
  border-radius: 20px;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 44%),
    linear-gradient(155deg, rgba(23, 37, 62, 0.72), rgba(10, 17, 30, 0.82));
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
  isolation: isolate;
}

.world-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%);
}

.world-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.28), inset 0 0 40px color-mix(in srgb, var(--accent) 3%, transparent);
}

.world-card--final {
  grid-column: 1 / -1;
  min-height: 214px;
}

.world-card--locked {
  filter: saturate(0.35);
  cursor: not-allowed;
}

.world-card--locked:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.world-card__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.world-card__index {
  color: var(--faint);
  font-family: var(--math);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.world-card__heat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.world-card__heat .icon {
  width: 11px;
  height: 11px;
}

.world-card__glyph {
  position: absolute;
  top: 44px;
  right: 15px;
  width: 102px;
  height: 102px;
  color: var(--accent);
  opacity: 0.52;
  transition: opacity 0.35s, transform 0.7s var(--ease);
  pointer-events: none;
}

.world-card:hover .world-card__glyph {
  opacity: 0.8;
  transform: rotate(8deg) scale(1.04);
}

.world-card h3 {
  position: relative;
  z-index: 2;
  margin-top: 25px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.world-card__sub {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  color: var(--accent);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.world-card__desc {
  position: relative;
  z-index: 2;
  max-width: 78%;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.world-card__tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.world-card__tags .chip {
  min-height: 22px;
  padding: 1px 7px;
  border-color: rgba(172, 194, 225, 0.1);
  color: var(--muted);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.world-card__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
}

.world-card__nodes {
  display: flex;
  align-items: center;
  gap: 0;
}

.node-pip {
  position: relative;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(172, 194, 225, 0.18);
  border-radius: 50%;
  color: var(--faint);
  background: rgba(6, 12, 22, 0.65);
  font-size: 8px;
}

.node-pip .icon {
  width: 9px;
  height: 9px;
}

.node-pip.is-done {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}

.node-pip.is-current {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226, 189, 123, 0.08);
}

.node-link {
  width: 15px;
  height: 1px;
  background: rgba(172, 194, 225, 0.15);
}

.node-link.is-done {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}

.world-card__enter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.world-card__enter .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.25s;
}

.world-card:hover .world-card__enter .icon {
  transform: translateX(3px);
}

.world-card--locked .world-card__enter {
  color: var(--faint);
}

.world-card__lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 9.5px;
}

.world-card__lock .icon {
  width: 12px;
  height: 12px;
}

/* sidebar */

.profile-panel {
  padding: 20px;
}

.profile-panel__top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.profile-panel__identity {
  min-width: 0;
  flex: 1;
}

.profile-panel__name {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-panel__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--gold);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.profile-panel__level {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--faint);
  font-size: 9px;
}

.profile-panel__level b {
  color: var(--text);
  font-family: var(--math);
  font-size: 22px;
  font-weight: 500;
}

.xp-block {
  margin-top: 16px;
}

.xp-block__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.xp-block__row span:last-child {
  font-family: var(--math);
  color: var(--text-soft);
}

.profile-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.mini-stat {
  padding: 8px 4px;
  border: 1px solid rgba(172, 194, 225, 0.09);
  border-radius: 9px;
  text-align: center;
  background: rgba(255, 255, 255, 0.018);
}

.mini-stat b {
  display: block;
  color: var(--text);
  font-family: var(--math);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.mini-stat span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.profile-panel__actions {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.profile-panel__actions .btn {
  flex: 1;
  min-height: 35px;
  padding: 7px 8px;
  font-size: 10.5px;
}

.skill-point-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(226, 189, 123, 0.16);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.055);
  font-size: 9.5px;
}

.skill-point-note .icon {
  width: 13px;
  height: 13px;
}

.skill-point-note b {
  margin-left: auto;
  font-family: var(--math);
  font-size: 14px;
  font-weight: 500;
}

.daily-panel {
  padding: 18px 18px 15px;
}

.daily-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.daily-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.daily-head span {
  color: var(--faint);
  font-size: 9px;
}

.daily-streak {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 144, 120, 0.15);
  border-radius: 9px;
  color: #ffb3a7;
  background: rgba(255, 144, 120, 0.045);
  font-size: 9.5px;
}

.daily-streak .icon {
  width: 14px;
  height: 14px;
  color: var(--coral);
}

.daily-streak b {
  margin-left: auto;
  color: var(--coral);
  font-family: var(--math);
  font-size: 13px;
  font-weight: 500;
}

.daily-list {
  display: grid;
  gap: 11px;
}

.daily-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
}

.daily-task__name {
  color: var(--text-soft);
  font-size: 10px;
}

.daily-task__progress {
  color: var(--faint);
  font-family: var(--math);
  font-size: 9px;
}

.daily-task__bar {
  grid-column: 1 / 2;
}

.daily-task .btn {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 8.5px;
}

.daily-task.is-claimed .daily-task__name {
  color: var(--faint);
  text-decoration: line-through;
}

.intel-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(226, 189, 123, 0.1), transparent 52%),
    rgba(15, 24, 43, 0.7);
}

.intel-card__label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.intel-card__label .icon {
  width: 13px;
  height: 13px;
}

.intel-card h3 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
}

.intel-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.intel-card__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 600;
}

.intel-card__link .icon {
  width: 12px;
  height: 12px;
}

.wrong-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 144, 120, 0.25);
  border-radius: 12px;
  background: rgba(255, 144, 120, 0.04);
}

.wrong-alert__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--coral);
  background: rgba(255, 144, 120, 0.08);
}

.wrong-alert__icon .icon {
  width: 15px;
  height: 15px;
}

.wrong-alert__text {
  flex: 1;
  min-width: 0;
}

.wrong-alert__text b {
  display: block;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
}

.wrong-alert__text span {
  color: var(--faint);
  font-size: 9px;
}

.wrong-alert .icon-btn {
  width: 28px;
  height: 28px;
  border-color: rgba(255, 144, 120, 0.2);
  color: var(--coral);
}

.wrong-alert .icon-btn .icon {
  width: 13px;
  height: 13px;
}

/* exam strip */

.exam-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.exam-tile {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 14px;
  background: rgba(15, 24, 43, 0.55);
}

.exam-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 28px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

.exam-tile__tag {
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.exam-tile h4 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.exam-tile p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.exam-tile__num {
  position: absolute;
  right: 13px;
  bottom: 7px;
  color: rgba(226, 189, 123, 0.08);
  font-family: var(--math);
  font-size: 50px;
  font-weight: 600;
  line-height: 1;
}

/* =========================================================
   RADAR
   ========================================================= */

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.view-head h1 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(29px, 3.4vw, 45px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.24;
}

.view-head h1 em {
  color: var(--gold);
  font-style: normal;
}

.view-head p {
  max-width: 520px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.view-head__aside {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.radar-overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 26px;
  overflow: hidden;
  padding: clamp(24px, 3.2vw, 38px);
  margin-bottom: 22px;
  border: 1px solid rgba(226, 189, 123, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 55% 100% at 100% 0, rgba(226, 189, 123, 0.08), transparent 65%),
    linear-gradient(120deg, rgba(20, 33, 56, 0.92), rgba(9, 17, 30, 0.9));
  box-shadow: var(--shadow-soft);
}

.radar-overview::after {
  content: "考";
  position: absolute;
  right: 2%;
  bottom: -22%;
  color: rgba(226, 189, 123, 0.035);
  font-family: var(--serif);
  font-size: 330px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.radar-overview__copy {
  position: relative;
  z-index: 1;
}

.radar-overview h2 {
  max-width: 600px;
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(23px, 2.7vw, 36px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.radar-overview h2 b {
  color: var(--gold);
  font-weight: 600;
}

.radar-overview p {
  max-width: 600px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.85;
}

.radar-signal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.radar-mini-ring {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 12px;
  padding-left: 26px;
  border-left: 1px solid rgba(172, 194, 225, 0.11);
}

.radar-mini-ring__item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
}

.radar-mini-ring__item span {
  color: var(--muted);
  font-size: 9.5px;
}

.radar-mini-ring__item b {
  color: var(--text-soft);
  font-family: var(--math);
  font-size: 10.5px;
  font-weight: 500;
}

.radar-mini-ring__bar {
  height: 4px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.radar-mini-ring__bar i {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, #b68d4e), color-mix(in srgb, var(--accent, #f0d39d) 65%, #fff));
}

.radar-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 19px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.radar-note .icon {
  width: 12px;
  height: 12px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.radar-list {
  display: grid;
  gap: 13px;
}

.radar-card {
  --accent: #67d8c4;
  display: grid;
  grid-template-columns: 92px minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(172, 194, 225, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 4%, transparent), transparent 25%),
    rgba(14, 23, 41, 0.62);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.radar-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.radar-card__index {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border-right: 1px solid rgba(172, 194, 225, 0.1);
}

.radar-card__index b {
  color: var(--accent);
  font-family: var(--math);
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.8;
}

.radar-card__index span {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.18em;
}

.radar-card__main h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.radar-card__main h3 .chip {
  min-height: 20px;
  padding: 1px 6px;
  font-size: 8px;
}

.radar-card__book {
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.radar-card__pattern {
  margin-top: 7px;
  color: var(--text-soft);
  font-size: 11px;
}

.radar-card__observation {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.72;
}

.radar-card__side {
  display: grid;
  gap: 10px;
}

.heat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.heat-row .stars .icon {
  width: 11px;
  height: 11px;
}

.radar-card__side .bar {
  height: 5px;
}

.radar-mastery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 8.5px;
}

.radar-mastery b {
  color: var(--text-soft);
  font-family: var(--math);
  font-size: 10px;
  font-weight: 500;
}

.radar-card__action {
  margin-top: 3px;
}

.radar-card__action .btn {
  width: 100%;
  min-height: 31px;
  padding: 5px 10px;
  font-size: 9.5px;
}

.formula-section {
  margin-top: 34px;
}

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

.formula-group {
  --accent: #67d8c4;
  overflow: hidden;
  border: 1px solid rgba(172, 194, 225, 0.11);
  border-radius: 14px;
  background: rgba(14, 23, 41, 0.55);
}

.formula-group summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.formula-group summary::-webkit-details-marker {
  display: none;
}

.formula-group summary::after {
  content: "+";
  margin-left: auto;
  color: var(--faint);
  font-family: var(--math);
  font-size: 19px;
  font-weight: 300;
  transition: transform 0.25s;
}

.formula-group[open] summary::after {
  transform: rotate(45deg);
}

.formula-group summary .chip {
  min-height: 21px;
  padding: 1px 7px;
  font-size: 8px;
}

.formula-group__title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.formula-group__body {
  display: grid;
  gap: 10px;
  padding: 0 17px 17px;
}

.formula-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid rgba(172, 194, 225, 0.08);
}

.formula-line__name {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.formula-line__math {
  color: var(--text-soft);
  font-family: var(--math);
  font-size: 13px;
  text-align: right;
}

.radar-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 25px;
  padding: 13px 15px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 10px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.015);
  font-size: 9.5px;
  line-height: 1.8;
}

.radar-disclaimer .icon {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  flex: 0 0 auto;
}

/* =========================================================
   CHARACTER / SHOP
   ========================================================= */

.character-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: start;
}

.character-card {
  position: relative;
  overflow: hidden;
  padding: 27px;
  border: 1px solid rgba(226, 189, 123, 0.14);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 50% 10%, rgba(226, 189, 123, 0.1), transparent 55%),
    linear-gradient(150deg, rgba(20, 34, 58, 0.92), rgba(9, 16, 29, 0.92));
  box-shadow: var(--shadow-soft);
}

.character-card::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 50%;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(226, 189, 123, 0.08);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 30px rgba(226, 189, 123, 0.012), 0 0 0 64px rgba(226, 189, 123, 0.008);
  pointer-events: none;
}

.character-card__portrait {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.character-card__halo {
  position: absolute;
  top: 48px;
  width: 215px;
  height: 215px;
  border: 1px dashed rgba(226, 189, 123, 0.19);
  border-radius: 50%;
  animation: spin 55s linear infinite;
}

.character-card__avatar {
  position: relative;
  margin-top: 15px;
  padding: 7px;
  border: 1px solid rgba(226, 189, 123, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 189, 123, 0.08), transparent);
  box-shadow: 0 0 50px rgba(226, 189, 123, 0.08);
}

.character-card__name {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.character-card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 2px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.character-card__title::before,
.character-card__title::after {
  content: "";
  width: 18px;
  height: 1px;
  background: rgba(226, 189, 123, 0.35);
}

.character-card__level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 5px 13px;
  border: 1px solid rgba(226, 189, 123, 0.19);
  border-radius: 99px;
  color: var(--muted);
  background: rgba(226, 189, 123, 0.04);
  font-size: 9.5px;
}

.character-card__level b {
  color: var(--text);
  font-family: var(--math);
  font-size: 16px;
  font-weight: 500;
}

.character-card__xp {
  width: 100%;
  margin-top: 20px;
}

.character-card__xp .bar {
  height: 6px;
}

.character-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 20px;
}

.character-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}

.character-stat__icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  color: var(--accent, var(--jade));
  background: color-mix(in srgb, var(--accent, var(--jade)) 8%, transparent);
}

.character-stat__icon .icon {
  width: 14px;
  height: 14px;
}

.character-stat__text span {
  display: block;
  color: var(--faint);
  font-size: 8.5px;
}

.character-stat__text b {
  color: var(--text);
  font-family: var(--math);
  font-size: 15px;
  font-weight: 500;
}

.rank-path {
  width: 100%;
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
  text-align: left;
}

.rank-path__label {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.rank-path__track {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 12px;
}

.rank-dot {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.rank-dot::before {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(172, 194, 225, 0.12);
}

.rank-dot:first-child::before { display: none; }

.rank-dot i {
  display: block;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(172, 194, 225, 0.25);
  border-radius: 50%;
  background: #111d31;
}

.rank-dot.is-done i {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 8px rgba(226, 189, 123, 0.5);
}

.rank-dot.is-current i {
  width: 10px;
  height: 10px;
  border-color: var(--gold);
  background: transparent;
  box-shadow: 0 0 0 4px rgba(226, 189, 123, 0.1);
}

.rank-dot:last-child::after {
  content: "";
  flex: 1;
  height: 1px;
  background: transparent;
}

.skill-panel,
.shop-panel,
.account-panel {
  padding: 23px;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.panel-head h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.panel-head p {
  color: var(--faint);
  font-size: 9.5px;
  text-align: right;
}

.skill-points {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(226, 189, 123, 0.19);
  border-radius: 99px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.055);
  font-size: 9.5px;
  white-space: nowrap;
}

.skill-points b {
  font-family: var(--math);
  font-size: 14px;
  font-weight: 500;
}

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

.skill-card {
  --accent: #67d8c4;
  position: relative;
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(172, 194, 225, 0.11);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 7%, transparent), transparent 50%),
    rgba(255, 255, 255, 0.018);
}

.skill-card__top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.skill-card__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-family: var(--serif);
  font-size: 14px;
}

.skill-card__name {
  color: var(--text);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.skill-card__rank {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--math);
  font-size: 9px;
}

.skill-card__desc {
  min-height: 38px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.65;
}

.skill-card__pips {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}

.skill-pip {
  height: 3px;
  flex: 1;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.skill-pip.is-on {
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent);
}

.skill-card__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
}

.skill-cost {
  color: var(--faint);
  font-size: 8.5px;
}

.skill-cost b {
  color: var(--gold);
  font-family: var(--math);
  font-size: 11px;
  font-weight: 500;
}

.skill-card__action .btn {
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 8.5px;
}

.character-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.shop-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.017);
}

.shop-item__icon {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(226, 189, 123, 0.16);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.055);
  font-family: var(--serif);
  font-size: 13px;
}

.shop-item__name {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.shop-item__name span {
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--math);
  font-size: 9px;
  font-weight: 400;
}

.shop-item__desc {
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.shop-item__buy {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 600;
}

.shop-item__buy:hover {
  color: #f5dbab;
}

.shop-item__buy:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.shop-item__buy .icon {
  width: 10px;
  height: 10px;
}

.shop-note {
  margin-top: 10px;
  color: var(--faint);
  font-size: 8.5px;
}

.stats-history {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 3px;
}

.history-stat {
  padding: 9px;
  border: 1px solid rgba(172, 194, 225, 0.08);
  border-radius: 9px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
}

.history-stat b {
  display: block;
  color: var(--text-soft);
  font-family: var(--math);
  font-size: 16px;
  font-weight: 500;
}

.history-stat span {
  color: var(--faint);
  font-size: 7.5px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-note-box {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.02);
  font-size: 8.5px;
  line-height: 1.7;
}

.character-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 18px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 12px;
  color: var(--faint);
  background: rgba(14, 23, 41, 0.48);
  font-size: 9.5px;
}

.character-footer .btn {
  min-height: 31px;
  font-size: 9.5px;
}

/* ---------- linked courses ---------- */

.study-panel {
  margin-top: 20px;
  padding: 23px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

.study-head-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.study-head-links .btn {
  min-height: 31px;
  padding: 5px 10px;
  color: var(--text-soft);
  font-size: 9.5px;
  text-decoration: none;
}

.study-head-links .btn:hover {
  color: var(--gold);
}

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

.study-card {
  --accent: #67d8c4;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, rgba(172, 194, 225, 0.1));
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 7%, transparent), transparent 48%),
    rgba(255, 255, 255, 0.017);
}

.study-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.7;
}

.study-card__chapter {
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.study-card__focus {
  color: var(--text);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.study-card__note {
  min-height: 44px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

.study-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 5px;
}

.study-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(172, 194, 225, 0.13);
  border-radius: 6px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9.5px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.study-link:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.study-link--primary {
  border-color: color-mix(in srgb, var(--accent) 27%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.study-link span {
  font-size: 9px;
  opacity: 0.7;
}

.study-note {
  margin-top: 13px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.explain-resources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
}

.explain-resources > span {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.study-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid rgba(226, 189, 123, 0.18);
  border-radius: 5px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.04);
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
}

.study-inline-link:hover {
  border-color: rgba(226, 189, 123, 0.4);
  color: #f4ddb2;
  background: rgba(226, 189, 123, 0.09);
}

.study-inline-link span {
  opacity: 0.65;
}

/* =========================================================
   CODEX / ACHIEVEMENTS
   ========================================================= */

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(7, 13, 24, 0.55);
}

.segmented button {
  min-height: 30px;
  padding: 4px 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: 0.2s;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  color: #10131b;
  background: var(--gold);
}

.codex-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  margin-bottom: 17px;
  border: 1px solid rgba(255, 144, 120, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(255, 144, 120, 0.055), transparent 45%),
    rgba(15, 24, 43, 0.62);
}

.codex-summary__num {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 144, 120, 0.22);
  border-radius: 50%;
  color: var(--coral);
  font-family: var(--math);
  font-size: 21px;
  background: rgba(255, 144, 120, 0.05);
}

.codex-summary__text {
  flex: 1;
}

.codex-summary__text b {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.codex-summary__text span {
  color: var(--muted);
  font-size: 10px;
}

.wrong-list {
  display: grid;
  gap: 11px;
}

.wrong-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 13px;
  background: rgba(14, 23, 41, 0.55);
  transition: border-color 0.25s;
}

.wrong-card:hover {
  border-color: rgba(172, 194, 225, 0.2);
}

.wrong-card__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.wrong-card__world {
  color: var(--accent, var(--gold));
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.wrong-card__text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wrong-card__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wrong-card__actions .btn {
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 8.5px;
}

.wrong-card__remove {
  color: var(--faint);
  font-size: 8.5px;
  transition: color 0.2s;
}

.wrong-card__remove:hover {
  color: var(--coral);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 60px 20px;
  border: 1px dashed rgba(172, 194, 225, 0.13);
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.012);
}

.empty-state__sigil {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(103, 216, 196, 0.2);
  border-radius: 50%;
  color: var(--jade);
  background: rgba(103, 216, 196, 0.04);
  font-family: var(--serif);
  font-size: 23px;
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.empty-state p {
  max-width: 360px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
}

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

.knowledge-card {
  --accent: #67d8c4;
  padding: 18px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 7%, transparent), transparent 45%),
    rgba(14, 23, 41, 0.55);
}

.knowledge-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.knowledge-card h3::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.knowledge-tags .chip {
  min-height: 22px;
  padding: 1px 7px;
  font-size: 8px;
}

.knowledge-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.7;
}

.knowledge-card__formula {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(172, 194, 225, 0.08);
  color: var(--accent);
  font-family: var(--math);
  font-size: 12px;
}

.achievement-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(226, 189, 123, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(226, 189, 123, 0.09), transparent 55%),
    rgba(15, 24, 43, 0.65);
}

.achievement-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--progress), rgba(255, 255, 255, 0.07) 0);
}

.achievement-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0e1728;
}

.achievement-ring__inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.achievement-ring__inner b {
  display: block;
  color: var(--gold);
  font-family: var(--math);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
}

.achievement-ring__inner span {
  color: var(--faint);
  font-size: 8px;
}

.achievement-summary__text h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.achievement-summary__text p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.achievement-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 13px;
  background: rgba(14, 23, 41, 0.52);
  transition: 0.25s;
}

.achievement-card:hover {
  border-color: rgba(226, 189, 123, 0.22);
}

.achievement-card.is-locked {
  opacity: 0.62;
}

.achievement-card__seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226, 189, 123, 0.18);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.05);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.achievement-card.is-locked .achievement-card__seal {
  border-color: rgba(172, 194, 225, 0.12);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.02);
}

.achievement-card__body {
  min-width: 0;
}

.achievement-card__body b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
}

.achievement-card__body p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.achievement-card__reward {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  color: var(--gold);
  font-size: 8px;
}

.achievement-card__reward .icon {
  width: 9px;
  height: 9px;
}

.achievement-card__date {
  margin-top: 6px;
  color: var(--faint);
  font-family: var(--math);
  font-size: 8px;
}

.achievement-card__unlocked {
  position: absolute;
  top: 8px;
  right: -22px;
  width: 80px;
  padding: 2px 0;
  color: #1a1409;
  background: var(--gold);
  font-size: 7px;
  font-weight: 800;
  text-align: center;
  transform: rotate(38deg);
}

/* =========================================================
   MODALS / TOASTS
   ========================================================= */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 7, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-root.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(86vh, 850px);
  overflow: auto;
  border: 1px solid rgba(183, 205, 235, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 30%),
    #0f192b;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.55), inset 0 1px rgba(255, 255, 255, 0.05);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.35s var(--ease);
}

.modal-root.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal--wide {
  width: min(900px, 100%);
}

.modal--small {
  width: min(430px, 100%);
}

.modal__head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 25px 16px;
  border-bottom: 1px solid rgba(172, 194, 225, 0.09);
  background: rgba(15, 25, 43, 0.94);
  backdrop-filter: blur(18px);
}

.modal__head h2 {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.modal__head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.modal__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition: 0.2s;
}

.modal__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.modal__body {
  padding: 22px 25px 25px;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 25px 20px;
  border-top: 1px solid rgba(172, 194, 225, 0.09);
}

.modal__foot--between {
  justify-content: space-between;
}

.modal-close-btn {
  display: inline-flex;
}

/* world modal */

.world-modal__hero {
  --accent: #67d8c4;
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  padding: 24px 25px;
  border-bottom: 1px solid rgba(172, 194, 225, 0.09);
  background:
    radial-gradient(ellipse at 100% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    linear-gradient(120deg, rgba(18, 31, 52, 0.95), rgba(10, 18, 31, 0.95));
}

.world-modal__hero-copy {
  flex: 1;
  min-width: 0;
}

.world-modal__chapter {
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.world-modal__hero h2 {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.world-modal__hero p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.world-modal__glyph {
  width: 100px;
  height: 100px;
  color: var(--accent);
  opacity: 0.7;
}

.world-intel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
  padding: 20px 25px 0;
}

.intel-box {
  padding: 14px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.intel-box__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.intel-box__label .icon {
  width: 11px;
  height: 11px;
}

.intel-box p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.7;
}

.intel-box .chip {
  margin: 9px 4px 0 0;
}

.stage-list {
  display: grid;
  gap: 8px;
  padding: 18px 25px 23px;
}

.stage-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
  transition: 0.22s;
}

.stage-row:hover {
  border-color: rgba(172, 194, 225, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.stage-row.is-locked {
  opacity: 0.48;
}

.stage-row.is-locked:hover {
  border-color: rgba(172, 194, 225, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.stage-row__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(172, 194, 225, 0.12);
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--math);
  font-size: 11px;
  background: rgba(8, 14, 25, 0.4);
}

.stage-row.is-boss .stage-row__num {
  border-color: rgba(226, 189, 123, 0.25);
  color: var(--gold);
  background: rgba(226, 189, 123, 0.05);
}

.stage-row__title {
  min-width: 0;
}

.stage-row__title b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
}

.stage-row__title span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8.5px;
}

.stage-row__stars {
  min-width: 49px;
  text-align: right;
}

.stage-row__stars .icon {
  width: 11px;
  height: 11px;
}

.stage-row .btn {
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 8.5px;
}

/* settings / confirm */

.settings-section {
  display: grid;
  gap: 11px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(172, 194, 225, 0.08);
}

.settings-section:first-of-type {
  padding-top: 0;
}

.settings-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.settings-row__text b {
  display: block;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 600;
}

.settings-row__text span {
  color: var(--faint);
  font-size: 8.5px;
}

.switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 41px;
  height: 23px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  transition: 0.25s;
}

.switch::after {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.25s var(--ease), background 0.25s;
}

.switch.is-on {
  border-color: rgba(103, 216, 196, 0.3);
  background: rgba(103, 216, 196, 0.14);
}

.switch.is-on::after {
  background: var(--jade);
  transform: translateX(18px);
}

.save-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.danger-zone {
  padding: 12px;
  border: 1px dashed rgba(255, 111, 125, 0.23);
  border-radius: 10px;
  background: rgba(255, 111, 125, 0.035);
}

.danger-zone h4 {
  color: #ffb5bc;
  font-size: 10px;
}

.danger-zone p {
  margin-top: 3px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.danger-zone .btn {
  margin-top: 8px;
}

.confirm-copy {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.85;
}

.confirm-copy strong {
  color: var(--gold);
  font-weight: 600;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.import-file {
  display: none;
}

/* review modal */

.review-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}

.review-question {
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
}

.review-answer {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(103, 216, 196, 0.18);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(103, 216, 196, 0.045);
  font-size: 11px;
  line-height: 1.8;
}

.review-answer b {
  color: var(--jade);
  font-weight: 600;
}

.review-explain {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.95;
}

.review-explain .hl,
.review-answer .hl {
  color: var(--gold);
}

.review-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold);
  color: var(--muted);
  background: rgba(226, 189, 123, 0.035);
  font-size: 10px;
  line-height: 1.75;
}

/* toast */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(350px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid rgba(183, 205, 235, 0.17);
  border-radius: 11px;
  color: var(--text-soft);
  background: rgba(14, 24, 42, 0.96);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  font-size: 10.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  animation: toast-in 0.35s var(--ease) forwards;
  backdrop-filter: blur(16px);
}

.toast.is-out {
  animation: toast-out 0.3s var(--ease) forwards;
}

.toast__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.08);
  font-size: 11px;
}

.toast--success {
  border-color: rgba(103, 216, 196, 0.26);
}

.toast--success .toast__icon {
  color: var(--jade);
  background: rgba(103, 216, 196, 0.08);
}

.toast--danger {
  border-color: rgba(255, 111, 125, 0.28);
}

.toast--danger .toast__icon {
  color: var(--danger);
  background: rgba(255, 111, 125, 0.08);
}

.toast__text b {
  color: var(--text);
  font-weight: 600;
}

.toast--achievement {
  border-color: rgba(226, 189, 123, 0.3);
  background:
    linear-gradient(110deg, rgba(226, 189, 123, 0.08), transparent 55%),
    rgba(14, 24, 42, 0.98);
}

/* =========================================================
   BATTLE
   ========================================================= */

.battle-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(ellipse 70% 55% at 50% -10%, rgba(47, 102, 111, 0.2), transparent 60%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(91, 71, 145, 0.14), transparent 60%),
    #070c16;
  animation: battle-in 0.5s var(--ease) both;
}

.battle-layer.is-hidden {
  display: none !important;
}

.battle-screen {
  position: relative;
  min-height: 100vh;
  padding: 18px clamp(16px, 3vw, 42px) 30px;
}

.battle-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(141, 169, 204, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 169, 204, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000, transparent 80%);
}

.battle-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(1290px, 100%);
  min-height: 49px;
  margin: 0 auto 16px;
}

.battle-bar__exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9.5px;
  transition: 0.2s;
}

.battle-bar__exit:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.battle-bar__exit .icon {
  width: 13px;
  height: 13px;
}

.battle-bar__title {
  min-width: 0;
}

.battle-bar__title b {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-bar__title span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.battle-bar__progress {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  color: var(--faint);
  font-family: var(--math);
  font-size: 10px;
}

.battle-bar__progress .dots {
  display: flex;
  gap: 4px;
}

.battle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.battle-dot.is-done { background: var(--jade); }
.battle-dot.is-current { background: var(--gold); box-shadow: 0 0 7px rgba(226, 189, 123, 0.6); }

.battle-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 17px;
  align-items: stretch;
  width: min(1290px, 100%);
  margin: 0 auto;
}

.arena-panel {
  --enemy-color: #67d8c4;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 620px;
  border: 1px solid color-mix(in srgb, var(--enemy-color) 19%, transparent);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 33%, color-mix(in srgb, var(--enemy-color) 12%, transparent), transparent 66%),
    linear-gradient(170deg, rgba(18, 31, 52, 0.95), rgba(7, 13, 24, 0.96));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.045);
  isolation: isolate;
}

.arena-panel::before {
  content: "";
  position: absolute;
  top: 13%;
  left: 50%;
  width: 340px;
  height: 340px;
  border: 1px solid color-mix(in srgb, var(--enemy-color) 12%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 30px color-mix(in srgb, var(--enemy-color) 2.5%, transparent),
    0 0 0 64px color-mix(in srgb, var(--enemy-color) 1.6%, transparent);
  transform: translateX(-50%);
  pointer-events: none;
}

.arena-panel::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 50%;
  width: 250px;
  height: 250px;
  border: 1px dashed color-mix(in srgb, var(--enemy-color) 14%, transparent);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: spin 70s linear infinite;
  pointer-events: none;
}

.enemy-head {
  position: relative;
  z-index: 2;
  padding: 19px 20px 0;
}

.enemy-head__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.enemy-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--enemy-color);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.enemy-title::before {
  content: "";
  width: 13px;
  height: 1px;
  background: currentColor;
}

.enemy-name {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.enemy-level {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--enemy-color) 25%, transparent);
  border-radius: 5px;
  color: var(--enemy-color);
  font-family: var(--math);
  font-size: 9px;
  background: color-mix(in srgb, var(--enemy-color) 5%, transparent);
}

.enemy-hp {
  margin-top: 13px;
}

.enemy-hp__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.enemy-hp__row b {
  color: var(--enemy-color);
  font-family: var(--math);
  font-size: 10px;
  font-weight: 500;
}

.enemy-hp .bar {
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.enemy-hp .bar__fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--enemy-color) 50%, #111), var(--enemy-color));
  box-shadow: 0 0 16px color-mix(in srgb, var(--enemy-color) 28%, transparent);
}

.enemy-hp__under {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 7.5px;
}

.enemy-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 280px;
  padding: 4px 10px 0;
}

.enemy-art {
  position: relative;
  width: min(330px, 86%);
  color: var(--enemy-color);
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.35));
  animation: enemy-float 5s ease-in-out infinite;
}

.enemy-art svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.enemy-art.is-hit {
  animation: enemy-hit 0.5s var(--ease);
}

.enemy-art.is-defeated {
  animation: enemy-defeat 1.1s var(--ease) forwards;
}

.enemy-art .art-fill {
  fill: currentColor;
  fill-opacity: 0.07;
}

.enemy-art .art-fill-2 {
  fill: currentColor;
  fill-opacity: 0.14;
}

.enemy-art .art-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-opacity: 0.62;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.enemy-art .art-stroke-strong {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-opacity: 0.92;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.enemy-art .art-eye {
  fill: #ffe6a8;
  filter: drop-shadow(0 0 8px rgba(255, 221, 145, 0.9));
  animation: eye-blink 5.5s infinite;
}

.enemy-art .art-rune {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-opacity: 0.25;
  stroke-dasharray: 2 7;
}

.enemy-art .art-orbit {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-opacity: 0.28;
  stroke-dasharray: 2 6;
  transform-origin: center;
  animation: spin 32s linear infinite;
}

.enemy-art .art-orbit-2 {
  animation-direction: reverse;
  animation-duration: 22s;
}

.enemy-art .art-glow {
  fill: currentColor;
  opacity: 0.1;
  filter: blur(12px);
}

.enemy-art--complex .art-eye { fill: #f4eaff; }
.enemy-art--solid .art-eye { fill: #ffe3a0; }
.enemy-art--stats .art-eye { fill: #c5ffe9; }
.enemy-art--probability .art-eye { fill: #ffe0d1; }
.enemy-art--final .art-eye { fill: #ffe9b5; }

.enemy-crown {
  fill: none;
  stroke: #e2bd7b;
  stroke-width: 1.4;
  stroke-opacity: 0.85;
}

.boss-mark {
  position: absolute;
  top: 9%;
  left: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 8px;
  letter-spacing: 0.3em;
  transform: translateX(-50%);
  opacity: 0.6;
}

.arena-floor {
  position: absolute;
  bottom: 89px;
  left: 50%;
  z-index: 0;
  width: 62%;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--enemy-color) 18%, transparent), transparent 68%);
  filter: blur(7px);
  transform: translateX(-50%);
}

.enemy-taunt {
  position: relative;
  z-index: 2;
  margin: 0 20px 12px;
  padding: 8px 11px;
  border-left: 2px solid color-mix(in srgb, var(--enemy-color) 45%, transparent);
  color: var(--muted);
  background: color-mix(in srgb, var(--enemy-color) 3%, transparent);
  font-family: var(--serif);
  font-size: 9.5px;
  line-height: 1.65;
}

.enemy-taunt b {
  color: var(--enemy-color);
  font-weight: 500;
}

.player-strip {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding: 13px 18px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
  background: rgba(6, 12, 22, 0.55);
}

.player-strip.is-hit {
  animation: player-hit 0.45s ease;
}

.player-strip__avatar {
  position: relative;
  flex: 0 0 auto;
}

.player-strip__avatar .avatar {
  width: 43px;
  height: 43px;
}

.player-shield {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--jade);
  border-radius: 50%;
  box-shadow: 0 0 13px rgba(103, 216, 196, 0.45);
  animation: pulse 2s infinite;
}

.player-strip__info {
  flex: 1;
  min-width: 0;
}

.player-strip__top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.player-strip__name {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-strip__lv {
  color: var(--faint);
  font-family: var(--math);
  font-size: 8px;
}

.player-strip__hp {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.player-strip__hp .bar {
  flex: 1;
  height: 5px;
}

.player-strip__hp .bar__fill {
  background: linear-gradient(90deg, #2d9688, #72e1cd);
}

.player-strip__hp span {
  flex: 0 0 auto;
  color: var(--jade);
  font-family: var(--math);
  font-size: 8px;
}

.player-strip__combo {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 47px;
  padding-left: 10px;
  border-left: 1px solid rgba(172, 194, 225, 0.1);
}

.player-strip__combo b {
  color: var(--gold);
  font-family: var(--math);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.1;
}

.player-strip__combo span {
  color: var(--faint);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.combo-flare {
  color: var(--coral) !important;
  text-shadow: 0 0 12px rgba(255, 144, 120, 0.65);
}

/* question panel */

.quiz-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 620px;
  padding: clamp(23px, 3vw, 37px);
  border: 1px solid rgba(183, 205, 235, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 30%),
    rgba(14, 24, 42, 0.88);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
}

.quiz-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 21px;
}

.quiz-index {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: var(--faint);
  font-family: var(--math);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.quiz-index b {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.quiz-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 1px 8px;
  border: 1px solid rgba(172, 194, 225, 0.14);
  border-radius: 5px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.quiz-type--choice { border-color: rgba(103, 216, 196, 0.25); color: var(--jade); }
.quiz-type--fill { border-color: rgba(255, 144, 120, 0.28); color: var(--coral); }
.quiz-type--proof { border-color: rgba(226, 189, 123, 0.3); color: var(--gold); }

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.difficulty i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.difficulty i.is-on {
  background: var(--gold);
}

.quiz-exam {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.quiz-stem {
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(17px, 1.55vw, 20px);
  line-height: 2;
  letter-spacing: 0.02em;
}

.quiz-stem p + p {
  margin-top: 9px;
}

.quiz-stem .math {
  font-size: 1.06em;
}

.quiz-stem strong {
  color: var(--gold);
  font-weight: 600;
}

.question-goal {
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(226, 189, 123, 0.2);
  border-left: 2px solid var(--gold);
  border-radius: 0 9px 9px 0;
  color: var(--text-soft);
  background: rgba(226, 189, 123, 0.045);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.8;
}

.question-goal b {
  color: var(--gold);
  font-weight: 600;
}

.proof-chain {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.proof-chain__item {
  display: grid;
  grid-template-columns: 19px 1fr;
  gap: 9px;
  align-items: start;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
  background: rgba(103, 216, 196, 0.035);
  font-size: 10px;
  line-height: 1.7;
  animation: proof-in 0.35s var(--ease) both;
}

.proof-chain__item i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #071410;
  background: var(--jade);
  font-family: var(--math);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.proof-chain__item b {
  color: var(--text-soft);
  font-weight: 500;
}

.proof-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.proof-step-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 189, 123, 0.2), transparent);
}

.proof-prompt {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.8;
}

.answer-area {
  flex: 1;
  margin-top: 22px;
}

.options {
  display: grid;
  gap: 9px;
}

.option {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 53px;
  padding: 9px 13px;
  border: 1px solid rgba(172, 194, 225, 0.13);
  border-radius: 10px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: 0.2s var(--ease);
}

.option:hover:not(:disabled) {
  border-color: rgba(226, 189, 123, 0.3);
  background: rgba(226, 189, 123, 0.035);
  transform: translateX(3px);
}

.option.is-selected {
  border-color: rgba(226, 189, 123, 0.55);
  background: rgba(226, 189, 123, 0.075);
  box-shadow: inset 0 0 22px rgba(226, 189, 123, 0.025);
}

.option.is-correct {
  border-color: rgba(103, 216, 196, 0.55);
  background: rgba(103, 216, 196, 0.075);
  box-shadow: 0 0 0 1px rgba(103, 216, 196, 0.14);
}

.option.is-wrong {
  border-color: rgba(255, 111, 125, 0.3);
  background: rgba(255, 111, 125, 0.045);
  opacity: 0.62;
}

.option.is-eliminated {
  opacity: 0.23;
  text-decoration: line-through;
  filter: grayscale(1);
}

.option:disabled {
  cursor: default;
}

.option.is-correct:disabled,
.option.is-wrong:disabled {
  cursor: default;
}

.option__key {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(172, 194, 225, 0.15);
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--math);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: 0.2s;
}

.option.is-selected .option__key {
  border-color: var(--gold);
  color: #151109;
  background: var(--gold);
}

.option.is-correct .option__key {
  border-color: var(--jade);
  color: #06130f;
  background: var(--jade);
}

.option.is-wrong .option__key {
  border-color: var(--danger);
  color: var(--danger);
}

.option__text {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.65;
}

.option__mark {
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 12px;
}

.option.is-correct .option__mark { color: var(--jade); }
.option.is-wrong .option__mark { color: var(--danger); }

/* fill */

.fill-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(172, 194, 225, 0.17);
  border-radius: 12px;
  background: rgba(4, 9, 17, 0.58);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.fill-box:focus-within {
  border-color: rgba(226, 189, 123, 0.55);
  box-shadow: 0 0 0 4px rgba(226, 189, 123, 0.06);
}

.fill-box input {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 8px;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-family: var(--math);
  font-size: 22px;
  letter-spacing: 0.04em;
}

.fill-box input::placeholder {
  color: #4e5f78;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.fill-box .btn {
  flex: 0 0 auto;
  min-height: 39px;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 10.5px;
}

.math-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.math-key {
  min-width: 32px;
  height: 27px;
  padding: 0 8px;
  border: 1px solid rgba(172, 194, 225, 0.11);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--math);
  font-size: 11px;
  transition: 0.18s;
}

.math-key:hover {
  border-color: rgba(172, 194, 225, 0.25);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.fill-note {
  margin-top: 9px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

/* proof option wrap */

.proof-options .option {
  min-height: 48px;
}

/* feedback */

.answer-feedback {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.8;
  animation: feedback-in 0.3s var(--ease) both;
}

.answer-feedback--wrong {
  border: 1px solid rgba(255, 111, 125, 0.2);
  color: #ffb0b8;
  background: rgba(255, 111, 125, 0.055);
}

.answer-feedback--right {
  border: 1px solid rgba(103, 216, 196, 0.2);
  color: var(--jade);
  background: rgba(103, 216, 196, 0.045);
}

.answer-feedback b {
  font-weight: 700;
}

.answer-feedback .hint-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.explain-box {
  margin-top: 14px;
  padding: 14px 15px;
  border: 1px solid rgba(103, 216, 196, 0.17);
  border-radius: 10px;
  background:
    linear-gradient(100deg, rgba(103, 216, 196, 0.05), transparent 70%),
    rgba(255, 255, 255, 0.015);
  animation: feedback-in 0.4s var(--ease) both;
}

.explain-box__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--jade);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.explain-box__label::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  color: #061510;
  background: var(--jade);
  font-size: 8px;
}

.explain-box__answer {
  margin-top: 7px;
  color: var(--text);
  font-size: 12px;
}

.explain-box__answer b {
  color: var(--jade);
}

.explain-box__body {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.95;
}

.explain-box__body .hl {
  color: var(--gold);
}

.explain-box__body .math {
  color: var(--text-soft);
}

.method-tip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
  color: var(--gold);
  font-size: 9px;
  line-height: 1.7;
}

.method-tip .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  flex: 0 0 auto;
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(172, 194, 225, 0.1);
}

.quiz-footer__left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.quiz-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(172, 194, 225, 0.12);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 8.5px;
  font-weight: 600;
  transition: 0.2s;
}

.quiz-tool:hover:not(:disabled) {
  border-color: rgba(226, 189, 123, 0.28);
  color: var(--gold);
  background: rgba(226, 189, 123, 0.035);
}

.quiz-tool:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quiz-tool .icon {
  width: 12px;
  height: 12px;
}

.quiz-tool .tool-count {
  color: var(--gold);
  font-family: var(--math);
  font-size: 8.5px;
}

.quiz-footer__right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.quiz-footer__right .btn {
  min-height: 37px;
  padding: 7px 17px;
  border-radius: 9px;
  font-size: 10.5px;
}

.focus-meter {
  display: flex;
  align-items: center;
  gap: 7px;
}

.focus-meter__bar {
  width: 72px;
  height: 4px;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
}

.focus-meter__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a7542, var(--gold), #fff0c8);
  transition: width 0.5s var(--ease);
}

.focus-meter span {
  color: var(--faint);
  font-family: var(--math);
  font-size: 8px;
}

.ultimate-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid rgba(226, 189, 123, 0.22);
  border-radius: 7px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.055);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: 0.2s;
}

.ultimate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.ultimate-btn.is-ready {
  border-color: rgba(255, 226, 166, 0.7);
  color: #151006;
  background: linear-gradient(120deg, #f7e2b6, #dfb76f, #b88a47);
  box-shadow: 0 0 22px rgba(226, 189, 123, 0.26);
  animation: ready-pulse 2s infinite;
}

.ultimate-btn .icon {
  width: 12px;
  height: 12px;
}

.hint-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  padding: 9px 12px;
  border: 1px solid rgba(226, 189, 123, 0.18);
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(226, 189, 123, 0.045);
  font-size: 9.5px;
  line-height: 1.7;
  animation: feedback-in 0.3s var(--ease) both;
}

.hint-banner b {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0.08em;
}

/* damage numbers */

.damage-float {
  position: absolute;
  z-index: 8;
  top: 37%;
  left: 50%;
  pointer-events: none;
  color: var(--gold);
  font-family: var(--math);
  font-size: 30px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(226, 189, 123, 0.45);
  animation: damage-float 1s var(--ease) forwards;
  white-space: nowrap;
}

.damage-float--enemy { color: #ffe3a3; }
.damage-float--player { color: var(--danger); }
.damage-float--heal { color: var(--jade); }
.damage-float small {
  margin-left: 2px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.float-label {
  position: absolute;
  z-index: 9;
  top: 31%;
  left: 50%;
  pointer-events: none;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 18px rgba(226, 189, 123, 0.35);
  animation: damage-float 1.1s var(--ease) forwards;
  white-space: nowrap;
}

.particle {
  position: fixed;
  z-index: 250;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--gold);
  box-shadow: 0 0 8px currentColor;
  animation: particle-burst 0.8s var(--ease) forwards;
}

.fx-root {
  position: fixed;
  inset: 0;
  z-index: 250;
  overflow: hidden;
  pointer-events: none;
}

.arena-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 40%, rgba(255, 231, 180, 0.22), transparent 56%);
  opacity: 0;
}

.arena-flash.is-active {
  animation: arena-flash 0.5s ease-out;
}

/* battle result */

.battle-result {
  position: relative;
  z-index: 10;
  display: grid;
  place-items: center;
  width: min(620px, 100%);
  margin: 8vh auto 0;
  padding: 8px;
}

.result-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 34px;
  border: 1px solid rgba(226, 189, 123, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0, rgba(226, 189, 123, 0.13), transparent 65%),
    linear-gradient(155deg, rgba(25, 40, 65, 0.98), rgba(8, 15, 27, 0.98));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: result-in 0.7s var(--ease) both;
}

.result-card--fail {
  border-color: rgba(255, 111, 125, 0.28);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0, rgba(255, 111, 125, 0.08), transparent 65%),
    linear-gradient(155deg, rgba(31, 35, 55, 0.98), rgba(8, 13, 25, 0.98));
}

.result-card::before {
  content: "";
  position: absolute;
  top: -160px;
  left: 50%;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(226, 189, 123, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(226, 189, 123, 0.018);
  transform: translateX(-50%);
  pointer-events: none;
}

.result-kicker {
  position: relative;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.result-card--fail .result-kicker { color: #ff9aa5; }

.result-title {
  position: relative;
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 49px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.result-sub {
  position: relative;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 21px;
}

.result-stars .icon {
  width: 29px;
  height: 29px;
  color: rgba(255, 255, 255, 0.12);
}

.result-stars .icon.is-on {
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(226, 189, 123, 0.5));
  animation: star-pop 0.55s var(--ease) both;
}

.result-stars .icon:nth-child(2) { animation-delay: 0.1s; }
.result-stars .icon:nth-child(3) { animation-delay: 0.2s; }

.result-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 23px;
}

.result-stat {
  padding: 11px 6px;
  border: 1px solid rgba(172, 194, 225, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.result-stat b {
  display: block;
  color: var(--text);
  font-family: var(--math);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
}

.result-stat span {
  color: var(--faint);
  font-size: 7.5px;
  letter-spacing: 0.05em;
}

.result-rewards {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(226, 189, 123, 0.18);
  border-radius: 99px;
  color: var(--gold);
  background: rgba(226, 189, 123, 0.055);
  font-family: var(--math);
  font-size: 10px;
}

.reward-pill .icon {
  width: 12px;
  height: 12px;
}

.reward-pill--jade {
  border-color: rgba(103, 216, 196, 0.18);
  color: var(--jade);
  background: rgba(103, 216, 196, 0.045);
}

.result-unlock {
  position: relative;
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px dashed rgba(103, 216, 196, 0.25);
  border-radius: 9px;
  color: var(--jade);
  background: rgba(103, 216, 196, 0.04);
  font-size: 10.5px;
  line-height: 1.7;
}

.result-unlock b {
  color: var(--text);
}

.result-actions {
  position: relative;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 23px;
}

.result-actions .btn {
  min-height: 41px;
  padding: 9px 18px;
  font-size: 11px;
}

.result-note {
  position: relative;
  margin-top: 13px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.battle-result + .battle-bar,
.battle-result .battle-bar {
  display: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1240px) {
  .hub-layout {
    grid-template-columns: minmax(0, 1fr) 306px;
    gap: 20px;
  }

  .worlds-section {
    margin-top: 28px;
  }

  .main-nav {
    gap: 1px;
    margin-left: 0;
  }

  .nav-item {
    padding: 0 10px;
  }

  .nav-item .icon {
    display: none;
  }

  .battle-layout {
    grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1.32fr);
  }

  .arena-panel,
  .quiz-panel {
    min-height: 590px;
  }

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

@media (max-width: 1060px) {
  .onboarding-body {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 40px;
  }

  .onboarding-title {
    font-size: clamp(43px, 5.6vw, 70px);
  }

  .hub-layout {
    grid-template-columns: 1fr;
  }

  .hub-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .profile-panel {
    grid-row: span 2;
  }

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

  .character-layout {
    grid-template-columns: 1fr;
  }

  .character-side {
    grid-template-columns: 1fr 1fr;
  }

  .character-footer {
    grid-column: 1;
  }

  .radar-card {
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 0.78fr);
    gap: 17px;
  }

  .radar-overview {
    grid-template-columns: 1fr;
  }

  .radar-mini-ring {
    grid-template-columns: repeat(2, 1fr);
    padding: 16px 0 0;
    border-top: 1px solid rgba(172, 194, 225, 0.11);
    border-left: 0;
  }

  .battle-layout {
    grid-template-columns: 1fr;
    max-width: 850px;
  }

  .arena-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 235px;
    grid-template-rows: auto 1fr;
    min-height: 0;
  }

  .arena-panel::before,
  .arena-panel::after {
    left: 72%;
  }

  .enemy-head {
    grid-column: 1;
    grid-row: 1;
  }

  .enemy-visual {
    grid-column: 2;
    grid-row: 1 / 3;
    min-height: 205px;
    padding: 12px;
  }

  .enemy-art {
    width: 210px;
  }

  .enemy-taunt {
    grid-column: 1;
    grid-row: 2;
    margin-top: 7px;
  }

  .arena-floor {
    display: none;
  }

  .player-strip {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .quiz-panel {
    min-height: 0;
  }

  .enemy-head {
    padding-bottom: 4px;
  }
}

@media (max-width: 860px) {
  :root {
    --topbar-h: 64px;
  }

  body {
    padding-bottom: 72px;
  }

  .onboarding {
    padding: 22px 22px 20px;
  }

  .onboarding-nav {
    margin-bottom: 0;
  }

  .onboarding-body {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: auto;
    padding: 44px 0 30px;
  }

  .onboarding-copy {
    padding: 0;
  }

  .onboarding-title {
    max-width: 640px;
    font-size: clamp(43px, 9vw, 68px);
  }

  .onboarding-lead {
    margin-top: 18px;
  }

  .onboarding-art {
    top: 8%;
    right: -28%;
    width: 76vw;
    opacity: 0.42;
  }

  .onboarding-account {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .onboarding-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .topbar {
    gap: 13px;
    padding: 0 18px;
  }

  .topbar .brand__text span {
    display: none;
  }

  .main-nav {
    display: none;
  }

  .topbar__right {
    gap: 7px;
  }

  .profile-chip {
    padding-right: 5px;
  }

  .profile-chip__text {
    display: none;
  }

  .top-stat {
    height: 32px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .topbar__settings {
    display: none;
  }

  .app-main {
    padding: 24px 17px 28px;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 1px;
    height: 59px;
    padding: 5px;
    border: 1px solid rgba(183, 205, 235, 0.16);
    border-radius: 16px;
    background: rgba(8, 15, 27, 0.9);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  .mobile-nav .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    height: 100%;
    padding: 0;
    border-radius: 10px;
    font-size: 8px;
  }

  .mobile-nav .nav-item .icon {
    display: block;
    width: 17px;
    height: 17px;
  }

  .mobile-nav .nav-item.is-active::after {
    right: 22%;
    bottom: 4px;
    left: 22%;
  }

  .hub-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
  }

  .hub-head__right {
    padding: 0;
  }

  .hero-quest {
    min-height: 0;
    padding: 26px 22px;
  }

  .hero-quest__inner {
    align-items: flex-start;
  }

  .hero-quest__sigil {
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 170px;
    opacity: 0.4;
  }

  .hero-quest__desc {
    max-width: 88%;
  }

  .hero-quest__meta {
    gap: 12px;
  }

  .hero-quest__actions .btn {
    min-height: 43px;
    padding: 9px 16px;
    font-size: 11.5px;
  }

  .hub-side {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    grid-row: auto;
  }

  .world-grid {
    grid-template-columns: 1fr;
  }

  .world-card--final {
    grid-column: auto;
  }

  .world-card {
    min-height: 235px;
  }

  .exam-strip {
    grid-template-columns: 1fr;
  }

  .view-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .view-head__aside {
    padding: 0;
  }

  .radar-overview {
    padding: 23px 20px;
  }

  .radar-overview::after {
    font-size: 230px;
  }

  .radar-list {
    gap: 10px;
  }

  .radar-card {
    grid-template-columns: 52px 1fr;
    gap: 13px;
    padding: 16px;
  }

  .radar-card__index {
    border-right: 0;
    border-bottom: 1px solid rgba(172, 194, 225, 0.1);
    padding-bottom: 9px;
  }

  .radar-card__index b {
    font-size: 25px;
  }

  .radar-card__side {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding-top: 10px;
    border-top: 1px solid rgba(172, 194, 225, 0.08);
  }

  .radar-card__action {
    grid-column: 2;
    margin: 0;
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

  .character-card,
  .skill-panel,
  .shop-panel,
  .account-panel {
    padding: 20px;
  }

  .character-side {
    grid-template-columns: 1fr;
  }

  .study-panel {
    padding: 20px;
  }

  .study-panel .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .study-grid {
    grid-template-columns: 1fr;
  }

  .study-card__note {
    min-height: 0;
  }

  .study-head-links {
    width: 100%;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .achievement-summary {
    gap: 14px;
    padding: 17px;
  }

  .achievement-ring {
    width: 74px;
    height: 74px;
  }

  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .modal-root {
    padding: 12px;
    align-items: end;
  }

  .modal {
    max-height: 90vh;
    border-radius: 18px;
  }

  .daily-list {
    gap: 13px;
  }

  .daily-task .btn {
    min-height: 31px;
    padding: 4px 10px;
    font-size: 9.5px;
  }

  .segmented button {
    min-height: 34px;
    padding: 5px 15px;
    font-size: 10.5px;
  }

  .modal__head {
    padding: 18px 18px 13px;
  }

  .modal__close {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .modal__body {
    padding: 17px 18px 19px;
  }

  .modal__foot {
    padding: 13px 18px 17px;
  }

  .world-intel {
    grid-template-columns: 1fr;
    padding: 15px 18px 0;
  }

  .world-modal__hero {
    padding: 20px 18px;
  }

  .world-modal__hero h2 {
    font-size: 26px;
  }

  .world-modal__glyph {
    width: 76px;
    height: 76px;
  }

  .stage-list {
    padding: 14px 18px 18px;
  }

  .stage-row {
    grid-template-columns: 31px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .stage-row__num {
    width: 29px;
    height: 29px;
  }

  .stage-row__stars {
    display: none;
  }

  .stage-row .btn {
    min-width: 62px;
    min-height: 36px;
    padding: 5px 9px;
    font-size: 9.5px;
  }

  .wrong-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wrong-card__actions {
    flex-direction: row;
    align-items: center;
  }

  .wrong-card__actions .btn {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 9.5px;
  }

  .wrong-card__remove {
    font-size: 9.5px;
    padding: 8px 4px;
  }

  .codex-summary {
    align-items: flex-start;
  }

  .battle-screen {
    padding: 10px 11px 22px;
  }

  .battle-bar {
    gap: 9px;
    margin-bottom: 10px;
  }

  .battle-bar__title b {
    font-size: 11px;
  }

  .battle-bar__exit span {
    display: none;
  }

  .battle-bar__exit {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .battle-layout {
    gap: 10px;
  }

  .arena-panel {
    grid-template-columns: 1fr 150px;
    border-radius: 16px;
  }

  .enemy-head {
    padding: 14px 14px 0;
  }

  .enemy-name {
    font-size: 19px;
  }

  .enemy-hp {
    margin-top: 9px;
  }

  .enemy-art {
    width: 170px;
  }

  .enemy-visual {
    min-height: 155px;
    padding: 4px;
  }

  .enemy-taunt {
    margin: 5px 14px 8px;
    font-size: 8.5px;
    line-height: 1.55;
  }

  .player-strip {
    padding: 10px 14px;
  }

  .player-strip__avatar .avatar {
    width: 36px;
    height: 36px;
  }

  .quiz-panel {
    padding: 17px 15px;
    border-radius: 16px;
  }

  .quiz-head {
    margin-bottom: 14px;
  }

  .quiz-stem {
    font-size: 16px;
    line-height: 1.85;
  }

  .quiz-exam {
    display: none;
  }

  .answer-area {
    margin-top: 15px;
  }

  .math-keys {
    gap: 6px;
    margin-top: 11px;
  }

  .math-key {
    min-width: 37px;
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .fill-note {
    font-size: 9.5px;
  }

  .option {
    grid-template-columns: 27px minmax(0, 1fr) 14px;
    gap: 9px;
    min-height: 52px;
    padding: 9px 10px;
  }

  .option__key {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .option__text {
    font-size: 12.5px;
  }

  .quiz-footer {
    gap: 8px;
    margin-top: 13px;
    padding-top: 11px;
  }

  .quiz-footer__left {
    gap: 5px;
  }

  .quiz-tool {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 9px;
  }

  .quiz-tool .icon {
    width: 12px;
    height: 12px;
  }

  .quiz-footer__right .btn {
    min-height: 40px;
    padding: 7px 15px;
    font-size: 11px;
  }

  .ultimate-btn {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 8.5px;
  }

  .focus-meter__bar {
    width: 56px;
  }

  .battle-bar__exit {
    width: 38px;
    height: 38px;
  }

  .result-card {
    padding: 29px 18px;
  }

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

  .battle-result {
    margin-top: 4vh;
  }
}

@media (max-width: 480px) {
  .onboarding {
    padding: 18px 16px;
  }

  .onboarding-nav__meta {
    display: none;
  }

  .onboarding-title {
    font-size: clamp(40px, 11vw, 50px);
  }

  .onboarding-lead {
    font-size: 14px;
    line-height: 1.85;
  }

  .onboarding-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    margin-top: 25px;
  }

  .metric__num {
    font-size: 22px;
  }

  .onboarding-account {
    padding: 21px 17px;
    border-radius: 20px;
  }

  .account-head h2 {
    font-size: 22px;
  }

  .account-seal {
    width: 43px;
    height: 43px;
    font-size: 14px;
  }

  .avatar-picker {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .avatar-choice {
    padding: 10px 3px 8px;
    font-size: 9px;
  }

  .avatar-choice .avatar {
    width: 43px;
    height: 43px;
  }

  .onboarding-foot {
    font-size: 8.5px;
  }

  .top-stat--streak {
    display: none;
  }

  .topbar {
    padding: 0 13px;
  }

  .app-main {
    padding: 20px 13px 24px;
  }

  .hub-head h1 {
    font-size: 27px;
  }

  .hero-quest h2 {
    font-size: 30px;
  }

  .hero-quest__desc {
    max-width: 100%;
    font-size: 11px;
  }

  .hero-quest__actions {
    gap: 8px;
  }

  .hero-quest__actions .btn {
    flex: 1;
    min-width: 130px;
  }

  .hero-quest__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero-quest__sigil {
    width: 140px;
    right: -38px;
    bottom: -38px;
  }

  .world-card {
    padding: 18px;
  }

  .world-card__glyph {
    width: 82px;
    height: 82px;
  }

  .world-card h3 {
    font-size: 23px;
  }

  .world-card__desc {
    max-width: 90%;
  }

  .world-card__bottom {
    gap: 8px;
  }

  .world-card__nodes .node-pip {
    width: 18px;
    height: 18px;
  }

  .world-card__nodes .node-link {
    width: 8px;
  }

  .world-card__enter {
    font-size: 9.5px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .section-title p {
    text-align: left;
  }

  .character-card__name {
    font-size: 25px;
  }

  .skill-grid {
    grid-template-columns: 1fr;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .formula-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .formula-line__math {
    text-align: left;
  }

  .character-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .battle-bar__progress {
    font-size: 8.5px;
  }

  .enemy-name {
    font-size: 17px;
  }

  .enemy-title {
    font-size: 7px;
  }

  .arena-panel {
    grid-template-columns: 1fr 120px;
  }

  .enemy-art {
    width: 145px;
  }

  .enemy-visual {
    min-height: 135px;
  }

  .enemy-taunt {
    display: none;
  }

  .player-strip__combo {
    min-width: 38px;
    padding-left: 8px;
  }

  .quiz-panel {
    padding: 15px 13px;
  }

  .quiz-stem {
    font-size: 15.5px;
  }

  .option__text {
    font-size: 12px;
  }

  .fill-box input {
    font-size: 19px;
  }

  .quiz-footer__left {
    width: 100%;
  }

  .quiz-footer__right {
    width: 100%;
    justify-content: flex-end;
  }

  .focus-meter {
    margin-right: auto;
  }

  .toast-root {
    right: 12px;
    bottom: 82px;
    width: calc(100vw - 24px);
  }

  .modal-root {
    padding: 8px;
  }

  .modal__head h2 {
    font-size: 20px;
  }

  .world-modal__hero h2 {
    font-size: 23px;
  }

  .world-modal__glyph {
    width: 62px;
    height: 62px;
  }
}

/* =========================================================
   MOTION
   ========================================================= */

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.82); }
}

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

@keyframes toast-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(7px); }
}

@keyframes battle-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes enemy-float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-11px) rotate(0.4deg); }
}

@keyframes eye-blink {
  0%, 44%, 48%, 100% { opacity: 1; }
  46% { opacity: 0.15; }
}

@keyframes enemy-hit {
  0% { transform: translateX(0) scale(1); filter: brightness(1); }
  18% { transform: translateX(-12px) scale(0.97); filter: brightness(2); }
  38% { transform: translateX(10px) scale(1.01); filter: brightness(1.4); }
  58% { transform: translateX(-6px); filter: brightness(1.15); }
  100% { transform: translateX(0) scale(1); filter: brightness(1); }
}

@keyframes enemy-defeat {
  0% { opacity: 1; transform: scale(1); }
  30% { opacity: 0.8; transform: scale(1.06); filter: brightness(2.2); }
  100% { opacity: 0; transform: scale(0.7) translateY(28px); filter: brightness(0.2) blur(8px); }
}

@keyframes player-hit {
  0%, 100% { background: rgba(6, 12, 22, 0.55); }
  25% { background: rgba(130, 31, 46, 0.55); }
  60% { background: rgba(90, 24, 37, 0.26); }
}

@keyframes damage-float {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.8); }
  16% { opacity: 1; transform: translate(-50%, -4px) scale(1.08); }
  45% { opacity: 1; transform: translate(-50%, -30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -74px) scale(0.92); }
}

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

@keyframes proof-in {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes star-pop {
  0% { opacity: 0; transform: scale(0.4) rotate(-30deg); }
  70% { opacity: 1; transform: scale(1.15) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(226, 189, 123, 0.18); }
  50% { box-shadow: 0 0 28px rgba(226, 189, 123, 0.42); }
}

@keyframes particle-burst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

@keyframes arena-flash {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

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

.world-card,
.exam-tile,
.radar-card,
.skill-card,
.achievement-card {
  animation: reveal-up 0.6s var(--ease) both;
}

.world-card:nth-child(2) { animation-delay: 0.04s; }
.world-card:nth-child(3) { animation-delay: 0.08s; }
.world-card:nth-child(4) { animation-delay: 0.12s; }
.world-card:nth-child(5) { animation-delay: 0.16s; }
.world-card:nth-child(6) { animation-delay: 0.2s; }

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

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}
