body {
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #1a1a2e; 
  font-family: Arial, sans-serif;
  overflow: hidden;
  color: white;
}

body.meme-world {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460); 
}

body.digital-realm {
  background: linear-gradient(135deg, #0a192f, #112240, #0f2942); 
}

body.cyberpunk-city {
  background: linear-gradient(135deg, #1f2937, #111827, #374151); 
}

body.wasteland-world {
  background: url('/desert_wasteland_background.png') center/cover no-repeat;
}

body.arcade-world {
  background: url('/pixel_arcade_background.png') center/cover no-repeat;
}

body.hell-world {
  background: url('/hell_background.png') center/cover no-repeat;
}

body.time-warp-world {
  background: url('/time_warp_background.png') center/cover no-repeat;
}

body.quantum-realm {
  background: url('/quantum_background.png') center/cover no-repeat;
}

#game {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  transform-origin: top left;
  background: rgba(0, 0, 0, 0.4); 
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#game.meme-world {
  background: rgba(30, 50, 100, 0.4);
  box-shadow: 0 10px 30px rgba(100, 150, 255, 0.3);
}

#game.digital-realm {
  background: rgba(0, 50, 100, 0.4);
  box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
}

#game.cyberpunk-city {
  background: rgba(50, 0, 100, 0.4);
  box-shadow: 0 10px 30px rgba(255, 0, 255, 0.3);
}

#game.wasteland-world {
  background: rgba(139,69,19,0.4);
  box-shadow: 0 10px 30px rgba(210,180,140,0.3);
}

#game.arcade-world {
  background: rgba(50,50,100,0.4);
  box-shadow: 0 10px 30px rgba(100,100,255,0.3);
}

#game.hell-world {
  background: rgba(100,0,0,0.4);
  box-shadow: 0 10px 30px rgba(255,69,0,0.3);
}

#game.time-warp-world {
  background: rgba(0,50,100,0.4);
  box-shadow: 0 10px 30px rgba(0,100,200,0.3);
}

#game.quantum-realm {
  background: rgba(50,0,100,0.4);
  box-shadow: 0 10px 30px rgba(150,0,255,0.3);
}

#gameCanvas {
  border: 2px solid rgba(255, 255, 255, 0.2); 
  background: rgba(30, 30, 30, 0.7); 
  max-width: 800px;
  max-height: 600px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

#gameCanvas.meme-world {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(100, 100, 200, 0.2); 
}

#gameCanvas.digital-realm {
  border-color: rgba(0, 255, 255, 0.4);
  background: rgba(0, 100, 200, 0.2); 
}

#gameCanvas.cyberpunk-city {
  border-color: rgba(255, 0, 255, 0.4);
  background: rgba(100, 0, 200, 0.2); 
}

#gameCanvas.wasteland-world {
  background: rgba(181,101,29,0.2);
  border-color: rgba(210,180,140,0.4);
}

#gameCanvas.arcade-world {
  background: rgba(100,100,200,0.2);
  border-color: rgba(100,100,255,0.4);
}

#gameCanvas.hell-world {
  background: rgba(150,0,0,0.2);
  border-color: rgba(255,69,0,0.4);
}

#gameCanvas.time-warp-world {
  background: rgba(0,100,200,0.2);
  border-color: rgba(0,200,255,0.4);
}

#gameCanvas.quantum-realm {
  background: rgba(100,0,200,0.2);
  border-color: rgba(200,0,255,0.4);
}

#sidebar {
  width: 200px;
  min-width: 200px;
  padding: 20px;
  background: rgba(50, 50, 50, 0.6); 
  border-radius: 10px;
  height: fit-content;
  max-height: 600px;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

#sidebar.meme-world {
  background: rgba(50, 50, 150, 0.6);
}

#sidebar.digital-realm {
  background: rgba(0, 50, 150, 0.6);
}

#sidebar.cyberpunk-city {
  background: rgba(100, 0, 150, 0.6);
}

#sidebar.wasteland-world {
  background: rgba(139,69,19,0.6);
}

#sidebar.arcade-world {
  background: rgba(50,50,150,0.6);
}

#sidebar.hell-world {
  background: rgba(150,0,0,0.6);
}

#sidebar.time-warp-world {
  background: rgba(0,50,150,0.6);
}

#sidebar.quantum-realm {
  background: rgba(100,0,150,0.6);
}

#startWave {
  width: 100%;
  padding: 10px;
  margin-top: 20px;
  background: #4CAF50;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

#startWave:hover {
  background: #45a049;
}

#startWave:disabled {
  background: #666;
  cursor: not-allowed;
}

#money, #health {
  font-size: 18px;
  margin-bottom: 15px;
}

#waveInfo {
  margin-bottom: 15px;
  padding: 10px;
  background: #555;
  border-radius: 5px;
}

.stat-label {
  font-weight: bold;
  color: #aaa;
}

#notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.bonus-notification {
  background: rgba(76, 175, 80, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  margin-bottom: 10px;
  animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 2.7s;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

#audio-controls {
  margin-top: 20px;
  padding: 10px;
  background: #555;
  border-radius: 5px;
}

#toggleMusic {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  background: #666;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

#toggleMusic:hover {
  background: #777;
}

#volumeSlider {
  width: 100%;
  margin-top: 5px;
}

#upgradePanel {
  margin-top: 10px;
  padding: 10px;
  background: #555;
  border-radius: 5px;
}

#upgradePanel button {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  background: #666;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

#upgradePanel button:hover {
  background: #777;
}

#upgradePanel button:disabled {
  background: #444;
  cursor: not-allowed;
}

#selectedTowerInfo {
  margin-bottom: 10px;
  font-size: 14px;
}

.tower {
  position: relative;
}

.tower-level {
  position: absolute;
  top: -5px;
  right: -5px;
  background: gold;
  color: black;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.tower-upgrade-menu {
  position: absolute;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid #666;
  border-radius: 8px;
  padding: 10px;
  color: white;
  z-index: 1000;
  min-width: 200px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tower-stats {
  margin-bottom: 10px;
  font-size: 12px;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
}

.tower-stat {
  display: flex;
  justify-content: space-between;
  margin: 2px 0;
}

.stat-name {
  color: #aaa;
}

.upgrade-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
}

.upgrade-cost {
  color: gold;
}

.tower-range-indicator {
  position: absolute;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#cooldownTimer {
  background: #666;
  color: #fff;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  margin: 10px 0;
  font-size: 14px;
  display: none;
}

.tower-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 100px;
  margin: 0 auto;
  padding: 10px;
  background: #555;
  border-radius: 5px;
  cursor: grab;
  transition: background 0.3s;
}

.tower-option:active {
  cursor: grabbing;
}

.tower-option:hover {
  background: #666;
}

.tower-option img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.tower-option div {
  text-align: center;
  margin-top: 5px;
  font-size: 14px;
}

.tower-option[data-type="medic"] img {
  filter: hue-rotate(120deg);
}

.tower-option[data-type="diamond"] img {
  filter: brightness(1.2) saturate(1.5);
}

#towers {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.towers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  overflow-y: auto;
  max-height: 300px;
  padding-right: 10px;
}

.towers-grid::-webkit-scrollbar {
  width: 8px;
}

.towers-grid::-webkit-scrollbar-track {
  background: rgba(50, 50, 50, 0.6);
}

.towers-grid::-webkit-scrollbar-thumb {
  background: #4CAF50;
  border-radius: 4px;
}

.towers-grid::-webkit-scrollbar-thumb:hover {
  background: #45a049;
}

.title-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
  text-align: center;
  background-image: url('/epic-face-sz7h2ca92jlqeqw9.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.title-container {
  background: rgba(0, 0, 0, 0.7);
  padding: 40px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
}

.title-container h1 {
  font-size: 3rem;
  margin-bottom: 30px;
  color: #4CAF50;
}

#startGame {
  padding: 15px 30px;
  font-size: 1.2rem;
  background: #4CAF50;
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#startGame:hover {
  background: #45a049;
  transform: scale(1.05);
}

.instructions {
  margin-top: 20px;
  background: rgba(50, 50, 50, 0.6);
  padding: 20px;
  border-radius: 10px;
}

.hidden {
  display: none;
}

.difficulty-selector {
  margin-top: 20px;
  text-align: center;
}

.difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.difficulty-btn {
  padding: 10px 20px;
  font-size: 1rem;
  background: #666;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

.difficulty-btn:hover {
  background: #777;
}

.difficulty-btn.selected {
  background: #4CAF50;
}

.epilogue-story {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.epilogue-story p {
  margin-bottom: 15px;
  color: #e0e0e0;
}

#continueToTitle {
  padding: 15px 30px;
  font-size: 1.2rem;
  background: #4CAF50;
  border: none;
  border-radius: 10px;
  color: white;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#continueToTitle:hover {
  background: #45a049;
  transform: scale(1.05);
}

.tower-bio-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.tower-bio-content {
  background: rgba(30, 30, 30, 0.9);
  padding: 30px;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: white;
  text-align: center;
}

.tower-bio-content img {
  max-width: 200px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.close-bio {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 20px;
}

.effective-enemy {
  background-color: #4CAF50;
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  margin: 0 2px;
  display: inline-block;
  font-size: 0.9em;
}

#sandboxControls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#toggleSandbox, #gotoWave {
  width: 100%;
  padding: 8px;
  background: #007bff;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

#toggleSandbox:hover, #gotoWave:hover {
  background: #0056b3;
}

#gotoWaveInput {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #666;
  background: #333;
  color: #fff;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  #game {
    transform: scale(0.8);
  }
}

@media (max-width: 800px) {
  #game {
    transform: scale(0.6);
  }
  .towers-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}