body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #6b7280, #a5b4fc);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #1f2937;
  position: relative;
  overflow-x: hidden;
}

main {
  width: 90%;
  max-width: 900px;
  padding: 2rem;
}

.section {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 2.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideIn 0.5s ease-in;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.topic-grid button {
  background: linear-gradient(45deg, #3b82f6, #60a5fa);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.topic-grid button:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.topic-grid button i {
  font-size: 1.2rem;
}

.progress-score {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#progress-text,
#score-text {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#question-container {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #fff;
  text-align: center;
  animation: slideIn 0.5s ease-in;
}

#options-container button {
  display: block;
  width: 100%;
  background: linear-gradient(45deg, #e5e7eb, #f3f4f6);
  border: none;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f2937;
  transition: background 0.3s, transform 0.3s;
  animation: slideIn 0.5s ease-in;
}

#options-container button:hover {
  background: linear-gradient(45deg, #60a5fa, #93c5fd);
  transform: translateX(10px);
  color: #fff;
}

#options-container button.correct {
  background: linear-gradient(45deg, #22c55e, #4ade80);
  color: white;
}

#options-container button.incorrect {
  background: linear-gradient(45deg, #ef4444, #f87171);
  color: white;
}

#next-button,
#restart-button {
  background: linear-gradient(45deg, #2563eb, #60a5fa);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  display: block;
  margin: 1rem auto;
  transition: transform 0.3s, box-shadow 0.3s;
}

#next-button:hover,
#restart-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1.1);
  }
}

.hidden {
  display: none;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

@media (max-width: 600px) {
  h2 {
    font-size: 1.5rem;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  #question-container {
    font-size: 1.2rem;
  }

  #options-container button {
    font-size: 1rem;
    padding: 0.75rem;
  }

  #next-button,
  #restart-button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }

  .progress-score {
    flex-direction: column;
    gap: 0.5rem;
  }
}
