:root {
  color-scheme: light;
  --cream: #faf6ef;
  --paper: #fffdf9;
  --ink: #594632;
  --line: #795e48;
  --subtle: #90795f;
  --border: #eadfce;
  --green: #e5edd9;
  --lavender: #eee5f1;
  --shadow: 0 8px 24px rgb(94 69 43 / 7%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #9b7ec3; outline-offset: 3px; }

.site-header { width: min(1120px, calc(100% - 40px)); min-height: 84px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; width: min(280px, 48vw); }
.brand img { display: block; width: 100%; height: auto; }
.site-nav { display: flex; gap: 8px; align-items: center; }
.site-nav a { padding: 11px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: #725b43; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 650; }
.site-nav a:hover, .site-nav a.active { background: #fffaf2; border-color: var(--border); }
.menu-toggle { display: none; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 50%; background: var(--paper); }

main { width: min(1040px, calc(100% - 40px)); min-height: 65vh; margin: 28px auto 80px; }
.panel { border: 1px solid #ecdcc2; border-radius: 30px; background: #fff9ec; box-shadow: var(--shadow); }
.hero { display: grid; grid-template-columns: 1fr 0.9fr; align-items: center; gap: 36px; padding: clamp(28px, 5vw, 60px); overflow: hidden; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: #8a6a4e; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(34px, 5vw, 58px); line-height: 1.2; letter-spacing: -.04em; }
h2 { line-height: 1.35; }
.hero h1 span { color: #80634b; }
.hero-lead { margin: 0 0 10px; font-size: clamp(18px, 2.2vw, 23px); font-weight: 750; }
.hero-sub { color: #77634c; line-height: 1.9; }
.hero-actions { display: grid; gap: 11px; max-width: 370px; margin-top: 26px; }
.quiet, .muted, .small-note, .quiz-disclaimer { color: #89755f; font-size: 13px; line-height: 1.75; }
.quiet { margin: 14px 0 0; }
.hero-animals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; transform: rotate(2deg); }
.hero-animal { display: grid; place-items: center; padding: 8px 12px; border: 1px solid rgb(121 94 72 / 12%); border-radius: 24px; background: var(--animal-bg, #f3e5cf); color: #765b41; font-size: 14px; font-weight: 750; }
.hero-animal:nth-child(even) { transform: translateY(18px); }
.animal-image { display: block; width: 100%; height: auto; object-fit: contain; }
.hero-animal .animal-image { max-width: 175px; }

.button { min-height: 48px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 15px; cursor: pointer; font-weight: 750; text-align: center; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 13px rgb(75 53 33 / 12%); }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button.primary { background: #795e48; color: #fffdf9; box-shadow: 0 4px 0 #5f4938; }
.button.secondary { background: #fffdf9; color: var(--ink); border-color: #dfcfb8; }
.button.outline { color: #72563e; background: transparent; border-color: #cdb99e; }
.button.dark { background: #252525; color: white; }
.button.line { color: white; background: #13844f; }
.center { margin: 24px 0 0; text-align: center; }
.text-link { color: #795e48; font-weight: 750; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }

.section { padding: 64px 0 12px; }
.section-heading { margin-bottom: 24px; }
.section-heading h2, .page-heading h1 { margin-bottom: 9px; font-size: clamp(28px, 4vw, 40px); }
.section-heading p:last-child, .page-heading p:last-child { color: #806d58; }
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.type-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.type-tile { display: flex; min-width: 0; flex-direction: column; align-items: center; padding: 17px 13px; overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: var(--paper); text-align: center; box-shadow: 0 4px 14px rgb(94 69 43 / 4%); transition: transform .15s ease; }
.type-tile:hover { transform: translateY(-3px); }
.type-tile .animal-image { width: min(100%, 180px); min-height: 86px; border-radius: 15px; background: var(--animal-bg); }
.type-tile-code { margin-top: 10px; color: #987b5c; font-size: 11px; letter-spacing: .12em; }
.type-tile strong { margin: 3px 0; font-size: 16px; }
.page-heading { padding: 26px 0 24px; }
.callout { margin-top: 38px; padding: 30px; border: 1px solid #e4d7c4; border-radius: 25px; background: #f1eadc; text-align: center; }
.callout h2 { margin-bottom: 8px; }
.callout p { color: #77634c; line-height: 1.7; }

.quiz-shell { width: min(720px, 100%); margin: 0 auto; padding: clamp(22px, 5vw, 52px); border: 1px solid var(--border); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.quiz-counter { color: #80694f; font-size: 14px; font-weight: 750; }
.progress-track, .axis-track, .stat-track { overflow: hidden; border-radius: 999px; background: #eee7dc; }
.progress-track { height: 8px; margin-bottom: 35px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: #957454; transition: width .2s ease; }
.quiz-shell .eyebrow { margin-bottom: 14px; }
.quiz-prompt { margin-bottom: 26px; font-size: clamp(24px, 3.5vw, 33px); line-height: 1.6; letter-spacing: -.025em; }
.choice-poles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 13px; }
.choice-poles > div { min-height: 76px; padding: 13px 15px; display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; background: var(--green); line-height: 1.6; }
.choice-poles > div:nth-child(2) { background: var(--lavender); }
.choice-poles b { flex: 0 0 auto; font-size: 18px; }
.binary-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.binary-choice div { min-height: 62px; padding: 14px; border-radius: 15px; background: var(--green); font-weight: 700; text-align: center; }
.binary-choice div + div { background: var(--lavender); }
.answer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.answer-choice { min-width: 0; min-height: 72px; padding: 9px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid #e2d7c7; border-radius: 13px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: center; }
.answer-choice:nth-child(1), .answer-choice:nth-child(2) { border-color: #d8e4cf; }
.answer-choice:nth-child(4), .answer-choice:nth-child(5) { border-color: #e4d6e9; }
.answer-choice:hover { background: #fff9ef; }
.answer-choice.selected { border: 2px solid #795e48; background: #f4eadb; box-shadow: inset 0 0 0 1px #795e48; }
.choice-dot { width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #ab997f; border-radius: 50%; }
.answer-choice:nth-child(1) .choice-dot, .answer-choice:nth-child(2) .choice-dot { border-color: #7d9c77; }
.answer-choice:nth-child(4) .choice-dot, .answer-choice:nth-child(5) .choice-dot { border-color: #9b80b1; }
.answer-choice.selected .choice-dot { border-color: #795e48; background: #795e48; box-shadow: inset 0 0 0 3px #fff; }
.answer-grid.two { grid-template-columns: 1fr 1fr; }
.answer-grid.two .answer-choice { min-height: 84px; }
.status-grid .answer-choice { min-height: 66px; font-size: 12px; }
.axis-hint { margin: 14px 0 0; color: #8a7863; font-size: 12px; text-align: center; }
.quiz-actions { margin-top: 27px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.quiz-actions .button { min-width: 130px; }
.auto-next-hint { color: #89755f; font-size: 12px; text-align: right; }
.quiz-disclaimer { margin: 19px 0 0; }

.result-hero { padding: clamp(26px, 5vw, 50px); text-align: center; background: var(--animal-bg); }
.result-hero .eyebrow { color: #80664b; }
.result-art { width: min(420px, 90%); margin: 0 auto 0; }
.result-art .animal-image { max-height: 270px; }
.type-code { margin: 4px 0 4px; color: #80664b; font-size: 13px; font-weight: 800; letter-spacing: .18em; }
.result-hero h1 { margin: 0 0 7px; font-size: clamp(34px, 5vw, 52px); }
.result-tagline { margin-bottom: 14px; font-size: clamp(17px, 2.5vw, 22px); font-weight: 750; }
.result-desc { max-width: 700px; margin: 0 auto; color: #705b44; line-height: 1.9; }
.personal-note { margin: 19px 0 0; color: #80694f; font-size: 13px; }
.share-panel, .detail-card { margin-top: 18px; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--border); border-radius: 23px; background: var(--paper); box-shadow: 0 4px 16px rgb(94 69 43 / 4%); }
.share-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; align-items: center; }
.share-panel h2 { margin-bottom: 7px; font-size: 22px; }
.share-panel p { margin-bottom: 0; color: #83705b; font-size: 14px; line-height: 1.7; }
.share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.share-actions .button { min-height: 44px; padding: 10px; border-radius: 12px; font-size: 13px; }
.share-feedback { grid-column: 1 / -1; min-height: 1.5em; color: #755c41 !important; }
.result-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-card h2 { margin-bottom: 15px; font-size: 21px; }
.detail-card h3 { margin: 21px 0 8px; font-size: 16px; }
.detail-card p, .detail-card li { color: #715e48; line-height: 1.85; }
.detail-card ul { margin: 0; padding-left: 1.25em; }
.detail-card li + li { margin-top: 9px; }
.detail-card li::marker { color: #c18d66; }
.axis-result + .axis-result { margin-top: 18px; }
.axis-labels { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.axis-track { position: relative; height: 12px; background: linear-gradient(90deg, #dfe9d9 0 50%, #eee4f2 50% 100%); }
.axis-track span { position: absolute; top: -3px; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: #795e48; box-shadow: 0 0 0 1px #795e48; transform: translateX(-50%); }
.axis-result small { display: block; margin-top: 5px; color: #8b7862; font-size: 11px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.stat-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 13px; }
.stat-row b { color: #80654b; }
.stat-track { height: 8px; }
.stat-track span { display: block; height: 100%; border-radius: inherit; background: #a8b99a; }
.small-note { margin: 15px 0 0; }
.invite-callout { margin-top: 20px; padding: 26px; border-radius: 22px; background: #eee6f1; text-align: center; }
.invite-callout h2 { margin-bottom: 16px; }

.pair-form { width: min(760px, 100%); margin: 0 auto; padding: clamp(22px, 5vw, 44px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 15px; }
.pair-form label { display: grid; gap: 8px; font-weight: 750; }
.pair-form select { width: 100%; min-height: 52px; padding: 10px 38px 10px 14px; border: 1px solid #d9c9b4; border-radius: 13px; background: white; color: var(--ink); }
.pair-mark { align-self: center; padding-top: 19px; color: #987e61; font-size: 25px; font-weight: 800; }
.pair-form button, .pair-form .small-note { grid-column: 1 / -1; }
.pair-result { padding: clamp(24px, 5vw, 48px); background: #f4f8ed; text-align: center; }
.pair-result h1 { margin-bottom: 25px; font-size: clamp(28px, 4vw, 42px); }
.pair-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(6px, 3vw, 25px); }
.pair-character { min-width: 0; padding: 16px; border: 1px solid #e5dbc9; border-radius: 20px; background: var(--animal-bg); }
.pair-character .animal-image { max-width: 300px; max-height: 205px; margin: 0 auto 8px; }
.pair-character b { display: block; font-size: clamp(14px, 2vw, 19px); }
.pair-x { font-size: 27px; font-weight: 800; }
.combo-name { margin: 27px 0 8px; font-size: clamp(27px, 4vw, 39px); font-weight: 850; line-height: 1.45; }
.pair-label { color: #806c55; font-size: 14px; }
.pair-relationship { max-width: 740px; margin: 23px auto 0; color: #705c45; line-height: 1.9; }
.disclaimer { margin: 25px 0; color: #897760; font-size: 12px; line-height: 1.8; text-align: center; }
.prose { max-width: 780px; margin: 0 auto; }
.prose h2:not(:first-child) { margin-top: 30px; }
.notice { padding: 14px; border-radius: 12px; background: #f4ecdd; }
.empty-state { max-width: 680px; margin: 10vh auto; padding: 40px; text-align: center; }
.empty-state p { color: #806d58; line-height: 1.7; }
.site-footer { padding: 30px 20px 42px; border-top: 1px solid #e9dfd1; color: #826f58; text-align: center; }
.site-footer p { margin: 0 auto 7px; font-size: 12px; line-height: 1.75; }
.site-footer a { display: inline-block; margin-top: 7px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.reveal-screen { position: relative; width: min(680px, calc(100% - 40px)); min-height: 70vh; margin: 4vh auto; padding: 45px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #eadfce; border-radius: 32px; background: radial-gradient(circle at 50% 40%, #fffdf8 0, #f8eddc 68%, #f2e6d4 100%); text-align: center; }
.reveal-screen .eyebrow { margin-bottom: 17px; }
.reveal-copy { min-height: 2em; margin: 0 0 12px; color: #80664b; font-size: clamp(17px, 2.8vw, 23px); font-weight: 750; }
.reveal-mascot-stage { width: 176px; height: 176px; margin: 7px auto 14px; display: grid; place-items: center; border: 1px solid #ead9bd; border-radius: 50%; background: #fffaf0; box-shadow: 0 13px 32px rgb(94 69 43 / 10%); animation: reveal-bounce .72s ease-in-out infinite alternate; }
.reveal-mascots { width: 125px; height: 125px; object-fit: contain; }
.reveal-screen h1 { margin: 0 0 17px; font-size: clamp(27px, 4vw, 38px); }
.reveal-progress { width: min(360px, 90%); margin: 0 auto 20px; }
.reveal-progress-heading { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; color: #795e48; font-size: 13px; font-weight: 750; }
.reveal-progress-heading strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.reveal-meter { height: 15px; overflow: hidden; border: 1px solid #e5d5bf; border-radius: 999px; background: #fffdf8; box-shadow: inset 0 2px 4px rgb(94 69 43 / 8%); }
.reveal-meter span { position: relative; display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e8b982, #df9e87, #b99acb); transition: width .08s linear; }
.reveal-meter span::after { position: absolute; top: 50%; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: #fffaf2; box-shadow: 0 0 8px rgb(255 255 255 / 90%); content: ''; transform: translateY(-50%); }
.reveal-skip { min-width: 200px; }
.reveal-note { margin: 15px 0 0; color: #8a765f; font-size: 12px; }
.reveal-spark { position: absolute; color: #b99a70; font-size: 32px; animation: reveal-sparkle 1.5s ease-in-out infinite alternate; }
.spark-one { top: 23%; left: 17%; }
.spark-two { top: 33%; right: 16%; animation-delay: .35s; }
.spark-three { top: 54%; left: 16%; color: #d58f9b; font-size: 20px; animation-delay: .7s; }
@keyframes reveal-bounce { from { transform: translateY(4px) rotate(-2deg); } to { transform: translateY(-7px) rotate(2deg); } }
@keyframes reveal-sparkle { from { opacity: .35; transform: scale(.8) rotate(-10deg); } to { opacity: 1; transform: scale(1.15) rotate(12deg); } }

@media (max-width: 760px) {
  .site-header { min-height: 72px; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .site-header { position: relative; }
  .site-nav { position: absolute; z-index: 5; top: calc(100% - 3px); right: 0; left: 0; display: none; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
  .site-nav.open { display: grid; grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-animals { max-width: 430px; margin: 0 auto; }
  .hero-animal .animal-image { max-width: 150px; }
  .type-grid, .type-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .share-panel { grid-template-columns: 1fr; gap: 15px; }
  .result-columns { grid-template-columns: 1fr; gap: 0; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  main { width: calc(100% - 24px); margin-top: 14px; }
  .site-header { width: calc(100% - 24px); }
  .brand { width: 218px; }
  .hero { padding: 23px 18px; border-radius: 23px; }
  .hero-actions { max-width: none; }
  .hero-animal { padding: 6px; }
  .hero-animal .animal-image { max-width: 125px; }
  .quiz-shell { padding: 21px 14px; border-radius: 21px; }
  .quiz-prompt { font-size: 24px; }
  .choice-poles { gap: 7px; }
  .choice-poles > div { min-height: 92px; padding: 10px; gap: 7px; font-size: 13px; }
  .answer-grid { gap: 5px; }
  .answer-choice { min-height: 74px; padding: 8px 2px; border-radius: 10px; font-size: 11px; }
  .choice-dot { width: 16px; height: 16px; }
  .status-grid .answer-choice { font-size: 10px; }
  .status-grid { grid-template-columns: 1fr; gap: 7px; }
  .status-grid .answer-choice { min-height: 46px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 12px; font-size: 13px; text-align: left; }
  .reveal-screen { width: calc(100% - 24px); min-height: 72vh; margin: 3vh auto; padding: 30px 18px; }
  .reveal-mascot-stage { width: 158px; height: 158px; }
  .reveal-mascots { width: 112px; height: 112px; }
  .quiz-actions .button { min-width: 108px; }
  .auto-next-hint { font-size: 11px; }
  .share-actions { gap: 7px; }
  .share-actions .button { min-height: 46px; font-size: 12px; }
  .pair-form { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 20px 14px; }
  .pair-form select { padding-left: 9px; font-size: 13px; }
  .pair-character { padding: 8px 4px; }
  .pair-character .animal-image { max-height: 125px; }
}

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