:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  color: #111;
  background: #ececec;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 48px 24px;
  background: #ececec;
}

button {
  font: inherit;
}

.quiz-sheet {
  width: min(940px, 100%);
  min-height: min(1020px, calc(100vh - 96px));
  margin: 0 auto;
  padding: 38px clamp(28px, 8vw, 100px) 64px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.quiz-header {
  position: relative;
  text-align: center;
}

.quiz-meta {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #737373;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.quiz-meta p {
  margin: 0;
}

.question-number {
  text-align: left;
}

.progress {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

h1 {
  margin: 18px 0 18px;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.question-text {
  margin: 20 auto 30px;
  max-width: 740px;
  font-size: clamp(25px, 2.2vw, 50px);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  white-space: pre-wrap;
}

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

.choice {
  width: 100%;
  min-height: 82px;
  padding: 18px 22px;
  border: 4px solid #080808;
  border-radius: 0;
  background: #fff;
  color: #111;
  text-align: left;
  font-size: clamp(20px, 1.9vw, 30px);
  font-weight: 600;
  line-height: 1.55;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.choice:not(:disabled):hover {
  background: #f4f7ff;
  border-color: #2e5bea;
}

.choice:not(:disabled):active {
  transform: scale(0.99);
}

.choice:focus-visible,
.next-button:focus-visible,
.next-button1:focus-visible,
.next-button2:focus-visible {
  outline: 4px solid #79a6ff;
  outline-offset: 4px;
}

.choice:disabled {
  cursor: default;
}

.choice.is-correct {
  border-color: #168447;
  background: #eff9f2;
}

.choice.is-incorrect {
  border-color: #ca3131;
  background: #fff2f1;
}

.result {
  min-height: 32px;
  margin: 18px 0 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.subject-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: min(100%, 420px);
  margin: 24px auto 0;
}

.next-button,
.next-button1,
.next-button2 {
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 16px 20px;
  border: 0;
  border-radius: 0;
  color: #000;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 750;
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}

.next-button {
  background: #49ff01;
}

.next-button1 {
  background: #ddff01;
}

.next-button2 {
  width: min(100%, 420px);
  margin: 16px auto 0;
  background: #acacac;
}

.next-button span {
  margin-left: 10px;
  font-size: 0.9em;
}

.next-button:not(:disabled):hover {
  background: #13bd04;
}

.next-button2:not(:disabled):hover {
  background: #8e8e8e;
}

.next-button1:not(:disabled):hover {
  background: #bcd902;
}

.next-button:not(:disabled):active {
  transform: translateY(2px);
}

.next-button1:not(:disabled):active {
  transform: translateY(2px);
}

.next-button2:not(:disabled):active {
  transform: translateY(2px);
}

.next-button:disabled {
  background: #a7a7a7;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  body {
    padding: 0;
    min-height: 100svh;
  }

  .quiz-sheet {
    min-height: 100vh;
    min-height: 100svh;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  }

  .subject-buttons {
    width: min(100%, 380px);
    gap: 10px;
    margin-top: 18px;
  }

  h1 {
    margin: 20px 0 16px;
  }

  .question-text {
    margin-bottom: 24px;
  }

  .choices {
    gap: 14px;
  }

  .choice {
    min-height: 72px;
    padding: 15px 16px;
    border-width: 3px;
  }

  .result {
    font-size: 16px;
  }

  .next-button,
  .next-button1 {
    min-height: 60px;
    padding: 12px 8px;
    font-size: clamp(17px, 5vw, 22px);
  }

  .next-button2 {
    width: min(100%, 380px);
    min-height: 56px;
    margin-top: 14px;
    font-size: clamp(18px, 5vw, 22px);
  }
}

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