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

body {
  background: #0a0f1a;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  color: #b8c4d8;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#ui {
  position: fixed;
  top: 20px;
  left: 20px;
  max-width: 280px;
  z-index: 10;
}

#info {
  background: rgba(10, 15, 26, 0.85);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(80, 100, 140, 0.2);
  margin-bottom: 12px;
  transition: opacity 0.3s;
}

#info h3 {
  font-size: 14px;
  font-weight: normal;
  color: #d0dae8;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

#info p {
  font-size: 11px;
  line-height: 1.5;
  color: #8898b0;
  margin-bottom: 8px;
}

#info p.muted {
  color: #5a6a82;
  font-size: 10px;
}

#controls {
  background: rgba(10, 15, 26, 0.85);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(80, 100, 140, 0.2);
  margin-bottom: 12px;
}

.control {
  margin-bottom: 10px;
}

.control:last-child {
  margin-bottom: 0;
}

.control label {
  display: block;
  font-size: 9px;
  color: #5a6a82;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.control input[type="range"] {
  width: calc(100% - 70px);
  height: 4px;
  -webkit-appearance: none;
  background: rgba(60, 80, 110, 0.3);
  border-radius: 2px;
  outline: none;
  vertical-align: middle;
}

.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #7c9a82;
  border-radius: 50%;
  cursor: pointer;
}

.control span {
  font-size: 10px;
  color: #8898b0;
  margin-left: 8px;
  display: inline-block;
  width: 58px;
  text-align: right;
}

#stats {
  background: rgba(10, 15, 26, 0.85);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(80, 100, 140, 0.2);
  margin-bottom: 12px;
}

.stat {
  font-size: 11px;
  margin-bottom: 4px;
}

.stat:last-child {
  margin-bottom: 0;
}

.stat .label {
  color: #5a6a82;
}

.stat.surplus {
  color: #c49a6c;
}

#status {
  font-size: 10px;
  color: #7c9a82;
  padding: 8px 12px;
  background: rgba(10, 15, 26, 0.7);
  border-radius: 6px;
  text-align: center;
  min-height: 30px;
}

#status.extinction {
  color: #c97a6c;
}

#status.thriving {
  color: #7c9a82;
}

#mode-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 11px;
  color: #7c9a82;
  letter-spacing: 2px;
  z-index: 10;
  background: rgba(10, 15, 26, 0.7);
  padding: 8px 14px;
  border-radius: 4px;
}

#mode-indicator.extinction {
  color: #c97a6c;
}

#mode-indicator.decline {
  color: #c49a6c;
}

#buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

#buttons button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(80, 100, 140, 0.3);
  background: rgba(10, 15, 26, 0.8);
  color: #8898b0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#buttons button:hover {
  background: rgba(20, 30, 50, 0.9);
  border-color: rgba(100, 120, 160, 0.4);
}

@media (max-width: 600px) {
  #ui {
    max-width: calc(100% - 40px);
    left: 10px;
    top: 10px;
  }

  #info h3 {
    font-size: 12px;
  }

  #info p {
    font-size: 10px;
  }

  #mode-indicator {
    top: 10px;
    right: 10px;
    font-size: 9px;
  }
}
