* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

.font-orbitron {
  font-family: 'Orbitron', sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Stars background */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 60px 70px, white, transparent),
    radial-gradient(1px 1px at 50px 50px, white, transparent),
    radial-gradient(1px 1px at 130px 80px, white, transparent),
    radial-gradient(2px 2px at 90px 10px, white, transparent);
  background-size: 200px 200px;
  animation: stars-move 120s linear infinite;
  opacity: 0.5;
}

@keyframes stars-move {
  from { background-position: 0 0; }
  to { background-position: -200px -200px; }
}

/* Glass panel effect */
.glass-panel {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 32px 0 rgba(139, 92, 246, 0.2);
}

/* Planet container */
.planet-container {
  width: 300px;
  height: 300px;
  position: relative;
  transition: transform 0.2s;
}

.planet-container:hover {
  transform: scale(1.05);
}

.planet-container:active {
  transform: scale(0.95);
}

.planet {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  animation: planet-rotate 60s linear infinite;
  box-shadow: 
    0 0 60px rgba(139, 92, 246, 0.4),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  transition: background 2s ease;
}

/* Planet stages */
.planet-stage-1 .planet {
  background: radial-gradient(circle at 30% 30%, #4a4a4a, #2a2a2a);
  box-shadow: 
    0 0 40px rgba(100, 100, 100, 0.3),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.planet-stage-2 .planet {
  background: radial-gradient(circle at 30% 30%, #8b4513, #5c2e0f);
  box-shadow: 
    0 0 50px rgba(255, 69, 0, 0.4),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.planet-stage-3 .planet {
  background: 
    radial-gradient(circle at 70% 70%, #d2691e, transparent 30%),
    radial-gradient(circle at 20% 40%, #8b6914, transparent 40%),
    radial-gradient(circle at 30% 30%, #4169e1, #1e3a8a);
  box-shadow: 
    0 0 60px rgba(65, 105, 225, 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.planet-stage-4 .planet {
  background: 
    radial-gradient(circle at 60% 30%, #228b22, transparent 25%),
    radial-gradient(circle at 30% 70%, #2e8b57, transparent 30%),
    radial-gradient(circle at 80% 50%, #006400, transparent 20%),
    radial-gradient(circle at 30% 30%, #1e90ff, #0c4a8a);
  box-shadow: 
    0 0 70px rgba(34, 139, 34, 0.6),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.planet-stage-5 .planet {
  background: 
    radial-gradient(circle at 50% 20%, white, transparent 15%),
    radial-gradient(circle at 60% 30%, #228b22, transparent 28%),
    radial-gradient(circle at 30% 70%, #2e8b57, transparent 35%),
    radial-gradient(circle at 80% 50%, #006400, transparent 22%),
    radial-gradient(circle at 20% 40%, #32cd32, transparent 25%),
    radial-gradient(circle at 30% 30%, #00bfff, #0066cc);
  box-shadow: 
    0 0 100px rgba(0, 191, 255, 0.8),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
}

@keyframes planet-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Click effects */
.click-effect {
  position: absolute;
  pointer-events: none;
  color: #fbbf24;
  font-weight: bold;
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-80px);
    opacity: 0;
  }
}

/* Resource displays */
.resource-display {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Upgrade cards */
.upgrade-card {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: all 0.3s;
}

.upgrade-card.affordable {
  border-color: rgba(34, 197, 94, 0.5);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
  }
}

/* Notifications */
.notification {
  animation: slide-in 0.3s ease-out;
  font-weight: 600;
}

@keyframes slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Planet title animation */
.planet-title {
  text-shadow: 
    0 0 10px rgba(139, 92, 246, 0.5),
    0 0 20px rgba(139, 92, 246, 0.3);
  animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(139, 92, 246, 0.5),
      0 0 20px rgba(139, 92, 246, 0.3);
  }
  50% {
    text-shadow: 
      0 0 20px rgba(139, 92, 246, 0.8),
      0 0 40px rgba(139, 92, 246, 0.5);
  }
}

/* Victory confetti */
.victory-confetti {
  animation: victory-bounce 0.6s ease-out;
}

@keyframes victory-bounce {
  0% {
    transform: scale(0.3) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.7);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .planet-container {
    width: 250px;
    height: 250px;
  }
  
  .glass-panel {
    max-height: none !important;
  }
}