@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Fredoka", sans-serif;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Animated stars background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite;
}

.star:nth-child(1) {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.star:nth-child(2) {
  top: 40%;
  left: 80%;
  animation-delay: 0.5s;
}

.star:nth-child(3) {
  top: 70%;
  left: 30%;
  animation-delay: 1s;
}

.star:nth-child(4) {
  top: 30%;
  left: 70%;
  animation-delay: 1.5s;
}

.star:nth-child(5) {
  top: 80%;
  left: 60%;
  animation-delay: 0.8s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 2;
}

/* Start screen styles */
.welcome-section {
  text-align: center;
  margin-bottom: 40px;
}

.title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  font-weight: 600;
}

.mascot {
  font-size: 4rem;
  margin: 20px 0;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.container_h3 {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  max-width: 600px;
  line-height: 1.4;
}

.start-btn {
  font-size: clamp(1.5rem, 4vw, 2rem);
  padding: 20px 40px;
  background: linear-gradient(45deg, #d946ef, #ec4899);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  color: white;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}

.start-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  background: linear-gradient(45deg, #c026d3, #db2777);
}

.btn-emoji {
  font-size: 1.5em;
  animation: wiggle 1s infinite alternate;
}

@keyframes wiggle {
  0% {
    transform: rotate(-8deg);
  }
  100% {
    transform: rotate(8deg);
  }
}

/* Main game styles */
.main {
  display: none;
  width: 100%;
  max-width: 800px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

.timer-container,
.score-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 25px;
  border-radius: 25px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-label,
.score-label {
  color: #86198f;
  font-size: 1.2rem;
  font-weight: 600;
}

.timer,
.score {
  color: #c026d3;
  font-size: 1.5rem;
  font-weight: 700;
}

.question-container {
  background: rgba(255, 255, 255, 0.9);
  padding: 40px;
  border-radius: 30px;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.question {
  font-size: clamp(3rem, 8vw, 6rem);
  color: #a21caf;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.ans-row {
  display: flex;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.answer {
  height: 80px;
  width: 80px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border: 3px solid white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2rem;
  font-weight: 600;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.answer:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ec4899, #a855f7);
}

.motivation-message {
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 500;
  color: #a21caf;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.motivation-message.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
  .game-header {
    justify-content: center;
  }

  .ans-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .answer {
    height: 70px;
    font-size: 1.5rem;
  }

  .question-container {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .ans-row {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto 30px;
  }

  .container {
    padding: 15px;
  }
}

/* Animation classes */
.correct-answer {
  background: linear-gradient(135deg, #48bb78, #38a169) !important;
  animation: correctPulse 0.6s ease;
}

.wrong-answer {
  background: linear-gradient(135deg, #f56565, #e53e3e) !important;
  animation: wrongShake 0.6s ease;
}

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

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