@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&family=Noto+Serif+SC:wght@500;600;700;900&display=swap');

:root {
  --night: #180f11;
  --night-deep: #10090a;
  --wine: #421620;
  --wine-soft: #662130;
  --red: #d04b64;
  --red-bright: #ef6d83;
  --gold: #cdb27d;
  --gold-soft: #ead9b7;
  --ivory: #f6eee1;
  --muted: #afa097;
  --line: rgba(218, 192, 140, .2);
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--night); color: var(--ivory); font-family: var(--sans); }
body { overflow-x: hidden; }
button { font: inherit; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(126, 32, 48, .55), transparent 34%),
    radial-gradient(circle at 4% 58%, rgba(94, 53, 31, .18), transparent 35%),
    radial-gradient(circle at 96% 50%, rgba(112, 23, 39, .22), transparent 32%),
    linear-gradient(135deg, #130b0d 0%, #1d1012 44%, #11090a 100%);
}
.ambient::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.app-shell { width: min(520px, 100%); min-height: 100vh; margin: 0 auto; padding: 26px 22px 48px; }
.screen { display: none; min-height: calc(100vh - 74px); animation: screen-in .48s cubic-bezier(.16, 1, .3, 1); }
.screen.is-active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.masthead, .result-header, .quiz-topbar { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 600 9px/1 var(--sans); letter-spacing: .16em; }
.masthead, .result-header { border-bottom: 1px solid var(--line); padding-bottom: 15px; }

/* Intro */
.intro-layout { display: flex; min-height: calc(100vh - 155px); flex-direction: column; align-items: center; padding-top: clamp(44px, 10vh, 104px); text-align: center; }
.intro-seal { position: relative; display: grid; width: 68px; height: 68px; margin-bottom: 17px; place-items: center; border: 1px solid rgba(205, 178, 125, .65); transform: rotate(45deg); box-shadow: inset 0 0 0 4px rgba(29, 16, 18, .9), 0 0 32px rgba(205, 178, 125, .11); }
.intro-seal span { color: var(--gold-soft); font: 700 22px var(--serif); transform: rotate(-45deg); }
.intro-seal i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 13px var(--red); }
.intro-seal small { position: absolute; bottom: -24px; color: #887a69; font: 700 8px var(--sans); letter-spacing: .18em; transform: rotate(-45deg); }
.intro-kicker { margin: 12px 0 10px; color: var(--gold); font: 600 11px var(--sans); letter-spacing: .2em; }
.intro-layout h1 { margin: 0; color: var(--gold-soft); font: 700 clamp(42px, 10vw, 60px)/1.12 var(--serif); letter-spacing: -.075em; }
.intro-layout h1 i { color: var(--red); font-style: normal; font-size: .72em; }
.hero-caption { margin: 12px 0 0; color: #c4b6a6; font-size: 12px; letter-spacing: .06em; }
.intro-radar { position: relative; display: grid; width: 166px; height: 166px; margin: 18px 0 15px; place-items: center; background: linear-gradient(30deg, transparent 49.2%, rgba(205,178,125,.35) 49.5%, rgba(205,178,125,.35) 50.5%, transparent 50.8%), linear-gradient(-30deg, transparent 49.2%, rgba(205,178,125,.35) 49.5%, rgba(205,178,125,.35) 50.5%, transparent 50.8%), repeating-radial-gradient(circle, transparent 0 19px, rgba(205,178,125,.16) 20px 21px); clip-path: polygon(50% 0, 89% 18%, 100% 58%, 72% 96%, 28% 96%, 0 58%, 11% 18%); filter: drop-shadow(0 10px 22px rgba(208,75,100,.18)); }
.intro-radar::before { content: ''; position: absolute; width: 72px; height: 72px; border: 1px solid rgba(239,109,131,.64); transform: rotate(45deg); }
.intro-radar span { z-index: 1; color: var(--gold-soft); font: 800 38px var(--serif); text-shadow: 0 0 18px rgba(205,178,125,.35); }
.lede { width: 100%; margin: 0; padding: 19px 19px; border: 1px solid rgba(205, 178, 125, .22); background: rgba(18, 10, 12, .6); box-shadow: 0 20px 50px rgba(0, 0, 0, .22); color: #c4b8aa; text-align: left; font: 14px/1.9 var(--sans); }
.intro-meta { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 14px 0; border: 1px solid rgba(205, 178, 125, .2); background: rgba(205, 178, 125, .2); }
.intro-meta div { padding: 13px 5px; background: rgba(27, 14, 16, .9); }
.intro-meta small { display: block; color: #968979; font-size: 9px; }
.intro-meta strong { display: block; margin-top: 7px; color: var(--gold-soft); font: 700 14px var(--serif); white-space: nowrap; }
.primary-cta { display: flex; width: 100%; align-items: center; justify-content: center; gap: 22px; padding: 16px 20px; border: 1px solid rgba(240, 112, 135, .7); background: linear-gradient(105deg, #a92e43, #d34963 52%, #af2f48); box-shadow: 0 12px 28px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.18); color: #fff9ef; cursor: pointer; font: 800 16px var(--sans); letter-spacing: .1em; transition: transform .2s, filter .2s; }
.primary-cta:hover { filter: brightness(1.12); transform: translateY(-2px); }
.primary-cta b { font-size: 20px; font-weight: 500; }
.text-toggle { margin: 20px auto 0; border: 0; background: transparent; color: var(--gold); cursor: pointer; font: 12px var(--sans); letter-spacing: .12em; }
.text-toggle span { color: var(--red-bright); margin-left: 5px; }
.info-panel { max-height: 0; width: 100%; overflow: hidden; transition: max-height .42s ease; text-align: left; }
.info-panel.is-open { max-height: 260px; }
.info-panel p { margin: 12px 0 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: rgba(49, 24, 29, .7); color: #c7b9ad; font: 12px/1.8 var(--sans); }
.info-panel .note { border-color: var(--red); color: #edb7c1; }
.intro-footer { margin-top: 28px; color: #897a70; text-align: center; font: 10px/1.7 var(--sans); }

/* Quiz */
.screen--quiz { display: none; flex-direction: column; }
.screen--quiz.is-active { display: flex; }
.quiz-topbar { gap: 13px; padding: 3px 0 18px; border-bottom: 1px solid var(--line); }
.quiz-mark { color: var(--gold); font: 700 16px var(--serif); }
.quiz-mark--right { color: var(--red-bright); font-size: 10px; }
.progress-wrap { flex: 1; }
.progress { height: 3px; overflow: hidden; background: rgba(205,178,125,.17); }
.progress i { display: block; width: 2%; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); box-shadow: 0 0 13px rgba(239,109,131,.62); transition: width .3s ease; }
.progress-label { display: flex; justify-content: space-between; margin-top: 10px; color: #a99686; font-size: 10px; letter-spacing: .12em; }
.progress-label b { color: var(--gold-soft); font-weight: 700; }
.question-wrap { flex: 1; padding-top: clamp(68px, 14vh, 136px); }
.question-kicker { margin: 0 0 19px; color: var(--red-bright); font: 600 10px var(--sans); letter-spacing: .16em; }
.question-wrap h2 { min-height: 4.1em; margin: 0; color: var(--ivory); font: 700 clamp(31px, 8.2vw, 48px)/1.35 var(--serif); letter-spacing: -.055em; }
.question-wrap.is-choice { padding-top: clamp(42px, 8vh, 80px); }
.question-wrap.is-choice h2 { min-height: auto; font-size: clamp(27px, 6.8vw, 39px); }
.question-wrap.is-choice .likert-wrap { margin-top: 30px; }
.likert-wrap { margin-top: clamp(52px, 9vh, 88px); }
.likert-scale { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.likert-scale::before { content: ''; position: absolute; right: 22px; left: 22px; height: 1px; background: linear-gradient(90deg, rgba(205,178,125,.25), rgba(239,109,131,.58)); }
.likert-choice { position: relative; z-index: 1; display: grid; width: 62px; padding: 0; place-items: center; border: 0; background: transparent; color: #8f8177; cursor: pointer; }
.likert-orb { display: grid; width: 35px; height: 35px; place-items: center; border: 2px solid rgba(234,217,183,.58); border-radius: 50%; background: #1b1012; box-shadow: 0 6px 18px rgba(0,0,0,.3); color: #fff7eb; font: 700 14px var(--sans); transition: .2s ease; }
.likert-choice:first-child .likert-orb, .likert-choice:last-child .likert-orb { width: 56px; height: 56px; }
.likert-choice:nth-child(2) .likert-orb, .likert-choice:nth-child(4) .likert-orb { width: 45px; height: 45px; }
.likert-choice.is-selected .likert-orb { border-color: var(--red-bright); background: linear-gradient(135deg, #d44861, #8d273b); box-shadow: 0 0 0 5px rgba(226,79,107,.13), 0 8px 22px rgba(208,75,100,.28); color: white; transform: translateY(-4px); }
.likert-choice:hover .likert-orb { border-color: var(--gold-soft); transform: translateY(-2px); }
.likert-text { position: absolute; top: 68px; display: none; width: 84px; color: #aa9a8e; font-size: 9px; white-space: nowrap; }
.likert-choice.is-selected .likert-text { display: block; color: var(--red-bright); }
.likert-endpoints { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 26px; color: #a99a90; font-size: 12px; }
.likert-endpoints span:last-child { color: var(--red-bright); text-align: right; }
.likert-endpoints strong { color: var(--gold-soft); font: 600 10px var(--sans); letter-spacing: .04em; }
.likert-endpoints[hidden] { display: none; }
.choice-list { display: grid; gap: 10px; }
.answer-card { display: grid; grid-template-columns: 30px 1fr 22px; gap: 11px; width: 100%; align-items: start; padding: 14px 14px; border: 1px solid rgba(205,178,125,.19); background: rgba(28,16,18,.72); box-shadow: 0 7px 20px rgba(0,0,0,.12); color: #d8cec2; text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.answer-card:hover { border-color: rgba(205,178,125,.55); background: rgba(50,27,30,.8); transform: translateX(3px); }
.answer-card.is-selected { border-color: var(--red-bright); background: linear-gradient(100deg, rgba(103,30,45,.72), rgba(48,23,28,.92)); box-shadow: 0 0 0 3px rgba(208,75,100,.08), 0 10px 25px rgba(0,0,0,.2); }
.answer-index { color: var(--gold); font: 700 10px/1.7 var(--sans); letter-spacing: .08em; }
.answer-text { font: 500 13px/1.68 var(--sans); }
.answer-card.is-selected .answer-text { color: #fff2e7; }
.answer-check { color: var(--red-bright); font: 800 15px/1.45 var(--sans); text-align: right; }
.quiz-footer { display: block; margin-top: 34px; }
.nav-button { padding: 16px 14px; border: 1px solid rgba(205,178,125,.36); background: transparent; color: var(--gold-soft); cursor: pointer; font: 700 16px var(--serif); transition: .2s ease; }
.nav-button--back { width: 100%; }
.nav-button:disabled { cursor: not-allowed; opacity: .26; }
.nav-button:not(:disabled):hover { background: rgba(205,178,125,.12); transform: translateY(-1px); }

/* Result */
.result-kicker { margin: 28px 0 11px; color: var(--gold); text-align: center; font: 700 10px var(--sans); letter-spacing: .22em; }
.result-hero { text-align: center; }
.result-hero h2 { margin: 0; color: var(--gold-soft); font: 700 clamp(25px, 7vw, 34px)/1.25 var(--serif); letter-spacing: -.055em; white-space: nowrap; }
.result-hero h2 i { color: var(--red-bright); font-style: normal; font-size: .72em; margin: 0 6px; }
.result-hero::after { content: '✦  SEVEN SINS × VIRTUES  ✦'; display: block; margin-top: 18px; color: #76695e; font-size: 9px; letter-spacing: .16em; }
.result-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 13px; }
.result-card { position: relative; min-height: 143px; padding: 20px 12px; overflow: hidden; border: 1px solid; text-align: center; }
.result-card::before { content: ''; position: absolute; top: -34px; left: 50%; width: 110px; height: 110px; border: 1px solid currentColor; border-radius: 50%; opacity: .12; transform: translateX(-50%); }
.result-card .card-label, .result-card > span:last-child { position: relative; display: block; }
.result-card .card-label { margin-bottom: 12px; color: #b6a89c; font-size: 10px; }
.result-card strong { position: relative; display: block; font: 700 31px var(--serif); }
.result-card > span:last-child { margin-top: 8px; font-size: 13px; }
.result-card--sin { border-color: rgba(216,199,164,.42); background: linear-gradient(145deg, #1a1112, #2d1c1c); color: var(--gold-soft); }
.result-card--sin > span:last-child { color: #d5c3a0; }
.result-card--virtue { border-color: rgba(239,109,131,.6); background: linear-gradient(145deg, #3b1520, #5a202e); color: #ffbdc9; box-shadow: 0 10px 25px rgba(80,20,33,.25); }
.result-card--virtue .card-label { color: #e1a1ad; }
.result-card--virtue > span:last-child { color: var(--red-bright); }
.result-balance { margin: 9px 0 26px; color: #b7a99e; text-align: center; font-size: 12px; letter-spacing: .06em; }
.radar-section, .detail-section, .result-guide { padding-top: 24px; border-top: 1px solid var(--line); }
.section-title { margin: 0 0 8px; color: var(--gold-soft); font: 700 17px var(--serif); letter-spacing: .04em; }
.section-title::before { content: '✦'; margin-right: 7px; color: var(--red-bright); font-size: .9em; }
.radar-wrap { height: 410px; margin: 9px -15px -2px; }
.radar-wrap canvas { display: block; width: 100%; height: 100%; }
.detail-section [data-detail-list] { margin-top: 16px; }
.detail-group { margin-top: 19px; padding: 14px 16px; border: 1px solid; font: 700 19px var(--serif); }
.detail-group--sin { border-color: rgba(216,199,164,.24); background: rgba(216,199,164,.09); color: var(--gold-soft); }
.detail-group--virtue { border-color: rgba(239,109,131,.34); background: rgba(121,37,54,.35); color: #ffc2cc; }
.detail-row { padding: 25px 0; border-bottom: 1px solid rgba(205,178,125,.16); }
.detail-head { display: flex; align-items: baseline; justify-content: space-between; }
.detail-name { margin: 0; color: var(--ivory); font: 700 22px var(--serif); }
.detail-score { font: 800 32px/1 var(--serif); }
.detail-row--sin .detail-score { color: var(--gold-soft); }
.detail-row--virtue .detail-score { color: var(--red-bright); }
.detail-bar { height: 7px; margin: 15px 0 14px; overflow: hidden; border-radius: 999px; background: rgba(242,234,219,.11); }
.detail-fill { display: block; height: 100%; border-radius: inherit; transition: width .65s cubic-bezier(.16, 1, .3, 1); }
.detail-row--sin .detail-fill { background: linear-gradient(90deg, #9c8a6d, #e1ceaa); box-shadow: 0 0 10px rgba(225,206,170,.26); }
.detail-row--virtue .detail-fill { background: linear-gradient(90deg, #a92f47, #f16b82); box-shadow: 0 0 12px rgba(241,107,130,.3); }
.detail-desc { margin: 0; color: #d6cbc0; font: 500 14px/1.95 var(--sans); }
.result-guide { margin-top: 22px; }
.result-guide p { margin: 0 0 14px; color: #d6cbc0; font: 500 14px/1.9 var(--sans); }
.result-actions { display: grid; grid-template-columns: 1fr 106px; gap: 12px; margin-top: 24px; }
.secondary-cta { border: 1px solid rgba(205,178,125,.42); background: rgba(31,17,20,.72); color: var(--gold-soft); cursor: pointer; font: 700 13px var(--sans); }
.secondary-cta:hover { border-color: var(--gold); background: rgba(205,178,125,.1); }
.result-notice { margin-top: 15px; padding: 15px; border-left: 2px solid var(--red); background: rgba(95,29,43,.36); color: #d3adb4; font: 12px/1.8 var(--sans); }
.result-notice b { color: #ffc2cc; }
.auth-mask { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 22px; background: rgba(7,3,4,.86); backdrop-filter: blur(9px); }
.auth-mask.is-visible { display: flex; animation: screen-in .25s ease; }
.auth-modal { width: min(390px,100%); padding: 30px 25px 24px; border: 1px solid rgba(205,178,125,.38); background: linear-gradient(145deg,#201215,#120b0c); box-shadow: 0 30px 80px rgba(0,0,0,.55); text-align: center; }
.auth-seal { display: grid; width: 56px; height: 56px; margin: 0 auto 18px; place-items: center; border: 1px solid var(--gold); color: var(--gold-soft); font: 700 18px var(--serif); transform: rotate(45deg); }
.auth-seal span { transform: rotate(-45deg); }
.auth-modal h2 { margin: 0; color: var(--gold-soft); font: 700 26px var(--serif); }
.auth-modal > p { margin: 10px 0 18px; color: #a99b90; font: 12px/1.7 var(--sans); }
.auth-modal input { width: 100%; padding: 14px 12px; border: 1px solid rgba(205,178,125,.38); outline: none; background: #10090a; color: var(--ivory); text-align: center; font: 800 29px var(--serif); letter-spacing: .55em; text-indent: .55em; }
.auth-modal input:focus { border-color: var(--red-bright); box-shadow: 0 0 0 3px rgba(208,75,100,.12); }
.auth-modal .auth-error { min-height: 22px; margin: 8px 0 10px; color: var(--red-bright); }
.auth-modal .primary-cta { margin-top: 0; }
.auth-close { margin-top: 15px; border: 0; background: transparent; color: #9c8d83; cursor: pointer; font-size: 12px; }
.auth-close:hover { color: var(--gold-soft); }
.toast { position: fixed; z-index: 5; bottom: 23px; left: 50%; max-width: min(450px, calc(100vw - 36px)); padding: 12px 16px; border: 1px solid rgba(205,178,125,.35); background: #2b171b; box-shadow: 0 12px 32px rgba(0,0,0,.35); color: var(--gold-soft); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: .22s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .app-shell { padding: 20px 17px 40px; }
  .intro-layout { padding-top: 58px; }
  .intro-layout h1 { font-size: 43px; }
  .intro-radar { width: 150px; height: 150px; }
  .question-wrap { padding-top: 80px; }
  .question-wrap h2 { font-size: 31px; }
  .question-wrap.is-choice { padding-top: 44px; }
  .question-wrap.is-choice h2 { font-size: 27px; line-height: 1.42; }
  .question-wrap.is-choice .likert-wrap { margin-top: 24px; }
  .answer-card { padding: 13px 12px; }
  .answer-text { font-size: 12px; }
  .likert-choice { width: 54px; }
  .likert-choice:first-child .likert-orb, .likert-choice:last-child .likert-orb { width: 48px; height: 48px; }
  .likert-choice:nth-child(2) .likert-orb, .likert-choice:nth-child(4) .likert-orb { width: 40px; height: 40px; }
  .likert-orb { width: 30px; height: 30px; }
  .likert-scale::before { right: 18px; left: 18px; }
  .likert-endpoints { font-size: 10px; }
  .likert-endpoints strong { font-size: 8px; }
  .radar-wrap { height: 360px; }
  .result-hero h2 { font-size: 25px; }
  .detail-desc, .result-guide p { font-size: 13px; }
}
