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

body {
  background: #1a1625;
  overflow: hidden;
  font-family: 'Segoe UI', sans-serif;
}

#renderCanvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

#ui-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: rgba(20, 15, 35, 0.92);
  border-right: 1px solid #2e2845;
  padding: 1.5rem 1.2rem;
  z-index: 10;
  color: #e8e0f0;
}

#ui-panel h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9a8f0;
  margin-bottom: 1.5rem;
}

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a6f90;
  margin: 1.2rem 0 0.6rem;
}

#tower-buttons {
  display: flex;
  gap: 0.4rem;
}

#tower-buttons button {
  flex: 1;
  padding: 0.4rem 0;
  background: #2a2440;
  border: 1px solid #2e2845;
  border-radius: 6px;
  color: #b8aed0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

#tower-buttons button:hover {
  border-color: #8b6bb0;
  color: #c9a8f0;
}

#tower-buttons button.active {
  background: #c9a8f0;
  color: #1a1625;
  border-color: #c9a8f0;
}

#floor-slider {
  width: 100%;
  margin: 0.4rem 0;
  accent-color: #c9a8f0;
}

#floor-label {
  font-size: 13px;
  color: #b8aed0;
  margin-bottom: 0.4rem;
}

#unit-name, #unit-tower, #unit-size, #unit-value {
  font-size: 13px;
  color: #b8aed0;
  margin-bottom: 0.3rem;
}

.legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 12px;
  color: #b8aed0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.green { background: #1de84e; }
.legend-dot.red { background: #e83232; }

#btn-reset {
  width: 100%;
  padding: 0.5rem;
  background: #2a2440;
  border: 1px solid #2e2845;
  border-radius: 6px;
  color: #b8aed0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1.2rem;
  transition: all 0.2s;
}

#btn-reset:hover {
  border-color: #8b6bb0;
  color: #c9a8f0;
}

#toggle-panel-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
  background: rgba(20, 15, 35, 0.92);
  border: 1px solid #2e2845;
  border-radius: 6px;
  color: #c9a8f0;
  font-size: 18px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  #toggle-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #ui-panel {
    transform: translateX(0);
    transition: transform 0.3s ease;
  }

  #ui-panel.hidden {
    transform: translateX(-100%);
  }
}