body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #f6d365, #fda085);
  text-align: center;
}

header {
  padding: 20px;
  background: rgba(255,255,255,0.8);
}

.back-btn {
  margin-top: 10px;
  display: inline-block;
  padding: 8px 15px;
  background: #e67e22;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
}

#quiz-container {
  margin: 50px auto;
  width: 450px;
  padding: 30px;
  background: linear-gradient(145deg, #fff, #f8f9fa);
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

#quiz-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #2ecc71);
  animation: progress 15s linear infinite;
}

#question {
  font-size: 1.3rem;
  margin-bottom: 25px;
  text-align: center;
  transition: all 0.3s ease;
}

.question-number {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 10px;
}

.equation {
  font-size: 1.8rem;
  font-weight: bold;
  color: #2c3e50;
  margin: 15px 0;
}

.difficulty {
  font-size: 0.9rem;
  color: #f39c12;
  margin-top: 10px;
}

.option-btn {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 15px;
  background: linear-gradient(145deg, #3498db, #2980b9);
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translateX(-20px);
  opacity: 0;
  animation: slideIn 0.5s ease forwards;
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.option-btn:hover::before {
  left: 100%;
}

.option-btn:hover {
  background: linear-gradient(145deg, #2980b9, #1f639a);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(52, 152, 219, 0.4);
}

.option-btn:disabled {
  cursor: not-allowed;
}

.option-btn.correct {
  background: linear-gradient(145deg, #2ecc71, #27ae60);
  animation: correctPulse 0.6s ease;
}

.option-btn.wrong {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  animation: wrongShake 0.5s ease;
}

.option-btn.correct-answer {
  background: linear-gradient(145deg, #f39c12, #e67e22);
  animation: showCorrect 0.5s ease;
}

.timer, .score {
  background: rgba(52, 152, 219, 0.1);
  padding: 10px 20px;
  margin: 10px 0;
  border-radius: 10px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.timer.warning {
  background: rgba(243, 156, 18, 0.2);
  color: #f39c12;
}

.timer.critical {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  animation: criticalPulse 1s ease-in-out infinite;
}

.streak {
  font-size: 0.9rem;
  color: #e67e22;
}

.max-streak {
  font-size: 0.8rem;
  color: #7f8c8d;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: confettiFall 1s ease-out forwards;
  pointer-events: none;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes showCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes criticalPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Enhanced Timer Container */
.timer-container-quiz {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.timer-display-quiz {
  text-align: center;
}

.timer-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.timer-progress-quiz {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timer-progress-fill {
  height: 100%;
  background: #4CAF50;
  border-radius: 10px;
  transition: width 1s ease, background-color 0.5s ease;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.timer-controls-quiz {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.control-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-btn.paused {
  background: linear-gradient(135deg, #4CAF50, #81C784);
  animation: pulse 1.5s infinite;
}

#difficultySelect {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#difficultySelect:hover {
  border-color: #667eea;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  }
  50% {
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6);
    transform: scale(1.05);
  }
}

/* Responsive Design */
@media (max-width: 600px) {
  .timer-container-quiz {
    margin: 10px 0;
    padding: 15px;
  }
  
  .timer-controls-quiz {
    flex-direction: column;
    align-items: center;
  }
  
  .control-btn, #difficultySelect {
    width: 100%;
    max-width: 200px;
  }
}
