:root {
  --primary-color: #FF9800;
  --secondary-color: #4CAF50;
  --accent-color: #9C27B0;
  --background-color: #FFFDE7;
  --correct-color: #4CAF50;
  --incorrect-color: #F44336;
  --text-color: #333;
}

body {
  font-family: 'Comic Neue', 'Bubblegum Sans', cursive;
  background-color: var(--background-color);
  background-image: 
    linear-gradient(rgba(255, 152, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 152, 0, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background-color: var(--background-color);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.score, .level, .timer {
  font-size: 1.3rem;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: white;
}

.score {
  color: var(--primary-color);
}

.level {
  color: var(--secondary-color);
}

.timer {
  color: var(--accent-color);
}

.alphabet-container {
  width: 100%;
  height: 350px;
  background-color: #F5F5F5;
  border-radius: 15px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.letter {
  position: absolute;
  font-size: 2.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
  user-select: none;
  will-change: transform, opacity;
  z-index: 5;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.letter.target {
  color: var(--primary-color);
  animation: pulse-subtle 2s infinite;
}

.letter.non-target {
  color: var(--text-color);
}

.letter.clicked {
  animation: pop 0.3s ease-out;
  pointer-events: none;
  opacity: 0;
}

.letter.correct {
  color: var(--correct-color);
}

.letter.incorrect {
  color: var(--incorrect-color);
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes pulse-subtle {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
  }
}

.target-letter-container {
  margin-bottom: 20px;
  position: relative;
}

.target-letter {
  font-size: 4rem;
  font-weight: bold;
  color: var(--primary-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  display: inline-block;
  width: 100px;
  height: 100px;
  line-height: 100px;
  background-color: #FFFDE7;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 4px solid var(--primary-color);
  transition: transform 0.3s;
}

.target-letter.pulse {
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.instruction {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 20px;
}

.instruction-letter {
  font-weight: bold;
  color: var(--primary-color);
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}

#start-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#start-button:hover {
  background-color: #F57C00;
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sound-btn {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

.sound-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background-color: #E0E0E0;
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--primary-color);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.instructions {
  background-color: var(--background-color);
  padding: 15px;
  border-radius: 15px;
  margin-top: 20px;
}

.instructions h3 {
  color: var(--primary-color);
  margin-top: 0;
}

.instructions p {
  margin: 8px 0;
}

.feedback {
  position: absolute;
  font-size: 2rem;
  font-weight: bold;
  color: white;
  padding: 5px 20px;
  border-radius: 10px;
  transform: translate(-50%, -50%);
  z-index: 100;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  opacity: 0;
  animation: fadeInOut 1s ease-in-out;
  pointer-events: none;
}

.feedback.correct {
  background-color: var(--correct-color);
}

.feedback.wrong {
  background-color: var(--incorrect-color);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

.level-complete, .game-over {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 100;
}

.level-complete.show, .game-over.show {
  opacity: 1;
  pointer-events: all;
}

.level-complete-text, .game-over-text {
  color: white;
  font-size: 3rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.final-score {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 30px;
}

.score-breakdown {
  background-color: rgba(255,255,255,0.9);
  padding: 15px 25px;
  border-radius: 15px;
  margin: 20px 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  min-width: 300px;
}

.floating-letter {
  position: absolute;
  font-size: 3rem;
  font-weight: bold;
  opacity: 1;
  color: var(--primary-color);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  pointer-events: none;
  animation: float-up 1.5s ease-out forwards;
  z-index: 10;
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-100px) rotate(20deg);
  }
}

.confetti {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.time-bonus {
  animation: pulse-highlight 1.5s ease-in-out;
  position: relative;
  display: inline-block;
}

@keyframes pulse-highlight {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    color: #4CAF50;
    text-shadow: 0 0 12px rgba(76, 175, 80, 0.7);
  }
}

.letter-stats {
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-left: 8px;
}

.letter-stats-detail {
  font-size: 1rem;
  color: var(--text-color);
  margin-top: 8px;
  padding: 5px 10px;
  background-color: rgba(255, 248, 225, 0.7);
  border-radius: 10px;
  display: inline-block;
}

@media (max-width: 768px) {
  .game-info {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  
  .alphabet-container {
    height: 250px;
  }
  
  .letter {
    font-size: 2rem;
  }
  
  .target-letter {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    line-height: 80px;
  }
} 