:root {
  --bg-deep: #0a0a1a;
  --bg-card: #141428;
  --bg-card-hover: #1c1c3a;
  --accent-gold: #fbbf24;
  --accent-orange: #f97316;
  --accent-pink: #ec4899;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-green: #22c55e;
  --glow-gold: rgba(251, 191, 36, 0.4);
  --glow-orange: rgba(249, 115, 22, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(249, 115, 22, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

.title-text {
  font-family: 'Lilita One', cursive;
}

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px var(--glow-gold), 0 0 40px var(--glow-orange); }
  50% { text-shadow: 0 0 30px var(--glow-gold), 0 0 60px var(--glow-orange), 0 0 80px rgba(251,191,36,0.2); }
}

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

@keyframes pop-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

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

@keyframes golden-float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes achievement-slide {
  0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
  15% { transform: translateY(0) scale(1.05); opacity: 1; }
  25% { transform: translateY(0) scale(1); opacity: 1; }
  85% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-100px) scale(0.5); opacity: 0; }
}

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

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

.click-button {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #f97316, #fbbf24, #f59e0b);
  box-shadow: 
    0 0 30px var(--glow-orange),
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 -6px 12px rgba(0,0,0,0.2),
    inset 0 6px 12px rgba(255,255,255,0.2);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
}

.click-button:active {
  transform: scale(0.92);
  box-shadow: 
    0 0 50px var(--glow-gold),
    0 4px 16px rgba(0,0,0,0.4),
    inset 0 -3px 6px rgba(0,0,0,0.2),
    inset 0 3px 6px rgba(255,255,255,0.2);
}

.click-button::after {
  content: '🍪';
  font-size: 80px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.click-button .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

.upgrade-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 14px 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.upgrade-card:hover:not(.disabled) {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.upgrade-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.upgrade-card .buy-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #0a0a1a;
}

.upgrade-card .buy-btn:hover:not(:disabled) {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.upgrade-card .buy-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(1) brightness(0.5);
}

.achievement-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: achievement-slide 3.5s ease-in-out forwards;
  background: linear-gradient(135deg, #1c1c3a, #2a1a4a);
  border: 2px solid var(--accent-gold);
  border-radius: 16px;
  padding: 14px 24px;
  box-shadow: 0 0 30px var(--glow-gold), 0 8px 32px rgba(0,0,0,0.5);
  text-align: center;
  min-width: 280px;
}

.golden-cookie {
  position: fixed;
  cursor: pointer;
  z-index: 500;
  font-size: 60px;
  animation: golden-float 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(251,191,36,0.8));
  transition: transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.golden-cookie:hover {
  transform: scale(1.2);
}

.stats-bar {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(20,20,40,0.8) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}

.frenzy-active {
  animation: shake 0.3s ease-in-out infinite;
}

.frenzy-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, rgba(249,115,22,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  z-index: 99;
}

.number-bump {
  transition: transform 0.1s ease;
}

.cps-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}

.cps-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width 0.3s ease;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
  .click-button {
    width: 160px;
    height: 160px;
  }
  .click-button::after {
    font-size: 65px;
  }
}