body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(to bottom, #2d1b4e, #1a0f2e);
  font-family: 'Arial', sans-serif;
  text-align: center;
}

main {
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}


.game-container {
  display: flex;
  gap: 20px;
  position: relative;
  align-items: flex-start;
}



canvas {
  order: 2;
  border: 5px solid black;
  box-sizing: border-box;
}
.menu-container {
  max-width: 600px;
  width: 90%;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #ffd700, #ffa500);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: #b39ddb;
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1rem 2rem;
  margin: 1rem 0;
  font-size: 1.2rem;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.menu-button i {
  margin-right: 10px;
}

#classicModeButton {
  background: linear-gradient(to right, #4CAF50, #45a049);
}

#arcadeModeButton {
  background: linear-gradient(to right, #2196F3, #1976D2);
}

#multiplayerModeButton {
  background: linear-gradient(to right, #f44336, #d32f2f);
}

#guideBtn {
  background: linear-gradient(to right, #A8A8A8, #A9A9A9);
}

.guide-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #1a1a1a;
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  transition: background-color 0.2s;
}

.guide-button:hover {
  background-color: #333;
}

.menu-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.level-select {
  display: none;
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

h2 {
  color: white;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.level-button {
  padding: 1rem 2rem;
  margin: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  background: linear-gradient(to right, #7e57c2, #673ab7);
  color: white;
  border: none;
  border-radius: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.level-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.back-button {
  padding: 0.8rem 1.5rem;
  margin-top: 2rem;
  font-size: 1rem;
  cursor: pointer;
  background: transparent;
  color: #b39ddb;
  border: 2px solid #b39ddb;
  border-radius: 6px;
  transition: all 0.2s;
}

.back-button:hover {
  background: rgba(179, 157, 219, 0.1);
  color: white;
  border-color: white;
}

#tower-selection {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 2000px;
  margin: 0 auto;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
}

.tower-card {
  width: 150px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
}

.tower-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.tower-card.selected {
  border-color: #ffd700;
}

.tower-card img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.tower-card-details {
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
}

.tower-card-details h3 {
  margin: 0;
  font-size: 10px;
}

.tower-cost {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ffd700;
  color: black;
  padding: 5px 10px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
}
.tower-button {
  padding: 10px 20px;
  font-size: 16px;
  border: 2px solid #444;
  background-color: rgba(240, 240, 240, 0.9);
  color: #333;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
  flex: 1;            
  min-width: 120px;   
  max-width: 200px;   
}

.tower-button:hover {
  background-color: #ddd;
  border-color: #000;
  transform: translateY(-2px);
}

.tower-button.selected {
  background-color: #4caf50;
  color: white;
  border-color: #3e8e41;
}



#tower-overlay {
  position: absolute;
  left: calc(100% + 5px);
  top: 0;
  width: 210px;
  background: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 100%);
  color: #ecf0f1;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
  font-family: 'Arial', sans-serif;
}

#tower-overlay h2 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #ffd700;
  background: linear-gradient(to right, #ffd700, #ffa500);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.3em;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#tower-overlay p {
  margin: 8px 0;
  padding: 6px;
  background: rgba(45, 27, 78, 0.6);
  border-radius: 4px;
  font-size: 0.9em;
}

#tower-overlay strong {
  color: #ffd700;
  margin-right: 5px;
}

#tower-overlay span {
  color: #fff;
  font-weight: bold;
}

#upgrade-tower-button, #sell-tower-button {
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

#upgrade-tower-button {
  background: linear-gradient(to bottom, #ffd700, #ffa500);
  color: #1a0f2e;
  margin-bottom: 8px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

#upgrade-tower-button:hover {
  background: linear-gradient(to bottom, #ffc500, #ff9000);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.4);
}

#sell-tower-button {
  background: linear-gradient(to bottom, #e74c3c, #c0392b);
  color: white;
}

#sell-tower-button:hover {
  background: linear-gradient(to bottom, #c0392b, #a93226);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


@keyframes borderGlow {
  0% { border-color: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
  50% { border-color: #ffa500; box-shadow: 0 0 20px rgba(255, 165, 0, 0.4); }
  100% { border-color: #ffd700; box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
}

#tower-overlay:hover {
  animation: borderGlow 2s infinite;
}



p, h1, h3 {
  color: white;
}

#enemy-controller {
  position: absolute;
  left: -257px;
  top: -150px;
  width: 222px;
  background: linear-gradient(180deg, rgba(45, 27, 78, 0.95), rgba(26, 15, 46, 0.95));
  padding: 15px;
  border-radius: 8px;
  z-index: 1;
  text-align: center;
  border: 1px solid #b39ddb;
  box-shadow: 0 0 15px rgba(179, 157, 219, 0.15);
}

#enemy-selection {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  gap: 8px;
  margin-top: 10px;
}

.enemy-card {
  border: 1px solid #b39ddb;
  border-radius: 6px;
  padding: 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
  background: rgba(45, 27, 78, 0.4);
}

.enemy-card img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.enemy-card h4 {
  margin: 4px 0;
  font-size: 9px;
  color: #ecf0f1;
}

.enemy-card p {
  margin: 0;
  font-size: 11px;
  color: #b39ddb;
}

.enemy-card.selected {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

#enemy-controller h3 {
  color: #ffd700;
  margin: 0 0 10px 0;
}

#enemy-controller p {
  color: #ecf0f1;
}

#enemy-controller strong {
  color: #ffd700;
}

#enemy-controller span {
  color: #b39ddb;
}

#game-timer-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 120px;
  height: 120px;
  z-index: 10;
}

#game-timer-circle {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    #4caf50 0%,
    #4caf50 var(--progress),
    #ddd var(--progress),
    #ddd 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-timer-circle::after {
  content: "";
  position: absolute;
  width: 85%;
  height: 85%;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  z-index: 1;
}

#game-timer-text {
  position: absolute;
  z-index: 2;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.map-select {
  display: none;
}

.map-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

/* .map-card:hover {
  transform: translateY(-4px);
} */

/* .map-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
} */

/* .map-info {
  padding: 1rem;
} */

.map-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.select-map-btn {
  width: 100%;
  padding: 0.75rem;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 0 0 8px 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.select-map-btn:hover {
  background: #357abd;
}

.slider-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  
  height: auto;
}

.map-slider {
  display: flex;
  transition: transform 0.3s ease-in-out;
  
  width: 200%;  
  margin-top: 10px;
}

.map-card {
  
  width: 50%;  
  flex-shrink: 0;  
  padding: 1rem;
  box-sizing: border-box;  
  
  overflow: hidden;
}


.map-preview {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;  
  max-width: 100%;  
}


.slider-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 1rem;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

.prev-button {
  left: 10px;
}

.next-button {
  right: 10px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dot.active {
  background: #ffd700;
}


.map-info {
  width: 100%;
  overflow: hidden;
}


.select-map-btn {
  width: 100%;
  margin-top: 1rem;
}



.spell-container {
  display: flex;
  gap: 15px;
}

.spell-card {
  position: relative;
  display: inline-block;
  text-align: center;
}

.spell-name {
  margin-top: 5px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.spell-button {
  border: none;
  background-color: transparent;
  cursor: pointer;
  position: relative;
}

.spell-button:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.spell-button img {
  width: 80px;
  height: 80px;
  display: block;
}

.spell-quantity {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 5px;
  border-radius: 50%;
  font-size: 12px;
}

.spell-button.selected {
  border: 2px solid #ffd700;
  background-color: rgba(255, 255, 0, 0.2);
}

.cooldown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 5px;
  display: none; 
}

#menuButton {
  top: 20px; 
  right: 350px;
}


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

.modal-content {
  background: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 100%);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 400px;
  width: 80%;
  border: 2px solid #ffd700;
  color: white;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal h3 {
  color: #ffd700;
  margin-top: 0;
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal p {
  margin-bottom: 20px;
  color: #ecf0f1;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

#confirmReturn {
  background: linear-gradient(to bottom, #e74c3c, #c0392b);
  color: white;
}

#confirmReturn:hover {
  background: linear-gradient(to bottom, #c0392b, #a93226);
  transform: translateY(-2px);
}

#cancelReturn {
  background: linear-gradient(to bottom, #3498db, #2980b9);
  color: white;
}

#cancelReturn:hover {
  background: linear-gradient(to bottom, #2980b9, #1f6aa7);
  transform: translateY(-2px);
}


.music-control-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1000;
  color: white;
  transition: all 0.3s ease;
}

.music-control-button:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.music-control-button.muted .fa-volume-up:before {
  content: "\f6a9";  
}

