/* ===== 全体の設定 ===== */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* 見えなくするが、場所は残す（レイアウトがずれないように） */
.invisible {
  visibility: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #eef2f7;
  color: #1f2937;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
}

button {
  font-family: inherit;
}

/* ===== カード ===== */
.card {
  width: 100%;
  max-width: 480px;
  margin: 16px;
  padding: 32px 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
}

h1 {
  margin: 0 0 24px;
  font-size: 24px;
  color: #16a34a;
}

/* ===== 進み具合（問題 3 / 10 とバー） ===== */
.progress {
  margin: 0 0 20px;
}

#progress-text {
  margin: 0 0 8px;
  font-size: 14px;
  color: #6b7280;
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

#progress-fill {
  width: 0;
  height: 100%;
  background: #16a34a;
  transition: width 0.3s ease;
}

/* ===== 問題文 ===== */
#question {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: bold;
}

/* ===== 選択肢ボタン（2列×2段） ===== */
#choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#choices button {
  padding: 16px;
  font-size: 16px;
  color: #16a34a;
  background: #ffffff;
  border: 2px solid #16a34a;
  border-radius: 12px;
  cursor: pointer;
}

#choices button:hover:not(:disabled) {
  color: #ffffff;
  background: #16a34a;
}

#choices button:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ===== 結果メッセージ ===== */
#result {
  min-height: 1.5em;
  margin: 24px 0 16px;
  font-size: 18px;
  font-weight: bold;
}

/* ===== タイトル画面 ===== */
.lead {
  margin: 0 0 32px;
  font-size: 18px;
  line-height: 1.8;
}

#total {
  margin: 0 4px;
  font-size: 28px;
  font-weight: bold;
  color: #16a34a;
}

#start {
  padding: 16px 64px;
  font-size: 20px;
}

/* ===== 結果エリア ===== */
.summary-label {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

#score-text {
  margin: 8px 0 0;
  font-size: 48px;
  font-weight: bold;
  color: #16a34a;
}

#rate-text {
  margin: 0 0 16px;
  color: #6b7280;
}

#comment {
  margin: 0 0 32px;
  font-size: 18px;
  font-weight: bold;
}

/* ===== 画面が切り替わるときにふわっと出す ===== */
section,
#summary {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== スタート・次へ・もう一度ボタン ===== */
#start,
#next,
#retry {
  padding: 12px 32px;
  font-size: 16px;
  color: #ffffff;
  background: #16a34a;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

#start:hover,
#next:hover,
#retry:hover {
  background: #15803d;
}

/* ===== 正解・不正解の色 ===== */
#choices button.correct {
  color: #ffffff;
  background: #15803d;
  border-color: #15803d;
  opacity: 1;
}

#choices button.wrong {
  color: #ffffff;
  background: #dc2626;
  border-color: #dc2626;
  opacity: 1;
}
