:root {
  --bg: #fff4e8;
  --paper: #ffffff;
  --ink: #252a25;
  --muted: #6f766f;
  --line: #eadfce;
  --soft: #fff8ef;
  --accent: #ffd84d;
  --accent-soft: #fff0b8;
  --pill-bg: #fff0b8;
  --shadow: 0 18px 48px rgba(80, 58, 35, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body {
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
}

.app {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px 28px;
}

.screen {
  display: none;
}

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

.brand-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 22px;
}

.brand-logo {
  width: 104px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-kicker,
.brand-name,
.eyebrow,
.microcopy,
.card-label,
.result-label,
.result-topline,
.progress-meta {
  margin: 0;
  color: var(--muted);
}

.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
}

.brand-name {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.hero-card,
.question-card,
.loading-card,
.result-poster,
.detail-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: calc(100vh - 126px);
  padding: 38px 24px 24px;
  border-radius: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  font-size: 14px;
  font-weight: 700;
}

.hero-card h1 {
  margin: 16px 0 14px;
  font-size: clamp(38px, 11vw, 54px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  margin: 0;
  color: #4d554d;
  font-size: 18px;
  line-height: 1.55;
}

.hero-group {
  display: block;
  width: min(245px, 72vw);
  margin: 26px auto 4px;
  border-radius: 22px;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 54px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button {
  background: var(--accent);
}

.microcopy {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
}

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 0 18px;
  background: linear-gradient(var(--bg) 78%, rgba(255, 244, 232, 0));
}

.ghost-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1dfc9;
}

.progress-fill {
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: #ffd84d;
  transition: width 200ms ease;
}

.question-card {
  min-height: calc(100vh - 106px);
  padding: 30px 20px;
  border-radius: 28px;
}

.question-card h2 {
  margin: 14px 0 26px;
  font-size: clamp(26px, 7.5vw, 36px);
  line-height: 1.22;
  letter-spacing: 0;
}

.options {
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  line-height: 1.45;
  cursor: pointer;
}

.option-button:active {
  transform: scale(0.99);
}

.loading-card {
  min-height: calc(100vh - 46px);
  padding: 30px 22px;
  border-radius: 34px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.scan-ring {
  display: grid;
  width: 150px;
  height: 150px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff0b8;
  animation: pulse 1.2s ease-in-out infinite;
}

.scan-ring img {
  width: 118px;
  height: auto;
  border-radius: 999px;
  object-fit: contain;
}

.loading-card h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.screen-result {
  padding-bottom: 24px;
}

.result-poster {
  min-height: 680px;
  padding: 22px 20px 24px;
  border-radius: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.result-logo {
  width: 92px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.result-label {
  margin-top: 42px;
  font-size: 24px;
}

.result-poster h1 {
  margin: 16px auto 10px;
  max-width: none;
  width: 100%;
  font-size: clamp(27px, 7.4vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.result-poster h1.is-long {
  font-size: clamp(24px, 6.5vw, 34px);
}

.result-poster h1.is-extra-long {
  font-size: clamp(21px, 5.8vw, 30px);
}

.result-code {
  margin: 0;
  color: var(--accent);
  font-size: clamp(46px, 14vw, 72px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.result-figure {
  display: grid;
  min-height: 220px;
  flex: 1;
  place-items: center;
}

.result-image {
  display: none;
  max-width: min(260px, 68vw);
  max-height: 260px;
  object-fit: contain;
}

.result-figure.has-image .result-image {
  display: block;
}

.result-figure.has-image .figure-placeholder {
  display: none;
}

.figure-placeholder {
  display: grid;
  width: min(230px, 62vw);
  aspect-ratio: 1;
  place-items: center;
  border: 3px dashed color-mix(in srgb, var(--accent) 48%, white);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.3)),
    var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 62%, #1d251d);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}

.result-line {
  margin: 18px 0 0;
  color: #485148;
  font-size: clamp(18px, 5.2vw, 24px);
  font-weight: 700;
  line-height: 1.35;
}

.detail-card {
  margin-top: 14px;
  padding: 22px 20px;
  border-radius: 24px;
}

.detail-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.2;
}

.detail-card p {
  margin: 0;
  color: #566057;
  font-size: 16px;
  line-height: 1.7;
}

.card-label {
  margin-bottom: 6px;
  font-size: 14px;
}

.pill {
  display: inline-flex;
  width: auto;
  margin: 0 0 16px !important;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: #5d4a1f !important;
  font-weight: 800;
}

.result-actions {
  padding: 20px 4px 0;
  text-align: center;
}

.result-actions .secondary-button + .secondary-button {
  margin-top: 10px;
}

.result-actions p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.generated-wrap {
  margin: 14px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.generated-wrap img {
  display: block;
  width: 100%;
  border-radius: 16px;
}

@media (max-width: 360px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }

  .result-poster,
  .hero-card,
  .question-card {
    border-radius: 24px;
  }
}
