:root {
  --bg: #15130f;
  --surface: #211d16;
  --surface-raised: #292319;
  --ink: #f5eee1;
  --muted: #b9ad98;
  --faint: #827667;
  --gold: #e7c06b;
  --gold-pale: #f6dc9c;
  --line: rgba(245, 238, 225, .15);
  --display: Iowan Old Style, Baskerville, "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-width: 320px; min-height: 100%; margin: 0; background: radial-gradient(circle at 92% 5%, rgba(130, 91, 34, .35), transparent 26rem), radial-gradient(circle at -10% 95%, rgba(100, 74, 40, .24), transparent 30rem), var(--bg); color: var(--ink); font-family: var(--sans); }
body::before { position: fixed; z-index: -1; inset: 0; content: ""; opacity: .25; background-image: radial-gradient(rgba(255,255,255,.16) .65px, transparent .75px); background-size: 5px 5px; pointer-events: none; }
button, a { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }

.app { min-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) clamp(18px, 5vw, 34px) max(28px, env(safe-area-inset-bottom)); }
.shell { width: min(100%, 700px); min-height: calc(100dvh - 46px); margin: 0 auto; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font: 11px/1 var(--mono); letter-spacing: .1em; }
.brand a { color: inherit; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; gap: 9px; color: #ded3be; font-weight: 700; letter-spacing: .04em; }
.brand-mark::before { width: 10px; height: 10px; border: 1px solid var(--gold); border-radius: 50%; box-shadow: 0 0 0 4px rgba(231,192,107,.1); content: ""; }
.eyebrow { margin: 0; color: var(--gold); font: 11px/1.2 var(--mono); letter-spacing: .13em; }
.primary, .secondary { width: 100%; border-radius: 12px; padding: 16px 18px; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.primary { border: 1px solid var(--gold); background: var(--gold); color: #20180b; font-weight: 760; }
.primary span { margin-left: 8px; font-size: 18px; line-height: 0; }
.primary:hover { background: var(--gold-pale); transform: translateY(-2px); }
.primary:active, .secondary:active, .answer:active { transform: scale(.985); }
.secondary { border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 650; }
.secondary:hover { border-color: rgba(231,192,107,.72); background: rgba(231,192,107,.06); }
.footnote { margin: 15px 0 0; color: var(--faint); font-size: 12px; line-height: 1.65; text-align: center; }

.intro { display: flex; flex-direction: column; justify-content: space-between; padding: 26px 0 20px; }
.intro-stage { display: grid; grid-template-columns: minmax(0, 1fr) 165px; align-items: end; gap: clamp(20px, 7vw, 58px); margin: auto 0; }
.intro-copy { max-width: 31rem; }
.intro h1 { max-width: 7em; margin: 15px 0 0; font: 700 clamp(52px, 11vw, 82px)/.98 var(--display); letter-spacing: -.075em; text-wrap: balance; }
.intro h1 em { color: var(--gold-pale); font-style: italic; font-weight: 500; }
.lead { max-width: 25em; margin: 27px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.intro .primary { margin-top: 34px; max-width: 310px; text-align: left; }
.identity-index { position: relative; overflow: hidden; min-height: 346px; border: 1px solid rgba(231,192,107,.35); border-radius: 18px 18px 4px 4px; padding: 19px 16px; background: linear-gradient(160deg, rgba(231,192,107,.13), rgba(33,29,22,.82) 55%); }
.identity-index::after { position: absolute; right: -29px; bottom: -36px; width: 118px; height: 118px; border: 1px solid rgba(231,192,107,.45); border-radius: 50%; box-shadow: 0 0 0 13px rgba(231,192,107,.04), 0 0 0 31px rgba(231,192,107,.025); content: ""; }
.identity-index > p { margin: 0; color: var(--gold); font: 10px/1.4 var(--mono); letter-spacing: .09em; }
.identity-index dl { margin: 34px 0 30px; }
.identity-index dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.identity-index dt { color: var(--ink); font: 600 29px/1 var(--display); letter-spacing: -.04em; }
.identity-index dd { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.identity-index small { position: relative; z-index: 1; color: var(--faint); font-size: 11px; line-height: 1.7; }
.intro-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--faint); font: 10px/1.4 var(--mono); letter-spacing: .07em; }

.quiz { display: flex; flex-direction: column; padding: 29px 0 20px; }
.progress { height: 2px; margin-top: 18px; overflow: hidden; background: rgba(245,238,225,.14); }
.progress > i { display: block; height: 100%; background: var(--gold); transition: width .24s ease; }
.question { width: min(100%, 570px); margin: auto 0; }
.question-caption { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.question-caption span, .quiz-tip { color: var(--faint); font-size: 12px; }
.question h1 { max-width: 10em; margin: 19px 0 0; font: 700 clamp(34px, 7.8vw, 55px)/1.18 var(--display); letter-spacing: -.055em; text-wrap: balance; }
.answers { display: grid; gap: 10px; margin-top: clamp(30px, 7vw, 46px); }
.answer { display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; align-items: center; gap: 13px; min-height: 76px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(255,255,255,.025); color: var(--ink); text-align: left; line-height: 1.48; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.answer:hover { border-color: rgba(231,192,107,.75); background: rgba(231,192,107,.08); transform: translateX(3px); }
.answer-key { display: inline-grid; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(231,192,107,.56); border-radius: 50%; color: var(--gold-pale); font: 11px/1 var(--mono); }
.answer b { color: var(--gold); font: 16px/1 var(--mono); font-weight: 400; }
.quiz-tip { margin: 0; text-align: right; }

.result { padding: 29px 0 30px; }
.result-card { position: relative; overflow: hidden; margin-top: 23px; border: 1px solid rgba(231,192,107,.34); border-radius: 21px 21px 5px 5px; padding: 21px; background: linear-gradient(135deg, rgba(231,192,107,.12), rgba(33,29,22,.94) 44%); }
.result-card::before { position: absolute; right: -95px; top: -105px; width: 260px; height: 260px; border: 1px solid rgba(231,192,107,.24); border-radius: 50%; box-shadow: 0 0 0 24px rgba(231,192,107,.025); content: ""; }
.result-heading { position: relative; z-index: 1; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 19px; align-items: end; }
.character-frame { width: 104px; height: 208px; margin: 0; overflow: hidden; border: 1px solid rgba(231,192,107,.32); border-radius: 52px 52px 9px 9px; background: rgba(231,192,107,.075); }
.character-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.result-title { padding-bottom: 8px; }
.result-title h1 { margin: 10px 0 0; font: 700 clamp(43px, 10vw, 66px)/1.03 var(--display); letter-spacing: -.07em; }
.secondary-type { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.result-description { position: relative; z-index: 1; max-width: 34em; margin: 22px 0 0; color: #ded5c6; font-size: 14px; line-height: 1.8; }
.chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 19px; }
.chips span { padding: 6px 8px; border: 1px solid rgba(231,192,107,.22); border-radius: 4px; color: var(--gold-pale); font: 10px/1 var(--mono); letter-spacing: .04em; }
.task { position: relative; z-index: 1; display: grid; gap: 7px; margin-top: 22px; padding: 12px 0 0 13px; border-top: 1px solid var(--line); border-left: 2px solid var(--gold); color: #eee5d6; font-size: 14px; line-height: 1.65; }
.task small { color: var(--gold); font: 10px/1.3 var(--mono); letter-spacing: .09em; }
.conversion { display: grid; grid-template-columns: 91px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(33,29,22,.7); }
.qr { display: block; width: 91px; height: 91px; border-radius: 4px; background: #fff; object-fit: cover; }
.conversion p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.conversion .conversion-kicker { margin-bottom: 6px; color: var(--ink); font-weight: 700; font-size: 14px; }
.conversion strong { color: var(--gold-pale); font-weight: 700; }
.actions { display: grid; gap: 9px; margin-top: 13px; }
.share-hint { margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(231,192,107,.06); color: var(--muted); font-size: 12px; line-height: 1.6; }
.poster-preview { margin-top: 16px; }
.poster-preview[hidden] { display: none; }
.poster-preview img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.poster-preview p { margin: 10px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.compatibility-screen { display: flex; flex-direction: column; justify-content: center; min-height: calc(100dvh - 46px); }
.compatibility-screen h1 { max-width: 8em; margin: 15px 0 0; font: 700 clamp(47px, 11vw, 72px)/1.03 var(--display); letter-spacing: -.075em; }
.compatibility-screen p:not(.eyebrow) { max-width: 25em; color: var(--muted); line-height: 1.8; }
.compatibility-screen .compatibility-note { margin-top: 30px; color: var(--faint); font-size: 12px; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100vw - 36px); border: 1px solid rgba(231,192,107,.35); border-radius: 9px; padding: 11px 14px; background: #2b251b; color: #f6dfab; box-shadow: 0 18px 42px rgba(0,0,0,.33); font-size: 13px; }
.consent { position: fixed; z-index: 20; inset: auto 16px max(16px, env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 520px); margin: auto; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #282218; box-shadow: 0 18px 55px rgba(0,0,0,.5); }
.consent p { margin: 0; color: #ded5c6; font-size: 13px; line-height: 1.6; }
.consent a { color: var(--gold-pale); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.consent-actions button { border-radius: 8px; padding: 11px; }
.consent-no { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.consent-yes { border: 1px solid var(--gold); background: var(--gold); color: #20180b; font-weight: 700; }

@media (min-width: 760px) { .app { padding-inline: 38px; } .shell { min-height: calc(100dvh - 56px); } .result-card { padding: 29px; } .result-heading { grid-template-columns: 132px minmax(0, 1fr); gap: 25px; } .character-frame { width: 132px; height: 264px; } }
@media (max-width: 430px) { .intro-stage { grid-template-columns: minmax(0, 1fr) 120px; gap: 13px; } .intro h1 { font-size: clamp(48px, 13.5vw, 62px); } .identity-index { min-height: 310px; padding: 15px 12px; } .identity-index dl { margin: 24px 0; } .identity-index dt { font-size: 25px; } .intro-footer { font-size: 9px; } }
@media (max-width: 355px) { .app { padding-inline: 15px; } .intro-stage { grid-template-columns: 1fr; } .identity-index { display: none; } .result-heading { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; } .character-frame { width: 88px; height: 176px; } .conversion { grid-template-columns: 78px minmax(0, 1fr); } .qr { width: 78px; height: 78px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
