:root {
  --site-blue: #7F95D1;
  --site-blue-soft: #e9f6f8;
  --teal: #8c8fca;
  --teal-soft: #ececff;
  --gray-bar: #686868;
  --text: #68657a;
  --title: #56536c;
  --muted: #8d899d;
  --paper: #ffffff;
  --warm: #f7f6ff;
  --line: #e4e1f0;
  --kuro: #6464b5;
  --kuro-bg: #e4e3ff;
  --shiro: #b7d95f;
  --shiro-bg: #f1ffd8;
  --shadow: 0 10px 28px rgba(70, 68, 105, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0;
}

body::before,
body::after {
  content: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(280px, 680px) minmax(120px, 1fr);
  align-items: center;
  gap: 24px;
  padding: clamp(82px, 10vw, 126px) clamp(18px, 5vw, 64px) 86px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfbff 0%, #ffffff 72%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--site-blue);
  z-index: 0;
}

.hero::before {
  top: 0;
}

.hero::after {
  display: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-center {
  text-align: center;
}

.small-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  color: var(--title);
  font-size: clamp(42px, 6vw, 62px);
  font-weight: 500;
  line-height: 1.25;
  text-shadow: 0 4px 8px rgba(91, 88, 125, 0.13);
}

h2 {
  margin-bottom: 18px;
  color: var(--title);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  line-height: 1.45;
}

h3 {
  margin-bottom: 14px;
  color: var(--title);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 600;
  line-height: 1.55;
}

.hero-copy {
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: clamp(16px, 2vw, 18px);
}

.hero-copy span {
  display: block;
}

.main-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.main-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 58px;
  padding: 14px 30px;
  border-radius: 7px;
  color: #fff;
  background: var(--site-blue);
  box-shadow: 0 4px 8px rgba(116, 118, 179, 0.22);
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: -7px;
  font-size: 18px;
  font-weight: 700;
}

.main-button:hover {
  background: #7d81c2;
}

.main-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.text-button {
  padding: 10px 12px;
  color: var(--teal);
  background: transparent;
  font-weight: 700;
}

.hero-illust {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.character-slot {
  width: min(100%, 220px);
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 2px dashed #cbc8df;
  border-radius: 18px;
  color: #918da7;
  background: #fbfaff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.hero-illust img {
  width: min(100%, 260px);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 18px rgba(70, 68, 105, 0.12));
}

.character-slot img {
  width: min(100%, 230px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(70, 68, 105, 0.1));
}

.hero-illust-left {
  transform: rotate(-7deg);
}

.hero-illust-right {
  transform: rotate(5deg);
}

.content-section {
  padding: clamp(56px, 8vw, 92px) clamp(20px, 6vw, 78px);
}

.soft-bg {
  background: var(--warm);
}

.about-section {
  margin-top: clamp(-28px, -3vw, -16px);
  padding-top: clamp(34px, 5vw, 54px);
  background: #f4f4f6;
}

#kuro {
  background: linear-gradient(180deg, #efeeff, #f7f6ff);
}

#shiro {
  background: linear-gradient(180deg, #fbfff0, #ffffff);
}

#kuro .character-slot {
  border-color: rgba(100, 100, 181, 0.46);
  background: #e7e6ff;
  color: #6964a6;
}

#shiro .character-slot {
  border-color: rgba(155, 191, 46, 0.5);
  background: #f1ffd8;
  color: #7b9430;
}

.section-title {
  max-width: 820px;
  margin-bottom: 34px;
}

.section-title.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-title p:not(.small-label) {
  color: var(--muted);
}

.section-title p span {
  display: block;
}

.intro-layout,
.type-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
}

.text-block {
  font-size: 17px;
}

.balance-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.balance-side {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 10px;
  text-align: center;
}

.balance-side strong {
  font-size: 28px;
  color: var(--title);
}

.balance-side span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.kuro-side {
  background: var(--kuro-bg);
  border: 1px solid rgba(100, 100, 181, 0.28);
}

.shiro-side {
  background: var(--shiro-bg);
  border: 1px solid rgba(155, 191, 46, 0.32);
}

.balance-center {
  color: var(--teal);
  font-size: 22px;
  font-weight: 700;
}

.balance-illust {
  display: none;
}

.type-layout {
  grid-template-columns: minmax(230px, 360px) minmax(0, 1fr);
}

.type-layout.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 360px);
}

.type-layout.reverse .character-slot {
  order: 2;
}

.type-text {
  max-width: 680px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compare-table {
  max-width: 1120px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.compare-section {
  background: var(--site-blue-soft);
}

.compare-row {
  display: grid;
  grid-template-columns: 0.65fr 1fr 1fr;
  border-top: 1px solid var(--line);
}

.compare-row:first-child {
  border-top: 0;
}

.compare-row span {
  padding: 18px 20px;
}

.compare-head {
  color: #fff;
  background: var(--site-blue);
  font-weight: 700;
}

.map-section {
  background: #fff;
}

.gentle-map {
  position: relative;
  max-width: 760px;
  min-height: 430px;
  margin: 36px auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 25% 75%, rgba(169, 162, 255, 0.76) 0%, rgba(199, 195, 255, 0.48) 28%, rgba(241, 241, 244, 0) 58%),
    radial-gradient(ellipse at 75% 25%, rgba(214, 255, 119, 0.78) 0%, rgba(229, 255, 169, 0.5) 28%, rgba(241, 241, 244, 0) 58%),
    linear-gradient(135deg, #f4f4f6 0%, #ededf1 48%, #f4f4f6 100%);
  box-shadow: var(--shadow);
}

.gentle-map::before,
.gentle-map::after {
  content: "";
  position: absolute;
  background: rgba(86, 83, 108, 0.34);
}

.gentle-map::before {
  top: 46px;
  bottom: 46px;
  left: 50%;
  width: 1px;
}

.gentle-map::after {
  top: 50%;
  right: 46px;
  left: 46px;
  height: 1px;
}

.map-axis {
  position: absolute;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.map-axis-y {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.map-axis-x {
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.map-axis-left {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.map-axis-bottom {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.map-card {
  position: absolute;
  width: min(38%, 250px);
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(86, 83, 108, 0.13);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(70, 68, 105, 0.1);
}

.map-card strong {
  color: var(--title);
  font-size: 28px;
}

.map-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.map-kuro {
  bottom: 25%;
  left: 25%;
  transform: translate(-50%, 50%);
  background: var(--kuro-bg);
}

.map-shiro {
  right: 25%;
  top: 25%;
  transform: translate(50%, -50%);
  background: var(--shiro-bg);
}

.map-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  border: 1px solid rgba(140, 143, 202, 0.2);
  border-radius: 50%;
  color: var(--teal);
  background: #fff;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  z-index: 2;
  box-shadow: 0 10px 26px rgba(70, 68, 105, 0.12);
}

.quiz-start-title span {
  display: block;
}

.quiz-section {
  background: #fff;
}

.quiz-card {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--warm);
  box-shadow: var(--shadow);
}

.quiz-screen {
  display: none;
}

.quiz-screen.active {
  display: block;
}

#quiz-start {
  text-align: center;
}

.quiz-start-title {
  max-width: 560px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.7;
}

.quiz-eyebrow {
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.quiz-progress {
  margin-bottom: 28px;
}

.quiz-progress span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e2dc;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  margin: 0;
  background: #9295d2;
  transition: width 0.25s ease;
}

.question-text {
  margin-bottom: 24px;
  color: var(--title);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.65;
}

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

.answer-option {
  display: block;
}

.answer-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer-option span {
  display: block;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.answer-option input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--title);
  font-weight: 700;
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
}

#quiz-result {
  text-align: center;
}

#result-type {
  font-size: clamp(34px, 6vw, 54px);
  color: var(--teal);
}

.result-lead {
  max-width: 520px;
  margin: 0 auto 26px;
}

.score-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto 10px;
  color: var(--muted);
  font-weight: 700;
}

.result-track {
  max-width: 480px;
  margin: 0 auto 26px;
}

.flow-list {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
}

.flow-list a {
  min-width: 220px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  justify-self: center;
  padding: 14px 30px;
  border: 1px solid rgba(127, 149, 209, 0.36);
  border-radius: 8px;
  background: var(--site-blue);
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 18px rgba(53, 142, 163, 0.18);
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: -7px;
}

.flow-list strong,
.flow-list span {
  display: block;
}

.flow-list strong {
  margin-bottom: 8px;
  color: #fff;
}

.flow-list span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.site-flow .section-title {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.site-flow h2 {
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 600;
}

@media (max-width: 900px) {
  #top {
    display: flex;
    flex-direction: column;
  }

  .hero {
    order: 1;
  }

  .about-section {
    order: 2;
  }

  #shiro {
    order: 3;
  }

  #kuro {
    order: 4;
  }

  .compare-section {
    order: 5;
  }

  .map-section {
    order: 6;
  }

  .quiz-section {
    order: 7;
  }

  .site-flow {
    order: 8;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 72px;
  }

  .hero-illust {
    min-height: 150px;
  }

  .hero-illust img {
    max-width: 180px;
  }

  .hero-illust-left,
  .hero-illust-right {
    transform: none;
  }

  .hero-illust-right {
    order: -1;
  }

  .hero-center {
    order: 0;
  }

  .hero-illust-left {
    order: 1;
  }

  .intro-layout,
  .type-layout,
  .type-layout.reverse,
  .flow-list {
    grid-template-columns: 1fr;
  }

  .type-layout.reverse .character-slot {
    order: 0;
  }

  .character-slot {
    width: 100%;
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

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

  .balance-card {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 1200 / 630;
    display: block;
    overflow: visible;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .balance-card::before {
    content: none;
  }

  .balance-illust {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .shiro-side {
    top: 6%;
    color: #5f6f1f;
  }

  .balance-center {
    display: none;
  }

  .kuro-side {
    bottom: 7%;
    color: #5f5982;
  }

  .balance-side {
    position: absolute;
    left: 50%;
    z-index: 1;
    min-height: auto;
    width: min(46%, 156px);
    padding: 6px 10px;
    gap: 2px;
    line-height: 1.25;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 6px 16px rgba(70, 68, 105, 0.08);
    transform: translateX(-50%);
  }

  .balance-side strong {
    font-size: 22px;
    line-height: 1.2;
  }

  .balance-side span {
    color: currentColor;
    font-size: 12px;
    line-height: 1.25;
  }

  .compare-table {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .compare-row.compare-head {
    display: none;
  }

  .compare-row:not(.compare-head) {
    display: block;
    overflow: hidden;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .compare-row:not(.compare-head):first-of-type {
    margin-top: 0;
  }

  .compare-row span {
    display: grid;
    grid-template-columns: 5.5em minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
  }

  .compare-row span::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .compare-row span:first-child {
    background: var(--site-blue);
    color: #fff;
    font-weight: 700;
  }

  .compare-row span:first-child::before {
    color: rgba(255, 255, 255, 0.86);
  }

  .compare-row span + span {
    border-top: 1px solid var(--line);
  }

  .gentle-map {
    min-height: 380px;
  }

  .map-card {
    width: 42%;
    min-height: 104px;
  }

  .map-kuro {
    bottom: 25%;
    left: 25%;
  }

  .map-shiro {
    right: 25%;
    top: 25%;
  }

  .map-center {
    width: 112px;
    height: 112px;
    font-size: 14px;
  }

  .quiz-nav {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .quiz-nav .main-button,
  #quiz-start .main-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .flow-list a {
    width: min(100%, 416px);
    max-width: calc(100vw - 49px);
  }

  #quiz-start .main-button {
    width: min(calc(100% + 48px), 416px);
    max-width: calc(100vw - 49px);
    min-height: 93px;
  }
}
