:root {
  --space-dark-blue: #0d1117;
  --space-blue: #0EA5E9;
  --space-light-blue: #D3E4FD;
  --space-accent: #8B5CF6;
  --space-gray: #8E9196;
  --space-black: #121212;
  --space-green: #10b981;
  --space-red: #ef4444;
  --space-orange: #f97316;
  --space-yellow: #fbbf24;
  --space-pink: #ec4899;
  --space-purple: #8b5cf6;
  
  --panel-bg: rgba(17, 25, 40, 0.85);
  --panel-border: rgba(255, 255, 255, 0.125);
  --glass-shine: rgba(255, 255, 255, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  background: linear-gradient(180deg, var(--space-dark-blue) 0%, var(--space-black) 100%);
  background-attachment: fixed;
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glass Morphism Effects */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--glass-shine), transparent);
  transform: skewX(-25deg);
  transition: all 0.5s;
  opacity: 0;
}

.glass-panel:hover::before {
  left: 125%;
  opacity: 0.3;
  transition: all 0.5s;
}

#game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  position: relative;
}

#stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

header {
  position: relative;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(17, 25, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.game-title {
  font-family: 'Orbitron', sans-serif;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--space-blue), var(--space-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.game-title i {
  margin-right: 0.5rem;
  color: var(--space-accent);
}

#resources {
  display: flex;
  justify-content: space-around;
  padding: 0.5rem;
}

.resource {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.resource:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.resource-icon {
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.resource:nth-child(1) .resource-icon {
  color: var(--space-yellow);
}

.resource:nth-child(2) .resource-icon {
  color: var(--space-blue);
}

.resource:nth-child(3) .resource-icon {
  color: var(--space-green);
}

.resource span:first-of-type {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
}

.resource-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--space-gray);
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 5;
}

#station-view {
  perspective: 1000px;
  width: 100%;
  display: flex;
  justify-content: center;
}

#station-container {
  width: 260px;
  height: 260px;
  position: relative;
  margin: 2rem 0;
  transform-style: preserve-3d;
  animation: float 6s ease-in-out infinite;
}

.station-core {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.8), rgba(14, 165, 233, 0.6)), url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48cmVjdCB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgZmlsbD0iIzEyMTIxMiIgZmlsbC1vcGFjaXR5PSIwLjciLz48Y2lyY2xlIGN4PSIxMDAiIGN5PSIxMDAiIHI9IjUwIiBzdHJva2U9IiMwRUE1RTkiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIvPjxjaXJjbGUgY3g9IjEwMCIgY3k9IjEwMCIgcj0iNjUiIHN0cm9rZT0iIzhCNUNGNiIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtZGFzaGFycmF5PSI1LDUiIGZpbGw9Im5vbmUiLz48L3N2Zz4=');
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.station-core:hover {
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.3);
}

.station-core:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.station-modules {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

#click-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.main-button {
  background: linear-gradient(135deg, var(--space-blue), var(--space-accent));
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.85rem 2rem;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.main-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s;
}

.main-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.4);
}

.main-button:hover::before {
  left: 100%;
}

.main-button:active {
  transform: translateY(1px);
}

.main-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.progress-bar {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--space-green);
  transition: width 0.05s linear;
  border-radius: 2px;
  will-change: width;
  transform: translateZ(0);
}

#generate-materials .progress-fill {
  background: var(--space-blue);
}

#generate-research .progress-fill {
  background: var(--space-purple);
}

#generate-energy .progress-fill {
  background: var(--space-yellow);
}

.main-button i {
  font-size: 1.2rem;
}

.game-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.game-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  z-index: 5;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.game-panel:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.panel-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}

h2 i {
  margin-right: 0.5rem;
  color: var(--space-accent);
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.upgrade, .crew-member {
  background: rgba(26, 31, 44, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.upgrade:hover, .crew-member:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

.upgrade-icon, .crew-portrait {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--space-accent);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crew-portrait {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(139, 92, 246, 0.2));
}

.upgrade-info, .crew-info {
  margin-bottom: 1rem;
}

.upgrade h3, .crew-member h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--space-light-blue);
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
}

.upgrade p, .crew-member p {
  color: var(--space-gray);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.upgrade-cost, .crew-cost {
  font-size: 0.75rem;
  color: var(--space-gray);
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.upgrade-cost i, .crew-cost i {
  margin-right: 0.25rem;
}

.upgrade-cost i.fa-bolt {
  color: var(--space-yellow);
}

.upgrade-cost i.fa-cubes, .crew-cost i.fa-cubes {
  color: var(--space-blue);
}

.crew-cost i.fa-flask {
  color: var(--space-green);
}

.buy-btn, .recruit-btn {
  background: var(--space-blue);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 0.75rem;
  font-family: 'Exo 2', sans-serif;
}

.recruit-btn {
  background: var(--space-accent);
}

.buy-btn:disabled, .recruit-btn:disabled {
  background: #3a3f4b;
  cursor: not-allowed;
}

.buy-btn:hover:not(:disabled) {
  background: #0c8cbf;
}

.recruit-btn:hover:not(:disabled) {
  background: #7c4ddc;
}

.owned, .status {
  display: block;
  font-size: 0.75rem;
  color: var(--space-gray);
  text-align: center;
}

#achievements-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.achievement {
  background: rgba(26, 31, 44, 0.4);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.5;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.achievement.unlocked {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.2);
}

.achievement-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--space-accent), var(--space-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
}

.achievement-details {
  flex: 1;
}

.achievement-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-family: 'Exo 2', sans-serif;
}

.achievement-description {
  font-size: 0.75rem;
  color: var(--space-gray);
}

.crew-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

#notification-area {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
  pointer-events: none;
}

.notification {
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slide-in 0.3s ease, fade-out 0.5s ease 2.5s forwards;
  pointer-events: none;
}

.notification i {
  margin-right: 12px;
  font-size: 1.2rem;
}

.notification.success i {
  color: var(--space-green);
}

.notification.info i {
  color: var(--space-blue);
}

.notification.warning i {
  color: var(--space-orange);
}

.energy-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--space-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 0 10px 2px var(--space-blue);
}

/* Responsive styles */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }
  
  .game-title {
    font-size: 1.5rem;
  }
  
  #resources {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .resource {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.75rem 1rem;
  }
  
  .resource-icon {
    margin-bottom: 0;
  }
  
  .upgrade-grid, .crew-container {
    grid-template-columns: 1fr;
  }
  
  .game-panels {
    grid-template-columns: 1fr;
  }
  
  #station-container {
    width: 200px;
    height: 200px;
  }
  
  .station-core {
    width: 100px;
    height: 100px;
  }
}

/* Animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 70px rgba(139, 92, 246, 0.7), inset 0 0 30px rgba(255, 255, 255, 0.3);
  }
}

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

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

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.rotate {
  animation: rotate 60s linear infinite;
}

/* Star animation */
.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.7;
}

.star.tiny {
  width: 1px;
  height: 1px;
}

.star.small {
  width: 2px;
  height: 2px;
}

.star.medium {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

.star.large {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.9);
}

.star.twinkle {
  animation: twinkle 4s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.2;
  }
}
