body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 1000;
}

.title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 2rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ui-overlay {
  position: fixed;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none;
}

.coins-display {
  background: rgba(0, 0, 0, 0.8);
  color: #ffd700;
  padding: 10px 15px;
  border-radius: 25px;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-display {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 15px;
  text-align: right;
  font-size: 0.9rem;
}

.target-indicator {
  margin-top: 5px;
  font-weight: bold;
  color: #4caf50;
}

.instructions {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  z-index: 100;
  font-size: 1.1rem;
  line-height: 1.4;
}

.quiz-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.quiz-container {
  background: white;
  border-radius: 20px;
  padding: 30px;
  max-width: 90%;
  width: 500px;
  max-height: 80%;
  overflow-y: auto;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.question-number {
  font-size: 1.2rem;
  font-weight: bold;
  color: #667eea;
}

.quiz-question {
  font-size: 1.3rem;
  margin-bottom: 25px;
  color: #333;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  padding: 15px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quiz-option:hover {
  background: #e9ecef;
  transform: translateY(-2px);
}

.quiz-option.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.quiz-option.wrong {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.status-correct {
  color: #28a745;
}
.status-wrong {
  color: #dc3545;
}
.status-pending {
  color: #ffc107;
}

.result-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px 30px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 300;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: none;
}

.result-message.correct {
  color: #28a745;
}
.result-message.wrong {
  color: #dc3545;
}
.result-message.info {
  color: #17a2b8;
}

.completion-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 400;
  text-align: center;
}

.completion-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: celebrationPulse 2s ease-in-out infinite;
}

@keyframes celebrationPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.final-score {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ffd700;
  animation: scoreGlow 2s ease-in-out infinite alternate;
}

@keyframes scoreGlow {
  from {
    text-shadow: 0 0 10px #ffd700;
  }
  to {
    text-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700;
  }
}

.restart-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* New styles for lose screen */
.lose-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 400;
  text-align: center;
}

.lose-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.lose-message {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  max-width: 80%;
  line-height: 1.4;
}

/* Confetti Styles */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f0f;
  animation: confetti-fall linear infinite;
}

.confetti:nth-child(odd) {
  background: #ff6b6b;
  width: 8px;
  height: 8px;
  animation-duration: 3s;
}

.confetti:nth-child(even) {
  background: #4ecdc4;
  width: 6px;
  height: 6px;
  animation-duration: 2.5s;
}

.confetti:nth-child(3n) {
  background: #45b7d1;
  width: 12px;
  height: 12px;
  animation-duration: 2.8s;
}

.confetti:nth-child(4n) {
  background: #f9ca24;
  width: 9px;
  height: 9px;
  animation-duration: 3.2s;
}

.confetti:nth-child(5n) {
  background: #6c5ce7;
  width: 7px;
  height: 7px;
  animation-duration: 2.7s;
}

.confetti:nth-child(6n) {
  background: #a29bfe;
  width: 11px;
  height: 11px;
  animation-duration: 3.1s;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Confetti shapes variations */
.confetti.square {
  border-radius: 0;
}

.confetti.circle {
  border-radius: 50%;
}

.confetti.triangle {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid #ff6b6b;
}

@media (max-width: 768px) {
  .quiz-container {
    padding: 20px;
    margin: 20px;
  }
  .completion-title,
  .lose-title {
    font-size: 2rem;
  }
  .ui-overlay {
    flex-direction: column;
    gap: 10px;
  }
}
