:root {
  --plum: #2a2140;
  --plum-2: #4b3b78;
  --pink: #d6336c;
  --pink-2: #b02a5b;
  --blush: #fde8f0;
  --lav: #f7f3fc;
  --paper: #ffffff;
  --ink: #241d33;
  --muted: #655d7c;
  --line: #e6def2;
  --green: #12805c;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(75, 59, 120, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--lav);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink-2); }
h1, h2 { font-family: Fraunces, Georgia, serif; line-height: 1.15; color: var(--plum); }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 0 0 0.6em; }
h3 { font-size: 1rem; color: var(--plum); margin: 1.4em 0 0.5em; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1120px; margin: 0 auto; padding: 16px;
}
.brand { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.1rem; color: var(--plum); text-decoration: none; }
.brand-mark { color: var(--pink); }
.top-nav { display: flex; gap: 18px; align-items: center; }
.top-nav a { font-weight: 600; text-decoration: none; color: var(--plum-2); font-size: 0.95rem; }
.top-cta, .top-nav a.top-cta { font-weight: 600; text-decoration: none; color: var(--pink-2); }

.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.76rem; font-weight: 600; color: var(--pink-2); margin: 0; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 36em; margin: 0 0 1em; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 0.6em 0 0; }
.center { text-align: center; }
.section-lead { color: var(--muted); max-width: 46em; margin: 0 0 1.2em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; text-decoration: none; transition: transform 0.08s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-2); }
.btn-ghost { background: transparent; color: var(--plum); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--plum-2); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-block + .btn-block { margin-top: 10px; }
.link-btn { font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--plum-2); background: none; border: 0; padding: 0; cursor: pointer; }
.btn-mini { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--pink); background: var(--pink); color: #fff; cursor: pointer; white-space: nowrap; }
.btn-mini-ghost { background: transparent; color: var(--plum); border-color: var(--line); }
.btn-mini-ghost:hover { border-color: var(--plum-2); }

.card-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* First screen: heading on the left, the test itself on the right */
.hero {
  max-width: 1120px; margin: 0 auto; padding: 12px 16px 48px;
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: start;
}
.hero-copy { padding-top: 18px; }
.vs-banner { margin-top: 8px; padding: 14px 16px; border-radius: 14px; background: var(--blush); border: 1px solid #f6c6d8; color: var(--plum); }
.vs-banner strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.bar { height: 10px; border-radius: 999px; background: var(--lav); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 6px; }
.bar-fill { height: 100%; width: 2%; background: linear-gradient(90deg, var(--pink), #8f7ad1); transition: width 0.4s ease; }
.q-text { font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin: 16px 0 16px; min-height: 2.3em; outline: none; }
.answers { display: grid; gap: 10px; }
.answer {
  font: inherit; text-align: left; color: var(--ink); background: var(--lav); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 13px 16px; cursor: pointer; line-height: 1.4; min-height: 52px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.answer:hover, .answer:focus-visible { border-color: var(--pink); background: var(--blush); outline: none; }
.done-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 8px 0 18px; }

/* Result */
.result { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; scroll-margin-top: 12px; }
.result-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: start; }
.result-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 6px 0 8px; }
.result-side { display: grid; gap: 20px; }
.bars { display: grid; gap: 9px; margin: 18px 0 8px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 46px; gap: 10px; align-items: center; font-size: 0.92rem; }
.bar-row .bar-label { font-weight: 600; color: var(--muted); }
.bar-row .bar-track { height: 14px; border-radius: 999px; background: var(--lav); overflow: hidden; }
.bar-row .bar-val { text-align: right; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row .bar-in { height: 100%; border-radius: 999px; min-width: 4px; }
.bar-row.is-main .bar-label, .bar-row.is-main .bar-val { color: var(--plum); font-weight: 700; }
.type-desc h3:first-child { margin-top: 1.2em; }
.traits { margin: 0 0 1em; padding-left: 1.2em; }
.traits li { margin: 0.25em 0; }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1em 0; }
.flag { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); }
.flag h3 { margin: 0 0 4px; font-size: 0.9rem; }
.flag p { margin: 0; }
.flag-green { background: #eefaf4; border-color: #c5ead9; }
.flag-green h3 { color: var(--green); }
.flag-red { background: #fff1f3; border-color: #f8cdd5; }
.flag-red h3 { color: var(--pink-2); }

.result-card { width: 100%; max-width: 360px; height: auto; aspect-ratio: 4 / 5; display: block; margin: 0 auto 14px; border-radius: 14px; box-shadow: var(--shadow); background: var(--lav); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--plum); }
.field em, h3 em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input {
  font: inherit; font-weight: 400; color: var(--ink); padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; width: 100%;
}
.field input:focus, .link-out:focus { outline: none; border-color: var(--plum-2); box-shadow: 0 0 0 3px rgba(75, 59, 120, 0.15); }
.form-error { color: var(--pink-2); font-weight: 600; margin: 8px 0 0; }
.share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.share-row .btn { padding: 11px 8px; font-size: 0.95rem; }
.link-out { font: inherit; font-size: 0.85rem; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--lav); color: var(--ink); }
.match-panel p { margin: 0 0 14px; color: var(--muted); }
.anime-cta { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); padding: 14px; }
.anime-cta img { border-radius: 10px; aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.anime-cta strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.15rem; color: var(--plum); }
.anime-cta:hover { border-color: var(--pink); }

/* Friend comparison */
.compare { margin-bottom: 28px; text-align: center; }
.compare-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin: 14px 0; }
.compare-person { min-width: 0; }
.compare-name { display: block; font-size: 0.9rem; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.compare-type { display: block; font-family: Fraunces, Georgia, serif; font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: var(--plum); margin-bottom: 8px; }
.mini-bars { display: grid; gap: 4px; }
.mini-bars .bar-row { grid-template-columns: 76px 1fr 38px; font-size: 0.78rem; gap: 6px; text-align: left; }
.mini-bars .bar-row .bar-track { height: 8px; }
.compare-score { width: 104px; height: 104px; border-radius: 50%; background: var(--blush); border: 2px solid #f6c6d8; display: grid; place-content: center; }
.compare-score span { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.9rem; color: var(--pink-2); line-height: 1; }
.compare-score small { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.compare-line { font-size: 1.08rem; max-width: 38em; margin: 6px auto 16px; }

/* Character-card maker */
.maker {
  max-width: 1120px; margin: 0 auto; padding: 0 16px 56px; scroll-margin-top: 12px;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start;
}
.maker-lead { color: var(--muted); margin: 0 0 4px; }
.photo-box { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; margin: 0 0 14px; }
.photo-pick { display: grid; place-items: center; aspect-ratio: 1; border: 2px dashed #d9b8e8; border-radius: 14px; background: var(--lav); cursor: pointer; text-align: center; overflow: hidden; color: var(--muted); font-size: 0.82rem; line-height: 1.35; padding: 10px; }
.photo-pick:hover, #photoInput:focus-visible + .photo-pick { border-color: var(--pink); }
.photo-pick strong { display: block; color: var(--pink-2); font-size: 1rem; margin-bottom: 4px; }
.photo-pick.has-photo { border-style: solid; border-color: var(--plum-2); padding: 0; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-side .fine:first-child { margin-top: 0; }
.photo-side .btn-mini { margin-top: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pink); flex-shrink: 0; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.style {
  position: relative; border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden;
  background: var(--lav); cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.style img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.style span { display: block; padding: 7px 9px; font-size: 0.82rem; font-weight: 600; line-height: 1.25; }
.style[aria-checked="true"] { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(214, 51, 108, 0.15); }
.style[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--pink); color: #fff; display: grid; place-items: center; font-size: 0.85rem;
}
.headline-preview { margin: 14px 0; color: var(--muted); }
.headline-preview strong { color: var(--plum); font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.maker-form .form-error { margin: 0 0 12px; }
.maker-result { position: sticky; top: 16px; text-align: center; }
.spinner { font-size: 2.6rem; color: var(--pink); animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
.empty-sample { width: 70%; margin: 6px auto 4px; border-radius: 10px; box-shadow: var(--shadow); }
#previewImg { width: 100%; height: auto; border-radius: 10px; background: var(--lav); }
.maker-result .share-row { margin: 12px 0 4px; }
.actions { margin-top: 16px; }
.maker-result #againBtn { margin-top: 10px; }
.paid-note { font-weight: 600; color: var(--green); margin: 0 0 10px; }
.human-check:empty { display: none; }
.human-check { display: flex; justify-content: center; margin: 0 0 0.8em; }

/* Lists of types, how it works, questions */
.types, .how, .faq { max-width: 1120px; margin: 0 auto; padding: 0 16px 56px; scroll-margin-top: 12px; }
.gallery-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.gallery-grid a { display: block; text-decoration: none; color: var(--plum); font-weight: 600; font-size: 0.9rem; text-align: center; }
.gallery-grid img { width: 100%; border-radius: 10px; box-shadow: var(--shadow); aspect-ratio: 2 / 3; object-fit: cover; margin-bottom: 6px; }
.more-link a { font-weight: 600; text-decoration: none; }
.more-link a::after { content: " \2192"; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 58px; position: relative; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--plum); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--plum); }
.faq p { margin: 10px 0 2px; color: var(--muted); }
.page-intro { max-width: 820px; margin: 0 auto 44px; padding: 0 16px; }
.page-intro p { color: var(--muted); }

.foot { text-align: center; padding: 28px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); }
.foot a { color: var(--muted); }

/* Type pages (/types/<type>) */
.type-page { max-width: 1000px; margin: 0 auto; padding: 0 16px 40px; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.type-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; margin-bottom: 28px; }
.type-sample { margin: 0; }
.type-sample img { width: 100%; max-width: 320px; margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow); }
.type-sample figcaption, .before-after figcaption { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 8px; }
.type-body { max-width: 760px; }
.type-body h2 { margin-top: 1.6em; }
.type-body .faq, .type-body .style-links { padding: 0; max-width: none; }
.compat-list { padding-left: 1.2em; }
.compat-list li { margin: 0.4em 0; }
.compat-list a { font-weight: 600; }
.type-cta { display: grid; grid-template-columns: 1fr 150px; gap: 20px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 2em 0; box-shadow: var(--shadow); }
.type-cta h2 { margin-top: 0; }
.before-after { margin: 0; }
.before-after img { border-radius: 12px; width: 100%; aspect-ratio: 1; object-fit: cover; }
.style-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.style-links a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--plum); text-decoration: none; font-size: 0.9rem; background: var(--paper); }
.style-links a:hover { border-color: var(--plum-2); }

/* Share page (/s/<id>) and the 404 page */
.share-page, .notfound { max-width: 460px; margin: 0 auto; padding: 8px 16px 48px; text-align: center; }
.share-page .lead, .notfound .lead { margin-left: auto; margin-right: auto; }
.share-img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); margin: 0 0 18px; background: var(--paper); }

.legal { max-width: 760px; margin: 0 auto; padding: 8px 16px 56px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 14px; padding-bottom: 36px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: 1.6rem; margin-bottom: 0.3em; }
  .hero .lead { font-size: 0.98rem; margin-bottom: 0.4em; }
  .result-grid, .maker { grid-template-columns: 1fr; }
  .maker-result { position: static; }
  .maker-result.is-empty { display: none; }
  .steps { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .type-hero { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .card-panel { padding: 18px; }
  .top-nav a:not(.top-cta) { display: none; }
  .styles { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .style span { font-size: 0.7rem; padding: 5px 5px; }
  .style[aria-checked="true"]::after { width: 20px; height: 20px; top: 5px; right: 5px; font-size: 0.7rem; }
  .photo-box { grid-template-columns: 118px 1fr; gap: 12px; }
  .flags { grid-template-columns: 1fr; }
  .compare-pair { grid-template-columns: 1fr 1fr; }
  .compare-score { grid-column: 1 / -1; grid-row: 1; margin: 0 auto; width: 88px; height: 88px; }
  .mini-bars .bar-row { grid-template-columns: 1fr 30px; }
  .mini-bars .bar-row .bar-label { grid-column: 1 / -1; }
  .type-cta { grid-template-columns: 1fr; }
  .before-after { max-width: 160px; }
  .gallery-grid { gap: 8px; }
  .gallery-grid a { font-size: 0.78rem; }
}
