@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@400;700;900&family=Noto+Sans+JP:wght@400;500;700&display=swap');

.quiz-page {
  --q-bg: #F6F5F3;
  --q-card: #FCFBF9;
  --q-text: #1A1A1A;
  --q-sub: #4A4A4A;
  --q-muted: #8A8A8A;
  --q-accent: #1F9E8F;
  --q-correct: #16A34A;
  --q-wrong: #DC2626;
  --q-border: #E2E1DE;
  --q-radius: 12px;
  --q-max: 560px;
  --q-font-d: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --q-font-b: 'Noto Sans JP', sans-serif;

  min-height: 100vh;
  background: var(--q-bg);
  color: var(--q-text);
  font-family: var(--q-font-b);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.quiz-page *, .quiz-page *::before, .quiz-page *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

/* ---------- header ---------- */
.quiz-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(246, 245, 243, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--q-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.2rem;
}
.quiz-header__logo {
  font-family: var(--q-font-d); font-weight: 900; font-size: 1rem;
  color: var(--q-text); text-decoration: none;
}
.quiz-header__link {
  font-size: 0.78rem; font-weight: 600;
  color: var(--q-accent); text-decoration: none;
}

/* ---------- intro ---------- */
.quiz-intro {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 5rem 1.5rem 3rem;
}
.quiz-intro__inner {
  max-width: var(--q-max); text-align: center;
}
.quiz-intro__eyebrow {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em;
  color: var(--q-accent); text-transform: uppercase; margin-bottom: 1.2rem;
}
.quiz-intro__title {
  font-family: var(--q-font-d); font-weight: 900;
  font-size: 2.4rem; line-height: 1.25; letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.quiz-intro__desc {
  font-size: 0.92rem; color: var(--q-sub); line-height: 1.8;
  margin-bottom: 1.5rem;
}
.quiz-intro__meta {
  display: flex; justify-content: center; gap: 1.5rem;
  font-size: 0.82rem; font-weight: 600; color: var(--q-muted);
  margin-bottom: 2.5rem;
}
.quiz-intro__meta span {
  display: flex; align-items: center; gap: 0.3rem;
}
.quiz-btn-start {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--q-text); color: var(--q-bg);
  font-family: var(--q-font-d); font-weight: 700; font-size: 1rem;
  padding: 1rem 3rem; border-radius: 999px; border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(26, 26, 26, 0.12);
  transition: transform 0.2s, box-shadow 0.2s;
}
.quiz-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.18);
}

/* ---------- question ---------- */
.quiz-main {
  max-width: var(--q-max); margin: 0 auto;
  padding: 4.5rem 1.2rem 2rem;
  min-height: 100vh;
}
.quiz-progress {
  height: 4px; background: var(--q-border); border-radius: 2px;
  overflow: hidden; margin-bottom: 0.4rem;
}
.quiz-progress__bar {
  height: 100%; background: var(--q-accent); border-radius: 2px;
  transition: width 0.3s ease;
}
.quiz-progress__label {
  font-size: 0.72rem; font-weight: 600; color: var(--q-muted);
  text-align: right; margin-bottom: 1.5rem;
}

.quiz-card {
  background: var(--q-card); border: 1px solid var(--q-border);
  border-radius: var(--q-radius); padding: 1.5rem;
}
.quiz-card__chapter {
  font-size: 0.72rem; font-weight: 600; color: var(--q-muted);
  margin-bottom: 1rem;
}
.quiz-card__prompt {
  font-family: var(--q-font-d); font-weight: 500;
  font-size: 1.1rem; line-height: 1.7; margin-bottom: 1.5rem;
  color: var(--q-text);
}

.quiz-choices {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.quiz-choice {
  width: 100%; text-align: center;
  padding: 0.85rem 1rem; border-radius: 8px;
  border: 1.5px solid var(--q-border); background: #fff;
  font-family: var(--q-font-b); font-size: 0.92rem; font-weight: 500;
  color: var(--q-text); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.quiz-choice:not(:disabled):hover {
  border-color: var(--q-accent); background: rgba(31, 158, 143, 0.04);
  transform: translateY(-1px);
}
.quiz-choice:not(:disabled):active { transform: translateY(0); }

.quiz-choice--correct {
  border-color: var(--q-correct) !important;
  background: rgba(22, 163, 74, 0.08) !important;
  color: var(--q-correct); font-weight: 700;
}
.quiz-choice--wrong {
  border-color: var(--q-wrong) !important;
  background: rgba(220, 38, 38, 0.06) !important;
  color: var(--q-wrong);
}
.quiz-choice--dim { opacity: 0.4; }

/* feedback */
.quiz-feedback {
  margin-top: 1.2rem; padding: 1rem 1.2rem;
  border-radius: 8px; font-size: 0.88rem; line-height: 1.7;
}
.quiz-feedback--correct {
  background: rgba(22, 163, 74, 0.06);
  border-left: 3px solid var(--q-correct);
}
.quiz-feedback--wrong {
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid var(--q-wrong);
}
.quiz-feedback__label {
  font-family: var(--q-font-d); font-weight: 700; font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.quiz-feedback--correct .quiz-feedback__label { color: var(--q-correct); }
.quiz-feedback--wrong .quiz-feedback__label { color: var(--q-wrong); }
.quiz-feedback__text { color: var(--q-sub); }

.quiz-btn-next {
  display: block; width: 100%; margin-top: 1rem;
  padding: 0.75rem; border-radius: 999px; border: none;
  background: var(--q-text); color: var(--q-bg);
  font-family: var(--q-font-d); font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: transform 0.15s;
}
.quiz-btn-next:hover { transform: translateY(-1px); }

/* ---------- result ---------- */
.quiz-result {
  min-height: 100vh; padding: 5rem 1.2rem 3rem;
  display: flex; align-items: flex-start; justify-content: center;
}
.quiz-result__inner {
  max-width: var(--q-max); width: 100%; text-align: center;
}
.quiz-result__eyebrow {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em;
  color: var(--q-accent); text-transform: uppercase; margin-bottom: 1rem;
}
.quiz-result__score { margin-bottom: 0.5rem; }
.quiz-result__num {
  font-family: var(--q-font-d); font-weight: 900; font-size: 4rem;
  color: var(--q-text); line-height: 1;
}
.quiz-result__denom {
  font-family: var(--q-font-d); font-weight: 700; font-size: 1.6rem;
  color: var(--q-muted);
}
.quiz-result__comment {
  font-size: 0.92rem; color: var(--q-sub); margin-bottom: 2rem; line-height: 1.7;
}

/* chapter breakdown */
.quiz-result__chapters {
  background: var(--q-card); border: 1px solid var(--q-border);
  border-radius: var(--q-radius); padding: 1.5rem;
  margin-bottom: 1.5rem; text-align: left;
}
.quiz-result__chapters h3 {
  font-family: var(--q-font-d); font-size: 0.88rem; font-weight: 700;
  margin-bottom: 1rem; color: var(--q-text);
}
.quiz-result__ch { margin-bottom: 0.8rem; }
.quiz-result__ch:last-child { margin-bottom: 0; }
.quiz-result__ch-label {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; font-weight: 500; color: var(--q-sub);
  margin-bottom: 0.3rem;
}
.quiz-result__ch-bar {
  height: 8px; background: var(--q-border); border-radius: 4px; overflow: hidden;
}
.quiz-result__ch-fill {
  height: 100%; background: var(--q-accent); border-radius: 4px;
  transition: width 0.6s ease;
}
.quiz-result__ch-fill--full { background: var(--q-correct); }
.quiz-result__ch-fill--zero { width: 0 !important; }

/* weakness CTA */
.quiz-result__weak, .quiz-result__strong {
  background: var(--q-card); border: 1px solid var(--q-border);
  border-radius: var(--q-radius); padding: 1.2rem 1.5rem;
  margin-bottom: 2rem; text-align: left;
  font-size: 0.88rem; color: var(--q-sub); line-height: 1.8;
}
.quiz-result__weak { border-left: 3px solid var(--q-accent); }
.quiz-result__weak b { color: var(--q-text); }

.quiz-btn-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--q-text); color: var(--q-bg);
  font-family: var(--q-font-d); font-weight: 700; font-size: 1rem;
  padding: 0.9rem 2.4rem; border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(26, 26, 26, 0.12);
  transition: transform 0.2s, box-shadow 0.2s;
}
.quiz-btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 26, 26, 0.18);
}
.quiz-result__cta { margin-bottom: 0.5rem; }
.quiz-result__cta-note {
  font-size: 0.75rem; color: var(--q-muted); margin-top: 0.6rem;
}
.quiz-btn-retry {
  background: none; border: 1.5px solid var(--q-border);
  color: var(--q-muted); font-size: 0.82rem; font-weight: 600;
  padding: 0.6rem 1.5rem; border-radius: 999px; cursor: pointer;
  margin-top: 1rem; transition: border-color 0.15s, color 0.15s;
}
.quiz-btn-retry:hover { border-color: var(--q-accent); color: var(--q-accent); }

/* ---------- responsive (SP first, so these are desktop overrides) ---------- */
@media (min-width: 768px) {
  .quiz-intro__title { font-size: 3rem; }
  .quiz-card { padding: 2rem; }
  .quiz-card__prompt { font-size: 1.2rem; }
  .quiz-result__num { font-size: 5rem; }
}
