:root {
  --cream: #fff9f0;
  --cream-deep: #f5ead8;
  --peach: #f3c8ca;
  --lavender: #ddd5ec;
  --mint: #cfe4d8;
  --yellow: #f3e3a8;
  --blue: #d8e6ea;
  --ink: #453b38;
  --ink-soft: #776a65;
  --line: rgba(69, 59, 56, .16);
  --shadow: 0 18px 50px rgba(104, 78, 64, .12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --pixel-shadow: 4px 4px 0 rgba(69, 59, 56, .16);
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: "Courier New", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-number: "Arial Black", Impact, "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: #e9dfd2; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 8% 8%, rgba(243, 200, 202, .34), transparent 29rem),
    radial-gradient(circle at 93% 68%, rgba(207, 228, 216, .42), transparent 34rem),
    #e9dfd2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { color: inherit; font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid rgba(69, 59, 56, .34); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: .62;
}
.ambient-a { top: -85px; left: -70px; background: var(--peach); }
.ambient-b { right: -90px; bottom: -80px; background: var(--blue); }

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}
.app-frame {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(rgba(69, 59, 56, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 59, 56, .022) 1px, transparent 1px),
    var(--cream);
  background-size: 18px 18px;
  box-shadow: 0 0 80px rgba(78, 60, 50, .16);
}
.screen {
  display: none;
  min-height: 100dvh;
  animation: screenIn .44s cubic-bezier(.22, .8, .3, 1) both;
}
.screen.is-active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.archive-card {
  position: relative;
  border: 1px solid rgba(69, 59, 56, .14);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255,255,255,.52), rgba(255,249,240,.2)),
    rgba(255, 252, 245, .82);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.74);
}
.archive-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(69, 59, 56, .1);
  border-radius: calc(var(--radius-xl) - 8px);
  pointer-events: none;
}
.archive-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(69, 59, 56, .16);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(243, 227, 168, .38);
  font: 700 10px/1 var(--font-display);
  letter-spacing: .1em;
}
.archive-stamp::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 2px rgba(207, 228, 216, .35);
}
.archive-stamp.success { background: rgba(207, 228, 216, .56); }

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  font: 800 11px/1.5 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.primary-btn, .secondary-btn {
  width: 100%;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-btn {
  min-height: 58px;
  padding: 0 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #4a3d39;
  background: linear-gradient(135deg, var(--yellow), #f6d8cf 58%, var(--peach));
  box-shadow: 0 6px 0 rgba(69, 59, 56, .13), 0 12px 28px rgba(150, 104, 91, .16);
  border: 1px solid rgba(69, 59, 56, .13);
}
.primary-btn b { font-size: 21px; line-height: 1; }
.primary-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(69, 59, 56, .13); }
.secondary-btn {
  min-height: 54px;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(255, 252, 245, .86);
  border: 1px solid rgba(69, 59, 56, .18);
  box-shadow: var(--pixel-shadow);
}
.secondary-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(69, 59, 56, .13); }
.text-btn {
  border: 0;
  padding: 6px;
  color: var(--ink-soft);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Welcome */
#screen-welcome {
  padding: max(18px, env(safe-area-inset-top)) 17px max(18px, env(safe-area-inset-bottom));
}
.welcome-card {
  min-height: calc(100dvh - 36px);
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.welcome-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 230px;
  height: 230px;
  right: -100px;
  top: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(221,213,236,.68), rgba(221,213,236,0) 68%);
  pointer-events: none;
}
.loading-console {
  position: relative;
  z-index: 1;
  min-height: 33px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font: 700 10px/1.4 var(--font-display);
  letter-spacing: .08em;
}
.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--peach);
  box-shadow: 0 0 0 4px rgba(243,200,202,.25);
  animation: pulseDot .9s ease-in-out infinite alternate;
}
@keyframes pulseDot { to { transform: scale(1.5); opacity: .44; } }
.welcome-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity .45s ease, transform .45s ease;
}
.welcome-content.is-waiting { opacity: .25; transform: translateY(4px); }
.pixel-trophy {
  position: relative;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin: 8px 0 20px;
  border: 2px solid rgba(69,59,56,.18);
  border-radius: 22px;
  background: linear-gradient(145deg, var(--yellow), #f7d7cf 70%, var(--peach));
  box-shadow: 7px 7px 0 rgba(69,59,56,.11), inset 0 1px 0 rgba(255,255,255,.66);
}
.pixel-trophy::before, .pixel-trophy::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(255,249,240,.78);
  box-shadow: 0 0 0 2px rgba(69,59,56,.08);
}
.pixel-trophy::before { left: -5px; top: 22px; }
.pixel-trophy::after { right: -5px; bottom: 18px; }
.pixel-trophy span { font-size: 47px; filter: saturate(.78); transform: translateY(-1px); }
.welcome-content .eyebrow { margin-bottom: 8px; }
.welcome-content h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(35px, 10.6vw, 46px);
  line-height: 1.18;
  letter-spacing: -.05em;
  font-weight: 900;
}
.welcome-subtitle {
  margin: 17px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}
.stat-ribbon {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: center;
  padding: 13px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-ribbon div { display: grid; gap: 4px; }
.stat-ribbon strong { font: 900 22px/1 var(--font-number); letter-spacing: -.04em; }
.stat-ribbon span { color: var(--ink-soft); font-size: 10px; }
.stat-ribbon i { width: 1px; height: 27px; background: var(--line); }
.welcome-content blockquote {
  margin: 22px 0 18px;
  color: #6a5b56;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .03em;
}
.welcome-content .primary-btn { margin-top: auto; }
.resume-panel {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid rgba(69,59,56,.16);
  border-radius: 18px;
  background: rgba(216,230,234,.48);
  box-shadow: var(--pixel-shadow);
}
.resume-panel p { margin: 0 0 11px; font-size: 13px; line-height: 1.55; font-weight: 700; }
.resume-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resume-actions button { min-height: 42px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 800; }
.resume-actions .resume-main { background: var(--ink); color: var(--cream); }
.resume-actions .resume-reset { background: rgba(255,252,245,.72); }
.privacy-note {
  position: relative;
  z-index: 1;
  margin: 14px 5px 0;
  color: rgba(69,59,56,.52);
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

/* Test */
#screen-test { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.test-header {
  position: sticky;
  z-index: 5;
  top: 0;
  padding: max(14px, env(safe-area-inset-top)) 17px 13px;
  background: rgba(255,249,240,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(69,59,56,.08);
}
.test-nav { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,252,245,.8);
  font-size: 29px;
  line-height: 1;
  box-shadow: 2px 2px 0 rgba(69,59,56,.08);
  cursor: pointer;
}
.icon-btn:disabled { opacity: .25; }
.test-meta { display: grid; gap: 2px; text-align: center; font-family: var(--font-display); }
.test-meta span:first-child { color: var(--ink-soft); font-size: 10px; letter-spacing: .12em; }
.test-meta b { color: var(--ink); }
.test-meta span:last-child { overflow: hidden; color: rgba(69,59,56,.5); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.chapter-mini-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--mint);
  font-size: 19px;
}
.life-progress {
  position: relative;
  height: 9px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(69,59,56,.14);
  border-radius: 999px;
  background: rgba(69,59,56,.07);
}
.life-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--yellow) 52%, var(--peach));
  box-shadow: 0 0 12px rgba(243,200,202,.65);
  transition: width .45s cubic-bezier(.2,.8,.3,1);
}
.progress-glints { position: absolute; inset: 0; pointer-events: none; }
.progress-glints span { position: absolute; top: 1px; width: 2px; height: 5px; background: rgba(255,255,255,.66); }
.progress-glints span:nth-child(1) { left: 21%; }
.progress-glints span:nth-child(2) { left: 50%; }
.progress-glints span:nth-child(3) { left: 77%; }
.question-wrap {
  min-height: calc(100dvh - 105px);
  padding: 28px 17px 0;
  display: flex;
  flex-direction: column;
}
.question-stage { flex: 1; }
.chapter-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 33px;
  padding-bottom: 11px;
  border-bottom: 1px dashed rgba(69,59,56,.16);
  color: var(--ink-soft);
  font: 800 10px/1.3 var(--font-display);
  letter-spacing: .1em;
}
.chapter-line span:last-child { letter-spacing: 0; }
.question-number {
  margin: 0 0 10px;
  color: rgba(69,59,56,.24);
  font: 900 38px/1 var(--font-number);
  letter-spacing: -.06em;
}
.question-title {
  min-height: 76px;
  margin: 0 0 28px;
  font-size: clamp(24px, 7.1vw, 30px);
  line-height: 1.36;
  letter-spacing: -.035em;
  font-weight: 850;
}
.options-list { display: grid; gap: 13px; }
.option-card {
  position: relative;
  width: 100%;
  min-height: 76px;
  padding: 15px 45px 15px 58px;
  overflow: hidden;
  border: 1px solid rgba(69,59,56,.14);
  border-radius: 20px;
  background: rgba(255,252,245,.8);
  box-shadow: 0 5px 0 rgba(69,59,56,.07), 0 10px 25px rgba(104,78,64,.05);
  color: var(--ink);
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  animation: optionIn .38s cubic-bezier(.22,.8,.3,1) both;
}
.option-card:nth-child(2) { animation-delay: .05s; }
.option-card:nth-child(3) { animation-delay: .1s; }
.option-card:nth-child(4) { animation-delay: .15s; }
@keyframes optionIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.option-card::before {
  content: attr(data-label);
  position: absolute;
  left: 15px;
  top: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 10px;
  background: var(--option-color, var(--blue));
  color: #4a3d39;
  font: 900 12px/1 var(--font-display);
  box-shadow: inset 0 -1px 0 rgba(69,59,56,.12);
}
.option-card:nth-child(1) { --option-color: var(--mint); }
.option-card:nth-child(2) { --option-color: var(--yellow); }
.option-card:nth-child(3) { --option-color: var(--blue); }
.option-card:nth-child(4) { --option-color: var(--lavender); }
.option-card::after {
  content: "✦";
  position: absolute;
  right: 18px;
  top: 50%;
  opacity: 0;
  color: #a8865a;
  transform: translateY(-50%) scale(.6);
}
.option-card:active, .option-card.is-selected {
  transform: scale(1.018);
  border-color: rgba(69,59,56,.38);
  background: #fffaf1;
  box-shadow: 0 6px 0 rgba(69,59,56,.12), 0 15px 32px rgba(104,78,64,.1);
}
.option-card.is-selected::after { opacity: 1; transform: translateY(-50%) scale(1); animation: sparkle .35s ease both; }
@keyframes sparkle { 50% { transform: translateY(-50%) scale(1.4) rotate(18deg); } }
.tap-hint { margin: 22px 0 0; color: rgba(69,59,56,.42); font-size: 10px; text-align: center; }

/* Chapter transition */
.chapter-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  background: rgba(255,249,240,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity .3s ease, visibility .3s ease;
}
.chapter-overlay.is-visible { opacity: 1; visibility: visible; }
.chapter-transition { width: min(100%, 390px); text-align: center; animation: chapterUp .65s cubic-bezier(.22,.8,.3,1) both; }
@keyframes chapterUp { from { opacity: .15; transform: translateY(15px) scale(.98); } to { opacity: 1; transform: none; } }
.chapter-transition > span { color: var(--ink-soft); font: 800 11px/1 var(--font-display); letter-spacing: .2em; }
.transition-icon {
  width: 94px;
  height: 94px;
  margin: 23px auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(69,59,56,.13);
  border-radius: 30px;
  background: var(--mint);
  box-shadow: 7px 7px 0 rgba(69,59,56,.1);
  font-size: 46px;
}
.chapter-transition h2 { margin: 0 0 15px; font-size: 35px; letter-spacing: -.05em; }
.chapter-transition p { margin: 0 auto; max-width: 290px; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }

/* Generating */
.generating-screen { display: none; padding: max(18px, env(safe-area-inset-top)) 17px max(18px, env(safe-area-inset-bottom)); }
.generating-screen.is-active { display: grid; place-items: center; }
.generating-card {
  width: 100%;
  min-height: 650px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.archive-box {
  position: relative;
  width: 120px;
  height: 104px;
  margin: 35px 0 30px;
  border: 2px solid rgba(69,59,56,.28);
  border-radius: 17px;
  background: linear-gradient(155deg, var(--yellow), #f1cbc0);
  box-shadow: 9px 9px 0 rgba(69,59,56,.1), inset 0 1px 0 rgba(255,255,255,.7);
  animation: archiveFloat 2.2s ease-in-out infinite;
}
@keyframes archiveFloat { 50% { transform: translateY(-6px); } }
.box-lid { position: absolute; left: -7px; right: -7px; top: -14px; height: 25px; border: 2px solid rgba(69,59,56,.24); border-radius: 10px; background: #e9d9ae; }
.box-slot { position: absolute; left: 25px; right: 25px; top: -4px; height: 6px; border-radius: 4px; background: rgba(69,59,56,.29); }
.box-label { position: absolute; left: 50%; top: 55%; transform: translate(-50%,-50%); padding: 5px 8px; border: 1px solid rgba(69,59,56,.18); background: rgba(255,249,240,.64); font: 900 12px/1 var(--font-display); letter-spacing: .12em; }
.generating-card h2 { margin: 8px 0 24px; font-size: 21px; line-height: 1.5; }
.generation-list { width: min(100%, 310px); margin: 0; padding: 0; list-style: none; text-align: left; }
.generation-list li { display: flex; align-items: center; gap: 10px; min-height: 38px; color: rgba(69,59,56,.38); font-size: 13px; font-weight: 700; transition: color .3s ease; }
.generation-list li span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid rgba(69,59,56,.12); border-radius: 7px; background: rgba(69,59,56,.05); font-size: 11px; }
.generation-list li.is-done { color: var(--ink); }
.generation-list li.is-done span { border-color: rgba(80,128,105,.22); background: var(--mint); animation: checkPop .32s ease both; }
@keyframes checkPop { 50% { transform: scale(1.16) rotate(-4deg); } }
.generation-complete { min-height: 22px; margin: 20px 0 14px; color: #5a7967; font-size: 12px; font-weight: 800; opacity: 0; transition: opacity .35s ease; }
.generation-complete.is-visible { opacity: 1; }
.generation-btn { max-width: 330px; opacity: .42; transition: opacity .35s ease, transform .18s ease; }
.generation-btn:not(:disabled) { opacity: 1; }

/* Results */
.result-screen { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom)); }
.result-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 15px; color: var(--ink-soft); font: 800 10px/1 var(--font-display); letter-spacing: .15em; }
.result-toolbar .text-btn { font-size: 11px; letter-spacing: 0; }
.result-hero { padding: 22px 21px 24px; text-align: center; overflow: hidden; }
.result-hero::after { content: ""; position: absolute; z-index: 0; inset: auto -40px -70px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(243,200,202,.5), transparent 70%); pointer-events: none; }
.result-hero > * { position: relative; z-index: 1; }
.total-score { margin: 15px 0 5px; font: 900 clamp(72px, 23vw, 102px)/.9 var(--font-number); letter-spacing: -.1em; text-shadow: 4px 4px 0 rgba(69,59,56,.07); }
.total-score small { margin-left: 3px; font-size: .38em; letter-spacing: -.04em; }
.total-caption { min-height: 23px; margin: 0; color: var(--ink-soft); font-size: 13px; }
.level-plate { display: inline-flex; align-items: center; gap: 13px; margin: 20px 0 14px; padding: 11px 17px 11px 12px; border: 1px solid var(--line); border-radius: 17px; background: rgba(243,227,168,.38); text-align: left; box-shadow: 3px 3px 0 rgba(69,59,56,.08); }
.level-plate > span { padding: 8px 9px; border-radius: 11px; background: var(--ink); color: var(--cream); font: 900 12px/1 var(--font-number); }
.level-plate div { display: grid; gap: 3px; }
.level-plate strong { font-size: 15px; }
.level-plate em { color: var(--ink-soft); font-size: 10px; font-style: normal; }
.result-copy { max-width: 350px; margin: 0 auto; color: var(--ink-soft); font-size: 12px; line-height: 1.75; }
.result-section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; }
.section-heading > span { width: 33px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--mint); font: 900 11px/1 var(--font-number); }
.section-heading p { margin: 0 0 2px; color: var(--ink-soft); font: 800 9px/1 var(--font-display); letter-spacing: .16em; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.map-results { display: grid; gap: 10px; }
.map-row { padding: 14px 14px 13px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,252,245,.7); box-shadow: 2px 3px 0 rgba(69,59,56,.05); }
.map-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.map-row-head span { display: flex; align-items: center; gap: 8px; }
.map-row-head strong { font: 900 18px/1 var(--font-number); }
.map-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(69,59,56,.08); }
.map-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--stripe, var(--mint)), rgba(255,255,255,.8)); transition: width .8s cubic-bezier(.2,.8,.3,1); }
.radar-card { padding: 18px 16px; }
.radar-wrap { width: 100%; max-width: 330px; margin: 0 auto 6px; }
.radar-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.attribute-results { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; margin-top: 11px; }
.attribute-item { display: grid; gap: 5px; }
.attribute-item-head { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 10px; }
.attribute-item-head strong { color: var(--ink); font: 900 12px/1 var(--font-number); }
.attribute-bar { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(69,59,56,.08); }
.attribute-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--attribute-color, var(--lavender)); transition: width .8s ease; }
.achievement-summary { padding: 18px; }
.achievement-summary > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.achievement-summary strong { font: 900 33px/1 var(--font-number); letter-spacing: -.06em; }
.achievement-summary span { color: var(--ink-soft); font-size: 11px; }
.achievement-meter { height: 9px; margin: 14px 0 12px; overflow: hidden; border-radius: 99px; background: rgba(69,59,56,.08); }
.achievement-meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--yellow), var(--peach)); transition: width .9s ease; }
.achievement-summary p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.filter-row { display: flex; gap: 7px; margin: 13px 0 12px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-btn { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,252,245,.7); color: var(--ink-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
.filter-btn.is-active { color: var(--ink); background: var(--lavender); border-color: rgba(69,59,56,.22); }
.achievement-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.achievement-tile { min-height: 108px; padding: 12px 7px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,252,245,.72); text-align: center; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.achievement-tile:active { transform: scale(.98); }
.achievement-tile.is-locked { color: rgba(69,59,56,.38); background: rgba(69,59,56,.035); border-style: dashed; }
.achievement-medal { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; background: var(--yellow); box-shadow: 3px 3px 0 rgba(69,59,56,.1); font-size: 18px; }
.achievement-tile.is-locked .achievement-medal { background: rgba(69,59,56,.08); box-shadow: none; filter: grayscale(1); }
.achievement-tile strong { font-size: 11px; line-height: 1.35; }
.achievement-stars { color: #b58b50; font-size: 8px; letter-spacing: .08em; }
.title-card { padding: 26px 21px 21px; text-align: center; overflow: hidden; }
.title-card::after { content: ""; position: absolute; z-index: 0; inset: -90px -50px auto; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(207,228,216,.72), transparent 68%); }
.title-card > * { position: relative; z-index: 1; }
.title-icon { width: 69px; height: 69px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 22px; background: var(--lavender); box-shadow: 5px 5px 0 rgba(69,59,56,.09); font-size: 34px; }
.title-card > p { margin: 0 0 5px; color: var(--ink-soft); font-size: 10px; }
.title-card h3 { margin: 0 0 18px; font-size: 29px; line-height: 1.27; letter-spacing: -.05em; }
.title-card blockquote { margin: 0; padding-top: 17px; border-top: 1px dashed rgba(69,59,56,.16); color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.sub-titles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 15px; }
.sub-titles span { padding: 5px 8px; border-radius: 999px; background: rgba(221,213,236,.54); color: var(--ink-soft); font-size: 9px; }
.next-card { padding: 25px 21px 21px; text-align: center; }
.lock-badge { width: 57px; height: 57px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 19px; background: rgba(243,227,168,.55); box-shadow: 4px 4px 0 rgba(69,59,56,.08); font-size: 25px; }
.next-card h3 { margin: 8px auto 13px; max-width: 330px; font-size: 25px; line-height: 1.35; letter-spacing: -.04em; }
.next-card > p:not(.eyebrow) { max-width: 330px; margin: 0 auto 20px; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.player-card {
  position: relative;
  overflow: hidden;
  padding: 19px;
  border: 2px solid rgba(69,59,56,.24);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.46), transparent 50%),
    linear-gradient(160deg, #fff6e7, #f2ded1 52%, #dce9df);
  box-shadow: 7px 7px 0 rgba(69,59,56,.13), 0 20px 45px rgba(104,78,64,.14);
}
.player-card::before { content: ""; position: absolute; inset: 8px; border: 1px dashed rgba(69,59,56,.14); border-radius: 15px; pointer-events: none; }
.player-card::after { content: "LIFE PLAYER"; position: absolute; right: -17px; top: 94px; color: rgba(69,59,56,.06); font: 900 32px/1 var(--font-display); letter-spacing: .04em; transform: rotate(90deg); }
.player-card > * { position: relative; z-index: 1; }
.player-card-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid rgba(69,59,56,.15); font: 800 10px/1 var(--font-display); letter-spacing: .1em; }
.player-card-top b { padding: 4px 6px; border-radius: 5px; background: var(--ink); color: var(--cream); font-size: 8px; }
.player-card-level { display: flex; align-items: baseline; gap: 10px; margin: 17px 0 4px; }
.player-card-level strong { font: 900 25px/1 var(--font-number); }
.player-card-level span { font-size: 13px; font-weight: 800; }
.player-card-score { display: flex; align-items: baseline; gap: 9px; }
.player-card-score strong { font: 900 61px/1 var(--font-number); letter-spacing: -.08em; }
.player-card-score span { color: var(--ink-soft); font-size: 10px; }
.player-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.player-card-grid > div, .player-card-next { padding: 11px; border: 1px solid rgba(69,59,56,.12); border-radius: 13px; background: rgba(255,252,245,.48); }
.player-card-grid small, .player-card-next small { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 8px; letter-spacing: .08em; }
.player-card-grid strong { display: block; font-size: 11px; line-height: 1.4; }
.player-card-next { margin-top: 8px; }
.player-card-next strong { display: block; font-size: 13px; line-height: 1.4; }
.player-card > p { margin: 16px 0 0; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.result-actions { display: grid; gap: 11px; margin-top: 16px; }
.result-actions > p { margin: 0; color: var(--ink-soft); font-size: 10px; text-align: center; }
.result-footer { margin-top: 38px; padding: 24px 0 7px; border-top: 1px dashed var(--line); text-align: center; }
.result-footer p { margin: 0 0 5px; font-size: 12px; }
.result-footer small { display: block; max-width: 360px; margin: 19px auto 0; color: rgba(69,59,56,.46); font-size: 9px; line-height: 1.65; }

/* Modal */
.modal-layer { position: fixed; z-index: 80; inset: 0; display: grid; place-items: end center; padding: 17px; background: rgba(69,59,56,.34); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(100%, 440px); padding: 22px; border: 1px solid var(--line); border-radius: 25px; background: var(--cream); box-shadow: 0 25px 70px rgba(69,59,56,.24); animation: modalUp .28s cubic-bezier(.22,.8,.3,1) both; }
@keyframes modalUp { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-icon { width: 56px; height: 56px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 18px; background: var(--yellow); font-size: 26px; }
.modal-card h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.03em; }
.modal-card .modal-stars { margin-bottom: 10px; color: #b58b50; font-size: 12px; letter-spacing: .12em; }
.modal-card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.modal-actions button { min-height: 46px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,252,245,.75); font-size: 13px; font-weight: 800; cursor: pointer; }
.modal-actions button.primary { background: var(--ink); color: var(--cream); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); max-width: calc(100% - 40px); padding: 11px 15px; border: 1px solid rgba(69,59,56,.14); border-radius: 13px; background: rgba(69,59,56,.92); color: var(--cream); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 370px) {
  #screen-welcome, .result-screen, .generating-screen { padding-left: 12px; padding-right: 12px; }
  .welcome-card { padding-left: 16px; padding-right: 16px; }
  .question-wrap { padding-left: 13px; padding-right: 13px; }
  .test-header { padding-left: 13px; padding-right: 13px; }
  .question-title { font-size: 22px; }
  .option-card { padding-left: 52px; font-size: 13px; }
  .achievement-wall { gap: 6px; }
  .achievement-tile { min-height: 101px; padding-left: 4px; padding-right: 4px; }
}
@media (min-width: 700px) {
  .site-shell { padding: 22px 0; }
  .app-frame { min-height: calc(100dvh - 44px); border: 1px solid rgba(69,59,56,.13); border-radius: 34px; }
  .screen { min-height: calc(100dvh - 46px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
