:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #68645f;
  --line: #ded7cc;
  --paper: #f7f2e8;
  --white: #fffdf8;
  --lime: #d7ff5f;
  --coral: #ff6f61;
  --aqua: #54c6c2;
  --violet: #7d6bff;
  --shadow: 0 24px 70px rgba(23, 23, 23, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(23, 23, 23, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 42px;
}

.hidden {
  display: none !important;
}

.topbar,
.quiz-header,
.result-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--lime);
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--ink);
}

.status-pill,
.rarity {
  border: 1px solid var(--ink);
  background: var(--white);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 0.8fr);
  gap: 48px;
  align-items: center;
  padding: 70px 0 24px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 10vw, 116px);
  line-height: 0.9;
  letter-spacing: 0;
}

.intro-text {
  max-width: 620px;
  margin: 24px 0 32px;
  color: #3f3b37;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.35;
}

.primary-button,
.secondary-button,
.ghost-button,
.share-grid a,
.share-grid button {
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  background: var(--ink);
  color: var(--white);
  padding: 0 22px;
  box-shadow: 6px 6px 0 var(--coral);
}

.secondary-button,
.ghost-button,
.share-grid a,
.share-grid button {
  background: var(--white);
  color: var(--ink);
  padding: 0 18px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.answer-button:hover,
.share-grid a:hover,
.share-grid button:hover {
  transform: translate(-2px, -2px);
}

.primary-button:hover {
  box-shadow: 8px 8px 0 var(--coral);
}

.poster {
  position: relative;
  min-height: 520px;
}

.poster::before {
  position: absolute;
  inset: 36px 18px 18px 52px;
  border: 2px solid var(--ink);
  background:
    radial-gradient(circle at 22% 28%, var(--lime) 0 9%, transparent 10%),
    radial-gradient(circle at 78% 38%, var(--coral) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 82%, var(--aqua) 0 10%, transparent 11%),
    #26221f;
  box-shadow: 14px 14px 0 var(--ink);
  content: "";
}

.poster-card {
  position: absolute;
  width: min(330px, 84%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  padding: 18px;
  box-shadow: var(--shadow);
}

.poster-card span {
  display: block;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.poster-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.poster-card-a {
  top: 20px;
  left: 0;
  rotate: -4deg;
}

.poster-card-b {
  top: 190px;
  right: 0;
  background: #e9fffb;
  rotate: 5deg;
}

.poster-card-c {
  bottom: 18px;
  left: 36px;
  background: #fff2d1;
  rotate: -2deg;
}

.quiz-view {
  padding: 26px 0;
}

.quiz-header {
  margin-bottom: 32px;
}

.progress-wrap {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: var(--white);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--lime), var(--aqua));
  transition: width 220ms ease;
}

.question-count {
  min-width: 54px;
  text-align: right;
  font-weight: 900;
}

.question-panel {
  width: min(780px, 100%);
  margin: 0 auto;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  padding: clamp(22px, 5vw, 44px);
  box-shadow: 10px 10px 0 var(--ink);
}

.question-panel h2 {
  margin: 0 0 28px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.answer-button {
  width: 100%;
  min-height: 64px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fdf8ee;
  color: var(--ink);
  cursor: pointer;
  padding: 16px 18px;
  text-align: left;
  font-weight: 850;
  line-height: 1.25;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.answer-button span {
  display: block;
  margin-bottom: 7px;
  color: #5a5149;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.answer-button:nth-child(2n) {
  background: #ecfbfb;
}

.answer-button:nth-child(3n) {
  background: #f7efff;
}

.result-view {
  padding: 32px 0;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: start;
}

.result-card,
.result-actions {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 10px 10px 0 var(--ink);
}

.result-card {
  min-height: 660px;
  padding: clamp(22px, 5vw, 42px);
}

.viral-result-card {
  position: relative;
  display: grid;
  justify-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--coral);
  overflow: hidden;
  padding: 22px;
}

.viral-card-top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.viral-card-top strong {
  color: var(--ink);
}

.viral-result-card h2 {
  order: 4;
  width: 100%;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: clamp(42px, 7vw, 70px);
  line-height: 0.92;
  text-align: center;
}

.viral-result-card > strong {
  order: 3;
  width: 100%;
  margin-top: 28px;
  color: var(--ink);
  font-size: clamp(90px, 17vw, 150px);
  line-height: 0.74;
  text-align: center;
}

.viral-avatar {
  order: 2;
  display: grid;
  width: min(88%, 340px);
  aspect-ratio: 1;
  place-items: center;
  margin: 30px auto 0;
  border-radius: 28px;
  background: var(--white);
  box-shadow: 10px 10px 0 var(--ink);
}

.viral-avatar .avatar-svg {
  width: 100%;
  filter: none;
}

.viral-analysis {
  order: 5;
  width: 100%;
  border-top: 0;
  padding: 0;
}

.viral-analysis h3 {
  display: none;
}

.viral-analysis p {
  margin: 20px 0 88px;
  border-left: 0;
  padding-left: 0;
  color: var(--ink);
  font-size: clamp(24px, 4.2vw, 38px);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

.viral-cta {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  margin-top: 0;
  border: 3px solid var(--ink);
  background: var(--lime);
  padding: 16px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  text-align: center;
}

.detail-section {
  margin-top: 22px;
}

.result-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 32px);
  align-items: center;
  margin-top: 26px;
}

.avatar-frame {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 111, 97, 0.32), transparent 38%),
    linear-gradient(45deg, transparent 42%, rgba(215, 255, 95, 0.52) 42% 60%, transparent 60%),
    #fff8df;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}

.avatar-svg {
  width: min(100%, 330px);
  height: auto;
  filter: drop-shadow(0 12px 0 rgba(23, 23, 23, 0.12));
}

#resultCode {
  margin: 0 0 6px;
  font-size: clamp(70px, 12vw, 126px);
  line-height: 0.82;
  letter-spacing: 0;
}

#resultTitle {
  margin: 0;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1;
}

#resultSummary {
  max-width: 720px;
  margin: 22px 0 26px;
  color: #36322e;
  font-size: 21px;
  line-height: 1.42;
}

.confidence-box {
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fff2d1;
  padding: 14px;
}

.confidence-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.confidence-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.confidence-top strong {
  font-size: 28px;
  line-height: 1;
}

.confidence-track {
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: var(--white);
}

.confidence-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--lime), var(--aqua));
  transition: width 260ms ease;
}

#confidenceHint {
  margin: 10px 0 0;
  color: #3d3834;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.axis-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 22px;
}

.axis-chip {
  min-height: 106px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fdf8ee;
  padding: 12px;
}

.axis-chip strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.axis-chip span {
  display: block;
  margin-top: 8px;
  font-weight: 950;
}

.axis-chip em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

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

.trait-grid div {
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #f7f2e8;
  padding: 14px;
}

.trait-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.trait-grid strong {
  display: block;
  line-height: 1.22;
}

.shadow-panel {
  margin-top: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #e9fffb;
  padding: 18px;
}

.shadow-panel span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.shadow-panel strong {
  display: block;
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1;
}

.shadow-panel p {
  margin: 10px 0 0;
  color: #36322e;
  line-height: 1.42;
}

.tagline {
  margin: 28px 0 0;
  border-left: 6px solid var(--coral);
  padding-left: 16px;
  font-size: 20px;
  font-weight: 900;
}

.result-actions {
  padding: 24px;
}

.result-actions h2 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1;
}

.result-actions p:not(.kicker) {
  color: #3d3834;
  line-height: 1.5;
}

.action-stack {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.share-panel {
  display: grid;
  gap: 12px;
  margin: 22px 0;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: #fdf8ee;
  padding: 14px;
}

.share-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

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

.share-grid a,
.share-grid button {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.share-grid a:nth-child(3n + 1),
.share-grid button:nth-child(3n + 1) {
  background: #e9fffb;
}

.share-grid a:nth-child(3n + 2),
.share-grid button:nth-child(3n + 2) {
  background: #fff2d1;
}

.manual-share-label {
  margin-top: 4px;
}

.share-panel p {
  margin: 0;
  color: #3d3834;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}


@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 22px, 680px);
    padding-top: 14px;
  }

  .intro-grid,
  .result-layout,
  .trait-grid,
  .result-hero {
    grid-template-columns: 1fr;
  }

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

  .intro-grid {
    gap: 26px;
    padding-top: 44px;
  }

  .poster {
    min-height: 400px;
  }

  .poster-card {
    width: 78%;
  }

  .poster-card strong {
    font-size: 24px;
  }

  .quiz-header {
    gap: 10px;
  }

  .ghost-button {
    min-height: 42px;
    padding: 0 12px;
  }

  .question-panel {
    box-shadow: 7px 7px 0 var(--ink);
  }

  .result-card {
    min-height: auto;
  }

  .avatar-frame {
    width: min(100%, 320px);
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 56px;
  }

  .poster-card-a {
    left: 0;
  }

  .poster-card-b {
    top: 154px;
  }

  .poster-card-c {
    left: 0;
  }

  .question-count {
    min-width: 44px;
    font-size: 13px;
  }

  .axis-strip {
    grid-template-columns: 1fr;
  }

  #resultCode {
    font-size: 72px;
  }
}
