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

body {
  font-family: 'Nunito', sans-serif;
  background: #FFFDF7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sprout growing animation for loading */
@keyframes sproutGrow {
  0% { transform: scaleY(0); transform-origin: bottom; opacity: 0.5; }
  50% { transform: scaleY(1.1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 1; }
}

@keyframes leafWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes particleBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

.animate-pop-in {
  animation: popIn 0.3s ease-out forwards;
}

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

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

.gradient-title {
  background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 25%, #FFEAA7 50%, #ADFF2F 75%, #C5E384 100%);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(255, 182, 193, 0.15), 0 1px 6px rgba(0,0,0,0.04);
  border: 2px solid #FFE4E9;
  padding: 24px;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 28px rgba(255, 182, 193, 0.22), 0 2px 8px rgba(0,0,0,0.06);
}

.toggle-btn {
  border: 2px solid #E8E8E8;
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.toggle-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(173, 255, 47, 0.2);
  border-color: #C5E384;
}

.toggle-btn.selected {
  background: linear-gradient(135deg, #F0FFD0 0%, #E8FFB8 100%);
  border-color: #ADFF2F;
  box-shadow: 0 2px 12px rgba(173, 255, 47, 0.3);
}

.toggle-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  color: #5A9E0F;
  font-weight: 800;
  background: #D4FF88;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-btn {
  border: 2px solid #E8E8E8;
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  font-weight: 700;
}

.location-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(173, 255, 47, 0.2);
  border-color: #C5E384;
}

.location-btn.selected {
  background: linear-gradient(135deg, #F0FFD0 0%, #E8FFB8 100%);
  border-color: #ADFF2F;
  box-shadow: 0 2px 12px rgba(173, 255, 47, 0.3);
}

.pill-btn {
  border: 2px solid #E8E8E8;
  border-radius: 50px;
  padding: 12px 28px;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pill-btn:hover {
  transform: scale(1.04);
}

.pill-btn.selected-pink {
  background: linear-gradient(135deg, #FFB6C1 0%, #FF69B4 100%);
  border-color: #FF69B4;
  color: white;
  box-shadow: 0 4px 14px rgba(255, 105, 180, 0.3);
}

.format-btn {
  border: 2px solid #E8E8E8;
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}

.format-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(173, 255, 47, 0.15);
}

.format-btn.selected {
  background: linear-gradient(135deg, #F0FFD0 0%, #E8FFB8 100%);
  border-color: #ADFF2F;
  box-shadow: 0 2px 12px rgba(173, 255, 47, 0.3);
}

.generate-btn {
  background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 30%, #FFEAA7 60%, #ADFF2F 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  color: white;
  font-weight: 900;
  font-size: 20px;
  border: none;
  border-radius: 60px;
  padding: 18px 48px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 105, 180, 0.3);
  transition: all 0.25s ease;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.generate-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px rgba(255, 105, 180, 0.4);
}

.generate-btn:active {
  transform: scale(0.98);
}

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

.humor-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, #FFF8DC, #FFEAA7 30%, #FFB6C1 70%, #FF69B4);
  outline: none;
  transition: opacity 0.2s;
}

.humor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 3px solid #FF69B4;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
  transition: transform 0.15s ease;
}

.humor-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.humor-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 3px solid #FF69B4;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

.custom-select {
  appearance: none;
  -webkit-appearance: none;
  background: white;
  border: 2px solid #FFB6C1;
  border-radius: 14px;
  padding: 12px 40px 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FF69B4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select:focus {
  outline: none;
  border-color: #FF69B4;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.15);
}

.script-output {
  white-space: pre-wrap;
  font-family: 'Nunito', monospace;
  line-height: 1.7;
  font-size: 14px;
  color: #333;
}

.sprout-loading .stem {
  animation: sproutGrow 1.2s ease-out forwards;
  transform-origin: bottom;
}

.sprout-loading .leaf-left {
  animation: leafWiggle 1.5s ease-in-out infinite 0.6s;
}

.sprout-loading .leaf-right {
  animation: leafWiggle 1.5s ease-in-out infinite 0.8s;
}

.loading-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FF69B4;
  margin: 0 4px;
}

.loading-dot:nth-child(1) { animation: dotPulse 1.4s ease-in-out infinite 0s; }
.loading-dot:nth-child(2) { animation: dotPulse 1.4s ease-in-out infinite 0.2s; }
.loading-dot:nth-child(3) { animation: dotPulse 1.4s ease-in-out infinite 0.4s; }

.toast-banner {
  animation: fadeInUp 0.4s ease-out;
  background: linear-gradient(135deg, #FFF0F3 0%, #FFEBEE 100%);
  border: 2px solid #FFB6C1;
  border-radius: 16px;
  padding: 16px 20px;
  color: #C94070;
  font-weight: 700;
}

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

.gender-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #F0FFD0, #E8FFB8);
  border: 2px solid #ADFF2F;
  border-radius: 50px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
}

.chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.chip button:hover {
  color: #E53E3E;
}

/* Decorative background shapes */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(173, 255, 47, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 640px) {
  .card {
    padding: 18px 14px;
    border-radius: 16px;
  }
  
  .generate-btn {
    font-size: 17px;
    padding: 16px 32px;
  }
  
  .tooltip-text {
    display: none;
  }
}