/* =========================
   共通
========================= */

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  background:#f5f7fa;
  color:#333;
  min-height:100vh;
}

/* =========================
   ヘッダー
========================= */

header{
  text-align:center;
  padding:30px 15px;
  background:#0f4c81;
  color:#fff;
}

header h1{
  font-size:2rem;
  margin-bottom:10px;
}

header p{
  opacity:0.9;
}

/* =========================
   メニュー
========================= */

#quizList{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  padding:20px;
  background:#fff;
  border-bottom:1px solid #ddd;
}

#quizList a{
  text-decoration:none;
  color:#333;
  background:#eee;
  padding:10px 18px;
  border-radius:8px;
  transition:.2s;
  font-weight:bold;
}

#quizList a:hover{
  background:#ddd;
}

#quizList a.active{
  background:#0f4c81;
  color:#fff;
}

/* =========================
   レイアウト
========================= */

main{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  gap:20px;
  max-width:1400px;
  margin:30px auto;
  padding:0 15px;
}

/* =========================
   クイズボックス
========================= */

.quiz-box{
  flex:1;
  max-width:900px;
  background:#fff;
  border-radius:12px;
  padding:25px;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.status{
  display:flex;
  justify-content:space-between;
  margin-bottom:15px;
  font-weight:bold;
}

/* =========================
   プログレスバー
========================= */

.progress{
  width:100%;
  height:14px;
  background:#ddd;
  border-radius:999px;
  overflow:hidden;
  margin-bottom:25px;
}

#progressBar{
  width:0%;
  height:100%;
  background:#0f4c81;
  transition:.3s;
}

/* =========================
   問題
========================= */

#question{
  font-size:1.4rem;
  margin-bottom:25px;
  line-height:1.6;
}

/* =========================
   選択肢
========================= */

#choices{
  display:flex;
  flex-direction:column;
  gap:12px;
}

#choices button{
  width:100%;
  padding:15px;
  border:none;
  border-radius:8px;
  background:#f1f1f1;
  cursor:pointer;
  font-size:1rem;
  transition:.2s;
}

#choices button:hover{
  background:#e2e2e2;
}

.correct{
  background:#4caf50 !important;
  color:#fff;
}

.wrong{
  background:#e53935 !important;
  color:#fff;
}

/* =========================
   結果表示
========================= */

#result{
  margin-top:20px;
  font-weight:bold;
  line-height:1.8;
  min-height:40px;
}

/* =========================
   終了画面
========================= */

.finish{
  text-align:center;
}

.finish p{
  font-size:1.5rem;
  margin-bottom:20px;
}

.finish button,
.home-btn{
  display:inline-block;
  margin:8px;
  padding:12px 20px;
  border:none;
  border-radius:8px;
  background:#0f4c81;
  color:#fff;
  text-decoration:none;
  cursor:pointer;
  font-size:1rem;
}

.finish button:hover,
.home-btn:hover{
  opacity:.85;
}

/* =========================
   広告枠
========================= */

.ad-box{
  width:300px;
  min-width:300px;
  background:#fff;
  border-radius:12px;
  padding:15px;
  box-shadow:0 4px 12px rgba(0,0,0,.08);
  text-align:center;
}

.ad-box p{
  margin-bottom:10px;
  font-weight:bold;
}

/* =========================
   スマホ
========================= */

@media (max-width:900px){

  main{
    flex-direction:column;
    align-items:center;
  }

  .quiz-box{
    width:100%;
  }

  .ad-box{
    width:100%;
    min-width:auto;
  }

  header h1{
    font-size:1.5rem;
  }

  #question{
    font-size:1.2rem;
  }

}