body, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #111;
  color: #fff;
  overflow-x: hidden;
}

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, #1d2b64, #f8cdda, #009fff, #ec2f4b);
  background-size: 600% 600%;
  animation: gradientShift 20s ease infinite;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  max-width: 600px;
  margin: auto;
  padding: 20px;
  text-align: center;
}

h1 {
  margin-bottom: 20px;
  font-size: 2.5rem;
}

.controls {
  margin-bottom: 15px;
}

.controls select,
.controls button {
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  margin: 5px;
  border: none;
  cursor: pointer;
}

.controls button {
  background-color: #00c2ff;
  color: white;
  transition: transform 0.3s ease, background 0.3s;
}

.controls button:hover {
  transform: scale(1.05);
  background-color: #00a6d6;
}

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

canvas {
  background-color: #222;
  border: 4px solid #00c2ff;
  margin-bottom: 10px;
  box-shadow: 0 0 15px #00e5ff;
}

.info {
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 240px;
  margin: auto;
}

.touch-controls {
  display: none;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.touch-controls button {
  padding: 15px;
  font-size: 1.5rem;
  border: none;
  background-color: #ffffffcc;
  color: #000;
  border-radius: 8px;
  cursor: pointer;
}

.footer {
  margin-top: 30px;
  font-size: 0.9rem;
  color: #ccc;
}

@media (max-width: 600px) {
  canvas {
    width: 180px;
    height: 300px;
  }

  .info {
    font-size: 1rem;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .touch-controls {
    display: flex;
  }
}

.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-image: url('https://cdn-icons-png.flaticon.com/512/616/616408.png'), 
                    url('https://cdn-icons-png.flaticon.com/512/616/616416.png'), 
                    url('https://cdn-icons-png.flaticon.com/512/616/616430.png');
  background-repeat: repeat;
  animation: confettiFall 3s linear forwards;
  z-index: 1000;
  opacity: 0.8;
}

@keyframes confettiFall {
  0% {
    background-position: 0 -100vh, 20vw -120vh, 50vw -110vh;
  }
  100% {
    background-position: 0 100vh, 20vw 120vh, 50vw 110vh;
    opacity: 0;
  }
}
