@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: #1d2940;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 500;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 10% 12%, #e3efff 0, transparent 32rem),
    radial-gradient(ellipse at 95% 90%, #e8e8ff 0, transparent 28rem),
    #f4f7fb;
}

button {
  font: inherit;
}

.quiz-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: clamp(32px, 7vh, 72px) 0 28px;
}

.page-header {
  margin-bottom: 28px;
  text-align: center;
}

.eyebrow,
.result-label {
  margin: 0 0 8px;
  color: #5669d8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.intro {
  margin: 10px 0 0;
  color: #667085;
  font-size: 1.05rem;
}

.quiz-card {
  position: relative;
  min-height: 430px;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid #e8ebf2;
  border-radius: 24px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 55px rgb(40 55 90 / 10%);
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress,
.score {
  margin: 0;
  color: #626e83;
  font-size: 0.95rem;
  font-weight: 700;
}

.score {
  color: #5669d8;
}

.progress-track {
  height: 8px;
  margin: 15px 0 32px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf0f6;
}

.progress-bar {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6377e9, #8a70e9);
  transition: width 220ms ease;
}

.question {
  margin: 0 0 24px;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  line-height: 1.6;
}

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

.choice-button {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border: 2px solid #e7eaf1;
  border-radius: 14px;
  background: #fff;
  color: #29354b;
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.choice-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #8794ed;
  background: #f8f8ff;
}

.choice-button:focus-visible,
.next-button:focus-visible {
  outline: 3px solid #253bcb;
  outline-offset: 3px;
}

.choice-letter {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: #f0f2fa;
  color: #5969c8;
  font-size: 0.85rem;
  font-weight: 800;
}

.choice-button:disabled {
  cursor: default;
}

.choice-button.is-correct {
  border-color: #34a77a;
  background: #effaf5;
}

.choice-button.is-correct .choice-letter {
  background: #d8f2e6;
  color: #16734d;
}

.choice-button.is-wrong {
  border-color: #e28a8a;
  background: #fff4f3;
}

.choice-button.is-wrong .choice-letter {
  background: #ffe2df;
  color: #ad4141;
}

.feedback {
  min-height: 28px;
  margin: 18px 0 10px;
  font-weight: 700;
}

.feedback.correct {
  color: #16734d;
}

.feedback.incorrect {
  color: #b44141;
}

.next-button {
  min-height: 52px;
  padding: 12px 24px;
  border: 0;
  border-radius: 13px;
  background: #5969d8;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: background-color 150ms ease, transform 150ms ease;
}

.next-button:hover {
  transform: translateY(-1px);
  background: #4757c5;
}

.result {
  padding: 36px 0 20px;
  text-align: center;
}

.result h2 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.final-score {
  margin: 20px 0 6px;
  color: #5669d8;
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 800;
  line-height: 1.2;
}

.result-message {
  margin: 0 0 26px;
  color: #667085;
}

footer {
  margin-top: 22px;
  color: #778198;
  font-size: 0.85rem;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .quiz-shell {
    width: min(100% - 24px, 760px);
    padding-top: 28px;
  }

  .quiz-card {
    min-height: 400px;
    border-radius: 19px;
  }

  .choice-button {
    min-height: 56px;
    padding: 10px 13px;
  }
}

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