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

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  overflow-x: hidden;
}

.bg-gradient-base {
  background: linear-gradient(135deg, #1a0a2e 0%, #16213e 25%, #0f0f23 50%, #1a0a2e 75%, #2d1b4e 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  bottom: -20px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-container {
  position: fixed;
  top: 30%;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg) scale(0);
    opacity: 0;
  }
}

.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-container.loaded {
  opacity: 1;
  transform: translateY(0);
}

.edit-btn, .share-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.edit-btn:hover, .share-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.profile-section {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.avatar-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888, #833ab4, #5851db, #405de6);
  margin: 0 auto 1.5rem;
  cursor: pointer;
  animation: ringPulse 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.avatar-ring:hover {
  transform: scale(1.05);
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(225, 48, 108, 0.4); }
  50% { box-shadow: 0 0 40px rgba(225, 48, 108, 0.7); }
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-ring.generating {
  animation: ringPulse 0.5s ease-in-out infinite, rainbowSpin 2s linear infinite;
}

@keyframes rainbowSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.generate-avatar-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #ff6b9d, #c44cff);
  border: none;
  border-radius: 12px;
  color: white;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(196, 76, 255, 0.3);
}

.generate-avatar-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(196, 76, 255, 0.5);
}

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

.sparkle {
  position: absolute;
  color: #ffd700;
  font-size: 1.2rem;
  animation: sparkleFloat 2s ease-in-out infinite;
}

.sparkle-1 { top: 0; left: 20%; animation-delay: 0s; }
.sparkle-2 { top: 20%; right: 15%; animation-delay: 0.5s; }
.sparkle-3 { bottom: 40%; left: 10%; animation-delay: 1s; }

@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50% { transform: translateY(-8px) rotate(180deg); opacity: 1; }
}

.profile-name {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.2);
}

.profile-bio {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 400;
}

.edit-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  font-family: 'Bricolage Grotesque', sans-serif;
  width: 100%;
  outline: none;
  transition: all 0.3s ease;
}

.edit-input:focus {
  border-color: #e1306c;
  box-shadow: 0 0 15px rgba(225, 48, 108, 0.3);
}

.edit-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.edit-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.edit-field {
  margin-bottom: 1rem;
}

.edit-field:last-child {
  margin-bottom: 0;
}

.edit-field label {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.links-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: linkSlideIn 0.5s ease forwards;
}

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

.social-link.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.social-link:not(.disabled):hover {
  transform: scale(1.03) translateY(-2px);
}

.instagram-btn {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  box-shadow: 0 4px 25px rgba(225, 48, 108, 0.4);
}

.instagram-btn:not(.disabled):hover {
  box-shadow: 0 8px 35px rgba(225, 48, 108, 0.6);
}

.facebook-btn {
  background: linear-gradient(135deg, #1877F2, #0d65d9);
  box-shadow: 0 4px 25px rgba(24, 119, 242, 0.4);
}

.facebook-btn:not(.disabled):hover {
  box-shadow: 0 8px 35px rgba(24, 119, 242, 0.6);
}

.tiktok-btn {
  background: linear-gradient(135deg, #010101, #1a1a1a);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.tiktok-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, #00f2ea, #ff0050);
  z-index: -1;
  opacity: 0.8;
}

.tiktok-btn:not(.disabled):hover {
  animation: glitch 0.3s ease;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-label {
  flex: 1;
  text-align: center;
  margin-right: 1.5rem;
}

.footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: 0.5rem;
}

.remix-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease;
}

.remix-link:hover {
  color: #e1306c;
}

@media (max-width: 480px) {
  .main-container {
    padding: 1.5rem 1rem;
  }
  
  .avatar-ring {
    width: 100px;
    height: 100px;
  }
  
  .profile-name {
    font-size: 1.5rem;
  }
  
  .social-link {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
}