*{
  box-sizing:border-box;
}

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

header{
  text-align:center;
  padding:28px 12px;
  background:linear-gradient(135deg,#1f4fd8,#0f9bd7);
  color:#fff;
}

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

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

#quizList{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  padding:16px 10px;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}

#quizList a{
  text-decoration:none;
  color:#1f4fd8;
  border:1px solid #1f4fd8;
  border-radius:999px;
  padding:8px 14px;
  font-size:14px;
  font-weight:700;
  background:#fff;
}

#quizList a:hover{
  background:#1f4fd8;
  color:#fff;
}

main.layout{
  max-width:1400px;
  margin:24px auto;
  display:grid;
  grid-template-columns:250px minmax(500px,760px) 250px;
  gap:24px;
  padding:0 20px;
  align-items:start;
  justify-content:center;
}

.quiz-box{
  background:#fff;
  border-radius:16px;
  padding:22px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.ad-box{
  background:#fff;
  border-radius:16px;
  padding:16px;
  min-height:280px;
  text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
  position:sticky;
  top:20px;
}

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

.status{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-weight:700;
  color:#555;
  margin-bottom:14px;
}

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

#progressBar{
  width:0%;
  height:100%;
  background:#1f4fd8;
  transition:.25s;
}

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

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

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

#choices button:hover{
  border-color:#1f4fd8;
  background:#f0f5ff;
}

#choices button.correct{
  border-color:#16a34a;
  background:#dcfce7;
  color:#166534;
}

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

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

#result{
  min-height:28px;
  margin:18px 0 0;
  font-size:18px;
  font-weight:800;
  text-align:center;
}

#result.ok{
  color:#16a34a;
}

#result.ng{
  color:#dc2626;
}

@media(max-width:1100px){
  main.layout{
    grid-template-columns:1fr;
    max-width:760px;
  }

  .ad-box{
    display:none;
  }
}

@media(max-width:600px){
  header h1{
    font-size:24px;
  }

  .quiz-box{
    padding:18px;
  }

  #question{
    font-size:19px;
  }

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