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

:root {
  --bg-deep: #06061a;
  --bg-panel: rgba(15, 15, 50, 0.7);
  --gold: #f5a623;
  --gold-glow: #f5a62355;
  --purple: #7c3aed;
  --purple-glow: #7c3aed44;
  --green: #22c55e;
  --green-glow: #22c55e55;
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --border: rgba(255,255,255,0.08);
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Starfield Background */
.starfield {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Cookie Button */
.cookie-btn {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 35%, #d4943a, #a0651a 60%, #7a4e15);
  box-shadow: 0 0 40px var(--gold-glow), 0 8px 30px rgba(0,0,0,0.5), inset 0 -4px 12px rgba(0,0,0,0.3);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  animation: pulse 2s ease-in-out infinite;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cookie-btn:hover {
  box-shadow: 0 0 60px var(--gold-glow), 0 8px 30px rgba(0,0,0,0.5), inset 0 -4px 12px rgba(0,0,0,0.3);
}

.cookie-btn:active, .cookie-btn.clicked {
  transform: scale(0.92);
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes bounce-in {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.cookie-btn.bounce {
  animation: bounce-in 0.2s ease-out;
}

/* Particles */
.particle {
  position: absolute;
  pointer-events: none;
  font-size: 20px;
  animation: particle-fly 0.8s ease-out forwards;
  z-index: 100;
}

@keyframes particle-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.3); }
}

/* Click float text */
.click-float {
  position: absolute;
  pointer-events: none;
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  color: var(--gold);
  text-shadow: 0 0 10px var(--gold-glow);
  animation: float-up 1s ease-out forwards;
  z-index: 100;
}

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

/* Glass panels */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* Building card */
.building-card {
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.building-card:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

.building-card.affordable {
  border-color: var(--green-glow);
  box-shadow: 0 0 12px var(--green-glow);
}

.building-card.affordable:hover {
  box-shadow: 0 0 20px var(--green-glow);
}

/* Buy button */
.buy-btn {
  transition: all 0.15s ease;
}

.buy-btn:not(:disabled):hover {
  transform: scale(1.05);
}

.buy-btn:not(:disabled):active {
  transform: scale(0.95);
}

/* Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* Toast */
.toast-enter {
  animation: toast-in 0.4s ease-out;
}

@keyframes toast-in {
  0% { transform: translateX(100%) scale(0.8); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

.toast-exit {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-out {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* Prestige button */
.prestige-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7, #7c3aed);
  background-size: 200% 200%;
  animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Tab buttons */
.tab-btn {
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* Number tick animation */
.number-tick {
  transition: transform 0.1s ease;
}

/* Settings modal */
.modal-overlay {
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.modal-content {
  animation: modal-pop 0.25s ease-out;
}

@keyframes modal-pop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-btn {
    width: 160px;
    height: 160px;
    font-size: 80px;
  }
}

@media (max-width: 480px) {
  .cookie-btn {
    width: 140px;
    height: 140px;
    font-size: 70px;
  }
}

/* Nebula background */
.nebula {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}