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

body {
  font-family: 'Comic Sans MS', 'Arial', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow-y: auto;
  overflow-x: hidden;
  user-select: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

#title {
  font-size: 48px;
  font-weight: bold;
  color: white;
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
  text-align: center;
}

#container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
}

#gameBox {
  display: flex;
  justify-content: center;
  align-items: center;
}

#gameCanvas {
  display: block;
  background: #2a2a2a;
  cursor: grab;
  image-rendering: pixelated;
  width: 800px;
  height: 600px;
  border: 5px solid #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

#gameCanvas:active {
  cursor: grabbing;
}

#controls {
  width: 800px;
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 20px;
  border: 5px solid #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.control-section {
  flex: 1;
  min-width: 180px;
  padding: 15px;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.control-section:last-child {
  border-right: none;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #ff6b6b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button {
  width: 100%;
  padding: 12px;
  margin: 5px 0;
  border: 3px solid #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  font-family: inherit;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

button:active {
  transform: scale(0.95);
}

.spawn-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.control-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#gravitySlider {
  width: 100%;
  margin: 10px 0;
  cursor: pointer;
}

#gravityValue {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #4facfe;
  margin-bottom: 10px;
}

.info {
  text-align: center;
  border: none;
}

.info p {
  font-size: 14px;
  color: #aaa;
  line-height: 1.6;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ff6b6b;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid white;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ff6b6b;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid white;
}

/* Responsive */
@media (max-width: 900px) {
  #title {
    font-size: 32px;
  }
  
  #gameCanvas {
    width: 600px;
    height: 450px;
  }
  
  #controls {
    width: 600px;
  }
}

@media (max-width: 650px) {
  #title {
    font-size: 24px;
  }
  
  #gameCanvas {
    width: 400px;
    height: 300px;
  }
  
  #controls {
    width: 400px;
    flex-direction: column;
  }
  
  .control-section {
    border-right: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  }
  
  .control-section:last-child {
    border-bottom: none;
  }
}
