*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:#f3f6fb;
  color:#1f2937;
}

header{
  text-align:center;
  padding:28px 12px 18px;
  background:linear-gradient(135deg,#232f3e,#ff9900);
  color:#fff;
}

header h1{
  margin:0;
  font-size:28px;
  line-height:1.4;
}

header p{
  margin:10px 0 0;
  opacity:.95;
  font-size:15px;
}

.exam-list,
.quiz-list{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  padding:14px 10px;
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}

.quiz-list{
  padding-top:8px;
}

.exam-list a,
.quiz-list a{
  display:inline-block;
  text-decoration:none;
  color:#374151;
  background:#f9fafb;
  border:1px solid #d1d5db;
  border-radius:999px;
  padding:9px 14px;
  font-size:14px;
  font-weight:700;
  transition:.2s;
}

.exam-list a:hover,
.quiz-list a:hover{
  background:#fff7ed;
  border-color:#ff9900;
}

.exam-list a.active,
.quiz-list a.active{
  background:#ff9900;
  color:#111827;
  border-color:#ff9900;
}

.layout{
  max-width:1180px;
  margin:24px auto;
  padding:0 14px;
  display:grid;
  grid-template-columns:180px 1fr 180px;
  gap:18px;
  align-items:start;
}

.quiz-box{
  background:#fff;
  border-radius:18px;
  padding:24px;
  box-shadow:0 10px 30px rgba(15,23,42,.08);
  min-height:430px;
}

.status{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:14px;
  font-weight:700;
  color:#4b5563;
  margin-bottom:12px;
}

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

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

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

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

#choices button{
  width:100%;
  text-align:left;
  padding:15px 16px;
  border-radius:12px;
  border:1px solid #d1d5db;
  background:#f9fafb;
  color:#111827;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  transition:.2s;
}

#choices button:hover:not(:disabled){
  background:#fff7ed;
  border-color:#ff9900;
  transform:translateY(-1px);
}

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

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

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

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

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

.finish p{
  font-size:22px;
  font-weight:800;
  margin-bottom:20px;
}

.finish button{
  border:0;
  background:#ff9900;
  color:#111827;
  font-weight:800;
  padding:12px 20px;
  border-radius:999px;
  cursor:pointer;
  font-size:15px;
}

.ad-box{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:12px;
  min-height:280px;
  text-align:center;
  color:#6b7280;
  font-size:12px;
  box-shadow:0 8px 20px rgba(15,23,42,.05);
}

.ad-box p{
  margin:0 0 10px;
}

@media(max-width:980px){

  .layout{
    grid-template-columns:1fr;
    max-width:720px;
  }

  .ad-left,
  .ad-right{
    min-height:120px;
  }

}

@media(max-width:600px){

  header{
    padding:22px 10px 16px;
  }

  header h1{
    font-size:22px;
  }

  header p{
    font-size:13px;
  }

  .exam-list,
  .quiz-list{
    justify-content:flex-start;
    overflow-x:auto;
    flex-wrap:nowrap;
    padding:10px;
  }

  .exam-list a,
  .quiz-list a{
    white-space:nowrap;
    font-size:13px;
    padding:8px 12px;
  }

  .layout{
    margin:14px auto;
    padding:0 10px;
    gap:12px;
  }

  .quiz-box{
    padding:18px;
    border-radius:14px;
  }

  #question{
    font-size:18px;
  }

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

}