:root {
  --bg-deep: #0a0a14;
  --bg-card: #12121f;
  --bg-surface: #1a1a2e;
  --neon-green: #39ff14;
  --electric-blue: #00f0ff;
  --mutation-purple: #b026ff;
  --danger-red: #ff2e5b;
  --text-primary: #e8e8f0;
  --text-dim: #7a7a9a;
}

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

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

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(176,38,255,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,240,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(57,255,20,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(57,255,20,0.3), 0 0 15px rgba(57,255,20,0.1); }
  50% { box-shadow: 0 0 15px rgba(57,255,20,0.5), 0 0 30px rgba(57,255,20,0.2); }
}

@keyframes dna-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes float-in {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes evolve-flash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes slide-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes particle-burst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes helix-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(3deg); }
  75% { transform: translateY(8px) rotate(-3deg); }
}

.animate-float-in {
  animation: float-in 0.5s ease-out forwards;
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

.animate-slide-up {
  animation: slide-up 0.4s ease-out forwards;
}

.glow-input:focus {
  animation: pulse-glow 2s ease-in-out infinite;
  outline: none;
  border-color: var(--neon-green) !important;
}

.creature-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26,26,46,0.9) 100%);
  border: 1px solid rgba(57,255,20,0.15);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.creature-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(57,255,20,0.2), rgba(0,240,255,0.1), rgba(176,38,255,0.2));
  z-index: -1;
  opacity: 0.5;
}

.evolve-btn {
  background: linear-gradient(135deg, var(--neon-green), #2bcc0e);
  color: #0a0a14;
  font-family: 'Silkscreen', cursive;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.evolve-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(57,255,20,0.4), 0 4px 15px rgba(57,255,20,0.2);
}

.evolve-btn:active {
  transform: translateY(0);
}

.evolve-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.quick-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.quick-btn:hover {
  border-color: var(--electric-blue);
  background: rgba(0,240,255,0.08);
  transform: translateY(-1px);
}

.quick-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

.trait-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(176,38,255,0.15);
  border: 1px solid rgba(176,38,255,0.3);
  color: #d88aff;
}

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

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease-out;
}

.timeline-node {
  cursor: pointer;
  transition: all 0.2s;
}

.timeline-node:hover {
  transform: scale(1.05);
}

.timeline-node.active {
  border-color: var(--neon-green) !important;
  box-shadow: 0 0 10px rgba(57,255,20,0.3);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  background: rgba(0,240,255,0.08);
  border: 1px solid rgba(0,240,255,0.2);
  color: var(--electric-blue);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(0,240,255,0.15);
  border-color: rgba(0,240,255,0.4);
  transform: translateY(-1px);
}

.evolve-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(57,255,20,0.08);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: evolve-flash 1.5s ease-in-out forwards;
  pointer-events: none;
}

.evolve-overlay .dna {
  font-size: 80px;
  animation: dna-spin 1s linear infinite;
}

.journal-entry {
  border-left: 2px solid rgba(176,38,255,0.3);
  padding-left: 16px;
  margin-bottom: 16px;
}

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.pixel-image {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.achievement-badge {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,215,0,0.3);
  color: #ffd700;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Silkscreen', cursive;
}

/* Remake art button */
.remake-art-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.remake-art-btn:hover {
  background: rgba(0,240,255,0.1);
  border-color: var(--electric-blue);
  color: var(--electric-blue);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(0,240,255,0.2);
}

.remake-art-btn:active {
  transform: translateY(0);
}

/* Cocoon state styles */
.cocoon-state {
  border-color: rgba(176,38,255,0.3) !important;
}

.cocoon-state::before {
  background: linear-gradient(135deg, rgba(176,38,255,0.25), rgba(80,20,120,0.15), rgba(176,38,255,0.2)) !important;
}

.cocoon-glow {
  animation: cocoon-pulse 3s ease-in-out infinite;
  position: relative;
}

@keyframes cocoon-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(176,38,255,0.2), 0 0 20px rgba(176,38,255,0.05);
    border-color: rgba(176,38,255,0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(176,38,255,0.4), 0 0 35px rgba(176,38,255,0.15), inset 0 0 10px rgba(176,38,255,0.05);
    border-color: rgba(176,38,255,0.6);
  }
}

@media (max-width: 768px) {
  .creature-card { margin: 0 8px; }
}