.page-take-quiz main > .section {
  min-height: calc(100vh - 160px);
  background: #f4f7fb;
}

.page-take-quiz .quiz-card {
  background: white;
  min-height: 300px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 5px;
  padding: 20px 24px 24px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
  border: 1px solid rgba(10,20,30,0.08);
  position: relative;
  overflow: visible;
}

.quiz-card {
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 5px;
  padding: 20px 24px 24px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.06);
  border: 1px solid rgba(10,20,30,0.08);
  position: relative;
  overflow: visible;
}

.quiz-question {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.3;
  max-height: 4.2em; 
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-answer {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.25;
}

.page-quiz .quiz-controls,
.page-experiments .quiz-controls,
.page-games .quiz-controls{
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 auto 22px;
}

.page-quiz .quiz-search,
.page-experiments .quiz-search,
.page-games .quiz-search{
  flex: 1;
  min-width: 260px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(10,20,30,.14);
  font: inherit;
  outline: none;
  background: white;
}

.page-quiz .quiz-search:focus,
.page-experiments .quiz-search:focus,
.page-games .quiz-search:focus{
  border-color: rgba(47,111,255,.55);
  box-shadow: 0 0 0 4px rgba(47,111,255,.14);
}

.page-quiz .grade-tabs,
.page-experiments .grade-tabs,
.page-games .grade-tabs{
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(10,20,30,.08);
}

.page-quiz .tab,
.page-experiments .tab,
.page-games .tab{
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  color: rgba(10,20,30,.75);
}

.page-quiz .tab.is-active,
.page-experiments .tab.is-active,
.page-games .tab.is-active{
  background: rgba(47,111,255,.14);
  color: rgba(10,20,30,.95);
}

.page-quiz .grade-section,
.page-experiments .grade-section,
.page-games .grade-section{
  margin-top: 18px;
}

.page-quiz .grade-header,
.page-experiments .grade-header,
.page-games .grade-header{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 14px;
}

.page-quiz .grade-header h3,
.page-experiments .grade-header h3,
.page-games .grade-header h3{
  margin: 0;
}

.page-quiz .grade-count,
.page-experiments .grade-count,
.page-games .grade-count{
  color: rgba(10,20,30,.65);
  font-weight: 600;
}

.page-quiz .grade-divider,
.page-experiments .grade-divider,
.page-games .grade-divider{
  border: none;
  border-top: 1px solid rgba(10,20,30,.10);
  margin: 26px 0;
}

.page-quiz .quiz-grid,
.page-experiments .quiz-grid,
.page-games .quiz-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.page-quiz .quiz-card,
.page-experiments .quiz-card,
.page-games .quiz-card{
  display:block;
  background: white;
  border-radius: var(--radius);
  border: 1px solid rgba(10,20,30,.08);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.page-quiz .quiz-card:hover,
.page-experiments .quiz-card:hover,
.page-games .quiz-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
  border-color: rgba(47,111,255,.25);
}

.page-quiz .quiz-card__top,
.page-experiments .quiz-card__top,
.page-games .quiz-card__top{
  display:flex;
  gap: 8px;
  align-items:center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.page-quiz .badge,
.page-experiments .badge,
.page-games .badge{
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7,20,35,.08);
}

.page-quiz .chip,
.page-experiments .chip,
.page-games .chip{
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(47,111,255,.12);
  color: rgba(10,20,30,.85);
}

.page-quiz .quiz-card h4,
.page-experiments .quiz-card h4,
.page-games .quiz-card h4{
  margin: 0 0 6px;
  font-size: 16px;
}

.page-quiz .quiz-card p,
.page-experiments .quiz-card p,
.page-games .quiz-card p{
  margin: 0;
  color: rgba(10,20,30,.65);
  line-height: 1.5;
  font-size: 14px;
}

@media (max-width: 900px){
  .page-quiz .quiz-grid,
  .page-experiments .quiz-grid,
  .page-games .quiz-grid{
    grid-template-columns: 1fr;
  }
}

.page-take-quiz .quiz-player {
  max-width: 640px;
  margin: 0 auto;

}

.quiz-question {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin: 8px 0 18px;
}

.quiz-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .quiz-answers {
    grid-template-columns: 1fr;
  }
}

.quiz-answer {
  all: unset;
  cursor: pointer;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 18px 20px;
  border-radius: 16px;

  background: white;
  border: 2px solid rgba(10,20,30,0.12);

  font-size: 16px;
  font-weight: 500;
  color: #0b1220;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.quiz-answer:not(:disabled):hover {
  background: #f2f5fa;
}

.quiz-answer::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;

  border: 2px solid rgba(10,20,30,0.35);
  background: white;

  flex-shrink: 0;
}

.quiz-answer.selected::before {
  border-color: #4aa3ff;
  background: #4aa3ff;
  box-shadow: inset 0 0 0 4px white;
}

.quiz-answer.selected {
  border-color: #4aa3ff;
  background: #e9f0ff;
  font-weight: 600;
}

.quiz-answer:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}


.question-dot {
  width: 40px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;

  display: grid;
  place-items: center;

  flex: 0 0 auto; 

  font-size: 15px;
  font-weight: 600;
  line-height: 1;

  background: white;
  border: 2px solid rgba(10,20,30,0.15);

  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";

  box-sizing: border-box;
}

.question-dot:hover:not(.active) {
  background: #f2f5fa;
}

.question-dot.active {
  background: #4aa3ff;
  color: white;
  border-color: #4aa3ff;
  opacity: 1;
}

.question-dot.answered:not(.active) {
  opacity: 0.45;
}

.question-dot:not(.active):hover {
  opacity: 0.75;
}

.quiz-top-nav{
  text-align: center;
  margin-bottom: 10px;
}
#questionBar {
  display: flex;
  justify-content: center;
  align-items:center ;
  gap: 14px;
  margin-top: 12px;

  padding: 6px 8px;          
  background: transparent;  
}
.page-take-quiz #quizTitle {
  text-align: center;
  margin-top: 24px;
  margin-bottom: 48px;
}

#progress {
  font-size: 14px;
  color: rgba(10,20,30,0.6);
  font-weight: 500;
}

#prevBtn,
#nextBtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;

  font-size: 56px;        
  font-weight: 500;
  color: gray;

  cursor: pointer;
  line-height: 1;

  transition: color 0.15s ease, transform 0.15s ease;

}
#prevBtn:hover,
#nextBtn:hover {
  color: rgba(10,20,30,0.9);
}

#prevBtn {
  left: -56px;
}

#nextBtn {
  right: -56px;
}

#prevBtn:disabled,
#nextBtn:disabled {
  opacity: 0;
  cursor: default;
  transform: none;
}


@media (max-width: 768px) {
  #prevBtn,
  #nextBtn {
    position: static;
    transform: none;
  }

  .quiz-top-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
}

.quiz-progress {
  margin-top: 36px;
  padding: 20px 20px;

  background: transparent; 
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;

}

.quiz-finish button {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;

  border-radius: 12px;
  border: 1px solid rgba(10,20,30,0.18);

  background: white;
  color: rgba(10,20,30,0.85);

  transition: background 0.15s ease, border-color 0.15s ease;
}


.quiz-finish button:disabled {
  background: #f4f7fb; 
  color: rgba(10,20,30,0.35);
  border-color: rgba(10,20,30,0.12);

  cursor: not-allowed;
  box-shadow: none;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,20,30,0.45);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 999;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 18px;
  padding: 28px 32px;

  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
  text-align: center;
}

.modal-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.modal-card p {
  margin: 0 0 24px;
  color: rgba(10,20,30,0.7);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.btn-primary {
  font-size: 15.5px; 
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(10,20,30,0.2);
  background: #4aa3ff;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(10,20,30,0.2);
  background: white;
  color: rgba(10,20,30,0.8);
  font-weight: 600;
  cursor: pointer;
}


.page-quiz-results .results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 900px) {
  .page-quiz-results .results-grid {
    grid-template-columns: 1fr;
  }
}
.results-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
  border: 1px solid rgba(10,20,30,0.08);
}

.results-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  margin-bottom: 12px;
}

.page-quiz-results .results-card > ul.results-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(10,20,30,0.75);
  font-size: 14px;
}
.results-card.correct .icon { color: #3aa76d; }
.results-card.incorrect .icon { color: #d14c4c; }
.results-card.unanswered .icon { color: #999; }

.results-summary {
  max-width: 560px;
  margin: 0 auto 32px;
  background: white;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.06);
  border: 1px solid rgba(10,20,30,0.08);
  text-align: center;
}

.results-summary p {
  margin: 6px 0;
  font-size: 15px;
  color: rgba(10,20,30,0.8);
}

.page-quiz-results .results-card > .results-list {
  display: none;
}

.page-quiz-results .results-card.open > .results-list {
  display: block;
}

.page-quiz-results .results-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-quiz-results .results-card .arrow {
  transition: transform 0.2s ease;
}

.page-quiz-results .results-card.open .arrow {
  transform: rotate(180deg);
}

.page-quiz-results .results-grid {
  align-items: start;
}

.page-quiz-results {
  background: transparent;
}

.page-quiz-results .quiz-results-actions {
  margin-top: 32px;
}

.page-quiz-results #resultTitle {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 24px;
}

.page-quiz-results .quiz-results-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;   
}

.quiz-card.is-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(1);
}

.quiz-card.is-locked .lock-icon {
  margin-left: auto;
  font-size: 14px;
}