:root {
  --bark-dark: #3E2723;
  --bark: #5C4033;
  --bark-light: #8B6914;
  --moss-dark: #2E5339;
  --moss: #4A7C59;
  --moss-light: #6B8E23;
  --cream: #FAF3E0;
  --cream-dark: #F5E6CA;
  --terracotta: #C67B5C;
  --gold: #BFA24E;
  --gold-light: #D4B96A;
  --soil: #3E2723;
  --soil-light: #5D4037;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(180deg, #2E3B2A 0%, #1A2416 40%, #0F1A0B 100%);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Leaf particles background */
#leaf-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.leaf-particle {
  position: absolute;
  font-size: 16px;
  opacity: 0;
  animation: leafFall linear infinite;
  pointer-events: none;
}

@keyframes leafFall {
  0% {
    opacity: 0;
    transform: translateY(-20px) rotate(0deg) translateX(0px);
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.2;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg) translateX(80px);
  }
}

/* Grove circle */
.grove-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #4A7C59 0%, #2E5339 40%, #1A3320 80%, #0F1A0B 100%);
  border: 4px solid var(--bark);
  box-shadow: 
    0 0 30px rgba(74, 124, 89, 0.3),
    0 0 60px rgba(74, 124, 89, 0.1),
    inset 0 -20px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow 0.5s ease;
}

.grove-circle.pulsing {
  animation: grovePulse 3s ease-in-out infinite;
}

@keyframes grovePulse {
  0%, 100% { box-shadow: 0 0 30px rgba(74, 124, 89, 0.3), 0 0 60px rgba(74, 124, 89, 0.1), inset 0 -20px 40px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 50px rgba(74, 124, 89, 0.5), 0 0 90px rgba(74, 124, 89, 0.2), inset 0 -20px 40px rgba(0,0,0,0.3); }
}

/* Click button */
.grow-btn {
  width: 160px;
  height: 64px;
  border: none;
  border-radius: 32px;
  background: linear-gradient(180deg, #6B8E23 0%, #4A7C59 50%, #2E5339 100%);
  color: var(--cream);
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 
    0 6px 0 #1A3320,
    0 8px 20px rgba(0,0,0,0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  position: relative;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.grow-btn:active {
  transform: translateY(4px);
  box-shadow: 
    0 2px 0 #1A3320,
    0 4px 10px rgba(0,0,0,0.3);
}

.grow-btn:hover:not(:active) {
  background: linear-gradient(180deg, #7EA828 0%, #5A9069 50%, #3E6349 100%);
}

/* Float numbers */
.float-number {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  font-size: 20px;
  color: var(--gold-light);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.3);
  }
}

/* Upgrade cards */
.upgrade-card {
  background: linear-gradient(135deg, rgba(92, 64, 51, 0.6) 0%, rgba(62, 39, 35, 0.8) 100%);
  border: 2px solid rgba(139, 105, 20, 0.3);
  border-radius: 20px;
  padding: 14px 16px;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.upgrade-card.affordable {
  border-color: rgba(107, 142, 35, 0.6);
  box-shadow: 0 0 15px rgba(107, 142, 35, 0.15);
}

.upgrade-card.locked {
  opacity: 0.4;
  filter: grayscale(0.5);
}

.buy-btn {
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.buy-btn.can-buy {
  background: linear-gradient(180deg, #6B8E23, #4A7C59);
  color: var(--cream);
  box-shadow: 0 3px 0 #2E5339, 0 4px 10px rgba(0,0,0,0.3);
}

.buy-btn.can-buy:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #2E5339;
}

.buy-btn.cannot-buy {
  background: rgba(62, 39, 35, 0.8);
  color: rgba(250, 243, 224, 0.3);
  cursor: not-allowed;
}

/* Leaderboard overlay */
.leaderboard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 11, 0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
  overflow-y: auto;
}

.leaderboard-row {
  border-radius: 14px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.leaderboard-row:nth-child(odd) {
  background: rgba(92, 64, 51, 0.25);
}

.leaderboard-row:nth-child(even) {
  background: rgba(62, 39, 35, 0.2);
}

.leaderboard-row.current-user {
  background: rgba(191, 162, 78, 0.2);
  border: 1px solid rgba(191, 162, 78, 0.4);
  box-shadow: 0 0 20px rgba(191, 162, 78, 0.1);
}

/* Level up flash */
.level-up-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(212, 185, 106, 0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: 50;
  animation: flashFade 1.5s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Score counter animation */
.score-display {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  transition: transform 0.1s ease;
}

/* Passive income bar */
.passive-bar {
  animation: passivePulse 2s ease-in-out infinite;
}

@keyframes passivePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

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

::-webkit-scrollbar-track {
  background: rgba(30, 20, 10, 0.3);
}

::-webkit-scrollbar-thumb {
  background: var(--bark);
  border-radius: 3px;
}

/* Auth badge */
.auth-badge {
  background: rgba(92, 64, 51, 0.6);
  border: 1px solid rgba(139, 105, 20, 0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--cream-dark);
}

/* Burst particles */
.burst-particle {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  animation: burstOut 0.6s ease-out forwards;
}

@keyframes burstOut {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--bx), var(--by)) scale(0.5) rotate(var(--br));
  }
}