:root {
  --void: #090807;
  --void-2: #11100e;
  --ink: #f6efe1;
  --muted: #a8a096;
  --line: rgba(246, 239, 225, 0.14);
  --line-strong: rgba(246, 239, 225, 0.28);
  --main: #f3c469;
  --turn: #3dd6b2;
  --turn-b: #6fa8ff;
  --restart: #d66aa4;
  --panel: rgba(21, 19, 16, 0.74);
  --panel-strong: rgba(31, 28, 23, 0.92);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --serif: "Times New Roman", "Noto Serif SC", serif;
  --sans: "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 20% 10%, rgba(243, 196, 105, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(61, 214, 178, 0.12), transparent 26%),
    radial-gradient(circle at 65% 80%, rgba(214, 106, 164, 0.14), transparent 30%),
    linear-gradient(135deg, #090807, #14110e 44%, #0b0b0c);
  overflow: hidden;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.stage-shell {
  width: min(1500px, calc(100% - 40px));
  height: 100vh;
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 10px;
  background: linear-gradient(180deg, rgba(9, 8, 7, 0.96), rgba(9, 8, 7, 0.72), transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-sigil {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line-strong);
  background: rgba(246, 239, 225, 0.06);
  color: var(--main);
  font-family: var(--serif);
  font-size: 28px;
  box-shadow: inset 0 0 28px rgba(243, 196, 105, 0.12);
}

.brand p,
.overline {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.nav-pills {
  display: flex;
  gap: 8px;
}

.nav-pills span {
  border: 1px solid var(--line);
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  background: rgba(246, 239, 225, 0.04);
}

.act {
  display: none;
}

.act.active {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  animation: sceneIn 650ms ease both;
}

.hero {
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: 20px;
  min-height: 0;
}

body.intro-mode .stage-shell {
  width: min(1000px, calc(100% - 32px));
  padding: 8px 0;
}

body.intro-mode .nav {
  padding: 4px 0 8px;
}

body.intro-mode .brand {
  gap: 10px;
}

body.intro-mode .brand-sigil {
  width: 38px;
  height: 38px;
  font-size: 23px;
}

body.intro-mode .brand p {
  margin-bottom: 3px;
  font-size: 8px;
  letter-spacing: 0.16em;
}

body.intro-mode .brand h1 {
  font-size: 16px;
}

body.intro-mode .nav-pills span {
  padding: 7px 10px;
  font-size: 12px;
}

body.intro-mode .hero {
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: 14px;
}

.hero-copy,
.stage-preview,
.setup-panel,
.path-stage,
.result-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: clamp(30px, 6vw, 76px);
}

body.intro-mode .hero-copy {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: center;
  justify-content: stretch;
  gap: 0;
  overflow: hidden;
  padding: clamp(20px, 3.2vw, 42px) clamp(24px, 3.4vw, 46px);
}

.hero-copy h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 7.2vw, 106px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0;
}

body.intro-mode .hero-copy h2 {
  max-width: none;
  font-size: clamp(38px, 2.9vw, 54px);
  line-height: 0.9;
  word-break: keep-all;
  overflow-wrap: normal;
}

.hero-title span {
  display: block;
  white-space: nowrap;
  width: max-content;
}

body.intro-mode .hero-title {
  display: grid;
  gap: 0.02em;
  width: max-content;
  max-width: 100%;
}

body.intro-mode .hero-title span:nth-child(1) {
  transform: translateX(0.05em);
}

body.intro-mode .hero-title span:nth-child(2) {
  transform: translateX(0.42em);
}

body.intro-mode .hero-title span:nth-child(3) {
  transform: translateX(1.02em);
}

body.intro-mode .hero-title span:nth-child(4) {
  transform: translateX(0.34em);
}

body.intro-mode .hero-title span:nth-child(5) {
  transform: translateX(0.08em);
}

.lede {
  max-width: 670px;
  margin: 28px 0 0;
  color: #cfc6b8;
  font-size: 18px;
  line-height: 1.85;
}

body.intro-mode .lede {
  max-width: 420px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.58;
}

.question-composer {
  max-width: 720px;
  margin-top: 32px;
}

body.intro-mode .question-composer {
  max-width: 390px;
  margin-top: 14px;
}

.composer-note {
  margin: 10px 0 0;
  color: #bfb5a7;
  font-size: 13px;
  line-height: 1.6;
}

body.intro-mode .composer-note {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.42;
}

.question-composer label,
.field-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 800;
}

body.intro-mode .question-composer label {
  margin-bottom: 6px;
  font-size: 11px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 18px;
  background: rgba(246, 239, 225, 0.08);
  color: var(--ink);
  line-height: 1.7;
  outline: none;
}

body.intro-mode textarea {
  min-height: 58px;
  padding: 9px 11px;
  font-size: 11px;
  line-height: 1.45;
}

textarea:focus {
  border-color: var(--turn);
  box-shadow: 0 0 0 4px rgba(61, 214, 178, 0.12);
}

select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 10px 12px;
  background: #151310;
  color: var(--ink);
  outline: none;
}

select option {
  background: #151310;
  color: var(--ink);
}

select:focus {
  border-color: var(--turn);
  box-shadow: 0 0 0 4px rgba(61, 214, 178, 0.12);
}

.template-row,
.stage-options,
.choice-grid,
.chip-grid,
.mini-options,
.history-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

body.intro-mode .template-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.template-row button,
.stage-options button,
.choice-grid button,
.chip-grid button,
.mini-options button,
.history-grid button,
.launch-btn,
.path-card,
.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(246, 239, 225, 0.055);
  color: var(--ink);
  transition: transform 180ms ease, border 180ms ease, background 180ms ease, color 180ms ease;
}

.template-row button,
.stage-options button,
.choice-grid button,
.chip-grid button,
.mini-options button,
.history-grid button {
  padding: 10px 12px;
  color: #d8d0c3;
}

body.intro-mode .template-row button {
  min-width: 0;
  min-height: 0;
  padding: 7px 8px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
}

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

.chip-grid button,
.history-grid button {
  text-align: left;
}

.chip-grid button span,
.history-grid button span {
  display: block;
  font-weight: 900;
}

.chip-grid button small,
.history-grid button small {
  display: block;
  margin-top: 6px;
  color: #a99f91;
  font-size: 11px;
  line-height: 1.45;
}

.chip-grid button.active small,
.history-grid button.active small {
  color: #d8cdbd;
}

.template-row button:hover,
.stage-options button:hover,
.choice-grid button:hover,
.chip-grid button:hover,
.mini-options button:hover,
.history-grid button:hover,
.template-row button.active,
.stage-options button.active,
.choice-grid button.active,
.chip-grid button.active,
.mini-options button.active,
.history-grid button.active {
  transform: translateY(-2px);
  border-color: var(--turn);
  background: rgba(61, 214, 178, 0.14);
  color: var(--ink);
}

.chip-grid button.active {
  border-color: var(--main);
  background: rgba(243, 196, 105, 0.15);
}

.profile-basics {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.field-group.compact {
  margin-top: 0;
}

.mini-options {
  gap: 8px;
}

.mini-options button {
  min-width: 58px;
  padding: 8px 10px;
  font-size: 12px;
}

.zodiac-options {
  max-height: 138px;
  overflow: auto;
  padding-right: 4px;
}

.questionnaire-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.075), rgba(246, 239, 225, 0.025)),
    rgba(246, 239, 225, 0.035);
  padding: 12px;
}

.questionnaire-progress {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-track {
  height: 5px;
  background: rgba(246, 239, 225, 0.1);
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: 14%;
  height: 100%;
  background: linear-gradient(90deg, var(--turn), var(--main));
  transition: width 220ms ease;
}

.profile-question {
  min-height: 0;
  max-height: 330px;
  overflow: auto;
  margin-top: 12px;
  animation: reveal 320ms ease both;
}

.profile-question h4 {
  margin: 0;
  font-size: 18px;
}

.question-note {
  margin: 8px 0 0;
  color: #c7beb0;
  font-size: 13px;
  line-height: 1.6;
}

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

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

.question-grid.mbti-grid {
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 7px;
}

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

.question-grid.zodiac-grid {
  max-height: 205px;
  overflow: auto;
  padding-right: 4px;
}

.multi-hint {
  margin-top: 12px;
  border: 1px solid rgba(243, 196, 105, 0.34);
  padding: 9px 10px;
  color: #f2dba6;
  background: rgba(243, 196, 105, 0.09);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.question-grid button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(246, 239, 225, 0.055);
  color: #d8d0c3;
  padding: 9px;
  text-align: left;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease;
}

.mbti-grid button {
  min-height: 42px;
  padding: 8px 6px;
  text-align: center;
}

.mbti-grid button span {
  font-size: 15px;
}

.mbti-grid button small {
  display: none;
}

.multi-grid button {
  position: relative;
  padding-right: 30px;
}

.multi-grid button.active::after {
  content: "✓";
  position: absolute;
  right: 9px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(243, 196, 105, 0.5);
  color: var(--main);
  font-size: 12px;
  font-weight: 900;
}

.question-grid button:hover,
.question-grid button.active {
  transform: translateY(-2px);
  border-color: var(--turn);
  background: rgba(61, 214, 178, 0.14);
  color: var(--ink);
}

.question-grid button span {
  display: block;
  font-weight: 900;
}

.question-grid button small {
  display: block;
  margin-top: 6px;
  color: #a99f91;
  font-size: 11px;
  line-height: 1.35;
}

.question-grid button.active small {
  color: #d8cdbd;
}

.questionnaire-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.ghost-btn {
  padding: 10px 13px;
}

.ghost-btn.primary {
  border-color: var(--turn);
  background: rgba(61, 214, 178, 0.14);
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.launch-btn {
  width: fit-content;
  margin-top: 28px;
  padding: 15px 22px;
  background: var(--ink);
  color: var(--void);
  font-weight: 900;
}

body.intro-mode .launch-btn {
  margin-top: 16px;
  padding: 12px 18px;
  font-size: 12px;
}

.launch-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(243, 196, 105, 0.2);
}

.stage-preview {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background:
    radial-gradient(circle at 26% 52%, rgba(246, 239, 225, 0.1), transparent 18%),
    linear-gradient(rgba(246, 239, 225, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(246, 239, 225, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    rgba(18, 15, 12, 0.72);
}

body.intro-mode .stage-preview {
  min-height: 0;
}

.preview-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(243, 196, 105, 0.18) 42% 42.5%, transparent 42.5%),
    linear-gradient(98deg, transparent 0 43%, rgba(61, 214, 178, 0.16) 43% 43.5%, transparent 43.5%),
    linear-gradient(82deg, transparent 0 44%, rgba(214, 106, 164, 0.16) 44% 44.5%, transparent 44.5%);
  opacity: 0.85;
  animation: previewGlow 5s ease-in-out infinite;
}

.node-card {
  position: absolute;
  left: 28%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: 260px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(246, 239, 225, 0.09);
  backdrop-filter: blur(10px);
}

body.intro-mode .node-card {
  left: 24%;
  top: 50%;
  width: 174px;
  padding: 16px;
}

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

body.intro-mode .node-card span {
  font-size: 10px;
}

.node-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
}

body.intro-mode .node-card strong {
  margin-top: 6px;
  font-size: 21px;
}

.node-card p {
  margin: 12px 0 0;
  color: #c9c0b2;
  font-size: 13px;
  line-height: 1.65;
}

body.intro-mode .node-card p {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.55;
}

.preview-lane {
  position: absolute;
  left: 54%;
  right: 6%;
  border-top: 2px solid currentColor;
  padding-top: 13px;
}

body.intro-mode .preview-lane {
  left: 54%;
  right: 6%;
  padding-top: 10px;
}

.preview-lane span {
  display: block;
  font-weight: 900;
}

body.intro-mode .preview-lane span {
  font-size: 12px;
}

.preview-lane p {
  max-width: 320px;
  margin: 7px 0 0;
  color: #c9c0b2;
  font-size: 13px;
  line-height: 1.55;
}

body.intro-mode .preview-lane p {
  max-width: 260px;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.45;
}

.preview-main {
  top: 25%;
  color: var(--main);
}

.preview-turn {
  top: 49%;
  color: var(--turn);
}

.preview-restart {
  top: 73%;
  color: var(--restart);
}

.simulator {
  grid-template-columns: minmax(320px, 0.78fr) minmax(560px, 1.34fr) minmax(340px, 0.84fr);
  gap: 18px;
  height: auto;
  min-height: 0;
}

.setup-panel,
.path-stage,
.result-panel {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.path-stage {
  display: grid;
  grid-template-rows: auto auto auto minmax(130px, 1fr) auto 78px;
  gap: 8px;
  overflow: hidden;
}

.setup-panel::-webkit-scrollbar,
.result-panel::-webkit-scrollbar,
.profile-question::-webkit-scrollbar {
  width: 7px;
}

.setup-panel::-webkit-scrollbar-thumb,
.result-panel::-webkit-scrollbar-thumb,
.profile-question::-webkit-scrollbar-thumb {
  background: rgba(246, 239, 225, 0.18);
}

.panel-title h3,
.node-summary h3 {
  margin: 0;
  font-size: 22px;
}

.field-group {
  margin-top: 24px;
}

.persona-profile {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.persona-card {
  position: relative;
  border: 1px solid var(--line);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.07), rgba(246, 239, 225, 0.025)),
    rgba(246, 239, 225, 0.035);
  animation: slideIn 420ms ease both;
}

.persona-card.focus {
  border-color: rgba(61, 214, 178, 0.42);
  box-shadow: inset 3px 0 0 rgba(61, 214, 178, 0.78);
}

.persona-head {
  display: grid;
  gap: 6px;
}

.persona-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.persona-head strong {
  color: var(--ink);
  font-size: 16px;
}

.persona-card p {
  margin: 8px 0 0;
  color: #cfc6b8;
  font-size: 13px;
  line-height: 1.55;
}

.persona-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.persona-tags span {
  border: 1px solid var(--line);
  padding: 5px 7px;
  color: #e6dccd;
  background: rgba(246, 239, 225, 0.055);
  font-size: 11px;
}

.history-tags span {
  border-color: rgba(243, 196, 105, 0.32);
  color: #f1d38b;
}

.path-stage {
  background:
    radial-gradient(circle at 20% 50%, rgba(243, 196, 105, 0.08), transparent 22%),
    radial-gradient(circle at 74% 48%, rgba(61, 214, 178, 0.06), transparent 26%),
    var(--panel);
}

.node-summary {
  display: grid;
  gap: 6px;
  max-width: 720px;
}

.node-summary p:last-child {
  color: #cfc6b8;
  margin: 0;
  line-height: 1.55;
  font-size: 13px;
}

.step-guide {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  margin-top: 0;
  border: 1px solid rgba(243, 196, 105, 0.44);
  padding: 9px 11px;
  background:
    linear-gradient(90deg, rgba(243, 196, 105, 0.18), rgba(61, 214, 178, 0.055)),
    rgba(246, 239, 225, 0.045);
  box-shadow: 0 0 34px rgba(243, 196, 105, 0.08);
}

.step-guide::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -18px;
  width: 2px;
  height: 18px;
  background: linear-gradient(var(--main), transparent);
}

.step-guide span {
  border: 1px solid rgba(243, 196, 105, 0.4);
  padding: 6px 8px;
  color: var(--main);
  font-size: 12px;
  font-weight: 900;
}

.step-guide strong {
  font-size: 17px;
}

.step-guide p {
  grid-column: 1 / -1;
  margin: 0;
  color: #d8cfbf;
  font-size: 13px;
  line-height: 1.55;
}

.step-guide.done {
  border-color: rgba(61, 214, 178, 0.36);
  background:
    linear-gradient(90deg, rgba(61, 214, 178, 0.14), rgba(246, 239, 225, 0.04)),
    rgba(246, 239, 225, 0.04);
}

.step-guide.done span {
  border-color: rgba(61, 214, 178, 0.4);
  color: var(--turn);
}

.node-confirm {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1.1fr);
  gap: 10px;
  margin-top: 0;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(246, 239, 225, 0.055);
}

.node-confirm.awaiting {
  border-color: rgba(243, 196, 105, 0.72);
  background:
    linear-gradient(135deg, rgba(243, 196, 105, 0.16), rgba(61, 214, 178, 0.055)),
    rgba(246, 239, 225, 0.06);
  box-shadow:
    0 0 0 1px rgba(243, 196, 105, 0.16),
    0 20px 80px rgba(243, 196, 105, 0.13);
  animation: confirmGlow 1.8s ease-in-out infinite;
}

.node-confirm.confirmed {
  border-color: rgba(61, 214, 178, 0.36);
}

.node-confirm h4 {
  margin: 0 0 6px;
  font-size: 18px;
}

.node-confirm p:last-child {
  margin: 0;
  color: #c7beb0;
  font-size: 13px;
  line-height: 1.45;
}

.node-switch {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 6px;
}

.node-switch button {
  border: 1px solid var(--line);
  background: rgba(246, 239, 225, 0.045);
  color: #d8d0c3;
  padding: 7px 9px;
  text-align: left;
  transition: transform 180ms ease, border 180ms ease, background 180ms ease;
}

.node-switch button span,
.node-switch button small {
  display: block;
}

.node-switch button span {
  font-weight: 900;
}

.node-switch button small {
  margin-top: 3px;
  color: #a99f91;
  font-size: 11px;
}

.node-switch button:hover,
.node-switch button.active {
  transform: translateY(-2px);
  border-color: var(--turn);
  background: rgba(61, 214, 178, 0.13);
  color: var(--ink);
}

.node-confirm.awaiting .node-switch button.active {
  border-color: var(--main);
  background: rgba(243, 196, 105, 0.17);
}

.node-switch button.active small {
  color: #efe1bf;
}

.path-canvas {
  position: relative;
  height: 100%;
  min-height: 145px;
  margin-top: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(246, 239, 225, 0.04) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(90deg, rgba(246, 239, 225, 0.04) 1px, transparent 1px) 0 0 / 38px 38px,
    rgba(9, 8, 7, 0.34);
  overflow: hidden;
}

.path-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.decision-path {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
  opacity: calc(0.22 + (var(--path-score, 0.58) * 0.52));
  cursor: pointer;
  pointer-events: stroke;
  transition: opacity 260ms ease, stroke-width 260ms ease, filter 260ms ease;
  animation: drawPath 1200ms ease forwards;
}

.decision-path:hover {
  opacity: 1;
  stroke-width: 12;
  filter: drop-shadow(0 0 14px currentColor);
}

.decision-path.main {
  stroke: url(#mainGrad);
  color: var(--main);
}

.decision-path.turnA {
  stroke: url(#turnGrad);
  color: var(--turn);
  animation-delay: 120ms;
}

.decision-path.turnB {
  stroke: url(#turnBGrad);
  color: var(--turn-b);
  animation-delay: 180ms;
}

.decision-path.restart {
  stroke: url(#restartGrad);
  color: var(--restart);
  animation-delay: 240ms;
}

.decision-path.active {
  opacity: 1;
  stroke-width: 14;
  filter: drop-shadow(0 0 18px currentColor);
}

.center-pulse {
  fill: rgba(246, 239, 225, 0.08);
  stroke: rgba(246, 239, 225, 0.38);
  animation: pulse 2.6s ease-in-out infinite;
}

.center-core {
  fill: var(--ink);
}

.decision-node,
.line-label {
  position: absolute;
}

.decision-node {
  left: 6%;
  top: 47%;
  border: 1px solid var(--line-strong);
  padding: 9px 12px;
  background: rgba(246, 239, 225, 0.1);
}

.line-label {
  right: 5%;
  border: 0;
  padding: 4px 7px;
  background: rgba(9, 8, 7, 0.24);
  color: currentColor;
  font: inherit;
  line-height: 1.2;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.line-label:hover,
.line-label.active {
  transform: translateX(-4px);
  background: rgba(246, 239, 225, 0.08);
  box-shadow: 0 0 18px currentColor;
}

.main-label {
  top: 16%;
  color: var(--main);
}

.turnA-label {
  top: 36%;
  color: var(--turn);
}

.turnB-label {
  top: 60%;
  color: var(--turn-b);
}

.restart-label {
  top: 82%;
  color: var(--restart);
}

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

.paths.single-panel {
  grid-template-columns: 1fr;
}

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

.line-explainer {
  border: 1px solid var(--line);
  padding: 9px 10px;
  background: rgba(246, 239, 225, 0.045);
}

.line-explainer span {
  display: block;
  margin-bottom: 5px;
  font-weight: 900;
}

.line-explainer p {
  margin: 0;
  color: #c7beb0;
  font-size: 12px;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.main-explainer span {
  color: var(--main);
}

.turnA-explainer span {
  color: var(--turn);
}

.turnB-explainer span {
  color: var(--turn-b);
}

.restart-explainer span {
  color: var(--restart);
}

.path-card {
  position: relative;
  min-height: 150px;
  padding: 13px;
  text-align: left;
  background: rgba(246, 239, 225, 0.065);
  animation: cardIn 500ms ease both;
}

.path-stage .line-explainer {
  min-height: 0;
}

.path-stage .path-card {
  height: 78px;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
}

.path-stage .path-card h4 {
  margin: 5px 0 5px;
  font-size: 13px;
  line-height: 1.15;
  padding-right: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.path-stage .path-card p {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.path-stage .path-card small {
  display: none;
}

.path-card:hover,
.path-card.active {
  transform: translateY(-5px);
  border-color: var(--path-color);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.path-card .tag {
  color: var(--path-color);
  font-size: 12px;
  font-weight: 900;
}

.path-score-mini {
  position: absolute;
  top: 9px;
  right: 9px;
  border: 1px solid var(--path-color);
  padding: 3px 5px;
  color: var(--path-color);
  background: rgba(9, 8, 7, 0.42);
  font-size: 10px;
  font-weight: 900;
}

.path-card h4 {
  margin: 8px 0 8px;
  font-size: 17px;
}

.path-card p {
  margin: 0;
  color: #c7beb0;
  font-size: 13px;
  line-height: 1.48;
}

.path-card small {
  display: inline-block;
  margin-top: 10px;
  color: var(--path-color);
  font-size: 12px;
  font-weight: 900;
}

.floating-tooltip {
  position: fixed;
  z-index: 100;
  width: min(310px, calc(100vw - 28px));
  border: 1px solid var(--tip-color, var(--line-strong));
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.08), rgba(246, 239, 225, 0.02)),
    rgba(12, 11, 10, 0.97);
  color: var(--ink);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.46);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 140ms ease, transform 140ms ease;
}

.floating-tooltip.show {
  opacity: 1;
  transform: none;
}

.locked-area {
  border-color: rgba(246, 239, 225, 0.08);
}

.awaiting-node .setup-panel,
.awaiting-node .result-panel {
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.03), rgba(246, 239, 225, 0.015)),
    rgba(10, 9, 8, 0.72);
}

.awaiting-node .path-canvas,
.awaiting-node .line-explainers {
  opacity: 0.34;
  filter: grayscale(0.7);
  pointer-events: none;
}

.awaiting-node .line-label,
.awaiting-node .decision-path {
  cursor: not-allowed;
}

.lock-message,
.locked-panel {
  border: 1px solid rgba(246, 239, 225, 0.16);
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.07), rgba(246, 239, 225, 0.025)),
    rgba(246, 239, 225, 0.035);
  padding: 16px;
  animation: reveal 360ms ease both;
}

.lock-message span,
.locked-panel span {
  color: var(--main);
  font-size: 12px;
  font-weight: 900;
}

.lock-message h4,
.locked-panel strong {
  display: block;
  margin: 8px 0;
  color: var(--ink);
  font-size: 19px;
}

.lock-message p,
.locked-panel p {
  margin: 0;
  color: #c9c0b2;
  font-size: 13px;
  line-height: 1.7;
}

.muted-card {
  border-style: dashed;
  opacity: 0.82;
}

.selected-copy,
.advice-card,
.advanced,
.score-item p {
  color: #cfc6b8;
}

.score-wheel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.score-wheel.locked-score {
  grid-template-columns: 1fr;
}

.overall-score {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
  border: 1px solid var(--line-strong);
  padding: 13px;
  background:
    linear-gradient(135deg, rgba(246, 239, 225, 0.08), rgba(246, 239, 225, 0.04)),
    rgba(246, 239, 225, 0.06);
  box-shadow: inset 4px 0 0 var(--overall-color);
}

.overall-score span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.overall-score strong {
  display: block;
  margin-top: 4px;
  color: var(--overall-color);
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 0.95;
}

.overall-score p {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.overall-score small {
  display: block;
  margin-top: 7px;
  color: #cfc6b8;
  font-size: 12px;
  line-height: 1.5;
}

.overall-score em {
  grid-column: 1 / -1;
  color: #efe2c8;
  font-style: normal;
  line-height: 1.55;
}

.score-item {
  position: relative;
  min-height: 104px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(246, 239, 225, 0.055);
  overflow: hidden;
}

.score-item::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  width: var(--score);
  background: var(--score-color);
  transition: width 420ms ease;
}

.score-item strong {
  display: block;
  color: var(--score-color);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.score-item span {
  display: block;
  margin-top: 8px;
  font-weight: 900;
}

.score-item p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.advice-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  padding: 14px;
  background: rgba(246, 239, 225, 0.07);
  line-height: 1.58;
  animation: reveal 520ms ease both;
}

.advice-card h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 20px;
}

.advice-lead {
  margin: 0 0 14px;
  color: #f1ddbd;
  font-size: 15px;
  font-weight: 800;
}

.advice-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.advice-card dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.advice-card dl div {
  border-top: 1px solid rgba(246, 239, 225, 0.12);
  padding-top: 8px;
}

.advice-card dt {
  color: var(--main);
  font-size: 12px;
  font-weight: 900;
}

.advice-card dd {
  margin: 5px 0 0;
  color: #d4cabb;
  font-size: 13px;
  line-height: 1.65;
}

.advanced {
  margin-top: 16px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: rgba(246, 239, 225, 0.045);
}

.advanced summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.advanced code {
  display: block;
  margin-top: 12px;
  white-space: pre-wrap;
  color: #bdb4a7;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

@keyframes sceneIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes previewGlow {
  0%, 100% {
    opacity: 0.62;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes drawPath {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pulse {
  0%, 100% {
    r: 28;
    opacity: 0.8;
  }
  50% {
    r: 44;
    opacity: 0.28;
  }
}

@keyframes confirmGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(243, 196, 105, 0.14),
      0 18px 62px rgba(243, 196, 105, 0.08);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(243, 196, 105, 0.28),
      0 24px 86px rgba(243, 196, 105, 0.18);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .stage-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .hero,
  .simulator {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .setup-panel,
  .path-stage,
  .result-panel {
    overflow: visible;
  }

  .path-stage {
    display: block;
  }

  .path-canvas {
    height: 310px;
  }

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

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

  .node-confirm {
    grid-template-columns: 1fr;
  }

  .stage-preview {
    min-height: 420px;
  }
}

@media (min-width: 1181px) and (max-height: 850px) {
  body.intro-mode .stage-shell {
    width: min(1000px, calc(100% - 28px));
    padding: 6px 0;
  }

  body.intro-mode .hero {
    gap: 12px;
  }

  body.intro-mode .hero-copy {
    padding: 16px 38px 12px;
  }

  body.intro-mode .hero-copy h2 {
    font-size: clamp(32px, 2.38vw, 45px);
    line-height: 0.9;
  }

  body.intro-mode .lede {
    max-width: 390px;
    margin-top: 11px;
    font-size: 11px;
    line-height: 1.45;
  }

  body.intro-mode .question-composer {
    max-width: 380px;
    margin-top: 10px;
  }

  body.intro-mode textarea {
    min-height: 52px;
    padding: 8px 10px;
  }

  body.intro-mode .composer-note {
    font-size: 10px;
    line-height: 1.45;
  }

  body.intro-mode .template-row {
    gap: 6px;
    margin-top: 8px;
  }

  body.intro-mode .template-row button {
    padding: 6px 7px;
    font-size: 10px;
  }

  body.intro-mode .launch-btn {
    margin-top: 10px;
    padding: 9px 15px;
  }

  .simulator {
    min-height: 0;
  }

  .path-stage {
    grid-template-rows: auto auto auto minmax(112px, 1fr) auto 70px;
    gap: 6px;
    padding: 14px;
  }

  .path-canvas {
    min-height: 120px;
  }

  .line-explainer {
    padding: 7px 9px;
  }

  .line-explainer p {
    -webkit-line-clamp: 1;
  }

  .path-stage .path-card {
    height: 70px;
    min-height: 0;
    padding: 7px;
  }

  .path-stage .path-card p {
    -webkit-line-clamp: 1;
  }

  .path-stage .path-card small {
    display: none;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .stage-shell {
    width: min(100% - 20px, 1500px);
    height: auto;
    min-height: 100vh;
    padding: 10px 0 18px;
    overflow: visible;
  }

  .nav {
    position: static;
    gap: 10px;
    padding: 4px 0 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-sigil {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .brand p {
    margin-bottom: 3px;
    font-size: 8px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .nav-pills {
    display: none;
  }

  .act.active {
    display: block;
    min-height: 0;
  }

  .hero,
  body.intro-mode .hero,
  .simulator {
    display: block;
    height: auto;
    min-height: 0;
  }

  .hero-copy,
  .setup-panel,
  .path-stage,
  .result-panel {
    padding: 14px;
    overflow: visible;
  }

  body.intro-mode .hero-copy {
    display: block;
    overflow: visible;
    padding: 18px 18px 20px;
  }

  body.intro-mode .hero-copy h2,
  .hero-copy h2 {
    font-size: clamp(38px, 13.5vw, 58px);
    line-height: 0.92;
  }

  body.intro-mode .hero-title,
  .hero-title {
    width: 100%;
  }

  body.intro-mode .hero-title span,
  .hero-title span {
    width: auto;
    max-width: 100%;
    white-space: normal;
  }

  body.intro-mode .hero-title span:nth-child(n) {
    transform: none;
  }

  body.intro-mode .lede,
  .lede {
    max-width: none;
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.65;
  }

  body.intro-mode .question-composer {
    max-width: none;
    margin-top: 18px;
  }

  body.intro-mode textarea {
    min-height: 92px;
    font-size: 13px;
    line-height: 1.55;
  }

  body.intro-mode .composer-note {
    font-size: 11px;
    line-height: 1.5;
  }

  body.intro-mode .template-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.intro-mode .template-row button {
    padding: 9px 8px;
    font-size: 12px;
  }

  body.intro-mode .launch-btn {
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
  }

  body.intro-mode .stage-preview {
    display: none;
  }

  .setup-panel,
  .path-stage,
  .result-panel {
    margin-top: 12px;
  }

  .paths,
  .score-wheel,
  .chip-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }

  .line-explainers {
    grid-template-columns: 1fr;
  }

  .line-explainer p {
    display: block;
    overflow: visible;
  }

  .node-confirm {
    grid-template-columns: 1fr;
  }

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

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

  .question-grid,
  .question-grid.compact-grid,
  .question-grid.mini-grid {
    grid-template-columns: 1fr;
  }

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

  .profile-question,
  .question-grid.zodiac-grid {
    max-height: none;
    overflow: visible;
  }

  .path-canvas {
    height: 260px;
    min-height: 260px;
  }

  .decision-node {
    left: 4%;
    top: 46%;
    padding: 7px 9px;
    font-size: 12px;
  }

  .line-label {
    right: 3%;
    font-size: 12px;
  }

  .paths {
    gap: 8px;
  }

  .path-stage .path-card {
    height: auto;
    min-height: 76px;
    padding: 10px;
  }

  .path-stage .path-card h4 {
    font-size: 15px;
    -webkit-line-clamp: 2;
  }

  .path-stage .path-card p {
    -webkit-line-clamp: 2;
  }

  .overall-score {
    grid-template-columns: 1fr;
  }

  .overall-score strong {
    font-size: 42px;
  }

  .score-wheel {
    gap: 8px;
  }

  .floating-tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
