:root {
  --bg-1: #54a9df;
  --bg-2: #3d97d4;
  --ink: #13436a;
  --muted: #5f84a3;
  --line: #b8def6;
  --card: #ffffff;
  --brand: #4ba9e6;
  --brand-dark: #2f86c6;
  --accent: #ffb52f;
  --accent-deep: #ff9533;
  --success: #42b88b;
  --error: #ef7f73;
  --navy: #20558c;
  --cream: #fff6dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "M PLUS 1p", "Noto Sans JP", sans-serif;
  background:
    radial-gradient(circle at 50% -10%, #9ed7ff 0, #9ed7ff00 28%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
  position: relative;
}

.site-header {
  width: 100%;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 10px 0;
  background: linear-gradient(180deg, #ffffffd9, #ffffffb8);
  border-bottom: 1px solid #ffffff80;
  backdrop-filter: blur(6px);
}

.header-inner {
  width: min(440px, calc(100vw - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffffee;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 18px #1c4d7830;
  backdrop-filter: blur(3px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--navy);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: min(180px, 48vw);
}

.menu-toggle {
  width: 44px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid;
  gap: 4px;
  align-content: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 999px;
}

.mobile-menu {
  width: min(440px, calc(100vw - 48px));
  margin: 8px auto 0;
  padding: 8px;
  border-radius: 12px;
  background: #ffffffee;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 18px #1c4d7830;
}

.mobile-menu a {
  display: block;
  padding: 10px 12px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.container {
  width: min(440px, calc(100vw - 48px));
  margin: 16px auto 40px;
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: 1fr;
}

.card {
  background: var(--card);
  border: 2px solid #ffffff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow:
    0 0 0 3px #2f86c61a,
    0 14px 30px #1c4d7830;
}

.hero h1,
.quiz-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.75rem, 7.2vw, 2.25rem);
  line-height: 1.2;
  text-align: center;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.lead {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 600;
  text-align: center;
}

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: #fff;
}

.quiz-start {
  text-align: center;
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.hero::after {
  display: none;
}

.hero-copy,
.section-copy {
  margin: 14px 0 0;
  color: var(--ink);
  line-height: 1.8;
  font-size: 0.94rem;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.hero-points span,
.section-label {
  display: inline-block;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.hero-points span {
  padding: 8px 10px;
  border-radius: 12px;
  background: #eef8ff;
  border: 2px solid var(--line);
  color: var(--navy);
}

.hero-visual {
  margin: 0 auto 18px;
}

.hero-image {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 auto;
}

.hero-figure {
  position: relative;
  width: 180px;
  height: 148px;
  margin: 6px auto 14px;
}

.hero-figure.compact {
  width: 150px;
  height: 124px;
}

.hero-circle {
  position: absolute;
  inset: 18px 22px 0;
  border-radius: 50%;
  background: #d8efff;
}

.hero-face {
  position: absolute;
  left: 50%;
  top: 44px;
  width: 78px;
  height: 78px;
  margin-left: -39px;
  border-radius: 50%;
  background: #fff5eb;
}

.hero-hair {
  position: absolute;
  left: 10px;
  top: -8px;
  width: 58px;
  height: 34px;
  background: var(--navy);
  border-radius: 18px 18px 10px 10px;
}

.hero-eye,
.hero-smile {
  position: absolute;
  display: block;
  background: var(--navy);
}

.hero-eye {
  top: 34px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.hero-eye.left {
  left: 24px;
}

.hero-eye.right {
  right: 24px;
}

.hero-smile {
  left: 27px;
  right: 27px;
  bottom: 18px;
  height: 4px;
  border-radius: 999px;
}

.hero-board {
  position: absolute;
  right: 30px;
  top: 30px;
  width: 26px;
  height: 92px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  transform: rotate(-24deg);
  box-shadow: inset 0 0 0 3px #ffffffb5;
}

.hero-figure.compact .hero-circle {
  inset: 16px 18px 0;
}

.hero-figure.compact .hero-face {
  top: 38px;
  width: 68px;
  height: 68px;
  margin-left: -34px;
}

.hero-figure.compact .hero-board {
  height: 78px;
  right: 26px;
  top: 28px;
}

.rules h2,
.quiz-body h2,
.card h2 {
  margin: 0 0 12px;
  line-height: 1.4;
  color: var(--navy);
  text-align: center;
  font-size: 1.45rem;
}

.rules ul {
  margin: 0;
  padding-left: 20px;
  color: #234;
}

.feature-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: #234;
  line-height: 1.8;
  font-size: 0.93rem;
}

.feature-list.compact {
  line-height: 1.6;
}

.page-path {
  margin: 0 0 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
}

.page-path a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.step {
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #f9fcff;
  text-align: center;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.step-num {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 14px #ffb52f55;
}

.section-label {
  display: block;
  width: fit-content;
  margin: 0 0 10px;
  margin-inline: auto;
  color: var(--brand-dark);
  text-align: center;
}

.accent-card {
  background: linear-gradient(180deg, #fff8f2, #ffffff);
}

.directory-grid,
.roadmap-grid,
.level-rows {
  display: grid;
  gap: 12px;
}

.directory-card,
.roadmap-item,
.level-row {
  padding: 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #f9fcff;
}

.directory-card h3,
.roadmap-item strong,
.level-name {
  color: var(--navy);
}

.directory-card h3 {
  margin: 0;
  text-align: center;
  font-size: 1.08rem;
}

.directory-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.92rem;
  text-align: center;
}

.directory-kicker {
  margin: 0 0 8px;
  color: var(--brand-dark);
  text-align: center;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.directory-levels,
.directory-actions,
.level-row-actions,
.level-switch,
.category-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.directory-levels,
.directory-actions,
.level-switch,
.category-switch {
  margin-top: 14px;
  justify-content: center;
}

.level-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef8ff;
  border: 2px solid var(--line);
  font-weight: 800;
  font-size: 0.86rem;
}

.level-row-actions {
  justify-content: center;
}

.level-chip,
.category-chip {
  appearance: none;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 6px 0 #dcebf7;
}

.level-chip.active,
.category-chip.active {
  border-color: #f6d288;
  background: linear-gradient(180deg, #fff4cf, #ffe7a7);
  box-shadow: 0 6px 0 #edd18d;
}

.level-chip:disabled,
.category-chip:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.roadmap-item strong {
  display: block;
  text-align: center;
  font-size: 1rem;
}

.roadmap-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
  font-size: 0.92rem;
}

.roadmap-item.active {
  background: linear-gradient(180deg, #fff9ea, #ffffff);
  border-color: #f6d288;
}

.category-panel {
  background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.quote {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cream);
  border: 2px solid #ffe0a7;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.final-cta {
  background: linear-gradient(160deg, #ffffff, #f3faff);
}

.actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 #dcebf7;
}

.btn.primary {
  border-color: #f6d288;
  background: linear-gradient(180deg, #ffc94d, #ffb52f);
  color: var(--navy);
  box-shadow: 0 6px 0 #e2a42b;
}

.btn.secondary {
  background: #f7fbff;
  color: var(--navy);
}

.btn:hover {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.feedback {
  font-weight: 700;
  text-align: center;
}

.feedback.success {
  border-color: #97e6c8;
  background: #f2fffa;
  color: #0a7a54;
}

.feedback.error {
  border-color: #f2b6b6;
  background: #fff4f4;
  color: #9f2f2f;
}

.progress {
  margin-top: 14px;
  height: 14px;
  background: #edf5fc;
  border: 2px solid #d8e8f5;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--brand));
}

.choices {
  display: grid;
  gap: 12px;
}

.choice-btn {
  width: 100%;
  border: 2px solid #cfe3f5;
  border-radius: 16px;
  background: #ffffff;
  color: #113;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 12px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #dcebf7;
}

.choice-btn:hover {
  border-color: var(--brand);
  background: #eef8ff;
}

.choice-btn.correct-answer {
  border-color: #8ed8be;
  background: #f2fff9;
  box-shadow: 0 6px 0 #bfe8d3;
}

.choice-btn.correct-answer .index {
  background: #8ed8be;
  color: #0a7a54;
}

.index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #dff0ff;
  color: #0f6e9f;
  font-weight: 800;
  font-size: 0.92rem;
}

.result.success {
  border-color: #8ed8be;
  background: #f2fff9;
}

.result.fail {
  border-color: #f0bbbb;
  background: #fff8f8;
}

.question,
.explanation {
  margin: 10px 0 0;
  color: #24384c;
  line-height: 1.7;
}

.explanation-toggle {
  margin-top: 14px;
}

.explanation-toggle summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #f7fbff;
  color: var(--navy);
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 0 #dcebf7;
}

.explanation-toggle summary::-webkit-details-marker {
  display: none;
}

.explanation-toggle[open] summary {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.quiz-copy,
.result-copy {
  margin: 10px 0 0;
  color: var(--brand-dark);
  text-align: center;
  line-height: 1.7;
  font-size: 0.92rem;
}

.score-total {
  margin: 10px 0 0;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 0.98rem;
}

.score-gain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2fff9;
  color: #0a7a54;
  border: 2px solid #8ed8be;
  font-size: 0.86rem;
  line-height: 1;
}

.score-breakdown {
  display: grid;
  gap: 12px;
}

.score-row {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #f9fcff;
}

.score-row-head,
.score-row-question,
.score-row-meta {
  margin: 0;
}

.score-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy);
  font-weight: 800;
  font-size: 0.92rem;
}

.score-row-question {
  margin-top: 8px;
  color: var(--ink);
  line-height: 1.6;
}

.score-row-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.timer {
  margin: 10px 0 0;
  color: var(--accent-deep);
  text-align: center;
  font-weight: 800;
  font-size: 0.98rem;
}

.timebar {
  width: 100%;
  height: 12px;
  margin: 12px 0 0;
  background: #edf5fc;
  border: 2px solid #d8e8f5;
  border-radius: 999px;
  overflow: hidden;
}

.timebar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 0.2s linear;
}

.foot-link {
  text-align: center;
}

.foot-link a {
  color: #1b5f86;
  text-decoration: none;
  font-weight: 700;
}

.site-footer {
  width: min(440px, calc(100vw - 48px));
  margin: 0 auto 24px;
  padding: 0 0 12px;
}

.footer-inner {
  background: linear-gradient(180deg, #eff8ff, #ffffff);
  border: 2px solid #ffffff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow:
    0 0 0 3px #2f86c61a,
    0 14px 30px #1c4d7830;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  justify-content: center;
  margin: 0;
  color: var(--navy);
  text-decoration: none;
}

.footer-logo {
  display: block;
  width: auto;
  height: 38px;
  max-width: min(200px, 56vw);
}

.footer-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-nav {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
}

.footer-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.footer-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .container {
    margin: 20px auto;
  }

  .card {
    border-radius: 14px;
    padding: 16px;
  }

  .choice-btn {
    padding: 11px;
  }
}

@media (min-width: 641px) {
  .directory-grid {
    grid-template-columns: 1fr 1fr;
  }
}
