:root {
  color-scheme: light;
  --cream: #fffaf0;
  --cream-deep: #fff3dd;
  --ink: #081a34;
  --muted: #5d6674;
  --pink: #ff668c;
  --pink-soft: #ffd5df;
  --mint: #63ddb7;
  --mint-soft: #d8f6df;
  --lavender: #b990f3;
  --lavender-soft: #ead9ff;
  --aqua: #35c7c4;
  --yellow: #ffc850;
  --paper: #fffef9;
  --line: #d4d0c6;
  --shadow: 0 18px 40px rgba(8, 26, 52, 0.12);
  --font-display: "Mochiy Pop One", "Hiragino Maru Gothic ProN", sans-serif;
  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 200, 80, 0.12), transparent 22rem),
    radial-gradient(circle at 87% 22%, rgba(99, 221, 183, 0.11), transparent 24rem),
    var(--cream);
  font-family: var(--font-body);
  font-weight: 700;
}

button, input { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 20px 48px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 4vw, 1.45rem);
  cursor: pointer;
}

.brand-avatar { flex: 0 0 auto; width: 48px; filter: none; }

.menu-button {
  display: grid;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.menu-button span { height: 4px; border-radius: 4px; background: var(--ink); }

.screen { animation: pop-in 420ms cubic-bezier(.2,.8,.2,1) both; }

.hero { text-align: center; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .15em;
}

.hero h1 {
  margin: 10px auto 4px;
  max-width: 650px;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 10vw, 4.9rem);
  line-height: 1.25;
  letter-spacing: -.04em;
  text-wrap: balance;
  filter: drop-shadow(0 3px 0 #fff);
}

.hero > .eyebrow { margin-top: 5px; }
.hero-lead { margin: 8px auto 0; color: #364257; font-weight: 900; line-height: 1.65; letter-spacing: .02em; }

.hero h1 .accent { position: relative; display: inline-block; }
.nowrap { white-space: nowrap; }
.hero h1 .accent::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -4%; right: -4%; bottom: .04em;
  height: .16em;
  border-radius: 50%;
  background: var(--pink-soft);
  transform: rotate(-2deg);
}

.mascot-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 480px);
  min-height: 315px;
  margin: 0 auto 6px;
}

.mascot-stage::before {
  content: "";
  position: absolute;
  width: 82%;
  height: 54%;
  bottom: 11%;
  border-radius: 50%;
  background: var(--pink-soft);
  box-shadow: inset 0 -10px 0 rgba(255, 102, 140, .12);
  transform: rotate(-3deg);
}

.mascot-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 230px;
  height: 220px;
  border: 4px dashed rgba(8, 26, 52, .3);
  border-radius: 46% 46% 42% 42%;
  color: var(--muted);
  background: rgba(255,255,255,.55);
  text-align: center;
  line-height: 1.7;
}

.sprite {
  display: inline-block;
  width: 100%;
  aspect-ratio: 1;
  background-image: url("./assets/dopagaki-characters.png");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  filter: drop-shadow(0 10px 6px rgba(8, 26, 52, .14));
}
.sprite-monkey { background-position: 0% 0%; }
.sprite-rabbit { background-position: 50% 0%; }
.sprite-hamster { background-position: 100% 0%; }
.sprite-crow { background-position: 0% 100%; }
.sprite-octopus { background-position: 50% 100%; }
.sprite-turtle { background-position: 100% 100%; }
.brand .brand-avatar { flex: 0 0 48px; width: 48px; }
.mascot-group { position: relative; z-index: 1; width: min(100%, 480px); height: 330px; }
.group-animal { position: absolute; }
.group-rabbit { --rotate: -7deg; left: -2%; bottom: -1%; width: 46%; transform: rotate(var(--rotate)); animation: mascot-float 3.9s ease-in-out .2s infinite; }
.group-hamster { --rotate: 0deg; left: 23%; bottom: -7%; z-index: 3; width: 57%; animation: mascot-float 3.5s ease-in-out infinite; }
.group-crow { --rotate: 6deg; right: -3%; bottom: 0; width: 43%; transform: rotate(var(--rotate)); animation: mascot-float 4.2s ease-in-out .45s infinite; }
.mascot-group:active .group-hamster { animation: mascot-tap 260ms ease-out 1; }
.stage-prop { position: absolute; z-index: 4; display: grid; place-items: center; width: 48px; height: 40px; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper); font-family: var(--font-display); font-size: 1.25rem; box-shadow: 0 3px 0 rgba(8,26,52,.1); }
.prop-heart { left: 2%; top: 13%; color: var(--pink); transform: rotate(-10deg); }
.prop-play { right: 2%; top: 10%; color: var(--ink); transform: rotate(8deg); }
.prop-note { left: 15%; bottom: 7%; color: var(--lavender); }
.prop-alert { right: 12%; bottom: 7%; color: var(--pink); }

.doodle { position: absolute; z-index: 2; color: var(--pink); font-family: var(--font-display); font-size: 2rem; }
.doodle.d1 { left: 3%; top: 18%; transform: rotate(-15deg); }
.doodle.d2 { right: 3%; top: 24%; color: var(--yellow); transform: rotate(12deg); }
.doodle.d3 { right: 9%; bottom: 10%; color: var(--mint); }
.doodle.d4 { left: 5%; bottom: 17%; color: var(--lavender); }

.pill-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--font-display);
  font-size: clamp(.9rem, 3.5vw, 1.15rem);
}

.community-dopa {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  column-gap: 5px;
  width: min(100%, 360px);
  margin: 12px auto 14px;
  padding: 11px 18px 10px;
  border: 3px solid var(--ink);
  border-radius: 26px;
  background: linear-gradient(135deg, var(--lavender-soft), var(--pink-soft) 55%, #fff1ad);
  box-shadow: 0 6px 0 rgba(8,26,52,.09);
  transform: rotate(-1deg);
}
.community-dopa::before, .community-dopa::after { position: absolute; color: var(--pink); font-family: var(--font-display); }
.community-dopa::before { content: "✦"; left: 12px; top: 9px; }
.community-dopa::after { content: "♡"; right: 12px; bottom: 9px; }
.community-dopa-kicker { grid-column: 1 / -1; color: var(--pink); font-family: var(--font-display); font-size: .75rem; letter-spacing: .08em; }
.community-dopa-number { font-family: var(--font-display); font-size: clamp(1.9rem, 8vw, 2.8rem); line-height: 1; text-shadow: 0 3px 0 #fff; }
.community-dopa-unit { font-family: var(--font-display); font-size: 1.05rem; }
.community-dopa small { grid-column: 1 / -1; margin-top: 5px; color: #475268; font-size: .7rem; }
.community-dopa.is-ready { animation: dopa-counter-pop 420ms cubic-bezier(.2,.9,.25,1.2) both; }

.primary-button, .share-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 530px);
  min-height: 78px;
  margin: 24px auto 0;
  padding: 16px 24px;
  border: 0;
  border-radius: 28px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 0 rgba(8, 26, 52, .14);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.85rem);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.primary-button:hover, .share-button:hover { transform: translateY(-2px); box-shadow: 0 10px 0 rgba(8, 26, 52, .14); }
.primary-button:active, .share-button:active { transform: translateY(2px); box-shadow: 0 4px 0 rgba(8, 26, 52, .14); }
.primary-button:disabled, .share-button:disabled { opacity: .6; cursor: wait; }
.primary-button::before, .primary-button::after, .share-button::before, .share-button::after {
  content: "";
  width: 6px;
  height: 24px;
  border-radius: 8px;
  background: var(--mint);
  transform: rotate(-34deg);
}
.primary-button::after, .share-button::after { background: var(--pink); transform: rotate(34deg); }
.hero .primary-button { animation: cta-nudge 760ms ease-in-out 900ms 2; }
.micro-note { margin: 18px 0 0; color: var(--muted); font-size: .84rem; }

.character-catalog {
  margin-top: 54px;
  padding: clamp(22px, 5vw, 34px);
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 9px 0 rgba(8,26,52,.08);
  text-align: left;
}
.character-catalog > .eyebrow { text-align: center; }
.character-catalog h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.45rem, 5vw, 2.15rem); line-height: 1.55; text-align: center; }
.catalog-lead { max-width: 35rem; margin: 10px auto 22px; color: var(--muted); font-size: .86rem; line-height: 1.75; text-align: center; }
.character-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.character-card {
  display: grid;
  grid-template-columns: 42% 1fr;
  align-items: center;
  min-width: 0;
  min-height: 164px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 5px 0 rgba(8,26,52,.055);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.character-card:nth-child(4n+1) { background: #fff0f3; }
.character-card:nth-child(4n+2) { background: #fff8dc; }
.character-card:nth-child(4n+3) { background: #f0e8ff; }
.character-card:nth-child(4n) { background: #e9fbf4; }
.character-card:hover { transform: translateY(-3px) rotate(-.3deg); border-color: var(--ink); box-shadow: 0 8px 0 rgba(8,26,52,.08); }
.character-image { display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; }
.character-image img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 5px rgba(8,26,52,.13)); }
.character-card-copy { display: grid; align-content: center; gap: 7px; min-width: 0; padding-left: 8px; }
.character-card-copy strong { font-family: var(--font-display); font-size: clamp(.92rem, 2.8vw, 1.08rem); line-height: 1.55; }
.character-card-copy small { color: #3f4a5c; font-size: .78rem; line-height: 1.6; }
.character-card-copy em { color: var(--pink); font-size: .72rem; font-style: normal; }

.character-profile { text-align: center; }
.catalog-back { display: block; margin: 0 0 10px; padding: 9px 12px; border: 0; background: transparent; font-weight: 900; cursor: pointer; }
.character-profile > .eyebrow { margin-top: 8px; }
.character-profile-image { width: min(82vw, 390px); margin: 0 auto -10px; }
.character-profile h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3.55rem); line-height: 1.35; }
.character-tagline { display: inline-block; margin: 13px 0 20px; padding: 8px 17px; border-radius: 999px; background: var(--pink-soft); font-family: var(--font-display); line-height: 1.65; }
.character-story { padding: 21px; border: 2px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.68); text-align: left; }
.character-story p { margin: 0; line-height: 2; }
.relatable-card { margin-top: 18px; padding: 22px; border-radius: 24px; background: linear-gradient(135deg, var(--lavender-soft), #f5eaff); text-align: left; }
.relatable-card h2 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; }
.relatable-card ul { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.relatable-card li { position: relative; padding: 13px 15px 13px 43px; border-radius: 16px; background: rgba(255,255,255,.78); line-height: 1.75; }
.relatable-card li::before { content: "♡"; position: absolute; left: 15px; top: 12px; color: var(--pink); font-family: var(--font-display); }
.catalog-disclaimer { margin: 17px auto 0; color: var(--muted); font-size: .8rem; line-height: 1.75; }
.other-characters { margin-top: 42px; padding-top: 26px; border-top: 3px dotted var(--line); }
.other-characters h2 { margin: 0 0 16px; font-family: var(--font-display); font-size: 1.35rem; }
.other-character-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.other-character-grid button { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 8px 6px 10px; border: 2px solid var(--line); border-radius: 16px; background: var(--paper); cursor: pointer; }
.other-character-grid .character-image { aspect-ratio: 1; }
.other-character-grid span:last-child { font-size: .68rem; line-height: 1.45; }

.profile-screen { text-align: center; }
.profile-step { display: inline-block; margin: 4px 0 8px; padding: 6px 16px; border-radius: 99px; background: var(--mint-soft); font-family: var(--font-display); }
.profile-screen h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3.25rem); }
.profile-lead { max-width: 34rem; margin: 12px auto 24px; line-height: 1.8; }
.profile-screen form { display: grid; gap: 16px; }
.profile-field, .gender-field, .privacy-note { padding: 18px; border: 2px solid #cfcac0; border-radius: 22px; background: rgba(255,255,255,.68); text-align: left; }
.profile-field > span, .gender-field legend { padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.profile-field em, .gender-field em { margin-left: 5px; padding: 3px 8px; border-radius: 99px; background: var(--lavender-soft); font-family: var(--font-body); font-size: .72rem; font-style: normal; }
.profile-field select, .profile-field input[type="text"] { width: 100%; min-height: 54px; margin-top: 12px; padding: 10px 14px; border: 2px solid #aeb7c4; border-radius: 16px; color: var(--ink); background: var(--paper); font: inherit; }
.nickname-field { position: relative; }
.nickname-field small { display: block; margin-top: 7px; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.nickname-field .nickname-count { margin-top: 4px; color: var(--pink); text-align: right; font-weight: 900; }
.gender-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.gender-options label { position: relative; cursor: pointer; }
.gender-options input { position: absolute; opacity: 0; }
.gender-options span { display: grid; place-items: center; min-height: 52px; padding: 8px; border: 2px solid #aeb7c4; border-radius: 16px; background: var(--paper); }
.gender-options input:checked + span { border-color: var(--ink); background: var(--mint-soft); box-shadow: inset 0 -3px 0 rgba(99,221,183,.2); }
.privacy-note { border-style: dashed; background: #fff8e9; }
.privacy-note strong { font-family: var(--font-display); }
.privacy-note p { margin: 8px 0 0; color: #4f5968; font-size: .82rem; line-height: 1.7; }
.profile-start { margin-top: 2px; }
.skip-button, .delete-data-button { margin: 0 auto; padding: 10px 16px; border: 0; color: var(--ink); background: transparent; text-decoration: underline; cursor: pointer; }
.delete-data-button { display: block; color: var(--muted); font-size: .8rem; }
.delete-data-button:disabled { cursor: default; text-decoration: none; }

.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 4px 10px; }
.progress-copy { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.progress-copy small { display: block; margin-top: 3px; color: var(--muted); font-family: var(--font-body); font-size: .72rem; }
.page-chip { min-width: 62px; padding: 7px 14px; border-radius: 999px; color: #fff; background: var(--ink); text-align: center; font-family: var(--font-display); }
.progress-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.progress-track span { height: 14px; border-radius: 99px; background: #e5e4df; box-shadow: inset 0 1px 2px rgba(8,26,52,.12); }
.progress-track span.done { background: linear-gradient(90deg, var(--mint), #43ceb8); }
.quiz-title { margin: 0 0 18px; text-align: center; font-family: var(--font-display); font-size: clamp(1.35rem, 5vw, 2rem); }
.quiz-title::before, .quiz-title::after { content: "〽"; display: inline-block; margin: 0 12px; color: var(--pink); transform: rotate(18deg); }
.quiz-title::after { transform: scaleX(-1) rotate(18deg); }

.question-list { display: grid; gap: 16px; }
.question-card {
  position: relative;
  padding: 20px;
  border: 2px solid #cfcac0;
  border-radius: 22px;
  background: rgba(255,255,255,.63);
  box-shadow: 0 5px 0 rgba(8,26,52,.05);
}
.question-card.has-error { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,102,140,.16); }
.question-card legend { width: 100%; padding: 0; }
.question-heading { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 84px; padding-right: 82px; font-family: var(--font-display); font-size: clamp(1rem, 3.8vw, 1.25rem); line-height: 1.65; }
.question-copy { flex: 1; }
.question-copy .scenario, .question-copy small { display: block; }
.question-copy small { margin-top: 4px; font-family: var(--font-body); font-size: .8em; line-height: 1.55; }
.optional-chip { display: inline-block; margin-top: 7px; padding: 4px 9px; border-radius: 99px; color: var(--ink); background: var(--lavender-soft); font-family: var(--font-body); font-size: .66em; font-style: normal; }
.question-guide { position: absolute; top: -16px; right: -10px; width: 88px; }
.question-number { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 58px; padding: 7px 11px; border-radius: 999px; color: var(--ink); background: var(--pink-soft); }
.question-card:nth-child(3n + 2) .question-number { background: var(--mint-soft); }
.question-card:nth-child(3n) .question-number { background: var(--lavender-soft); }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.option-label { position: relative; display: flex; align-items: center; min-height: 66px; padding: 12px 14px 12px 54px; border: 2px solid #aeb7c4; border-radius: 19px; background: var(--paper); line-height: 1.45; cursor: pointer; transition: border 160ms ease, background 160ms ease, transform 160ms ease; }
.option-label:hover { transform: translateY(-1px); border-color: var(--ink); }
.option-label:last-child { grid-column: 1 / -1; min-height: 50px; color: var(--muted); border-style: dashed; font-size: .88rem; }
.option-label input { position: absolute; left: 14px; width: 28px; height: 28px; margin: 0; accent-color: var(--pink); }
.option-label:has(input:checked) { border-color: var(--ink); background: var(--pink-soft); box-shadow: inset 0 -3px 0 rgba(255,102,140,.12); }
.question-card:nth-child(3n + 2) .option-label:has(input:checked) { background: var(--mint-soft); }
.question-card:nth-child(3n) .option-label:has(input:checked) { background: var(--lavender-soft); }
.validation-summary { display: none; margin: 0 0 16px; padding: 14px 18px; border: 2px solid var(--pink); border-radius: 16px; background: #fff0f3; }
.validation-summary.show { display: block; }
.nav-row { display: grid; grid-template-columns: minmax(100px, .45fr) minmax(180px, 1fr); gap: 12px; align-items: end; margin-top: 22px; }
.back-button { min-height: 64px; border: 2px solid var(--ink); border-radius: 22px; background: transparent; font-family: var(--font-display); cursor: pointer; }
.nav-row .primary-button { width: 100%; min-height: 70px; margin: 0; }

.result-reveal { position: relative; min-height: calc(100vh - 110px); padding: 16px 0 30px; text-align: center; overflow: hidden; }
.result-reveal::before, .result-reveal::after { content: ""; position: absolute; z-index: -1; width: 230px; height: 230px; border-radius: 50%; filter: blur(1px); }
.result-reveal::before { top: 4%; left: -110px; background: var(--mint-soft); }
.result-reveal::after { right: -120px; bottom: 12%; background: var(--pink-soft); }
.result-reveal h1 { margin: 8px 0 10px; font-family: var(--font-display); font-size: clamp(2.35rem, 10vw, 4.4rem); line-height: 1.38; }
.reveal-lead { margin: 0 auto 14px; color: #475268; font-size: .9rem; line-height: 1.8; }
.reveal-capsule { position: relative; display: grid; place-items: center; width: min(78vw, 340px); aspect-ratio: 1; margin: 0 auto; padding: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reveal-capsule::before { content: ""; position: absolute; inset: 14%; border: 5px solid var(--ink); border-radius: 50%; background: linear-gradient(160deg, #b9f5df 0 48%, #ffb8d1 49% 100%); box-shadow: inset 12px 14px 0 rgba(255,255,255,.32), 0 18px 0 rgba(8,26,52,.07), 0 24px 42px rgba(8,26,52,.16); animation: capsule-breathe 1.1s ease-in-out infinite; }
.reveal-capsule::after { content: ""; position: absolute; z-index: 2; left: 16%; right: 16%; top: 49%; height: 13%; border: 5px solid var(--ink); border-radius: 99px; background: #fffef9; box-shadow: inset 0 -5px 0 rgba(255,200,80,.22); }
.capsule-half { position: absolute; z-index: 1; left: 25%; right: 25%; height: 10px; border-radius: 99px; background: rgba(255,255,255,.72); transform: rotate(-25deg); }
.capsule-top { top: 28%; }
.capsule-bottom { bottom: 27%; }
.reveal-silhouette { position: absolute; z-index: 3; display: grid; place-items: center; width: 42%; height: 42%; opacity: .28; transform: scale(.82); }
.reveal-silhouette img { display: block; width: 100%; height: 100%; object-fit: contain; filter: brightness(0) saturate(100%); }
.reveal-pop { position: absolute; z-index: 4; color: var(--pink); font-style: normal; font-size: 2rem; opacity: 0; pointer-events: none; }
.pop-heart { left: 12%; top: 22%; }
.pop-star { right: 11%; top: 18%; color: var(--yellow); }
.pop-dot { right: 13%; bottom: 18%; color: var(--mint); font-size: 1.3rem; }
.result-reveal.is-squished .reveal-capsule::before { animation: capsule-squish 430ms cubic-bezier(.2,.8,.2,1) 1; }
.result-reveal.is-squished .reveal-pop { animation: reveal-pop 680ms ease-out 1 both; }
.result-reveal.is-squished .pop-star { animation-delay: 70ms; }
.result-reveal.is-squished .pop-dot { animation-delay: 120ms; }
.reveal-nickname { margin: -12px 0 0; color: var(--pink); font-family: var(--font-display); font-size: 1.05rem; }
.reveal-open { margin-top: 17px; }
.result-reveal.is-opening { animation: reveal-open 300ms ease-in forwards; pointer-events: none; }
.result { position: relative; text-align: center; }
.confetti-layer { position: absolute; z-index: 5; inset: 0 0 auto; height: 300px; overflow: hidden; pointer-events: none; }
.confetti-layer i { position: absolute; top: 38px; left: calc(12% + var(--i) * 15%); width: 9px; height: 22px; border-radius: 5px; background: var(--confetti); opacity: 0; animation: confetti-pop 950ms cubic-bezier(.18,.7,.26,1) calc(var(--i) * 55ms) 1 both; }
.result-label { position: relative; display: table; margin: 2px auto 10px; padding: 7px 20px; border-radius: 99px; background: var(--pink-soft); font-family: var(--font-display); }
.result-label::before, .result-label::after { content: "〽"; position: absolute; top: 1px; color: var(--pink); font-size: 1.35rem; }
.result-label::before { right: calc(100% + 8px); transform: rotate(-18deg); }
.result-label::after { left: calc(100% + 8px); transform: scaleX(-1) rotate(-18deg); }
.result h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2.1rem, 9vw, 4.4rem); line-height: 1.3; }
.result-subject { margin: 0 0 4px; color: var(--pink); font-family: var(--font-display); }
.result-title { position: relative; display: inline-block; }
.result-title::after { content: ""; position: absolute; z-index: -1; left: -2%; right: -2%; bottom: .02em; height: .16em; border-radius: 99px; background: var(--pink-soft); transform: rotate(-1.5deg); }
.result-mascot { min-height: 270px; margin-top: 4px; }
.result-character { position: relative; z-index: 1; width: min(78%, 330px); animation: character-arrive 620ms cubic-bezier(.2,.85,.25,1.2) 120ms both; }
.result-character-image { position: relative; z-index: 1; width: min(86%, 430px); min-height: 250px; animation: character-arrive 620ms cubic-bezier(.2,.85,.25,1.2) 120ms both; }
.result-character-image img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 10px rgba(8,26,52,.14)); }
.score-badge { display: inline-flex; align-items: baseline; gap: 8px; margin: -12px auto 18px; padding: 10px 24px; border: 4px solid var(--ink); border-radius: 999px; background: var(--paper); box-shadow: 0 6px 0 rgba(8,26,52,.08); font-family: var(--font-display); }
.score-badge strong { color: var(--pink); font-size: clamp(2.5rem, 10vw, 4.4rem); line-height: 1; }
.score-badge span { font-size: 1.4rem; }
.score-badge span:first-child { font-size: clamp(.75rem, 2.8vw, 1rem); }
.result-grade { display: table; margin: -8px auto 14px; padding: 6px 14px; border-radius: 99px; color: var(--ink); background: var(--yellow); font-family: var(--font-display); font-size: .86rem; }
.result-note { margin: 0 auto 22px; max-width: 30rem; font-size: 1.05rem; line-height: 1.8; }
.axis-panel { padding: 18px 20px; border: 2px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.67); text-align: left; }
.axis-row + .axis-row { margin-top: 14px; }
.axis-name { margin-bottom: 2px; font-family: var(--font-display); font-size: .9rem; }
.axis-labels, .axis-values { display: flex; justify-content: space-between; gap: 10px; }
.axis-labels { margin-bottom: 5px; font-size: .84rem; }
.axis-values { margin-top: 3px; font-family: var(--font-display); font-size: .92rem; }
.axis-values .axis-main { color: var(--axis-color); }
.bar { height: 18px; overflow: hidden; border-radius: 99px; background: #dfdfdc; box-shadow: inset 0 2px 2px rgba(8,26,52,.08); }
.bar span { display: block; width: var(--value); height: 100%; border-radius: inherit; background: var(--axis-color); }
.share-builder { margin-top: 22px; padding: clamp(18px, 4vw, 26px); border: 3px solid var(--ink); border-radius: 28px; background: rgba(255,255,255,.7); box-shadow: 0 7px 0 rgba(8,26,52,.08); text-align: left; }
.share-builder > .eyebrow { text-align: center; }
.share-builder h2 { margin: 0; font-family: var(--font-display); font-size: 1.55rem; text-align: center; }
.share-builder-lead { margin: 8px auto 18px; color: var(--muted); font-size: .82rem; line-height: 1.7; text-align: center; }
.share-choice { margin: 14px 0 0; padding: 0; border: 0; }
.share-choice legend { margin-bottom: 8px; font-family: var(--font-display); font-size: .9rem; }
.share-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.share-choice label { position: relative; cursor: pointer; }
.share-choice input { position: absolute; opacity: 0; }
.share-choice label span { display: grid; place-items: center; min-height: 48px; padding: 9px 12px; border: 2px solid #aeb7c4; border-radius: 15px; background: var(--paper); font-size: .8rem; line-height: 1.55; text-align: center; }
.share-choice input:checked + span { border-color: var(--ink); background: var(--pink-soft); box-shadow: inset 0 -3px 0 rgba(255,102,140,.12); }
.share-quote-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 14px; padding: 14px; border: 2px solid var(--ink); border-radius: 18px; background: linear-gradient(135deg, #fff4f8, #fffbe8); box-shadow: 0 4px 0 rgba(8,26,52,.06); }
.share-quote-card strong { color: var(--pink); font-family: var(--font-display); font-size: .78rem; }
.share-quote-card p { margin: 5px 0 0; font-family: var(--font-display); font-size: .84rem; line-height: 1.65; }
.share-quote-card button { min-height: 42px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: .74rem; font-weight: 900; cursor: pointer; }
.share-quote-card button:hover { background: var(--mint-soft); }
.share-toggle { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 0 11px; margin-top: 12px; padding: 13px; border: 2px dashed var(--pink); border-radius: 16px; background: #fff4f7; cursor: pointer; }
.share-toggle input { position: relative; grid-row: 1 / span 2; width: 44px; height: 26px; margin: 0; appearance: none; border: 2px solid var(--ink); border-radius: 999px; background: #d8dde5; transition: background 160ms ease; }
.share-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(8,26,52,.24); transition: transform 160ms ease; }
.share-toggle input:checked { background: var(--pink); }
.share-toggle input:checked::after { transform: translateX(18px); }
.share-toggle input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.share-toggle small { color: var(--muted); font-size: .7rem; }
.share-name-empty { margin: 14px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.share-preview-frame { position: relative; display: grid; place-items: center; min-height: 330px; margin-top: 16px; overflow: hidden; border: 2px solid var(--line); border-radius: 22px; background: #eafaf5; }
.share-preview-frame canvas { display: block; width: auto; max-width: calc(100% - 28px); height: 300px; border-radius: 12px; box-shadow: 0 10px 24px rgba(8,26,52,.15); opacity: 0; transition: opacity 180ms ease; }
.share-preview-frame canvas[data-ready="true"] { opacity: 1; }
.share-preview-frame [data-preview-status] { position: absolute; color: var(--muted); font-size: .78rem; }

@media (max-width: 430px) {
  .share-quote-card { grid-template-columns: 1fr; }
  .share-quote-card button { justify-self: start; }
}
.share-button { min-height: 68px; border-radius: 24px; font-size: 1.25rem; }
.ai-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 16px; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, var(--lavender-soft), #f2ddff 54%, #e5d5ff); text-align: left; }
.ai-card .bulb { font-size: 2rem; }
.ai-card h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 1.05rem; }
.ai-card p { margin: 0; line-height: 1.65; font-size: .9rem; }
.restart-button { margin-top: 16px; padding: 12px 18px; border: 0; background: transparent; text-decoration: underline; cursor: pointer; }
.download-button { margin: 10px auto 0; padding: 10px 16px; border: 0; color: var(--ink); background: transparent; text-decoration: underline; cursor: pointer; }
.share-subactions { display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; }
.x-share-button { margin: 10px 0 0; padding: 10px 16px; border: 0; color: var(--ink); background: transparent; text-decoration: underline; cursor: pointer; }
.share-note { max-width: 34rem; margin: 8px auto 0; color: var(--muted); font-size: .75rem; line-height: 1.6; }
.ai-card { opacity: .88; }
.disclaimer { margin: 24px auto 0; max-width: 38rem; color: var(--muted); font-size: .72rem; line-height: 1.7; }
.missing-list { width: min(100%, 520px); margin: 18px auto; padding: 16px 16px 16px 40px; border-radius: 18px; background: #fff0f3; text-align: left; line-height: 1.8; }

.about-dialog { width: min(90vw, 520px); padding: 30px; border: 3px solid var(--ink); border-radius: 24px; color: var(--ink); background: var(--cream); box-shadow: var(--shadow); }
.about-dialog::backdrop { background: rgba(8,26,52,.56); backdrop-filter: blur(4px); }
.about-dialog h2 { margin: 0 0 16px; font-family: var(--font-display); }
.about-dialog p { line-height: 1.8; }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; font-size: 2rem; cursor: pointer; }

@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes mascot-float { 0%,100% { transform: translateY(0) rotate(var(--rotate)); } 50% { transform: translateY(-7px) rotate(var(--rotate)); } }
@keyframes mascot-tap { 0% { transform: scale(1) rotate(var(--rotate)); } 55% { transform: scale(.93) rotate(var(--rotate)); } 100% { transform: scale(1.04) rotate(var(--rotate)); } }
@keyframes cta-nudge { 0%,100% { transform: translateY(0); } 48% { transform: translateY(-5px); } }
@keyframes character-arrive { from { opacity: 0; transform: translateY(22px) scale(.78) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes confetti-pop { 0% { opacity: 0; transform: translateY(-15px) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(235px) rotate(240deg); } }
@keyframes capsule-breathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7px) scale(1.025); } }
@keyframes capsule-squish { 0%,100% { transform: scale(1); } 38% { transform: scale(1.08,.86); } 70% { transform: scale(.94,1.08); } }
@keyframes reveal-pop { 0% { opacity: 0; transform: translate(0,16px) scale(.4) rotate(-20deg); } 38% { opacity: 1; } 100% { opacity: 0; transform: translate(0,-58px) scale(1.2) rotate(18deg); } }
@keyframes reveal-open { to { opacity: 0; transform: scale(1.035); } }
@keyframes dopa-counter-pop { 0% { opacity: .45; transform: rotate(-1deg) scale(.94); } 100% { opacity: 1; transform: rotate(-1deg) scale(1); } }

@media (max-width: 560px) {
  .app-shell { padding: 14px 14px 36px; }
  .topbar { padding-bottom: 12px; }
  .hero h1 { font-size: clamp(2.2rem, 12.8vw, 3.7rem); }
  .hero-lead { font-size: .9rem; }
  .mascot-stage { min-height: 300px; }
  .mascot-group { height: 292px; }
  .stage-prop { width: 41px; height: 35px; border-width: 2px; font-size: 1rem; }
  .option-grid { grid-template-columns: 1fr; }
  .option-label:last-child { grid-column: auto; }
  .question-card { padding: 16px 14px; border-radius: 18px; }
  .question-heading { gap: 8px; }
  .question-number { min-width: 48px; padding: 6px 8px; }
  .nav-row { grid-template-columns: 96px 1fr; }
  .quiz-title::before, .quiz-title::after { margin: 0 5px; }
  .ai-card { grid-template-columns: 1fr; text-align: center; }
  .character-catalog { margin-top: 42px; padding: 20px 14px; }
  .character-grid { grid-template-columns: 1fr; gap: 11px; }
  .character-card { grid-template-columns: 39% 1fr; min-height: 146px; padding: 9px; }
  .character-card-copy { padding-left: 5px; }
  .character-card-copy strong { font-size: 1rem; }
  .character-profile-image { width: min(88vw, 340px); }
  .other-character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:focus-visible { outline: 4px solid rgba(53,199,196,.55); outline-offset: 3px; }

.seo-sections { width: min(100% - 28px, 920px); margin: 22px auto 0; padding-bottom: 60px; }
.diagnostic-active .seo-sections { display: none; }
.content-nav { display: flex; justify-content: center; gap: 8px 18px; flex-wrap: wrap; padding: 18px; border: 2px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.58); }
.content-nav a, .seo-sections footer a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.info-section { margin-top: 18px; padding: clamp(22px, 5vw, 38px); border: 2px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.64); box-shadow: 0 8px 0 rgba(8,26,52,.035); }
.info-section h2 { margin: 0 0 14px; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2.15rem); }
.info-section h3 { margin: 0 0 7px; font-family: var(--font-display); font-size: 1rem; }
.info-section h3 a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.info-section p { line-height: 1.9; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.type-grid article { padding: 16px; border-radius: 18px; background: var(--paper); }
.type-grid article:nth-child(3n+1) { box-shadow: inset 0 4px 0 var(--pink-soft); }
.type-grid article:nth-child(3n+2) { box-shadow: inset 0 4px 0 var(--mint-soft); }
.type-grid article:nth-child(3n) { box-shadow: inset 0 4px 0 var(--lavender-soft); }
.type-grid p { margin: 0; font-size: .9rem; }
.info-section details { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: var(--paper); }
.info-section summary { font-weight: 900; cursor: pointer; }
.seo-sections footer { padding: 28px 14px; color: var(--muted); text-align: center; }

@media (max-width: 560px) { .type-grid { grid-template-columns: 1fr; } }

.seo-character-page { width: min(100% - 28px, 760px); margin: 0 auto; padding: 18px 0 56px; }
.seo-breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 16px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.seo-breadcrumb a, .seo-character-page footer a { color: var(--ink); text-underline-offset: 3px; }
.seo-character-card { position: relative; overflow: hidden; padding: clamp(22px, 6vw, 44px); border: 3px solid var(--ink); border-radius: 34px; background: rgba(255,255,255,.78); box-shadow: 0 10px 0 rgba(8,26,52,.08); text-align: center; }
.seo-character-card::before, .seo-character-card::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; filter: blur(2px); opacity: .45; pointer-events: none; }
.seo-character-card::before { top: -45px; left: -35px; background: var(--mint-soft); }
.seo-character-card::after { right: -40px; bottom: -45px; background: var(--pink-soft); }
.seo-character-card > * { position: relative; z-index: 1; }
.seo-character-card > img { display: block; width: min(72%, 360px); height: auto; margin: 0 auto 2px; object-fit: contain; }
.seo-character-card h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.75rem, 7vw, 2.8rem); line-height: 1.35; }
.seo-character-caption { margin: 12px 0 20px; color: var(--pink); font-family: var(--font-display); font-size: clamp(1rem, 4vw, 1.35rem); }
.seo-character-profile { margin: 0 auto; max-width: 38em; text-align: left; line-height: 1.95; }
.seo-character-card section { margin: 24px 0 0; padding: 18px; border-radius: 22px; background: var(--paper); text-align: left; }
.seo-character-card section h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.15rem; }
.seo-character-card section ul { margin: 0; padding-left: 1.4em; line-height: 1.9; }
.seo-character-note { margin: 18px 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }
.seo-character-cta { display: flex; width: min(100%, 390px); margin: 18px auto 0; text-decoration: none; }
.seo-character-links { margin-top: 20px; padding: 24px; border: 2px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.64); }
.seo-character-links h2 { margin: 0 0 14px; font-family: var(--font-display); font-size: 1.2rem; }
.seo-character-links > div { display: flex; gap: 8px; flex-wrap: wrap; }
.seo-character-links a { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: .78rem; font-weight: 900; text-decoration: none; }
.seo-character-page footer { padding: 30px 12px 0; color: var(--muted); text-align: center; font-size: .82rem; }
