:root {
  --bg: #100708;
  --bg-deep: #080506;
  --panel: #180d0e;
  --panel-soft: #201314;
  --crimson: #b72d3d;
  --crimson-bright: #d84b58;
  --gold: #e6b970;
  --gold-deep: #9f6c43;
  --ivory: #fff0d8;
  --text: #eadfd2;
  --muted: #a8978b;
  --line: rgba(230, 185, 112, 0.26);
  --line-soft: rgba(230, 185, 112, 0.12);
  --header-height: 56px;
  --display: "STZhongsong", "FZSongYi-Z13", "Songti SC", "SimSun", serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background: #d8d1c8;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

button,
.download {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

button:disabled {
  cursor: not-allowed;
  filter: grayscale(.5);
  opacity: .48;
}

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

#phone-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 4%, rgba(116, 39, 47, .22), transparent 30%),
    linear-gradient(rgba(230, 185, 112, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 185, 112, .022) 1px, transparent 1px),
    var(--bg-deep);
  background-size: auto, 32px 32px, 32px 32px, auto;
  box-shadow: 0 0 45px rgba(18, 8, 8, .25);
}

#phone-shell::after {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, .012) 3px 4px);
  mix-blend-mode: soft-light;
}

header {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  height: var(--header-height);
  padding: 0 21px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 5, 6, .72);
  backdrop-filter: blur(10px);
}

header a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ivory);
  font: 700 16px/1 var(--display);
  text-decoration: none;
}

header a i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

header a span {
  border-bottom: 1px solid var(--gold-deep);
  padding-bottom: 7px;
}

header > b {
  color: #806d63;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .16em;
}

main {
  position: relative;
  z-index: 1;
  padding: 18px 22px 38px;
}

body[data-screen="home"],
body[data-screen="quiz"],
body[data-screen="analysis"],
body[data-screen="ready"] {
  height: 100dvh;
  overflow: hidden;
}

body[data-screen="home"] #phone-shell,
body[data-screen="quiz"] #phone-shell,
body[data-screen="analysis"] #phone-shell,
body[data-screen="ready"] #phone-shell {
  height: 100dvh;
  min-height: 100dvh;
}

body[data-screen="home"] main,
body[data-screen="quiz"] main,
body[data-screen="analysis"] main,
body[data-screen="ready"] main {
  height: calc(100dvh - var(--header-height));
  min-height: 0;
  overflow: hidden;
}

.primary {
  border-color: #d65a63;
  background: linear-gradient(105deg, #9f1f32 0%, #c43b49 56%, #a62235 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .13), 0 10px 24px rgba(117, 18, 33, .24);
  color: #fff5e7;
  font-weight: 800;
}

.primary:active {
  transform: translateY(1px);
}

.text-button {
  min-height: 34px;
  border: 0;
  color: #b7a69b;
  font-size: 12px;
}

.screen-note,
.bottom-note {
  margin: 0;
  color: #796b63;
  font-size: 10px;
  text-align: center;
}

/* 首页 */
.home-screen {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.home-copy > p,
.analysis-kicker,
.result-kicker {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .12em;
}

.home-copy h1 {
  margin-bottom: 5px;
  color: var(--ivory);
  font: 800 42px/1.08 var(--display);
  letter-spacing: .03em;
}

.home-copy > span {
  color: var(--muted);
  font-size: 12px;
}

.seven-dial {
  position: relative;
  width: 246px;
  height: 246px;
  margin: 8px auto 6px;
  flex: 0 0 auto;
}

.seven-dial::before,
.seven-dial::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: linear-gradient(transparent, rgba(230, 185, 112, .2), transparent);
  transform: translate(-50%, -50%);
}

.seven-dial::before {
  width: 1px;
  height: 218px;
}

.seven-dial::after {
  width: 218px;
  height: 1px;
}

.dial-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.dial-ring-one {
  width: 224px;
  height: 224px;
  border: 1px solid rgba(230, 185, 112, .32);
  box-shadow: 0 0 0 26px rgba(230, 185, 112, .025);
}

.dial-ring-two {
  width: 154px;
  height: 154px;
  border: 1px dashed rgba(183, 45, 61, .43);
}

.dial-heptagon {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.heptagon-glow {
  fill: rgba(142, 27, 45, .5);
  filter: drop-shadow(0 0 17px rgba(183, 45, 61, .55));
  stroke: rgba(183, 45, 61, .38);
  stroke-width: 12;
}

.heptagon-face {
  fill: rgba(74, 15, 25, .84);
  stroke: var(--gold);
  stroke-width: 1.15;
}

.heptagon-spokes line {
  stroke: rgba(230, 185, 112, .25);
  stroke-width: 1;
}

.dial-names {
  position: absolute;
  inset: 0;
}

.dial-names span {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 47px;
  height: 47px;
  border: 1px solid rgba(230, 185, 112, .46);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, rgba(183, 45, 61, .45), #14090b 70%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  color: var(--ivory);
  font: 700 11px/1 var(--display);
  place-items: center;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 51.428deg)) translateY(-99px) rotate(calc(var(--i) * -51.428deg));
}

.dial-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: flex;
  width: 88px;
  height: 88px;
  border: 1px solid var(--gold);
  background: radial-gradient(circle at 50% 40%, #8f2635, #2b0d13 68%);
  box-shadow: 0 0 0 11px rgba(183, 45, 61, .08), 0 0 30px rgba(183, 45, 61, .34);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) rotate(45deg);
}

.dial-core b,
.dial-core small {
  transform: rotate(-45deg);
}

.dial-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: flex;
  width: 90px;
  height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.dial-mark svg {
  display: block;
  width: 61px;
  height: 54px;
  overflow: visible;
  filter: drop-shadow(0 2px 7px rgba(255, 230, 196, .24));
}

.dial-mark path {
  fill: #fff5e6;
}

.dial-mark small {
  display: block;
  margin-top: -1px;
  color: var(--gold);
  font: 600 8px/1 var(--sans);
  letter-spacing: .08em;
  white-space: nowrap;
}

.dial-core b {
  color: #fff6e9;
  font: 800 42px/.85 var(--display);
}

.dial-core small {
  margin-top: 10px;
  color: var(--gold);
  font-size: 8px;
  white-space: nowrap;
}

.home-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
  margin-bottom: 11px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.home-manifesto {
  margin: 2px 0 0;
  color: #bba89a;
  font: 700 13px/1.5 var(--display);
}

.home-manifesto span {
  color: #725f56;
  font: 500 10px/1.5 var(--sans);
}

.home-meta div {
  padding: 8px 2px;
}

.home-meta div + div {
  border-left: 1px solid var(--line-soft);
}

.home-meta b,
.home-meta span {
  display: block;
}

.home-meta b {
  color: var(--ivory);
  font: 700 20px/1.15 var(--display);
}

.home-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.home-cta {
  width: 100%;
  min-height: 54px;
  font-size: 18px;
  letter-spacing: .05em;
}

.home-screen > .text-button {
  margin-top: 2px;
}

.home-screen > .screen-note {
  margin-top: 7px;
}

/* 答题 */
.quiz-screen {
  position: relative;
  height: 100%;
  padding-left: 15px;
}

.quiz-screen::before {
  position: absolute;
  top: 2px;
  bottom: 1px;
  left: 0;
  width: 2px;
  content: "";
  background: linear-gradient(var(--crimson-bright), var(--gold), var(--crimson));
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c6b9ae;
  font-size: 10px;
}

.quiz-topline b {
  color: var(--ivory);
  font-weight: 500;
}

.quiz-progress {
  height: 3px;
  margin: 9px 0 17px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
}

.quiz-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--crimson-bright), var(--gold));
  box-shadow: 0 0 10px rgba(230, 185, 112, .3);
  transition: width .25s ease;
}

.question-heading {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: start;
}

.question-heading > span {
  color: var(--gold);
  font: 800 47px/.9 var(--display);
}

.question-heading h1 {
  height: 4.08em;
  min-height: 4.08em;
  margin: -3px 0 0;
  color: var(--ivory);
  font: 800 23px/1.36 var(--display);
}

.question-hint {
  margin: 4px 0 12px 64px;
  color: var(--muted);
  font-size: 10px;
}

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

.option {
  display: flex;
  width: 100%;
  min-height: 47px;
  padding: 8px 12px;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border-color: rgba(230, 185, 112, .22);
  border-radius: 4px;
  background: rgba(255, 240, 216, .018);
  background-clip: padding-box;
  text-align: left;
}

.option b {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 1px solid rgba(230, 185, 112, .34);
  color: var(--gold);
  font-size: 11px;
  place-items: center;
}

.option span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.option[aria-checked="true"] {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(183, 45, 61, .26), rgba(230, 185, 112, .08));
  box-shadow: inset 4px 0 var(--crimson-bright);
}

.option[aria-checked="true"] b {
  border-color: var(--gold);
  background: var(--gold);
  color: #190b0d;
}

.option.is-confirming {
  animation: option-confirm .22s ease-out;
}

.quiz-actions {
  display: flex;
  min-height: 38px;
  margin-top: 8px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

.quiz-actions > span {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.quiz-actions .text-button {
  align-self: flex-start;
  padding: 4px 0;
}

.quiz-screen > .screen-note {
  margin-top: 1px;
  text-align: left;
}

.final-actions {
  min-height: 98px;
  margin-top: 10px;
}

.generate-cta {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 68px;
  overflow: hidden;
  border-radius: 34px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: cta-breathe 2.25s ease-in-out infinite;
}

.generate-cta::before {
  position: absolute;
  inset: -100% -40%;
  content: "";
  background: linear-gradient(110deg, transparent 42%, rgba(255, 244, 223, .28) 50%, transparent 58%);
  animation: cta-shine 2.8s ease-in-out infinite;
}

.generate-cta small,
.generate-cta strong {
  position: relative;
  z-index: 1;
}

.generate-cta small {
  margin-bottom: 2px;
  color: #f3c4b3;
  font-size: 10px;
  font-weight: 500;
}

.generate-cta strong {
  color: #fff9ec;
  font: 800 23px/1.2 var(--display);
  letter-spacing: .05em;
}

/* 生成过程 */
.analysis-screen,
.ready-screen {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.analysis-kicker {
  width: 100%;
  margin-bottom: 0;
  text-align: left;
}

.signal-stage {
  position: relative;
  width: 232px;
  height: 232px;
  margin: 2px auto 0;
  flex: 0 0 auto;
}

.stage-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.stage-ring-one {
  width: 210px;
  height: 210px;
  border: 1px solid rgba(230, 185, 112, .45);
  border-right-color: transparent;
  animation: ring-spin 7.5s linear infinite;
}

.stage-ring-two {
  width: 146px;
  height: 146px;
  border: 1px dashed rgba(183, 45, 61, .55);
  border-top-style: solid;
  animation: ring-spin-reverse 5.2s linear infinite;
}

.signal-wheel {
  position: absolute;
  inset: 0;
  animation: wheel-spin 8.4s linear infinite;
}

.signal-node {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(230, 185, 112, .56);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #7d2431, #160a0c 70%);
  box-shadow: 0 0 12px rgba(183, 45, 61, .18);
  color: var(--ivory);
  place-items: center;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 51.428deg)) translateY(-94px) rotate(calc(var(--i) * -51.428deg));
  transition: opacity .12s ease;
}

.signal-node i {
  font: 800 10px/1 var(--display);
  font-style: normal;
  animation: wheel-counter-spin 8.4s linear infinite;
}

.signal-node.is-launched {
  visibility: hidden;
}

.signal-core {
  --core-scale: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: flex;
  width: 88px;
  height: 88px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #a43240, #2c0d13 65%, #12080a 72%);
  box-shadow: 0 0 0 12px rgba(183, 45, 61, .07), 0 0 36px rgba(183, 45, 61, .32);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(var(--core-scale));
  transition: transform .28s ease, box-shadow .3s ease;
}

.signal-core span {
  color: #fff7e8;
  font: 800 17px/1.15 var(--display);
}

.signal-core b {
  margin-top: 6px;
  color: var(--gold);
  font-size: 9px;
}

.signal-core.is-pulsing {
  animation: core-pulse .56s cubic-bezier(.24, .75, .28, 1);
}

.signal-core.is-ready {
  box-shadow: 0 0 0 20px rgba(183, 45, 61, .1), 0 0 55px rgba(230, 185, 112, .42);
}

.flight-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.signal-projectile {
  position: absolute;
  display: grid;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #d5535f, #42121b 70%);
  box-shadow: 0 0 18px rgba(216, 75, 88, .55);
  color: #fff8eb;
  font: 800 10px/1 var(--display);
  place-items: center;
}

.analysis-screen h1,
.ready-screen h1 {
  margin: -1px 0 2px;
  color: var(--ivory);
  font: 800 28px/1.25 var(--display);
}

.analysis-lead,
.ready-lead {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.liquid-progress {
  position: relative;
  width: 100%;
  height: 11px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid rgba(230, 185, 112, .34);
  border-radius: 99px;
  background: rgba(255, 255, 255, .045);
}

.liquid-progress > i {
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--crimson-bright), var(--gold));
  box-shadow: 0 0 13px rgba(230, 185, 112, .4);
  transition: width .48s cubic-bezier(.22, .72, .27, 1);
}

.liquid-progress > b {
  position: absolute;
  top: 2px;
  left: -10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe8c5;
  opacity: .7;
  animation: progress-bubble 1.55s cubic-bezier(.35, .08, .52, 1) infinite;
}

.liquid-progress > b:nth-of-type(2) {
  width: 4px;
  height: 4px;
  animation-delay: .48s;
}

.liquid-progress > b:nth-of-type(3) {
  animation-delay: .9s;
}

.analysis-steps {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.analysis-steps li {
  display: grid;
  min-height: 31px;
  grid-template-columns: 23px 1fr 10px;
  align-items: center;
  border-bottom: 1px solid rgba(230, 185, 112, .09);
  color: #6f6159;
  font-size: 10px;
}

.analysis-steps li > b {
  color: #7b6c63;
  font-size: 9px;
}

.analysis-steps li > i {
  width: 7px;
  height: 7px;
  border: 1px solid #665750;
  transform: rotate(45deg);
}

.analysis-steps li.active {
  color: var(--ivory);
}

.analysis-steps li.active > i {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(230, 185, 112, .08);
}

.analysis-steps li.done {
  color: #b8a79b;
}

.analysis-steps li.done > i {
  border-color: var(--crimson-bright);
  background: var(--crimson-bright);
}

.analysis-screen > .screen-note {
  margin-top: 7px;
}

/* 报告就绪 */
.ready-seal {
  position: relative;
  display: flex;
  width: 132px;
  height: 132px;
  margin: 12px auto 14px;
  border: 1px solid rgba(230, 185, 112, .48);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from -12.86deg, rgba(230, 185, 112, .18) 0 .65deg, transparent .65deg 51.428deg),
    radial-gradient(circle, rgba(183, 45, 61, .24), #13090b 68%);
  box-shadow: 0 0 0 9px rgba(183, 45, 61, .045), 0 0 34px rgba(183, 45, 61, .22);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ready-seal::before,
.ready-seal::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  clip-path: polygon(50% 0%, 89.1% 18.8%, 98.7% 61.1%, 71.7% 95%, 28.3% 95%, 1.3% 61.1%, 10.9% 18.8%);
  transform: translate(-50%, -50%);
}

.ready-seal::before {
  z-index: 1;
  width: 91px;
  height: 91px;
  background: linear-gradient(145deg, #f0c879, #8c5639 82%);
  filter: drop-shadow(0 0 12px rgba(230, 185, 112, .22));
}

.ready-seal::after {
  z-index: 2;
  width: 87px;
  height: 87px;
  background: radial-gradient(circle at 48% 37%, #852638, #280d13 68%, #12080a 72%);
}

.ready-seal i {
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(230, 185, 112, .36);
  border-radius: 50%;
  animation: wheel-spin 12s linear infinite;
}

.ready-seal span,
.ready-seal b {
  position: relative;
  z-index: 3;
}

.ready-seal span {
  color: var(--ivory);
  font: 800 38px/.9 var(--display);
  text-shadow: 0 2px 10px rgba(255, 223, 172, .2);
}

.ready-seal b {
  margin-top: 8px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: .08em;
}

.ready-lead {
  max-width: 310px;
  margin-top: 4px;
  margin-bottom: 13px;
}

.ready-preview {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 13px;
  border: 1px solid var(--line);
}

.ready-preview > div {
  min-height: 69px;
  padding: 8px 3px;
}

.ready-preview > div + div {
  border-left: 1px solid var(--line);
}

.ready-preview b,
.ready-preview span {
  display: block;
}

.ready-preview b {
  position: relative;
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border: 1px solid rgba(230, 185, 112, .38);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 45, 61, .22), transparent 66%);
  color: var(--gold);
  font-size: 0;
}

.ready-preview b::before,
.ready-preview b::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.ready-preview b::before {
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
}

.ready-preview b::after {
  width: 2px;
  height: 2px;
  background: var(--crimson-bright);
  box-shadow: 0 0 7px rgba(216, 75, 88, .7);
}

.ready-preview span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.unlock-cta {
  display: flex;
  width: 100%;
  min-height: 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.unlock-cta small {
  margin-bottom: 1px;
  color: #f3c4b3;
  font-size: 9px;
  font-weight: 500;
}

.unlock-cta strong {
  color: #fff9ec;
  font: 800 22px/1.25 var(--display);
}

.ready-screen > .screen-note {
  margin-top: 9px;
}

.ready-screen.is-unsealing .ready-seal {
  animation: archive-unseal .56s cubic-bezier(.2, .72, .24, 1) forwards;
}

.ready-screen.is-unsealing .ready-preview,
.ready-screen.is-unsealing h1,
.ready-screen.is-unsealing .ready-lead {
  opacity: .45;
  transition: opacity .32s ease;
}

/* 完整报告 */
body[data-screen="result"] {
  background: #d8d1c8;
}

body[data-screen="result"] main {
  padding: 0 0 38px;
}

.report-capture {
  width: 100%;
  padding: 22px 22px 1px;
  background:
    radial-gradient(circle at 78% 4%, rgba(116, 39, 47, .22), transparent 30%),
    linear-gradient(rgba(230, 185, 112, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 185, 112, .022) 1px, transparent 1px),
    var(--bg-deep);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

.result-head {
  padding-bottom: 15px;
}

.result-head h1 {
  margin-bottom: 4px;
  color: var(--ivory);
  font: 800 35px/1.15 var(--display);
}

.result-tagline {
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11px;
}

.result-overview {
  display: grid;
  gap: 10px;
}

.overall-card {
  position: relative;
  min-height: 122px;
  padding: 15px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, #2b1115, #160b0d 72%);
}

.overall-card::after {
  display: none;
}

.overall-card p,
.overall-card small {
  position: relative;
  z-index: 1;
  margin: 0;
}

.aggregate-sigil {
  position: absolute !important;
  top: 5px;
  right: 6px;
  z-index: 0 !important;
  width: 138px;
  height: 112px;
  margin: 0 !important;
}

.aggregate-sigil::before {
  position: absolute;
  inset: 12px 20px 2px;
  border-radius: 50%;
  content: "";
  background: radial-gradient(circle, rgba(183, 45, 61, .24), transparent 68%);
  filter: blur(2px);
}

.aggregate-sigil svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.aggregate-sigil circle,
.aggregate-sigil polygon,
.aggregate-sigil line {
  fill: none;
  stroke: rgba(230, 185, 112, .24);
  stroke-width: 1;
}

.aggregate-sigil .aggregate-track {
  stroke: rgba(230, 185, 112, .11);
  stroke-width: 2;
}

.aggregate-sigil .aggregate-score {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 2.4;
  transform: rotate(-90deg);
  transform-origin: 70px 60px;
}

.aggregate-sigil .aggregate-inner {
  fill: rgba(183, 45, 61, .13);
  stroke: rgba(216, 75, 88, .42);
}

.aggregate-sigil .aggregate-nodes circle {
  fill: var(--gold);
  stroke: #2b1115;
}

.aggregate-sigil > span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(230, 185, 112, .38);
  border-radius: 50%;
  background: rgba(38, 12, 17, .82);
  color: var(--gold);
  font: 700 13px/1 var(--display);
  place-items: center;
  transform: translate(-50%, -50%);
}

.overall-card p {
  color: var(--gold);
  font-size: 11px;
}

.overall-card > div {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.overall-card > div b {
  color: var(--ivory);
  font: 800 58px/.95 var(--display);
}

.overall-card > div span {
  color: var(--gold);
  font-size: 14px;
}

.overall-card small {
  color: var(--muted);
  font-size: 10px;
}

.dominant-card {
  display: grid;
  min-height: 178px;
  padding: 14px;
  grid-template-columns: 112px 1fr;
  gap: 15px;
  align-items: center;
  border: 1px solid rgba(230, 185, 112, .38);
  background: linear-gradient(135deg, rgba(126, 31, 44, .36), #12090b 64%);
}

.dominant-emblem {
  position: relative;
  display: flex;
  width: 108px;
  height: 108px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #a72f3e, #2d0d13 63%, #100708 68%);
  box-shadow: 0 0 0 8px rgba(183, 45, 61, .07), 0 0 25px rgba(183, 45, 61, .28);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dominant-emblem::before {
  position: absolute;
  inset: 11px;
  border: 1px dashed rgba(230, 185, 112, .35);
  border-radius: 50%;
  content: "";
}

.dominant-emblem small,
.dominant-emblem b {
  position: relative;
  z-index: 1;
}

.dominant-emblem small {
  color: var(--gold);
  font-size: 9px;
}

.dominant-emblem b {
  margin-top: 5px;
  color: var(--ivory);
  font: 800 30px/1 var(--display);
}

.dominant-copy > span {
  display: block;
  color: var(--gold);
  font-size: 9px;
}

.dominant-copy > strong {
  display: flex;
  margin: 1px 0 4px;
  align-items: baseline;
  gap: 4px;
  color: var(--ivory);
  font: 800 35px/1 var(--display);
}

.dominant-copy > strong small {
  color: var(--gold);
  font: 500 10px/1 var(--sans);
}

.dominant-copy h2 {
  margin: 0 0 5px;
  color: #f0c37e;
  font: 700 16px/1.3 var(--display);
}

.dominant-copy p {
  margin: 0;
  color: #cfc0b5;
  font-size: 10px;
  line-height: 1.65;
}

.score-explain {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--crimson-bright);
  color: #9d8d82;
  font-size: 10px;
  line-height: 1.7;
}

.score-explain b {
  color: #c9b7aa;
}

.report-card {
  margin-bottom: 12px;
  padding: 17px 15px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(34, 18, 20, .96), rgba(13, 8, 9, .96));
  box-shadow: inset 0 0 0 3px rgba(230, 185, 112, .025);
}

.section-title {
  display: flex;
  gap: 11px;
  margin-bottom: 13px;
  align-items: flex-start;
}

.section-title > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--gold-deep);
  border-radius: 50%;
  color: var(--gold);
  font: 700 13px/1 var(--display);
  place-items: center;
}

.section-title h2 {
  margin: 0;
  color: var(--ivory);
  font: 800 21px/1.25 var(--display);
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.chart-card svg {
  display: block;
  width: 100%;
  max-width: 330px;
  margin: -3px auto -4px;
}

.rank {
  display: grid;
  gap: 8px;
}

.rank-row {
  display: grid;
  min-height: 32px;
  grid-template-columns: 23px 36px 1fr 28px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid rgba(230, 185, 112, .08);
}

.rank-index {
  display: grid;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 9px;
  place-items: center;
}

.rank-name {
  font-size: 11px;
}

.rank-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .07);
}

.rank-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--crimson-bright), var(--gold));
}

.rank-row > b {
  color: var(--text);
  font-size: 12px;
  text-align: right;
}

.rank-row.leader {
  background: linear-gradient(90deg, rgba(183, 45, 61, .15), transparent);
}

.rank-row.leader .rank-name,
.rank-row.leader > b {
  color: var(--gold);
  font-weight: 800;
}

.insights {
  display: grid;
  gap: 10px;
}

.insights article {
  padding: 12px 12px 12px 14px;
  border-left: 2px solid var(--crimson-bright);
  background: rgba(255, 255, 255, .025);
}

.insights h3,
.balance-grid h3 {
  margin-bottom: 5px;
  color: var(--gold);
  font: 700 15px/1.4 var(--display);
}

.insights p,
.balance-grid p {
  margin: 0;
  color: #d4c6ba;
  font-size: 12px;
  line-height: 1.8;
}

.keyword-block {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

.keyword-block > p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.keyword-block > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword-block span {
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 10px;
}

.trigger-matrix {
  border-top: 1px solid var(--line-soft);
}

.trigger-row {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  padding: 11px 0;
  align-items: start;
  border-bottom: 1px solid var(--line-soft);
}

.trigger-row > b {
  display: grid;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 9px;
  place-items: center;
}

.trigger-row p {
  margin: 0;
  color: #d7c9bd;
  font-size: 11px;
  line-height: 1.65;
}

.trigger-row span {
  grid-column: 2;
  margin-top: -3px;
  color: var(--crimson-bright);
  font-size: 9px;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.balance-grid {
  display: grid;
  gap: 9px;
}

.balance-grid article {
  display: grid;
  padding: 11px;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  background: rgba(255, 255, 255, .025);
}

.balance-grid article > b {
  display: grid;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gold-deep);
  border-radius: 50%;
  color: var(--gold);
  font-size: 10px;
  place-items: center;
}

.balance-grid h3 {
  margin-top: 1px;
}

.balance-keywords span {
  color: #d8c9bd;
}

.closing {
  margin: 23px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--gold);
  font: 700 15px/1.8 var(--display);
  text-align: center;
}

.bank-version {
  margin: -12px 0 22px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  text-align: center;
}

.result-actions {
  display: grid;
  gap: 8px;
  margin: 0 22px;
}

.result-actions button {
  min-height: 45px;
  border-color: var(--line);
}

.result-actions .primary {
  min-height: 50px;
}

.bottom-note {
  margin: 11px 22px 0;
}

dialog {
  width: min(calc(100% - 30px), 420px);
  max-height: 88vh;
  padding: 19px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(4px);
}

dialog h3 {
  margin-bottom: 7px;
  color: var(--ivory);
  font: 800 21px/1.3 var(--display);
}

dialog p {
  color: var(--muted);
  font-size: 12px;
}

dialog img {
  display: block;
  width: 100%;
  margin: 12px 0;
}

dialog button,
dialog .download {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  text-align: center;
}

.export-dialog {
  width: min(calc(100% - 30px), 390px);
  max-height: min(88vh, 610px);
  padding: 23px 22px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(115, 55, 43, .24), transparent 36%),
    linear-gradient(rgba(230, 185, 112, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 185, 112, .025) 1px, transparent 1px),
    #1b1010;
  background-size: auto, 28px 28px, 28px 28px, auto;
  text-align: center;
}

.export-envelope {
  position: relative;
  width: 220px;
  height: 158px;
  margin: 0 auto 15px;
  perspective: 700px;
}

.envelope-letter {
  position: absolute;
  top: 17px;
  left: 22px;
  z-index: 1;
  display: flex;
  width: 176px;
  height: 116px;
  padding: 12px;
  border: 1px solid #ad8251;
  background:
    linear-gradient(rgba(76, 44, 31, .055) 1px, transparent 1px),
    #e8d7b6;
  background-size: 100% 19px, auto;
  box-shadow: 0 7px 20px rgba(0, 0, 0, .3);
  color: #3a1a17;
  flex-direction: column;
  align-items: center;
  transform: translateY(29px);
  transition: transform .7s cubic-bezier(.2, .78, .23, 1);
}

.envelope-letter span {
  color: #7b4d34;
  font-size: 8px;
  letter-spacing: .16em;
}

.envelope-letter b {
  margin-top: 3px;
  color: #40201b;
  font: 800 17px/1.2 var(--display);
}

.envelope-letter i {
  display: grid;
  width: 35px;
  height: 35px;
  margin-top: 7px;
  border: 1px solid #9a603b;
  border-radius: 50%;
  background: radial-gradient(circle, #6d3029, #3e1818 72%);
  box-shadow: 0 0 0 4px rgba(112, 48, 41, .1);
  color: #e9c98c;
  font: 800 19px/1 var(--display);
  font-style: normal;
  place-items: center;
}

.envelope-flap,
.envelope-pocket {
  position: absolute;
  left: 0;
  width: 100%;
}

.envelope-flap {
  top: 48px;
  z-index: 4;
  height: 78px;
  background: linear-gradient(155deg, #4b332a, #261814 76%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 1px rgba(230, 185, 112, .22));
  transform-origin: 50% 0;
  transition: transform .62s cubic-bezier(.2, .7, .22, 1), z-index 0s linear .3s;
}

.envelope-pocket {
  bottom: 0;
  z-index: 3;
  height: 103px;
  background: linear-gradient(145deg, #34231e, #1e1312 72%);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 0 1px #a77549) drop-shadow(0 8px 14px rgba(0, 0, 0, .34));
}

.export-dialog.is-open .envelope-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

.export-dialog.is-open .envelope-letter {
  transform: translateY(-7px);
}

.export-dialog h3 {
  margin-bottom: 5px;
  text-align: center;
}

.export-dialog > p {
  margin-bottom: 13px;
  text-align: center;
}

.export-dialog .download {
  display: flex;
  min-height: 60px;
  border-radius: 30px;
  align-items: center;
  justify-content: center;
  font: 800 20px/1.2 var(--display);
  animation: cta-breathe 2.25s ease-in-out infinite;
}

.export-dialog #close-export {
  min-height: 36px;
  margin-top: 5px;
  border: 0;
  color: var(--muted);
  font-size: 12px;
}

.reset-dialog > div {
  display: grid;
  gap: 4px;
}

.storage-warning {
  margin-top: 8px;
  color: #ffd8a5;
  font-size: 10px;
  text-align: center;
}

@keyframes option-confirm {
  50% { transform: scale(.985); }
}

@keyframes cta-breathe {
  0%, 100% { box-shadow: inset 0 1px rgba(255, 255, 255, .13), 0 8px 22px rgba(117, 18, 33, .28), 0 0 0 0 rgba(216, 75, 88, .18); }
  50% { box-shadow: inset 0 1px rgba(255, 255, 255, .17), 0 12px 29px rgba(117, 18, 33, .4), 0 0 0 8px rgba(216, 75, 88, 0); }
}

@keyframes cta-shine {
  0%, 52% { transform: translateX(-58%); }
  84%, 100% { transform: translateX(58%); }
}

@keyframes ring-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes ring-spin-reverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

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

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

@keyframes core-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(var(--core-scale)); }
  48% { transform: translate(-50%, -50%) scale(calc(var(--core-scale) + .16)); }
}

@keyframes progress-bubble {
  0% { left: -10px; opacity: 0; transform: translateY(2px) scale(.5); }
  18% { opacity: .8; }
  62% { transform: translateY(-2px) scale(1.1); }
  100% { left: calc(100% + 6px); opacity: 0; transform: translateY(1px) scale(.45); }
}

@keyframes archive-unseal {
  0% { filter: brightness(1); transform: scale(1); }
  42% { filter: brightness(1.35); transform: scale(1.08); }
  100% { filter: brightness(1.7); opacity: 0; transform: scale(1.34); }
}

@media (max-height: 710px) {
  :root { --header-height: 52px; }

  main { padding: 12px 20px 28px; }

  .home-copy h1 { font-size: 36px; }
  .home-copy > span { font-size: 10px; }
  .seven-dial { width: 214px; height: 214px; margin-top: 2px; }
  .dial-ring-one { width: 194px; height: 194px; }
  .dial-ring-two { width: 136px; height: 136px; }
  .dial-names span { width: 42px; height: 42px; transform: translate(-50%, -50%) rotate(calc(var(--i) * 51.428deg)) translateY(-86px) rotate(calc(var(--i) * -51.428deg)); }
  .dial-core { width: 76px; height: 76px; }
  .dial-core b { font-size: 36px; }
  .dial-mark { width: 78px; height: 82px; }
  .dial-mark svg { width: 54px; height: 48px; }
  .home-meta { margin-bottom: 8px; }
  .home-meta div { padding: 6px 2px; }
  .home-cta { min-height: 50px; }

  .quiz-progress { margin-bottom: 12px; }
  .question-heading { grid-template-columns: 47px 1fr; }
  .question-heading > span { font-size: 42px; }
  .question-heading h1 { font-size: 22px; }
  .question-hint { margin: 1px 0 8px 57px; }
  .options { gap: 5px; }
  .option { min-height: 43px; }
  .final-actions { min-height: 90px; margin-top: 7px; }
  .generate-cta { min-height: 60px; }

  .signal-stage { width: 202px; height: 202px; margin-top: -1px; }
  .stage-ring-one { width: 184px; height: 184px; }
  .stage-ring-two { width: 128px; height: 128px; }
  .signal-node { width: 40px; height: 40px; font-size: 9px; transform: translate(-50%, -50%) rotate(calc(var(--i) * 51.428deg)) translateY(-81px) rotate(calc(var(--i) * -51.428deg)); }
  .signal-core { width: 78px; height: 78px; }
  .analysis-screen h1, .ready-screen h1 { font-size: 25px; }
  .analysis-lead { margin-bottom: 5px; }
  .analysis-steps li { min-height: 29px; }
  .analysis-screen > .screen-note { margin-top: 4px; }

  .ready-seal { width: 112px; height: 112px; margin: 5px auto 8px; }
  .ready-seal span { font-size: 34px; }
  .ready-lead { margin-bottom: 8px; }
  .ready-preview { margin-bottom: 9px; }
  .ready-preview > div { min-height: 60px; padding: 6px 3px; }
  .unlock-cta { min-height: 57px; }
}

@media (max-width: 340px) {
  .question-heading { grid-template-columns: 43px 1fr; gap: 8px; }
  .question-heading > span { font-size: 38px; }
  .question-heading h1 { font-size: 19px; }
  .question-hint { margin-left: 51px; font-size: 9px; line-height: 1.45; }
}

@media (min-width: 461px) {
  body { padding: 24px 0; }
  #phone-shell { min-height: calc(100vh - 48px); border-radius: 8px; }
  body[data-screen="home"] #phone-shell,
  body[data-screen="quiz"] #phone-shell,
  body[data-screen="analysis"] #phone-shell,
  body[data-screen="ready"] #phone-shell { height: calc(100dvh - 48px); min-height: calc(100dvh - 48px); }
  body[data-screen="home"] main,
  body[data-screen="quiz"] main,
  body[data-screen="analysis"] main,
  body[data-screen="ready"] main { height: calc(100dvh - 48px - var(--header-height)); }
}

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