:root {
  --pink: #FFB6C1;
  --cream: #FFF3CD;
  --lavender: #E6E0FF;
  --gold: #FFD700;
  --warm-bg: #FFF0F5;
  --deep-pink: #FF69B4;
  --cookie-brown: #D2691E;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #FFF0F5 0%, #FDE8F0 25%, #F0E6FF 50%, #FFF3CD 75%, #FFE4E1 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .title-font {
  font-family: 'Fredoka', sans-serif;
}

/* Floating cookie background decorations */
@keyframes floatCookie {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  50% { transform: translateY(-20px) rotate(15deg); opacity: 0.25; }
}

.cookie-bg-item {
  position: fixed;
  font-size: 2rem;
  animation: floatCookie 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Button animations */
@keyframes pulse-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.bake-btn {
  animation: pulse-bounce 2s ease-in-out infinite;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #FF69B4, #FF1493, #FF69B4);
  background-size: 200% 200%;
  border: 4px solid #FFD700;
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
}

.bake-btn:hover {
  animation: none;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 105, 180, 0.5), 0 0 60px rgba(255, 215, 0, 0.3);
}

.bake-btn:active {
  transform: scale(0.95);
}

.bake-btn:disabled {
  animation: none;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Card rarity borders */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4); }
}

@keyframes ancient-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(220, 20, 60, 0.5); }
  50% { box-shadow: 0 0 40px rgba(220, 20, 60, 0.8), 0 0 70px rgba(139, 0, 0, 0.5); }
}

@keyframes superepic-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(233, 30, 99, 0.4); }
  50% { box-shadow: 0 0 30px rgba(233, 30, 99, 0.7), 0 0 50px rgba(233, 30, 99, 0.3); }
}

@keyframes beast-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 69, 0, 0.5); border-color: #FF4500; }
  25% { box-shadow: 0 0 35px rgba(255, 69, 0, 0.8), 0 0 60px rgba(220, 20, 60, 0.4); border-color: #FF6347; }
  50% { box-shadow: 0 0 45px rgba(255, 99, 71, 0.9), 0 0 80px rgba(255, 69, 0, 0.5); border-color: #DC143C; }
  75% { box-shadow: 0 0 35px rgba(255, 69, 0, 0.8), 0 0 60px rgba(220, 20, 60, 0.4); border-color: #FF4500; }
}

@keyframes witch-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 0, 255, 0.5); border-color: #8B00FF; }
  33% { box-shadow: 0 0 40px rgba(139, 0, 255, 0.8), 0 0 70px rgba(75, 0, 130, 0.5); border-color: #9B59B6; }
  66% { box-shadow: 0 0 50px rgba(186, 104, 200, 0.9), 0 0 90px rgba(139, 0, 255, 0.5); border-color: #4A148C; }
}

@keyframes rainbow-border {
  0% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
  17% { border-color: #ff8800; box-shadow: 0 0 20px #ff8800; }
  33% { border-color: #ffff00; box-shadow: 0 0 20px #ffff00; }
  50% { border-color: #00ff00; box-shadow: 0 0 20px #00ff00; }
  67% { border-color: #0088ff; box-shadow: 0 0 20px #0088ff; }
  83% { border-color: #8800ff; box-shadow: 0 0 20px #8800ff; }
  100% { border-color: #ff0000; box-shadow: 0 0 20px #ff0000; }
}

.card-common {
  border: 3px solid #999;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.card-rare {
  border: 3px solid #4A90D9;
  box-shadow: 0 4px 20px rgba(74, 144, 217, 0.3);
}

.card-epic {
  border: 3px solid #9B59B6;
  box-shadow: 0 4px 25px rgba(155, 89, 182, 0.4);
}

.card-legendary {
  border: 3px solid #FFD700;
  animation: glow-pulse 2s ease-in-out infinite;
}

.card-ancient {
  border: 3px solid #DC143C;
  animation: ancient-pulse 2s ease-in-out infinite;
}

.card-superepic {
  border: 3px solid #E91E63;
  box-shadow: 0 4px 25px rgba(233, 30, 99, 0.4);
  animation: superepic-pulse 2s ease-in-out infinite;
}

.card-beast {
  border: 4px solid #FF4500;
  animation: beast-pulse 1.5s ease-in-out infinite;
}

.card-witch {
  border: 4px solid #8B00FF;
  animation: witch-pulse 2s ease-in-out infinite;
}

.card-special {
  border: 4px solid #ff0000;
  animation: rainbow-border 3s linear infinite;
}

/* Reveal animation */
@keyframes card-reveal {
  0% { transform: scale(0.3) rotateY(180deg); opacity: 0; }
  50% { transform: scale(1.1) rotateY(90deg); opacity: 0.8; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.card-reveal-anim {
  animation: card-reveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Sparkle overlay */
@keyframes sparkle-burst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.sparkle-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}

.sparkle-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  animation: sparkle-burst 0.8s ease-out forwards;
}

/* Oven animation */
@keyframes oven-open {
  0% { transform: scaleY(0); opacity: 0; }
  30% { transform: scaleY(0.1); opacity: 1; }
  60% { transform: scaleY(0.5); opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}

.oven-reveal {
  animation: oven-open 0.6s ease-out forwards;
  transform-origin: bottom center;
}

/* Floating particles */
@keyframes particle-float {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-100px) scale(0); opacity: 0; }
}

.particle {
  position: absolute;
  pointer-events: none;
  animation: particle-float 1s ease-out forwards;
}

/* Stat bars */
.stat-bar-fill {
  transition: width 1s ease-out;
  border-radius: 999px;
}

/* Glass morphism card */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
}

/* Collection thumbnail */
.collection-thumb {
  transition: all 0.2s ease;
  cursor: pointer;
}

.collection-thumb:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Scrollbar styling */
.custom-scroll::-webkit-scrollbar {
  height: 8px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: rgba(255,182,193,0.2);
  border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #FFB6C1, #FF69B4);
  border-radius: 10px;
}

/* Rarity badge colors */
.badge-common { background: #888; }
.badge-rare { background: linear-gradient(135deg, #4A90D9, #357ABD); }
.badge-epic { background: linear-gradient(135deg, #9B59B6, #8E44AD); }
.badge-legendary { background: linear-gradient(135deg, #FFD700, #FFA500); }
.badge-ancient { background: linear-gradient(135deg, #DC143C, #8B0000); }
.badge-superepic { background: linear-gradient(135deg, #E91E63, #FF4081); }
.badge-beast { background: linear-gradient(135deg, #FF4500, #FF6347, #DC143C); background-size: 200% 200%; animation: shimmer 2s linear infinite; }
.badge-witch { background: linear-gradient(135deg, #8B00FF, #9B59B6, #4A148C); background-size: 200% 200%; animation: shimmer 2s linear infinite; }
.badge-special { background: linear-gradient(135deg, #FF6B6B, #4ECDC4, #45B7D1, #96CEB4, #FFEAA7); background-size: 300% 300%; animation: shimmer 2s linear infinite; }

/* Loading spinner */
@keyframes spin-cookie {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cookie-spinner {
  animation: spin-cookie 1s linear infinite;
  display: inline-block;
  font-size: 3rem;
}

/* Mode toggle buttons */
.mode-btn {
  transition: all 0.3s ease;
}

.mode-btn-active {
  background: linear-gradient(135deg, #FF69B4, #D2691E);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
  transform: scale(1.05);
}

.mode-btn-inactive {
  background: rgba(255, 255, 255, 0.7);
  color: #B8860B;
  border: 2px solid #F0C8A8;
}

.mode-btn-inactive:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.02);
}

/* Craft button */
.craft-btn {
  background: linear-gradient(135deg, #D2691E, #CD853F, #D2691E);
  background-size: 200% 200%;
  border: 3px solid #FFD700;
  box-shadow: 0 6px 20px rgba(210, 105, 30, 0.4), 0 0 30px rgba(255, 215, 0, 0.2);
  transition: all 0.3s ease;
}

.craft-btn:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 10px 30px rgba(210, 105, 30, 0.5), 0 0 50px rgba(255, 215, 0, 0.3);
}

.craft-btn:active {
  transform: scale(0.95);
}

/* Image pixelated rendering */
.pixel-art {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fade-in-up 0.5s ease-out forwards;
}

/* Sprinkle decorations */
@keyframes sprinkle-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(10px) rotate(180deg); opacity: 0; }
}