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

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: #0a0015;
  color: #e9d5ff;
  font-family: 'Crimson Pro', Georgia, serif;
}

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

#root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

@keyframes pulseRing {
  0%, 100% { box-shadow: 0 0 20px rgba(147, 51, 234, 0.4), 0 0 40px rgba(107, 33, 168, 0.2), inset 0 0 20px rgba(147, 51, 234, 0.1); }
  50% { box-shadow: 0 0 30px rgba(147, 51, 234, 0.7), 0 0 60px rgba(107, 33, 168, 0.4), inset 0 0 30px rgba(147, 51, 234, 0.2); }
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(192, 132, 252, 0.3), 0 0 20px rgba(147, 51, 234, 0.2); }
  50% { text-shadow: 0 0 20px rgba(192, 132, 252, 0.6), 0 0 40px rgba(147, 51, 234, 0.4), 0 0 60px rgba(107, 33, 168, 0.2); }
}

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

.mystic-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  min-height: 100vh;
}

.profile-card {
  background: rgba(10, 0, 21, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 24px;
  padding: 40px 32px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: floatIn 0.8s ease-out both;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.profile-card:hover {
  border-color: rgba(147, 51, 234, 0.6);
  box-shadow: 0 0 40px rgba(107, 33, 168, 0.15);
}

.avatar-wrapper {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #6b21a8, #9333ea, #c084fc, #9333ea, #6b21a8);
  background-size: 200% 200%;
  animation: pulseRing 3s ease-in-out infinite;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #1a0030, #2d0050);
}

.display-name {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #e9d5ff;
  animation: glowPulse 4s ease-in-out infinite;
  margin-bottom: 8px;
}

.bio-text {
  font-family: 'Crimson Pro', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 1.1rem;
  color: rgba(192, 132, 252, 0.7);
  line-height: 1.5;
}

.links-container {
  max-width: 440px;
  width: 100%;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(10, 0, 21, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(147, 51, 234, 0.25);
  border-radius: 16px;
  color: #e9d5ff;
  text-decoration: none;
  font-family: 'Crimson Pro', serif;
  font-size: 1.1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 56px;
}

.link-btn:hover {
  transform: scale(1.03);
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.25), 0 0 40px rgba(107, 33, 168, 0.1);
  background: rgba(26, 0, 48, 0.8);
}

.link-btn .link-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.link-btn .link-title {
  flex: 1;
  text-align: left;
}

.link-btn .link-arrow {
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
  color: rgba(192, 132, 252, 0.6);
}

.link-btn:hover .link-arrow {
  opacity: 1;
  transform: translateX(0);
}

.social-bar {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.social-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(10, 0, 21, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(147, 51, 234, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.35s ease;
  text-decoration: none;
}

.social-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: #c084fc;
  transition: fill 0.35s ease;
}

.social-icon-btn:hover {
  transform: scale(1.15);
}

.edit-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 0, 21, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(147, 51, 234, 0.3);
  color: #c084fc;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.edit-toggle:hover {
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

.edit-input {
  background: rgba(26, 0, 48, 0.6);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 8px;
  color: #e9d5ff;
  padding: 6px 10px;
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
  width: 100%;
}

.edit-input:focus {
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.2);
}

.edit-input-icon {
  width: 50px;
  text-align: center;
}

.edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.footer-section {
  margin-top: 48px;
  text-align: center;
  padding-bottom: 20px;
}

.footer-text {
  font-family: 'Crimson Pro', serif;
  font-size: 0.85rem;
  color: rgba(192, 132, 252, 0.35);
  letter-spacing: 0.1em;
}

.footer-text a {
  color: rgba(192, 132, 252, 0.35);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-text a:hover {
  color: rgba(192, 132, 252, 0.7);
}

.sound-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 0, 21, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(147, 51, 234, 0.3);
  color: #c084fc;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

.sound-toggle:hover {
  border-color: rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

.cursor-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.edit-action-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(147, 51, 234, 0.3);
  background: rgba(26, 0, 48, 0.6);
  color: #c084fc;
  font-family: 'Crimson Pro', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.edit-action-btn:hover {
  border-color: rgba(192, 132, 252, 0.6);
  background: rgba(45, 0, 80, 0.6);
}

.edit-action-btn.danger {
  border-color: rgba(234, 51, 80, 0.3);
  color: #f87171;
}

.edit-action-btn.danger:hover {
  border-color: rgba(234, 51, 80, 0.6);
  background: rgba(80, 0, 20, 0.4);
}

@media (max-width: 500px) {
  .mystic-container {
    padding: 24px 16px 40px;
  }
  .profile-card {
    padding: 32px 20px 24px;
  }
  .display-name {
    font-size: 1.6rem;
  }
  .avatar-wrapper {
    width: 100px;
    height: 100px;
  }
}