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

body{
  font-family:"Yu Gothic","Hiragino Sans",sans-serif;
  background:#f4f6f9;
  color:#333;
  line-height:1.6;
}

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

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

header p{
  opacity:.9;
}

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

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

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

#quizList a.active{
  background:#1976d2;
  color:#fff;
}

main{
  max-width:1200px;
  margin:20px auto;
  padding:0 15px;
  display:grid;
  grid-template-columns:1fr 300px;
  gap:20px;
}

.quiz-box{
  background:#fff;
  border-radius:12px;
  padding:25px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
}

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

.progress{
  width:100%;
  height:10px;
  background:#e0e0e0;
  border-radius:999px;
  overflow:hidden;
  margin-bottom:20px;
}

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

#question{
  font-size:1.4rem;
  margin-bottom:20px;
}

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

#choices button{
  border:none;
  background:#f5f5f5;
  padding:15px;
  border-radius:10px;
  cursor:pointer;
  text-align:left;
  font-size:16px;
  transition:.2s;
}

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

#choices button.correct{
  background:#4caf50;
  color:#fff;
}

#choices button.wrong{
  background:#e53935;
  color:#fff;
}

#choices button:disabled{
  cursor:not-allowed;
}

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

.finish{
  text-align:center;
}

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

.finish button{
  border:none;
  background:#1976d2;
  color:#fff;
  padding:12px 20px;
  border-radius:8px;
  cursor:pointer;
  margin:10px;
}

.home-btn{
  display:inline-block;
  text-decoration:none;
  background:#555;
  color:#fff;
  padding:12px 20px;
  border-radius:8px;
  margin:10px;
}

.ad-box{
  background:#fff;
  border-radius:12px;
  padding:20px;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
  text-align:center;
  height:fit-content;
}

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

footer{
  text-align:center;
  padding:30px;
  color:#666;
}

@media(max-width:900px){

  main{
    grid-template-columns:1fr;
  }

  .ad-box{
    order:-1;
  }

}

@media(max-width:600px){

  header h1{
    font-size:1.5rem;
  }

  #question{
    font-size:1.1rem;
  }

  #choices button{
    font-size:14px;
    padding:12px;
  }

}