:root {
  color-scheme: light;
  --paper: #f8f6ed;
  --white: #fffdf6;
  --ink: #25231e;
  --muted: #665f52;
  --line: #d8d1c1;
  --yellow: #ffcd45;
  --yellow-dark: #f4b927;
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans CJK JP", Meiryo, sans-serif;
  --mono: ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

h1, h2, p, figure { margin: 0; }
a { color: inherit; }
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button, a, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid #655100; outline-offset: 5px; }
[tabindex="-1"]:focus { outline: none; }

.wrap {
  width: min(100% - 36px, 1120px);
  margin-inline: auto;
}

.site-header, .site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
}

.site-header {
  min-height: 68px;
  border-bottom: 1px solid var(--ink);
}

.brand, .share-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: .04em;
}

.brand { min-height: 44px; }

.brand-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, var(--yellow) 50%);
  transform: rotate(27deg);
}

.header-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

.header-note span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

main { flex: 1; }

.site-footer {
  padding-block: 18px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
}

.site-footer > span { font-weight: 800; }

.intro {
  display: grid;
  gap: 38px;
  padding-block: 37px 45px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.eyebrow span {
  width: 20px;
  height: 2px;
  background: var(--ink);
}

.intro-title {
  margin: 14px 0 21px;
  font-size: clamp(3.65rem, 16vw, 6.45rem);
  font-weight: 900;
  letter-spacing: -.105em;
  line-height: 1.01;
}

.intro-title > span { display: block; width: fit-content; }

.title-accent {
  padding: 0 .06em .045em 0;
  background: linear-gradient(transparent 72%, var(--yellow) 72%, var(--yellow) 97%, transparent 97%);
}

.intro-description {
  max-width: 24em;
  font-size: .96rem;
  font-weight: 700;
  line-height: 1.95;
}

.start-form {
  display: grid;
  gap: 9px;
  max-width: 350px;
  margin-top: 24px;
}

.start-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .83rem;
  font-weight: 800;
}

.start-form label span {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.5;
}

.start-form input, .copy-fallback {
  width: 100%;
  min-height: 49px;
  padding: 10px 13px;
  border: 1px solid #8c8476;
  border-radius: 5px;
  background: var(--white);
  font-size: 1rem;
}

.start-form input::placeholder { color: #726a5e; }

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: .6em;
  padding: 10px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.button-primary { background: var(--ink); color: var(--white); }
.button-secondary { background: var(--white); }
.button:active { transform: translateY(2px); box-shadow: none; }

.start-form .button {
  min-height: 56px;
  justify-content: space-between;
  margin-top: 5px;
  padding-inline: 17px;
  box-shadow: 3px 3px 0 var(--yellow-dark);
  font-size: 1rem;
}

.button-arrow { color: var(--yellow); font-size: 1.25rem; line-height: 1; }

.hero {
  isolation: isolate;
  position: relative;
  width: 100%;
  aspect-ratio: 1.2;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  box-shadow: 4px 4px 0 var(--ink);
  background-color: var(--yellow);
  background-image:
    linear-gradient(#3a2d161a 1px, transparent 1px),
    linear-gradient(90deg, #3a2d161a 1px, transparent 1px);
  background-position: center;
  background-size: 25px 25px;
}

.hero-corner {
  position: absolute;
  inset: 4.5%;
  border: 1px solid #42301c58;
  border-radius: 3px;
}

.hero-egg {
  position: absolute;
  inset: 1% 10% 3%;
}

.hero-egg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(4px 6px 0 #25231e22);
}

.hero-option {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .55em;
  padding: .5em .7em;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: clamp(.84rem, 2.8vw, 1.2rem);
  font-weight: 900;
  white-space: nowrap;
}

.hero-option span, .choice-letter {
  display: grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  flex-shrink: 0;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--yellow);
  font: 800 .75em var(--mono);
}

.hero-option-a { top: 14%; left: 10%; transform: rotate(-12deg); }
.hero-option-b { bottom: 17%; right: 9%; transform: rotate(11deg); }

.hero-sparkle {
  position: absolute;
  z-index: 1;
  top: 12%;
  right: 14%;
  font-size: clamp(1.5rem, 5vw, 2.8rem);
  line-height: 1;
}

.hero-or {
  position: absolute;
  bottom: 11%;
  left: 10%;
  font-size: clamp(.85rem, 3.2vw, 1.25rem);
  font-weight: 900;
  transform: rotate(-12deg);
}

.narrow { width: min(100%, 640px); margin-inline: auto; }

.quiz { padding-block: 18px 42px; }
.result { padding-block: 28px 50px; }
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .875rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.progress-count { font: 800 .85rem var(--mono); }

.progress {
  height: 7px;
  margin: 7px 0 17px;
  overflow: hidden;
  border-radius: 6px;
  background: #e8e1d2;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width .15s ease;
}

.question-card {
  display: grid;
  min-height: 132px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 17px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  text-align: center;
}

.question-number { font: 800 .9rem var(--mono); letter-spacing: .12em; }
.question-card h1 { font-size: clamp(1.45rem, 6vw, 2.6rem); line-height: 1.38; text-wrap: balance; }

.choices { display: grid; gap: 11px; margin-top: 17px; }

.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 1.0625rem;
  font-weight: 800;
  text-align: left;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.choice-letter { width: 32px; height: 32px; font-size: .9rem; }
.choice-arrow { font-size: 1.15rem; line-height: 1; }
.choice:active { transform: translateY(2px); background: var(--yellow); box-shadow: none; }

.feedback {
  display: grid;
  gap: 11px;
  margin-top: 17px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.feedback-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
}

.feedback-heading h2 { font-size: 1.25rem; line-height: 1.3; }
.data-note { color: var(--muted); font-size: .8125rem; font-weight: 800; }
.data-note span { margin-left: .35em; font-weight: 500; }
.feedback-options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.feedback-options li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; align-items: end; }
.feedback-option { font-size: 1rem; font-weight: 800; overflow-wrap: anywhere; }
.feedback-selected {
  display: inline-block;
  margin-left: .45em;
  padding: 0 .4em;
  border-radius: 3px;
  background: var(--yellow);
  font-size: .75rem;
  vertical-align: .12em;
}

.feedback-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0 .5em;
  max-width: 9em;
  color: var(--muted);
  font-size: .8125rem;
}

.feedback-details strong { color: var(--ink); font: 900 1.125rem var(--mono); }
.feedback-track { grid-column: 1 / -1; height: 9px; overflow: hidden; border-radius: 5px; background: #eee9dc; }
.feedback-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #807667;
  transform: scaleX(var(--share));
  transform-origin: left;
  animation: fill-share .43s ease-out both;
}
.feedback-options .is-selected .feedback-track span { background: var(--yellow-dark); }
.feedback .button { justify-content: space-between; }

@keyframes fill-share {
  from { transform: scaleX(0); }
}

.result-title {
  margin-bottom: 16px;
  font-size: clamp(1.45rem, 5vw, 2rem);
  overflow-wrap: anywhere;
}

.share-card {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--white);
}

.score-card {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 21px 12px;
  background-color: var(--yellow);
  background-image: radial-gradient(#49360d35 1px, transparent 1px);
  background-position: center;
  background-size: 15px 15px;
  text-align: center;
}

.share-brand { font-size: .8rem; }
.share-brand .brand-mark { width: 16px; height: 16px; flex-basis: 16px; }
.score-label { margin-top: 11px; font-size: .97rem; font-weight: 800; }
.score { display: flex; align-items: baseline; font: 900 clamp(4.35rem, 20vw, 7.5rem)/1.1 var(--mono); letter-spacing: -.09em; }
.score-unit { margin-left: .17em; font-size: .4em; letter-spacing: -.04em; }

.rank {
  margin-top: 10px;
  padding: 5px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  font-weight: 800;
}

.minority-card { padding: 15px 14px; border-top: 1.5px solid var(--ink); }
.minority-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 1.0625rem; }
.minority-card h2 span {
  padding: 0 .5em;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--yellow);
  font-size: .8125rem;
  white-space: nowrap;
}
.minority-list { display: grid; gap: 0 16px; margin: 9px 0 0; padding: 0; list-style: none; }
.minority-list li { min-width: 0; padding-block: 7px; border-top: 1px solid var(--line); }
.minority-question { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.minority-answer { font-size: 1rem; font-weight: 800; }
#minority-empty { margin-top: 9px; color: var(--muted); font-size: .94rem; }

.result-shares { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.result-shares .button:first-child { flex: 1 1 175px; }
.result-shares .button:last-child { flex: 1 1 110px; }

.status { color: var(--muted); font-size: .85rem; }
.status:not(:empty) { margin-top: 8px; }
.copy-fallback { margin-top: 8px; min-height: 95px; resize: vertical; }
.card-preview { margin-top: 8px; }
.card-preview summary { min-height: 44px; padding: 9px 0; cursor: pointer; font-weight: 800; }
.card-preview img { display: block; width: 100%; height: auto; }

.highlights, .invite {
  margin-top: 32px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.highlights h2, .invite h2 { margin-bottom: 13px; font-size: 1.2rem; }
.ranking { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ranking li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
}

.ranking-number { padding-top: 2px; font: 800 1rem var(--mono); }
.ranking-question { font-size: .8125rem; font-weight: 800; color: var(--muted); }
.ranking-detail { font-size: 1rem; }
.invite .text-button { display: flex; width: fit-content; margin-top: 6px; }

@media (hover: hover) {
  .button-primary:hover { background: #3b3730; }
  .button-secondary:hover, .choice:hover { background: #ffecae; }
  .brand:hover { text-decoration: underline; text-underline-offset: 3px; }
}

@media (min-width: 600px) {
  .wrap { width: min(100% - 56px, 1120px); }
  .site-header { min-height: 76px; }
  .quiz, .result { padding-block: 52px 65px; }
  .question-card { min-height: 210px; }
  .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .choice { min-height: 78px; padding: 15px; }
  .feedback { padding: 16px; }
  .feedback-details { max-width: none; }
  .score-card { min-height: 285px; }
  .minority-card { padding: 17px 20px; }
  .minority-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 820px) {
  .intro {
    min-height: min(690px, calc(100vh - 145px));
    grid-template-columns: .9fr 1.1fr;
    align-items: center;
    gap: clamp(34px, 6vw, 92px);
    padding-block: 56px 64px;
  }
  .intro-title { margin-block: 17px 24px; font-size: clamp(5rem, 8.65vw, 8.25rem); }
  .intro-description { font-size: 1rem; }
  .start-form { margin-top: 28px; }
  .hero { aspect-ratio: 1.045; box-shadow: 6px 6px 0 var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .button, .choice, .progress span { transition: none; }
  .feedback-track span { animation: none; }
}
