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

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

#glCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
}

/* Top Bar */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

#resources {
  display: flex;
  gap: 2rem;
}

#score-display,
#mass-display {
  text-align: left;
  pointer-events: none;
}

#score {
  font-size: 3rem;
  font-weight: bold;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  color: #0ff;
}

#mass {
  font-size: 3rem;
  font-weight: bold;
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
  color: #f0f;
}

.label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  opacity: 0.6;
}

/* Evolution Bar */
#evolution-container {
  flex: 1;
  max-width: 400px;
}

.progress-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  opacity: 0.6;
  margin-bottom: 0.3rem;
}

#evolution-bar {
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 0, 255, 0.3);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

#evolution-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  border-radius: 12px;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

#evolution-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

#shader-mode {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  margin-top: 0.3rem;
  color: #ff00ff;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

/* Center Button */
#buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.clicker-btn {
  pointer-events: auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid #0ff;
  background: rgba(0, 255, 255, 0.1);
  color: #0ff;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  overflow: hidden;
}

.clicker-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

.clicker-btn:active {
  transform: scale(0.95);
  background: rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.6);
}

.clicker-btn .btn-inner {
  position: relative;
  z-index: 2;
}

.clicker-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Stats Bar */
#stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 1rem;
}

.stat {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.5;
  margin-bottom: 0.2rem;
}

.stat span:last-child {
  font-size: 1.2rem;
  color: #0ff;
}

/* Upgrades */
#upgrades {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.upgrade-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  min-width: 140px;
}

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  opacity: 0.6;
  text-align: center;
  margin-bottom: 0.3rem;
}

.currency-tag {
  font-size: 0.55rem;
  opacity: 0.7;
}

.energy-section .section-label {
  color: #0ff;
}

.mass-section .section-label {
  color: #f0f;
}

.upgrade-btn {
  pointer-events: auto;
  padding: 0.6rem 1rem;
  border: 1px solid #444;
  background: rgba(255, 255, 255, 0.03);
  color: #777;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  justify-content: space-between;
}

.upgrade-btn:hover:not(:disabled) {
  border-color: #0ff;
  color: #0ff;
  background: rgba(0, 255, 255, 0.1);
}

.upgrade-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.upgrade-btn .cost {
  opacity: 0.5;
  font-size: 0.75rem;
}

/* Mass-based upgrades - magenta styling */
.upgrade-btn[data-type="radius"],
.upgrade-btn[data-type="magnet"],
.upgrade-btn[data-type="spawn"],
.upgrade-btn[data-type="evolution"] {
  border-color: #606;
  color: #a0a;
}

.upgrade-btn[data-type="radius"]:hover:not(:disabled),
.upgrade-btn[data-type="magnet"]:hover:not(:disabled),
.upgrade-btn[data-type="spawn"]:hover:not(:disabled),
.upgrade-btn[data-type="evolution"]:hover:not(:disabled) {
  border-color: #f0f;
  color: #f0f;
  background: rgba(255, 0, 255, 0.1);
}

/* Tunnel mode upgrades - orange styling */
.upgrade-btn[data-type="fluid"],
.upgrade-btn[data-type="tunnel"] {
  border-color: #630;
  color: #a60;
}

.upgrade-btn[data-type="fluid"]:hover:not(:disabled),
.upgrade-btn[data-type="tunnel"]:hover:not(:disabled) {
  border-color: #f90;
  color: #f90;
  background: rgba(255, 150, 0, 0.1);
}

/* Tunnel mode active styles */
body.tunnel-mode #evolution-bar {
  border-color: rgba(255, 150, 0, 0.5);
}

body.tunnel-mode #evolution-fill {
  background: linear-gradient(90deg, #ff6600, #ffcc00);
  box-shadow: 0 0 20px rgba(255, 150, 0, 0.5);
}

body.tunnel-mode #shader-mode {
  color: #ff9900;
  text-shadow: 0 0 10px rgba(255, 150, 0, 0.5);
}

body.tunnel-mode .clicker-btn {
  border-color: #f90;
  background: rgba(255, 150, 0, 0.1);
  color: #f90;
}

body.tunnel-mode .clicker-btn:hover {
  background: rgba(255, 150, 0, 0.2);
  box-shadow: 0 0 30px rgba(255, 150, 0, 0.3);
}

/* Collect indicator */
.collect-popup {
  position: fixed;
  pointer-events: none;
  color: #0ff;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  animation: float-up 0.8s ease-out forwards;
  z-index: 100;
}

.collect-popup.mass-popup {
  color: #f0f;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.3);
  }
}

/* Responsive */
@media (max-width: 768px) {
  #top-bar {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  #score-display {
    text-align: center;
  }
  
  #evolution-container {
    width: 100%;
    max-width: none;
  }
  
  #upgrades {
    gap: 1rem;
  }
  
  .upgrade-section {
    min-width: 100px;
  }
  
  #stats-bar {
    gap: 1.5rem;
  }
}
