*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:sans-serif;
  background:#f4f6f8;
  color:#222;
}

header{
  text-align:center;
  padding:28px 12px;
  background:#1f2937;
  color:white;
}

header h1{
  margin:0;
  font-size:30px;
}

header p{
  margin:10px 0 0;
  color:#d1d5db;
}

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

#quizList a{
  text-decoration:none;
  color:#1f2937;
  background:#eef2f7;
  padding:10px 14px;
  border-radius:999px;
  font-weight:bold;
}

#quizList a.active{
  background:#2563eb;
  color:white;
}

main{
  display:flex;
  gap:20px;
  max-width:1100px;
  margin:24px auto;
  padding:0 14px;
  align-items:flex-start;
}

.quiz-box{
  flex:1;
  background:white;
  padding:24px;
  border-radius:14px;
  box-shadow:0 4px 14px rgba(0,0,0,.08);
}

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

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

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

#question{
  font-size:22px;
  line-height:1.6;
  margin:0 0 22px;
}

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

#choices button{
  width:100%;
  padding:14px 16px;
  font-size:16px;
  border:2px solid #d1d5db;
  border-radius:10px;
  background:white;
  cursor:pointer;
  text-align:left;
}

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

#choices button.correct{
  background:#dcfce7;
  border-color:#22c55e;
  color:#166534;
}

#choices button.wrong{
  background:#fee2e2;
  border-color:#ef4444;
  color:#991b1b;
}

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

#result{
  font-weight:bold;
  margin-top:18px;
  line-height:1.6;
}

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

.ad-box p{
  margin:0 0 10px;
  font-size:13px;
  color:#777;
}

.finish{
  text-align:center;
  padding:20px;
}

.finish p{
  font-size:24px;
  font-weight:bold;
}

.finish button,
.home-btn{
  display:inline-block;
  margin:8px;
  padding:12px 18px;
  border-radius:10px;
  border:none;
  background:#2563eb;
  color:white;
  text-decoration:none;
  font-weight:bold;
  cursor:pointer;
}

.home-btn{
  background:#374151;
}

@media(max-width:900px){
  main{
    display:block;
  }

  .ad-box{
    width:100%;
    margin-top:20px;
  }

  header h1{
    font-size:24px;
  }

  #question{
    font-size:19px;
  }
}