/* Basic styling */
body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  flex-direction: column;
}

header {
  background-color: #333;
  color: white;
  padding: 20px;
  text-align: center;
  width: 100%;
}

h1 {
  font-size: 36px;
  margin: 0;
}

.quiz-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 40px;
  text-align: center;
  width: 100%;
  max-width: 400px; /* Limit the width for better mobile design */
  margin: 20px;
  position: relative; /* For confetti positioning */
}

.question {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.answers {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Add space between buttons */
}

button {
  padding: 12px 20px;
  font-size: 18px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%; /* Make buttons take up full width */
  max-width: 300px; /* Ensure buttons don't get too wide */
  margin: 0 auto;
}

button:hover {
  background-color: #45a049;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.next-question {
  display: none;
  width: 100%;
}

.score {
  font-size: 18px;
  font-weight: bold;
  margin-top: 20px;
}

.confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

@media (max-width: 600px) {
  h1 {
    font-size: 28px;
  }
  .quiz-container {
    padding: 20px;
  }
  button {
    font-size: 16px;
    padding: 10px 15px;
  }
}

/* Confetti animation styles */
@keyframes confettiFall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  background-color: #f39c12;
  border-radius: 50%;
  opacity: 0;
  animation: confettiFall 3s ease-in-out forwards;
}

.confetti-piece:nth-child(odd) {
  background-color: #e74c3c;
}

.confetti-piece:nth-child(3n) {
  background-color: #9b59b6;
}

.confetti-piece:nth-child(4n) {
  background-color: #1abc9c;
}

.confetti-piece:nth-child(5n) {
  background-color: #3498db;
}




/* .firework { */
  /* position: absolute; */
  /* width: 10px; */
  /* height: 10px; */
  /* background-color: #ff0; */
  /* border-radius: 50%; */
  /* animation: explode 1s forwards, twinkle 1.5s infinite; */
  /* opacity: 0; Start with opacity 0 */
/* } */


/* Firework container should cover the entire screen */
/* .firework { */
  /* position: absolute; */
  /* width: 10px; */
  /* height: 10px; */
  /* background-color: #ff0; */
  /* border-radius: 50%; */
  /* opacity: 0; /* Start as hidden */ */
  /* animation: explode 1s forwards, twinkle 1.5s infinite; */
/* } */

.firework {
  position: fixed;  /* Make it fixed to the screen */
  top: 0;
  left: 0;
  width: 100vw;  /* Full width of the viewport */
  height: 100vh; /* Full height of the viewport */
  pointer-events: none; /* Don't block interactions with other elements */
  z-index: 9999;  /* Ensure it's above all other elements */
  overflow: hidden; /* Hide overflow */
}



/* Exploding animation with random direction */
@keyframes explode {
  0% {
    transform: scale(0) translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: scale(1) translate(var(--x), var(--y)); /* Move to random position */
    opacity: 0; /* Fade out */
  }
}

/* Twinkling effect for firework particles */
@keyframes twinkle {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

