:root {
  --paper: #f7f3ec;
  --paper-deep: #eee7dc;
  --ink: #322f39;
  --ink-soft: #6f6876;
  --line: rgba(50, 47, 57, 0.14);
  --apricot: #eaa58b;
  --aqua: #8fc7c1;
  --butter: #dfc66d;
  --berry: #8f7188;
  --white: #fffdf9;
  --shadow: 0 22px 60px rgba(75, 60, 66, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(143, 113, 136, 0.42);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.46;
  pointer-events: none;
}

.ambient-one {
  top: -120px;
  right: -105px;
  width: 280px;
  height: 280px;
  background: rgba(143, 199, 193, 0.5);
}

.ambient-two {
  bottom: 4vh;
  left: -120px;
  width: 240px;
  height: 240px;
  background: rgba(234, 165, 139, 0.36);
}

.shell {
  width: min(100% - 36px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 34px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
  text-decoration: none;
}

.wordmark-kicker,
.eyebrow,
.progress-meta,
.question-number {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.wordmark-kicker {
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.wordmark-title {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.045em;
}

.mini-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.65);
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.screen {
  animation: screen-in 0.42s ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.start-screen {
  padding: 6px 0 36px;
  text-align: center;
}

.blend-mark {
  display: grid;
  grid-template-columns: repeat(4, 17px);
  gap: 7px;
  width: max-content;
  margin: 0 auto 28px;
  transform: rotate(-4deg);
}

.blend-mark span {
  width: 17px;
  height: 17px;
  border: 1px solid rgba(50, 47, 57, 0.11);
  border-radius: 50%;
}

.blend-mark span:nth-child(4n + 1) { background: var(--apricot); }
.blend-mark span:nth-child(4n + 2) { background: var(--aqua); }
.blend-mark span:nth-child(4n + 3) { background: var(--butter); }
.blend-mark span:nth-child(4n) { background: var(--berry); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--berry);
  font-size: 0.72rem;
}

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

h1 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2.2rem, 11vw, 4.3rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.035em;
}

.intro {
  max-width: 560px;
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 2;
  text-align: left;
}

.character-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px auto 34px;
}

.character-list span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.58);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  min-width: min(100%, 310px);
  padding: 15px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(50, 47, 57, 0.14);
  color: var(--white);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(50, 47, 57, 0.18);
}

.primary-button:active,
.secondary-button:active,
.answer-button:active {
  transform: translateY(1px);
}

.microcopy {
  margin: 15px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.quiz-screen {
  max-width: 680px;
  margin: 0 auto;
}

.progress-wrap {
  margin-bottom: 22px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.progress-meta strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.progress-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.progress-bar span {
  display: block;
  width: 5%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--apricot), var(--berry));
  transition: width 260ms ease;
}

.question-card {
  min-height: 530px;
  padding: 30px 20px 22px;
  border: 1px solid rgba(50, 47, 57, 0.1);
  border-radius: 30px;
  background: rgba(255, 253, 249, 0.88);
  box-shadow: var(--shadow);
}

.question-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0 0 22px;
  border-radius: 50%;
  background: var(--aqua);
  color: var(--ink);
  font-size: 0.72rem;
}

.question-card h2 {
  min-height: 76px;
  margin: 0 0 26px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.45rem, 6vw, 2rem);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.025em;
}

.answer-list {
  display: grid;
  gap: 11px;
}

.answer-button {
  display: grid;
  grid-template-columns: 32px 1fr;
  width: 100%;
  min-height: 64px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  line-height: 1.65;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.answer-button:hover {
  border-color: rgba(143, 113, 136, 0.5);
  background: rgba(234, 165, 139, 0.1);
}

.answer-button[aria-pressed="true"] {
  border-color: var(--berry);
  background: rgba(143, 113, 136, 0.1);
}

.answer-letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
}

.text-button {
  display: block;
  margin: 18px auto 0;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.88rem;
}

.text-button:disabled {
  visibility: hidden;
}

.result-screen {
  padding-top: 2px;
}

.result-screen > .eyebrow,
.result-screen > h1,
.result-summary {
  text-align: center;
}

.result-screen h1 {
  font-size: clamp(2.25rem, 10vw, 3.8rem);
}

.result-summary {
  max-width: 570px;
  margin: 20px auto 34px;
  color: var(--ink-soft);
  line-height: 1.9;
}

.result-list {
  display: grid;
  gap: 14px;
}

.result-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  overflow: hidden;
  padding: 21px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 12px 30px rgba(75, 60, 66, 0.065);
}

.result-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: var(--card-color);
  content: "";
}

.result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.result-score strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.75rem;
  line-height: 1;
}

.result-score span {
  color: var(--ink-soft);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result-role {
  margin: 0 0 3px;
  color: var(--berry);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result-character {
  margin: 0 0 8px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.result-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.75;
}

.result-note {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  margin-top: 24px;
  padding: 17px 18px;
  border: 1px dashed rgba(50, 47, 57, 0.22);
  border-radius: 18px;
  color: var(--ink-soft);
}

.result-note p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.75;
}

.note-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--butter);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.result-actions {
  display: grid;
  gap: 11px;
  width: min(100%, 390px);
  margin: 30px auto 0;
}

.x-button {
  width: 100%;
}

.x-button > span {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
}

.secondary-button {
  width: 100%;
  padding: 14px 24px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.7);
  color: var(--ink-soft);
}

.secondary-button:hover {
  background: var(--white);
}

footer {
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.7;
  text-align: center;
}

footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  .shell {
    padding-top: 36px;
  }

  .site-header {
    margin-bottom: 64px;
  }

  .intro {
    text-align: center;
  }

  .question-card {
    padding: 40px 42px 34px;
  }

  .result-list {
    grid-template-columns: 1fr 1fr;
  }

  .result-card {
    grid-template-columns: 72px 1fr;
  }
}

@media (max-width: 390px) {
  .shell {
    width: min(100% - 28px, 760px);
  }

  .site-header {
    margin-bottom: 38px;
  }

  .wordmark-title {
    font-size: 0.98rem;
  }

  .question-card {
    min-height: 520px;
    border-radius: 24px;
  }

  .result-card {
    grid-template-columns: 72px 1fr;
    gap: 14px;
    padding-right: 15px;
  }
}

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