html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #ff80bf, #800040);
  color: #fff;
  height: 100vh; /* Fixed height instead of min-height */
  overflow: hidden; /* Prevent scrolling */
}

body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
}

canvas {
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#game-container {
  display: flex;
  justify-content: center;
  margin-top: 5px; /* Further reduced from 10px */
}

h1 {
  text-align: center;
  margin-top: 3px; /* Further reduced from 5px */
  margin-bottom: 3px; /* Further reduced from 5px */
  font-size: 1.8rem; /* Further reduced from 2rem */
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

h1::after {
  content: '';
  position: absolute;
  bottom: -5px; /* Reduced from -8px */
  left: 0;
  width: 100%;
  height: 2px; /* Reduced from 3px */
  background: linear-gradient(90deg, transparent, #ff3399, transparent);
}

.instructions {
  text-align: center;
  margin: 2px 0;
  font-size: 0.75rem; /* Further reduced from 0.8rem */
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

hr {
  margin: 3px auto; /* Further reduced from 5px */
  width: 80%;
  max-width: 600px;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.slide-container {
  margin: 3px auto; /* Further reduced from 5px */
  display: flex;
  justify-content: center;
  gap: 3px 10px; /* Further reduced from 5px 15px */
  flex-wrap: wrap;
  max-width: 800px;
  padding: 3px; /* Further reduced from 5px */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px; /* Reduced from 10px */
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slide-container div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slide-container label {
  margin-bottom: 3px; /* Further reduced from 5px */
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem; /* Further reduced from 0.9rem */
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px; /* Further reduced from 150px */
  height: 6px; /* Reduced from 8px */
  border-radius: 8px; /* Reduced from 10px */
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  opacity: 0.8;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mouse-over effects */
.slider:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

/* The slider handle */
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; /* Further reduced from 20px */
  height: 18px; /* Further reduced from 20px */
  border-radius: 50%;
  background: linear-gradient(135deg, #ff66cc, #cc0066);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
  width: 18px; /* Further reduced from 20px */
  height: 18px; /* Further reduced from 20px */
  border-radius: 50%;
  background: linear-gradient(135deg, #ff66cc, #cc0066);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  border: none;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.loader {
  border: 8px solid rgba(255, 255, 255, 0.1);
  border-top: 8px solid #ff3399;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 30px rgba(255, 51, 153, 0.3);
}

@keyframes spin {
  0% { 
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% { 
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Power-up legend styling */
.power-up-legend {
  max-width: 450px; /* Reduced from 500px */
  margin: 2px auto; /* Further reduced from 5px */
  padding: 5px; /* Further reduced from 8px */
  border-radius: 8px; /* Reduced from 12px */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Reduced shadow */
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.3s ease;
}

.power-up-legend:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); /* Reduced from 15px 40px */
}

.power-up-legend h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 3px; /* Further reduced from 5px */
  color: #fff;
  font-size: 1rem; /* Further reduced from 1.1rem */
  letter-spacing: 1px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.power-up-legend h3::after {
  content: '';
  position: absolute;
  bottom: -3px; /* Further reduced from -5px */
  left: 0;
  width: 100%;
  height: 1px; /* Reduced from 2px */
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.power-up-item {
  display: flex;
  align-items: center;
  margin-bottom: 3px; /* Further reduced from 5px */
  padding: 3px; /* Further reduced from 4px */
  border-radius: 6px; /* Reduced from 8px */
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.power-up-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.power-up-icon {
  width: 22px; /* Further reduced from 25px */
  height: 22px; /* Further reduced from 25px */
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 6px; /* Further reduced from 8px */
  border-radius: 4px;
  color: white;
  font-weight: bold;
  font-size: 0.8rem; /* Further reduced from 0.9rem */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Reduced from 0 4px 10px */
  animation: pulse 2s infinite;
}

.power-up-item span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem; /* Further reduced from 0.8rem */
  line-height: 1.1;
}

.power-up-item b {
  color: #fff;
  font-weight: 600;
}

.speed-boost {
  background: linear-gradient(135deg, #ff66b2, #cc0066);
  box-shadow: 0 0 10px rgba(255, 102, 178, 0.5);
}

.mega-growth {
  background: linear-gradient(135deg, #ff99cc, #ff3399);
  box-shadow: 0 0 10px rgba(255, 153, 204, 0.5);
}

.score-multiplier {
  background: linear-gradient(135deg, #ff80ff, #cc00cc);
  box-shadow: 0 0 10px rgba(255, 128, 255, 0.5);
}

/* Container styling */
#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  height: 100vh;
  box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
  
  .slide-container {
    flex-direction: column;
    align-items: center;
  }
  
  .power-up-legend {
    padding: 5px;
  }
}
