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

body {
  background: var(
    --body-background-color,
    radial-gradient(circle at center, #012, #000)
  );
  overflow: hidden;
  font-family: "Poppins", sans-serif;
  color: var(--text-color, white);
  height: 100vh;
  width: 100vw;
}

/* Screen Management */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.hidden {
  display: none !important;
}

/* Start Screen */
.start-content {
  text-align: center;
  max-width: 600px;
  padding: 20px;
}

.game-title {
  font-size: clamp(3rem, 8vw, 5rem);
  margin-bottom: 1rem;
  background: var(
    --title-color,
    linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1)
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

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

.game-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  opacity: 0.9;
}

.instructions {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.instruction-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: clamp(1rem, 3vw, 1.5rem);
  padding: 0.5rem;
  background: var(--backdrop-color, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.icon {
  font-size: 2rem;
}

.start-button {
  background: linear-gradient(
    45deg,
    var(--start-button-gradient-1, #ff6b6b),
    var(--start-button-gradient-2, #ff8e8e)
  );
  border: none;
  color: var(--button-text-color, white);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: bold;
  padding: 1rem 3rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px var(--button-shadow-color, rgba(255, 107, 107, 0.3));
  text-transform: uppercase;
  letter-spacing: 2px;
}

.start-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px var(--button-shadow-color, rgba(255, 107, 107, 0.4));
  background: linear-gradient(
    45deg,
    var(--button-hover-color, #ff5252),
    var(--start-button-gradient-2, #ff7979)
  );
}

.start-button:active {
  transform: translateY(-1px);
}

/* Game Over Screen */
.game-over-content {
  text-align: center;
  max-width: 500px;
  padding: 20px;
}

.game-over-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
  color: var(--game-over-color, #ff6b6b);
}

.final-score {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  color: var(--final-score-color, #4ecdc4);
}

.high-score-display {
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 2rem;
  color: var(--high-score-color, #ffd700);
  background: rgba(255, 215, 0, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.restart-button {
  background: linear-gradient(
    45deg,
    var(--restart-button-gradient-1, #4ecdc4),
    var(--restart-button-gradient-2, #44a08d)
  );
  border: none;
  color: var(--button-text-color, white);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: bold;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(78, 205, 196, 0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.restart-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(78, 205, 196, 0.4);
  background: linear-gradient(
    45deg,
    var(--button-hover-color, #26d0ce),
    var(--restart-button-gradient-2, #1a9cb0)
  );
}

.restart-button:active {
  transform: translateY(-1px);
}

/* Game UI */
#gameUI {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: 95%;
}

#score {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  background: var(--popup-background-color, rgba(0, 0, 0, 0.5));
  padding: 0.5rem 1rem;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  margin-bottom: 0.5rem;
  color: var(--score-color, white);
}

#highScore {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  background: rgba(255, 215, 0, 0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--high-score-color, #ffd700);
  width: max-content;
}

/* Hearts Container */
.hearts-container {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

.heart {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--heart-color, #ff6b6b);
  transition: all 0.3s ease;
  opacity: 1;
  display: inline-block;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.heart.hidden {
  opacity: 0;
  transform: scale(0.5);
  text-shadow: none;
}

.heart.losing {
  animation: heartLost 0.5s ease-out;
}

@keyframes heartLost {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.5);
    opacity: 0;
  }
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

/* Responsive Design */
@media (max-width: 768px) {
  .instructions {
    margin-bottom: 2rem;
  }

  .instruction-item {
    gap: 0.5rem;
    text-align: center;
  }

  .start-button,
  .restart-button {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .start-content,
  .game-over-content {
    padding: 10px;
  }

  .game-title {
    margin-bottom: 0.5rem;
  }

  .game-subtitle {
    margin-bottom: 1.5rem;
  }

  .instructions {
    margin-bottom: 1.5rem;
  }
}
