:root {
  color-scheme: light;
  --bg: #f6f1ea;
  --panel: #fffaf3;
  --ink: #211b18;
  --muted: #71675f;
  --line: #ded2c4;
  --coral: #d84f3f;
  --coral-dark: #9f2d23;
  --teal: #187a78;
  --violet: #6f58b8;
  --gold: #c5871f;
  --green: #4d8d49;
  --shadow: 0 18px 48px rgba(54, 39, 28, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(216, 79, 63, 0.1), transparent 30%),
    linear-gradient(215deg, rgba(24, 122, 120, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 0.95;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

.nav-row,
.progress-copy {
  display: flex;
  align-items: center;
}

.layout {
  display: block;
}

.stage {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stage {
  min-height: 600px;
  padding: clamp(22px, 4vw, 46px);
}

.progress-panel {
  margin-bottom: 28px;
}

.progress-copy {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-copy strong {
  color: var(--ink);
}

.progress-track {
  height: 10px;
  margin: 14px 0 0;
  overflow: hidden;
  background: #eadfd3;
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--teal));
  border-radius: inherit;
  transition: width 180ms ease;
}

.options {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.option-button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.option-button:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 79, 63, 0.55);
}

.option-button.selected {
  border-color: var(--coral);
  background: rgba(216, 79, 63, 0.11);
}

.option-letter {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

.option-button.selected .option-letter {
  background: var(--coral);
}

.option-copy {
  min-width: 0;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.35;
}

.nav-row {
  justify-content: space-between;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 850;
}

.primary-button,
.secondary-button {
  min-width: 118px;
  padding: 0 18px;
}

.primary-button {
  color: #fff;
  background: var(--ink);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.cover-stage {
  display: grid;
  align-items: center;
}

.cover-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
}

.cover-copy h2 {
  max-width: 740px;
  margin-bottom: 18px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.95;
}

.cover-lede,
.cover-body {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(18px, 2.3vw, 24px);
  line-height: 1.38;
}

.cover-lede {
  color: var(--ink);
}

.cover-body {
  margin-bottom: 24px;
}

.cover-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.cover-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  font-weight: 850;
}

.cover-start {
  min-width: 160px;
  min-height: 52px;
  font-size: 18px;
}

.cover-avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cover-avatar-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.result-stage {
  padding-bottom: 32px;
}

.result-hero {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

.result-code {
  width: fit-content;
  min-height: 32px;
  margin-bottom: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.persona-mark {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--panel);
}

.result-subtitle {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.result-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.result-label {
  margin-bottom: 10px;
  color: var(--coral-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-block p:last-child {
  margin-bottom: 0;
}

#aboutText {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.58;
}

.match-list,
.toy-list,
.compatibility-list {
  display: grid;
  gap: 10px;
}

.product-block {
  grid-column: 1 / -1;
}

.toy-list {
  display: flex;
  flex-wrap: wrap;
}

.compatibility-item {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.72);
  border: 1px solid var(--line);
}

.compatibility-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.compatibility-item span {
  color: var(--muted);
  line-height: 1.45;
}

.match-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.match-code {
  font-weight: 950;
}

.match-bar {
  height: 10px;
  overflow: hidden;
  background: #eadfd3;
  border-radius: 999px;
}

.match-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: inherit;
}

.match-percent {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.toy-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-weight: 850;
  width: fit-content;
}

.toy-chip:nth-child(2) {
  background: var(--violet);
}

.toy-chip:nth-child(3) {
  background: var(--coral);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 16px 0;
  }

  .topbar,
  .cover-grid,
  .result-detail-grid,
  .result-hero {
    grid-template-columns: 1fr;
  }

  .product-block {
    grid-column: auto;
  }

  .topbar {
    display: grid;
  }

  .stage {
    min-height: auto;
  }

  .result-hero {
    gap: 14px;
  }

  .cover-avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .persona-mark {
    width: 148px;
  }
}

@media (max-width: 540px) {
  .option-button,
  .match-item {
    grid-template-columns: 1fr;
  }

  .option-letter {
    width: 34px;
    height: 34px;
  }

  .match-percent {
    text-align: left;
  }

  .nav-row {
    display: grid;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
