:root {
  color-scheme: light;
  --ink: #2a1c26;
  --muted: #82757f;
  --paper: #fbf4e4;
  --soft: #fff9ed;
  --line: #dcc9a8;
  --green: #2b7c62;
  --mint: #dce9c7;
  --coral: #e97382;
  --yellow: #f5d84d;
  --lavender: #a987c8;
  --blue: #74b9c2;
  --rose: #f4a6b8;
  --shadow: 0 22px 60px rgba(73, 45, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(124, 105, 72, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(124, 105, 72, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #fffaf0 0%, #fbf0dc 48%, #f7ece5 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.app {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) 18px;
  display: grid;
  place-items: center;
}

.view {
  display: none;
  width: 100%;
}

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

.view-home {
  text-align: center;
}

.brand-lockup {
  margin: 0 auto 12px;
}

.mini-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: #5b3150;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(58px, 12vw, 104px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(245, 216, 77, 0.72), 0 12px 28px rgba(91, 49, 80, 0.12);
}

.garden-wall {
  width: min(100%, 430px);
  margin: 12px auto 22px;
  display: grid;
  gap: 9px;
  overflow: hidden;
  padding: 4px 0;
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.plant-sprite {
  display: inline-block;
  background-image: url("./assets/plants-sprite-web.jpg");
  background-repeat: no-repeat;
  background-size: 400% 400%;
  background-position: var(--sprite-x, 0%) var(--sprite-y, 0%);
}

.garden-row {
  width: 100%;
  overflow: hidden;
}

.garden-track {
  width: max-content;
  display: flex;
  gap: 9px;
  animation: garden-slide var(--duration, 20s) linear infinite;
}

.garden-row.is-reverse .garden-track {
  animation-name: garden-slide-reverse;
}

.garden-sprite {
  width: clamp(74px, 18vw, 94px);
  flex: 0 0 clamp(74px, 18vw, 94px);
  aspect-ratio: 1;
  border: 1px solid rgba(220, 201, 168, 0.75);
  border-radius: 8px;
  background-color: rgba(255, 249, 237, 0.75);
  box-shadow: 0 10px 24px rgba(91, 49, 80, 0.08);
}

@keyframes garden-slide {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes garden-slide-reverse {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

.home-copy {
  width: min(100%, 510px);
  margin: 0 auto;
}

.home-copy h2,
.question-title,
.result-name {
  margin: 0;
  font-size: clamp(24px, 5.4vw, 34px);
  line-height: 1.2;
  font-weight: 850;
}

.home-copy p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 700;
}

.primary-action,
.next-action,
.secondary-action {
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-action,
.next-action {
  width: min(100%, 360px);
  margin-top: 22px;
  background: #2f6f58;
  color: #ffffff;
  box-shadow: 0 10px 0 rgba(47, 111, 88, 0.22), 0 18px 36px rgba(47, 111, 88, 0.18);
}

.next-action {
  width: 100%;
}

.primary-action:hover,
.next-action:hover,
.secondary-action:hover,
.icon-button:hover,
.option-button:hover {
  transform: translateY(-2px);
}

.primary-action:active,
.next-action:active,
.secondary-action:active,
.icon-button:active,
.option-button:active {
  transform: translateY(1px);
}

.next-action:disabled {
  cursor: not-allowed;
  background: #cfc7b9;
  box-shadow: none;
  opacity: 0.75;
}

.play-mark {
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.play-mark::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  border-left: 9px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.save-mark {
  width: 18px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-width: 6px;
  border-radius: 4px;
  position: relative;
}

.save-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 4px;
  background: currentColor;
}

.fine-print {
  margin: 44px 0 0;
  color: #9b8d94;
  font-size: 13px;
  font-weight: 800;
}

.quiz-shell {
  width: min(100%, 440px);
  margin: 0 auto;
}

.quiz-topbar {
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  border: 1px solid rgba(220, 201, 168, 0.82);
  background: rgba(255, 249, 237, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.progress-wrap {
  grid-column: 2 / 3;
  display: grid;
  gap: 12px;
  text-align: center;
}

.progress-text {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.progress-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(220, 201, 168, 0.62);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--rose), var(--yellow), var(--blue));
  transition: width 240ms ease;
}

.question-meta {
  min-height: 56px;
  margin-bottom: 24px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(220, 201, 168, 0.78);
  border-radius: 8px;
  background: rgba(255, 249, 237, 0.82);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.meta-sprite {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.question-kicker {
  color: #8c5578;
  font-size: 14px;
  font-weight: 800;
}

.question-title {
  margin-bottom: 10px;
}

.question-body {
  margin: 0 0 28px;
  color: #6a5c64;
  font-size: 16px;
  line-height: 1.65;
  font-weight: 680;
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-button {
  min-height: 58px;
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgba(220, 201, 168, 0.9);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.82);
  color: var(--ink);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 9px 22px rgba(91, 49, 80, 0.045);
}

.option-letter {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #f4eadb;
  font-size: 19px;
  font-weight: 850;
}

.option-text {
  min-width: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 760;
}

.option-button.is-selected {
  border-color: #b96388;
  background: #fff1ed;
  box-shadow: 0 9px 0 rgba(233, 115, 130, 0.22);
}

.option-button.is-selected .option-letter {
  background: #b96388;
  color: #ffffff;
}

.result-card {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(226, 220, 211, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.result-topline {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #aaa2a5;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 760;
}

.result-portrait {
  width: clamp(152px, 43vw, 214px);
  aspect-ratio: 1;
  margin: 0 auto 28px;
  border-radius: 58px;
  display: grid;
  place-items: center;
  background: #f5f3f0;
  box-shadow: inset 0 0 0 1px rgba(220, 214, 205, 0.55);
}

.result-sprite {
  width: 78%;
  height: 78%;
  border-radius: 8px;
  background-color: transparent;
}

.result-kicker {
  margin: 0 0 10px;
  color: #aaa2a5;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 850;
}

.result-name {
  max-width: 430px;
  margin: 0 auto;
  color: #111111;
  font-size: clamp(34px, 8vw, 48px);
  line-height: 1.16;
  font-weight: 900;
}

.result-subtitle {
  margin: 12px 0 0;
  color: #aaa2a5;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 850;
}

.result-punchline {
  margin: 48px 0 0;
  padding: 20px 24px;
  border-radius: 14px;
  background: #f4f4f4;
  color: #202020;
  font-size: clamp(18px, 4.4vw, 22px);
  line-height: 1.65;
  font-weight: 760;
  text-align: left;
  position: relative;
}

.result-punchline::before {
  content: "“";
  position: absolute;
  left: 18px;
  top: -5px;
  color: rgba(0, 0, 0, 0.06);
  font-size: 58px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.tag-heading {
  margin: 32px 0 0;
  color: #aaa2a5;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 850;
  text-align: left;
}

.result-desc {
  margin: 30px 0 0;
  padding-top: 24px;
  border-top: 1px solid #e6e1db;
  color: #4f484b;
  font-size: clamp(17px, 4.2vw, 19px);
  line-height: 1.85;
  font-weight: 520;
  text-align: left;
}

.tag-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.tag-row span {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #171717;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 850;
}

.tag-row span:nth-child(2n) {
  background: #edf5ee;
}

.tag-row span:nth-child(3n) {
  background: #f7edf1;
}

.result-actions {
  width: min(100%, 520px);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: 1fr 144px;
  gap: 12px;
}

.primary-action.compact {
  width: 100%;
  margin: 0;
}

.secondary-action {
  border: 1px solid rgba(220, 201, 168, 0.82);
  background: rgba(255, 249, 237, 0.88);
  color: var(--ink);
}

@media (max-width: 540px) {
  .app {
    padding-inline: 16px;
  }

  .garden-wall {
    width: min(100%, 350px);
    margin-top: 10px;
    gap: 8px;
  }

  .garden-track {
    gap: 8px;
  }

  .garden-sprite {
    width: 74px;
    flex-basis: 74px;
  }

  .quiz-shell {
    width: 100%;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .secondary-action {
    min-height: 54px;
  }
}

@media (min-width: 760px) and (max-height: 780px) {
  .app {
    padding-block: 16px;
  }

  .brand-lockup {
    margin-bottom: 8px;
  }

  h1 {
    font-size: clamp(54px, 8vw, 88px);
  }

  .garden-wall {
    width: min(100%, 360px);
    margin: 10px auto 16px;
    gap: 8px;
  }

  .garden-track {
    gap: 8px;
  }

  .garden-sprite {
    width: 76px;
    flex-basis: 76px;
  }

  .home-copy h2 {
    font-size: 28px;
  }

  .home-copy p {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
  }

  .primary-action,
  .next-action {
    min-height: 54px;
    margin-top: 18px;
  }

  .fine-print {
    margin-top: 26px;
  }
}

@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;
  }
}
