:root {
  --primary: #4f46e5;
  --secondary: #10b981;
  --accent: #f59e0b;
  --background: #eff6ff;
  --text: #1f2937;
}

body {
  font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2000&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Semi-transparent overlay for better readability */
#app {
  background-color: rgba(255, 255, 255, 0.6); /* Reduced opacity for better background visibility */
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px); /* Reduced blur for better background visibility */
  -webkit-backdrop-filter: blur(4px);
}

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  background-image: linear-gradient(135deg, var(--primary), #6366f1);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
  background-image: linear-gradient(135deg, var(--secondary), #34d399);
}

.btn-accent {
  background-color: var(--accent);
  color: white;
  background-image: linear-gradient(135deg, var(--accent), #fbbf24);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.answer-btn {
  min-height: 60px;
  min-width: 120px;
  margin: 8px;
  font-size: 1.5rem;
}

.correct-answer {
  animation: pulse-green 0.5s;
  background-image: linear-gradient(135deg, #10b981, #34d399);
}

.wrong-answer {
  animation: shake 0.5s;
  background-image: linear-gradient(135deg, #ef4444, #f87171);
}

@keyframes pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.progress-bar {
  height: 10px;
  background-color: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.timer-bar {
  height: 10px;
  background-color: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  background-color: var(--accent);
  transition: width 0.1s linear;
}

/* Switch toggle for settings */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Card styling */
.card {
  background-color: rgba(255, 255, 255, 0.7); /* Reduced opacity for better background visibility */
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(2px); /* Reduced blur for better background visibility */
  -webkit-backdrop-filter: blur(2px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Heatmap styling */
.heatmap-container {
  background-color: rgba(255, 255, 255, 0.7); /* Reduced opacity for better background visibility */
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px); /* Reduced blur for better background visibility */
  -webkit-backdrop-filter: blur(2px);
}

.heatmap-cell {
  border-radius: 4px;
  transition: all 0.2s ease;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Game screen styling */
.game-screen {
  position: relative;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.7); /* Reduced opacity for better background visibility */
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px); /* Reduced blur for better background visibility */
  -webkit-backdrop-filter: blur(2px);
}

.question-display {
  position: relative;
  padding: 20px;
  margin-bottom: 20px;
  background-color: rgba(248, 250, 252, 0.6); /* Reduced opacity for better background visibility */
  border-radius: 8px;
  text-align: center;
}

.question-display::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 20px;
  width: 40px;
  height: 40px;
  background-image: url('https://cdn-icons-png.flaticon.com/512/1048/1048966.png');
  background-size: contain;
  background-repeat: no-repeat;
}

/* Input styling */
.answer-input {
  width: 100%;
  padding: 15px;
  font-size: 1.5rem;
  text-align: center;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.answer-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  outline: none;
}

/* Mascot */
.mascot {
  position: absolute;
  width: 80px;
  height: 80px;
  bottom: 10px;
  right: 10px;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
}

/* Confetti animation */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  opacity: 0.8;
  animation: confetti-fall 4s linear infinite;
}

@media (max-width: 640px) {
  .btn {
    padding: 12px 16px;
    font-size: 1.1rem;
  }
  
  .mascot {
    width: 60px;
    height: 60px;
  }
}

/* High contrast mode */
.high-contrast {
  --primary: #0000ff;
  --secondary: #008000;
  --accent: #ff6600;
  --background: #ffffff;
  --text: #000000;
}

/* Large text mode */
.large-text {
  font-size: 1.25rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.reduced-motion * {
  animation-duration: 0.001ms !important;
  transition-duration: 0.001ms !important;
}