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

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

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

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

@keyframes glow-border {
  0%, 100% { border-color: #a855f7; box-shadow: 0 0 20px rgba(168,85,247,0.15); }
  33% { border-color: #ec4899; box-shadow: 0 0 20px rgba(236,72,153,0.15); }
  66% { border-color: #06b6d4; box-shadow: 0 0 20px rgba(6,182,212,0.15); }
}

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

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

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes typewriter-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.gradient-text {
  background: linear-gradient(135deg, #06b6d4, #a855f7, #ec4899, #f97316);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

.glow-input {
  border: 2px solid #a855f7;
  animation: glow-border 4s ease-in-out infinite;
  transition: all 0.3s ease;
}

.glow-input:focus {
  border-color: #ec4899;
  box-shadow: 0 0 30px rgba(236,72,153,0.25), inset 0 0 30px rgba(236,72,153,0.03);
  outline: none;
}

.btn-generate {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-generate:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 0 30px rgba(168,85,247,0.4);
}

.btn-generate:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-surprise {
  background: linear-gradient(135deg, #06b6d4, #a855f7);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-surprise:hover {
  transform: scale(1.04);
  box-shadow: 0 0 25px rgba(6,182,212,0.35);
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.glass-card {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
}

.shimmer-loading {
  background: linear-gradient(
    90deg,
    rgba(168,85,247,0.05) 25%,
    rgba(168,85,247,0.15) 50%,
    rgba(168,85,247,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.style-chip {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  user-select: none;
}

.style-chip:hover {
  border-color: rgba(168,85,247,0.5);
  background: rgba(168,85,247,0.08);
  transform: translateY(-1px);
}

.style-chip.active {
  border-color: #a855f7;
  background: rgba(168,85,247,0.2);
  box-shadow: 0 0 15px rgba(168,85,247,0.2);
}

.image-card {
  animation: fadeInUp 0.8s ease forwards;
}

.image-card img {
  transition: transform 0.4s ease;
}

.gallery-thumb {
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(168,85,247,0.3);
}

.toast {
  animation: fadeInUp 0.3s ease forwards;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #a855f7;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: typewriter-blink 0.8s step-end infinite;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0f0f18;
}

::-webkit-scrollbar-thumb {
  background: #a855f7;
  border-radius: 10px;
}

.modal-overlay {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}