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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  -webkit-tap-highlight-color: transparent;
}

.game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.resource-display {
  margin-bottom: 30px;
  text-align: center;
}

.resource-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  transition: transform 0.15s ease-out;
}

.resource-value.gained {
  animation: counterPop 0.4s ease-out;
}

@keyframes counterPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.resource-label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-top: 4px;
}

.click-button,
.upgrade-btn {
  touch-action: manipulation;
}

.click-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: #4CAF50;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 24px;
  transition: transform 0.08s ease-out, background 0.15s ease;
  box-shadow: 0 4px 0 #388E3C;
}

.click-button:active {
  background: #388E3C;
  transform: scale(0.94) translateY(2px);
  box-shadow: 0 2px 0 #2E7D32;
}

.upgrades {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.upgrade-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.upgrade-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
}

.upgrade-stats {
  font-size: 0.8rem;
  color: #666;
}

.upgrade-requirement {
  display: none;
  font-size: 0.7rem;
  color: #c62828;
  white-space: nowrap;
  flex-shrink: 0;
}

.upgrade-btn {
  padding: 10px 14px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.08s ease-out, background 0.15s ease;
  box-shadow: 0 3px 0 #388E3C;
}

.upgrade-btn:active {
  background: #388E3C;
  transform: scale(0.97) translateY(1px);
  box-shadow: 0 1px 0 #2E7D32;
}

.upgrade-btn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}

.upgrade-btn:disabled:active {
  transform: none;
}

.upgrade-btn-label {
  font-weight: 600;
}

.upgrade-cost {
  font-weight: 500;
  opacity: 0.95;
}

.upgrade-card.upgraded {
  animation: cardPulse 0.5s ease-out;
}

@keyframes cardPulse {
  0% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  30% { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.4), 0 4px 12px rgba(0,0,0,0.15); }
  100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
}

.upgrade-popup {
  position: fixed;
  pointer-events: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: #2E7D32;
  text-shadow: 0 0 8px rgba(255,255,255,0.9);
  z-index: 100;
  animation: floatUp 0.7s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 15px)) scale(1.4);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 70px)) scale(1.2);
  }
}

.upgrade-particles {
  position: fixed;
  pointer-events: none;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  z-index: 99;
  animation: burstOut 0.6s ease-out forwards;
}

@keyframes burstOut {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3);
  }
}

.money-gain-popup {
  position: fixed;
  pointer-events: none;
  font-size: 1.3rem;
  font-weight: 800;
  color: #D4A017;
  text-shadow: 0 0 6px rgba(255,220,100,0.8), 0 1px 2px rgba(0,0,0,0.2);
  z-index: 100;
  animation: moneyFloatUp 0.8s ease-out forwards;
}

@keyframes moneyFloatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, calc(-50% - 20px)) scale(1.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 80px)) scale(1.1);
  }
}

.money-particle {
  position: fixed;
  pointer-events: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D4A017;
  box-shadow: 0 0 4px rgba(212, 160, 23, 0.6);
  z-index: 99;
  animation: moneyBurst 0.5s ease-out forwards;
}

@keyframes moneyBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}
