:root {
  --bg: #f7f3eb;
  --bg-soft: #fcfaf6;
  --paper: #ffffff;
  --line: #e9e1d4;
  --text: #2d3732;
  --muted: #6d786f;
  --green: #33a474;
  --green-soft: #dff3e7;
  --orange: #e67d41;
  --orange-soft: #fde8dc;
  --teal: #79bcc8;
  --teal-soft: #dff1f4;
  --yellow: #f3cf61;
  --yellow-soft: #fbf3cf;
  --shadow: 0 18px 40px rgba(74, 61, 45, 0.08);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --display: "Outfit", "Nunito Sans", sans-serif;
  --body: "Nunito Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background: linear-gradient(180deg, #fbf8f3 0%, #f5efe6 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
strong {
  font-family: var(--display);
}

.page-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.7;
}

.blob-a {
  top: -90px;
  left: -80px;
  width: 280px;
  height: 280px;
  background: rgba(121, 188, 200, 0.22);
}

.blob-b {
  top: 120px;
  right: -50px;
  width: 240px;
  height: 240px;
  background: rgba(243, 207, 97, 0.25);
}

.blob-c {
  bottom: -40px;
  left: 22%;
  width: 320px;
  height: 180px;
  background: rgba(230, 125, 65, 0.13);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 16px));
  margin: 8px auto 20px;
  border: 1px solid rgba(233, 225, 212, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.brand-mark {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 0.86rem;
  color: var(--muted);
}

.app-main {
  padding: 12px;
}

.screen {
  display: none;
  animation: fade-up 0.28s ease;
}

.screen.is-active {
  display: block;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 800;
}

.hero-card,
.quiz-card,
.panel-card,
.result-hero-card,
.intro-item,
.axis-block,
.match-card,
.atlas-entry,
.share-mini,
.art-slot {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 18px;
}

.hero-copy {
  padding: 2px 4px 8px;
}

.hero-copy h1,
.quiz-card h2,
.section-head h2,
.result-main h2,
.atlas-detail-card h3 {
  margin: 10px 0 0;
  line-height: 1.06;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 8vw, 3.5rem);
}

.lead,
.hero-note,
.statement-hint,
.scale-copy,
.axis-note,
.story-copy,
.panel-card p,
.match-card p,
.atlas-detail-card p,
.art-slot p {
  color: var(--muted);
  line-height: 1.78;
}

.lead {
  margin: 16px 0 0;
}

.hero-note {
  margin: 14px 0 0;
}

.art-slot {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  padding: 22px;
  border-radius: var(--radius-xl);
  border-style: dashed;
  background:
    radial-gradient(circle at 20% 22%, rgba(121, 188, 200, 0.2), transparent 26%),
    radial-gradient(circle at 82% 24%, rgba(243, 207, 97, 0.26), transparent 22%),
    radial-gradient(circle at 52% 82%, rgba(230, 125, 65, 0.14), transparent 30%),
    linear-gradient(180deg, #fefcf8 0%, #fff 100%);
}

.art-slot.has-image {
  min-height: auto;
  padding: 12px;
  border-style: solid;
  background: #fff;
}

.art-slot::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1px dashed rgba(109, 120, 111, 0.26);
  pointer-events: none;
}

.art-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(109, 120, 111, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.art-slot.has-image::after {
  display: none;
}

.persona-image,
.atlas-thumb,
.share-preview-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #fff;
}

.art-slot h2,
.art-slot h3 {
  margin: 18px 0 8px;
}

.intro-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.intro-item {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--bg-soft);
}

.intro-item strong {
  font-size: 1rem;
}

.intro-item p {
  margin: 8px 0 0;
}

.primary-btn,
.secondary-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.primary-btn {
  margin-top: 18px;
  background: var(--green);
  color: #fff;
  box-shadow: 0 14px 24px rgba(51, 164, 116, 0.22);
}

.secondary-btn {
  border: 1px solid #d5ece0;
  background: #f2fbf6;
  color: var(--green);
}

.text-btn {
  border: 1px solid var(--line);
  background: var(--paper);
}

.primary-btn:hover,
.secondary-btn:hover,
.text-btn:hover,
.option-card:hover,
.atlas-entry:hover {
  transform: translateY(-2px);
}

.quiz-card,
.panel-card,
.result-hero-card,
.atlas-detail-card {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.question-step,
.question-meta,
.result-badges,
.axis-head,
.share-axis-head,
.atlas-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-step strong {
  font-size: 0.98rem;
}

.progress-track {
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe8dd;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 56%, var(--orange) 100%);
  transition: width 0.24s ease;
}

.question-meta {
  margin-top: 18px;
  justify-content: flex-start;
}

.pill,
.axis-badge,
.small-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--yellow-soft);
  color: #946f17;
  font-size: 0.92rem;
  font-weight: 800;
}

.statement {
  margin: 24px 0 0;
  font-size: clamp(1.7rem, 6vw, 2.45rem);
  line-height: 1.26;
}

.statement-hint {
  margin: 12px 0 0;
}

.option-grid {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.option-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(252, 250, 246, 0.98) 100%);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.option-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(121, 188, 200, 0.12), transparent 36%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.option-card:hover,
.option-card.is-selected {
  border-color: #d6ccbe;
  box-shadow: 0 18px 28px rgba(74, 61, 45, 0.12);
}

.option-card:hover::before,
.option-card.is-selected::before {
  opacity: 1;
}

.option-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.option-head strong {
  font-size: 1.05rem;
}

.option-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.option-copy {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: #516059;
  line-height: 1.8;
}

.scale-copy {
  margin: 16px 0 0;
  text-align: center;
}

.quiz-actions,
.result-actions {
  margin-top: 16px;
}

.result-badges {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.text-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.text-btn:disabled:hover {
  transform: none;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  justify-content: space-between;
}

.result-hero-card {
  display: grid;
  gap: 18px;
}

.result-main h2 {
  font-size: clamp(2rem, 8vw, 3rem);
}

.result-code {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 0.04em;
}

.result-tagline {
  margin: 14px 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #495750;
}

.result-summary {
  margin: 12px 0 0;
}

.result-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.panel-card h3,
.panel-card h4,
.atlas-detail-card h3 {
  margin-top: 0;
}

.axis-list,
.story-list,
.match-list,
.share-axis-list {
  display: grid;
  gap: 16px;
}

.axis-block,
.match-card,
.share-mini,
.atlas-entry {
  border-radius: 20px;
}

.axis-block {
  padding: 16px;
  box-shadow: none;
  background: var(--bg-soft);
}

.axis-track,
.share-axis-track {
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: #efe8dd;
}

.axis-track {
  height: 12px;
  margin-top: 12px;
}

.axis-left,
.axis-right,
.share-axis-track span {
  height: 100%;
}

.axis-left {
  background: var(--green);
}

.axis-right {
  background: var(--orange);
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.axis-note {
  margin-top: 12px;
}

.story-copy,
.match-card p {
  margin: 0;
}

.match-card {
  padding: 16px;
  box-shadow: none;
  background: var(--bg-soft);
}

.match-card h4 {
  margin-bottom: 8px;
}

.match-card button {
  margin-top: 10px;
}

.share-mini {
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(121, 188, 200, 0.16), transparent 24%),
    radial-gradient(circle at 85% 20%, rgba(243, 207, 97, 0.2), transparent 22%),
    linear-gradient(180deg, #fefcf8 0%, #fff 100%);
}

.share-mini-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.share-mini-code {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--green);
}

.share-mini-emoji {
  font-size: 2rem;
}

.share-mini p {
  margin: 10px 0 0;
}

.share-preview-image {
  margin-top: 14px;
  border: 1px solid var(--line);
}

.share-axis-track {
  height: 10px;
  margin-top: 6px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.atlas-shell {
  margin-bottom: 16px;
}

.atlas-grid {
  display: grid;
  gap: 14px;
}

.atlas-entry {
  padding: 18px;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.atlas-thumb {
  margin-bottom: 14px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}

.atlas-entry:hover {
  border-color: #ddd4c7;
  box-shadow: 0 20px 30px rgba(74, 61, 45, 0.12);
}

.atlas-entry.is-active {
  border-color: #d5cbbe;
  box-shadow: 0 20px 30px rgba(74, 61, 45, 0.14);
}

.atlas-code {
  font-size: 1.45rem;
  font-weight: 900;
}

.atlas-icon {
  font-size: 1.7rem;
}

.atlas-entry h4 {
  margin: 12px 0 6px;
}

.atlas-entry p {
  margin: 0;
  color: #55625b;
  line-height: 1.72;
}

.atlas-detail-card {
  display: grid;
  gap: 18px;
}

.detail-top {
  display: grid;
  gap: 16px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .app-shell {
    width: min(980px, calc(100% - 28px));
    margin: 14px auto 24px;
  }

  .app-main {
    padding: 24px;
  }

  .hero-card,
  .result-hero-card {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    align-items: center;
  }

  .hero-art {
    order: 2;
  }

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

  .detail-top {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
  }

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

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