@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&family=Roboto:wght@400;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #e0f7fa, #f1f8ff);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  overflow-x: hidden;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 38px;
  color: #007BFF;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
  animation: fadeSlideDown 1s ease;
}

@keyframes fadeSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.difficulty-select {
  margin-bottom: 20px;
  animation: fadeIn 1.5s ease;
}

.difficulty-select select {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #007BFF;
  font-weight: bold;
  outline: none;
}

.game-area {
  background: #ffffff;
  border-radius: 20px;
  width: 360px;
  height: 480px;
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.15);
  padding: 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: bounceIn 1s ease;
  align-items: center;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#falling-word {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  font-weight: 700;
  color: #FF5722;
  text-shadow: 0 0 8px rgba(255, 87, 34, 0.4);
  animation: pulse 1.2s infinite alternate ease-in-out;
}

@keyframes pulse {
  from {
    transform: translateX(-50%) scale(1);
  }
  to {
    transform: translateX(-50%) scale(1.1);
  }
}

#typed-input {
  margin-top: 25px;
  padding: 14px;
  width: 95%;
  font-size: 20px;
  border: 2px solid #007BFF;
  border-radius: 10px;
  outline: none;
  background-color: #f1f8ff;
  color: #333;
  text-align: center;
  transition: 0.3s;
  animation: fadeIn 1.5s ease;
}

#typed-input:focus {
  border-color: #FF5722;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

.stats {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  padding: 0 20px;
  animation: fadeIn 2s ease;
  width: 100%;
}

.stats span {
  font-weight: bold;
  color: #28a745;
}

.controls {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
  animation: fadeInUp 2s ease;
}

.controls button {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(45deg, #2196f3, #00bcd4);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.controls button:hover {
  transform: scale(1.05);
  background: linear-gradient(45deg, #00bcd4, #2196f3);
}

.controls button:disabled {
  background: #ddd;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  animation: fadeIn 1s ease;
}

.popup-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 15px;
  text-align: center;
  color: #333;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  animation: fadeIn 1.2s ease;
}

.popup-content p {
  font-size: 20px;
  margin-bottom: 20px;
}

.popup-content button {
  padding: 10px 20px;
  background: linear-gradient(45deg, #ff6f61, #ff8a65);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}

.popup-content button:hover {
  background: linear-gradient(45deg, #ff8a65, #ff6f61);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 420px) {
  .game-area {
    width: 90%;
    height: auto;
  }

  #falling-word {
    font-size: 24px;
  }

  h1 {
    font-size: 28px;
  }
}.music-controls {
  margin-top: 10px;
}

#music-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, #00bcd4, #03a9f4);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

#music-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(45deg, #03a9f4, #00bcd4);
}
#music-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  background: linear-gradient(45deg, #64b5f6, #42a5f5);
  border: none;
  padding: 10px 14px;
  font-size: 18px;
  border-radius: 50%;
  color: white;
  box-shadow: 0 4px 8px rgba(66, 165, 245, 0.3);
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
}

#music-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(45deg, #42a5f5, #64b5f6);
}
