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

:root {
  --bg-deep: #0a0a0c;
  --bg-mid: #12141a;
  --bg-light: #1c1e28;
  --accent-orange: #e87a20;
  --accent-amber: #f5a623;
  --accent-yellow: #ffd93d;
  --accent-cyan: #4ecdc4;
  --accent-red: #e74c3c;
  --accent-blue: #3498db;
  --accent-star: #c084fc;
  --text-primary: #d4d0c8;
  --text-dim: #6b7280;
  --glow-orange: 0 0 20px rgba(232, 122, 32, 0.4);
  --glow-amber: 0 0 20px rgba(245, 166, 35, 0.4);
  --steel-dark: #1a1c24;
  --steel-mid: #2a2d38;
  --steel-light: #3a3d4a;
  --rust: #8b4513;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#root {
  height: 100vh;
  width: 100vw;
}

.font-cinzel {
  font-family: 'Orbitron', sans-serif;
}

/* Grid background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(232, 122, 32, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 122, 32, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* Particle layer - now sparks */
.particle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  animation: float-up linear infinite;
  opacity: 0;
  z-index: 1;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); }
  10% { opacity: 0.8; }
  50% { opacity: 0.5; }
  90% { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-100vh) translateX(30px) scale(0.3); }
}

/* Trunk pulse - factory press */
@keyframes trunk-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.02); filter: brightness(1.1); }
}

.trunk-button {
  animation: trunk-pulse 1.5s ease-in-out infinite;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trunk-button:hover {
  filter: brightness(1.3) !important;
  transform: scale(1.06) !important;
}

.trunk-button:active {
  transform: scale(0.92) !important;
  filter: brightness(1.5) !important;
}

/* Number bounce */
@keyframes num-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.num-bounce {
  animation: num-bounce 0.3s ease;
}

/* Conveyor belt flow on branches */
@keyframes sap-flow {
  0% { stroke-dashoffset: 20; }
  100% { stroke-dashoffset: 0; }
}

.sap-line {
  stroke-dasharray: 8 4;
  animation: sap-flow 0.8s linear infinite;
}

/* Node grow-in */
@keyframes node-appear {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.node-appear {
  animation: node-appear 0.4s ease-out forwards;
}

/* Branch grow */
@keyframes branch-grow {
  0% { stroke-dashoffset: 200; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

.branch-grow {
  stroke-dasharray: 200;
  animation: branch-grow 0.6s ease-out forwards;
}

/* Glow ring for affordable */
@keyframes glow-ring {
  0%, 100% { box-shadow: 0 0 5px rgba(232,122,32,0.3), 0 0 15px rgba(232,122,32,0.1); }
  50% { box-shadow: 0 0 10px rgba(232,122,32,0.6), 0 0 30px rgba(232,122,32,0.2); }
}

.affordable-glow {
  animation: glow-ring 2s ease-in-out infinite;
}

/* Toast */
@keyframes toast-in {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

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

.toast-enter {
  animation: toast-in 0.4s ease-out forwards;
}

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

/* Click floater */
@keyframes click-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.5); }
}

.click-floater {
  animation: click-float 0.8s ease-out forwards;
  pointer-events: none;
  position: absolute;
  z-index: 100;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  color: var(--accent-orange);
  text-shadow: 0 0 10px rgba(232,122,32,0.6);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--steel-mid); border-radius: 3px; }

/* Modal overlay */
.modal-overlay {
  backdrop-filter: blur(4px);
}

/* Tree container for pan/zoom */
.tree-viewport {
  overflow: hidden;
  touch-action: none;
}

/* Rebirth shimmer - science pack glow */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.rebirth-shimmer {
  background: linear-gradient(90deg, var(--accent-star) 0%, #fff 50%, var(--accent-star) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

/* Gear rotation animation */
@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

/* Conveyor belt dots */
@keyframes conveyor {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -24; }
}

.conveyor-belt {
  stroke-dasharray: 4 8;
  animation: conveyor 1s linear infinite;
}

/* Warning stripe pattern for borders */
.warning-stripe {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(232, 122, 32, 0.1) 4px,
    rgba(232, 122, 32, 0.1) 8px
  );
}