:root {
  --accent: #8b5cf6;
  --accent2: #ec4899;
  --card: #101010;
  --text: #e8e8ec;
  --muted: rgba(232,232,236,0.5);
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
i.fi { font-style: normal; font-family: "uicons-regular-rounded" !important; }

html, body { min-height: 100%; }

body {
  font-family: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #080808;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  background-size: cover;
  background-position: center;
  -webkit-font-smoothing: antialiased;
}
body.has-bg { background-color: #060608; }

body[data-bg="none"] { background-image: linear-gradient(160deg, #080808, #0c0c0c); }

/* ---------- Background effects ---------- */

#bg-effects { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
#bg-effects canvas { position: absolute; inset: 0; }

body[data-bg="aurora"] #bg-effects::before,
body[data-bg="aurora"] #bg-effects::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 22s ease-in-out infinite alternate;
}
body[data-bg="aurora"] #bg-effects::before {
  background: var(--accent);
  top: -20vmax; left: -15vmax;
}
body[data-bg="aurora"] #bg-effects::after {
  background: var(--accent2);
  bottom: -25vmax; right: -15vmax;
  animation-delay: -11s;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(12vmax, -8vmax) scale(1.15); }
}

body[data-bg="stars"] #bg-effects::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 60% 20%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 70% 85%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 90% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 50% 45%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 70%, rgba(255,255,255,0.7), transparent);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

body[data-bg="grid"] #bg-effects::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}

/* ---------- Custom cursor ---------- */

body[data-cursor="on"] { cursor: none; }
body[data-cursor="on"] a, body[data-cursor="on"] button { cursor: none; }

.cursor-dot, .cursor-ring {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  top: 0; left: 0;
  transform: translate(-100px, -100px);
  z-index: 999;
}
body[data-cursor="on"] .cursor-dot {
  width: 8px; height: 8px;
  background: var(--accent);
}
body[data-cursor="on"] .cursor-ring {
  width: 34px; height: 34px;
  border: 2px solid var(--accent);
  opacity: 0.7;
  transition: width 0.15s, height 0.15s, opacity 0.15s;
}

/* ---------- Card ---------- */

.card {
  position: relative;
  width: min(92vw, 480px);
  margin: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 40px 24px 30px;
  text-align: center;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  --card-opacity: 1;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bg-card, #101010);
  opacity: var(--card-opacity);
  z-index: -1;
}

.avatar-wrap {
  width: 108px; height: 108px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
#avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: none;
  background: #1a1a1a;
  display: block;
}
#avatar[src=""], #avatar:not([src]) { display: none; }
.avatar-wrap:empty + .display-name { margin-top: 0; }

.display-name {
  margin-top: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
  word-break: break-word;
}
.display-name.gradient {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.display-name.glow { text-shadow: 0 0 20px var(--accent); }
.display-name.gradient.glow { filter: drop-shadow(0 0 10px var(--accent)); }

.display-name.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  width: 0;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  animation: typewriter-cycle 4s steps(20, end) infinite;
}
@keyframes typewriter-cycle {
  0% { width: 0; border-right-color: var(--accent); }
  40% { width: 100%; border-right-color: var(--accent); }
  50% { width: 100%; border-right-color: transparent; }
  90% { width: 0; border-right-color: transparent; }
  100% { width: 0; border-right-color: var(--accent); }
}

.display-name.rainbow {
  background: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff, #ff0000);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: rainbow-shift 3s linear infinite;
}
@keyframes rainbow-shift { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }

.display-name.wave {
  display: inline-block;
  animation: wave-bounce 1.2s ease-in-out infinite;
}
@keyframes wave-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.handle {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.username {
  color: var(--muted);
  font-size: 0.95rem;
}

.location {
  color: var(--muted);
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.location .fi { font-size: 0.85em; }

/* ---------- Badges ---------- */

.badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px 5px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bc, var(--accent));
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  cursor: help;
}
.badge::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.badge:hover::after { opacity: 1; }
.badge .fi { font-size: 0.85em; line-height: 1; display: inline-flex; }

.mono-icons .badge i,
.mono-icons .link-icon i { filter: grayscale(1); }

.bio {
  margin-top: 16px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Music player ---------- */

.music { margin-top: 22px; }
.music iframe {
  width: 100%;
  height: 80px;
  border: 0;
  border-radius: 12px;
}

.music-player {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.mp-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.mp-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; flex: none;
  overflow: hidden;
}
.mp-icon .fi { font-size: 1.15em; }
.mp-icon img.mp-icon-img { width: 100%; height: 100%; object-fit: cover; }
.mp-info { flex: 1; min-width: 0; text-align: left; }
.mp-title { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-artist { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.mp-btn {
  background: none; border: none; color: var(--text);
  cursor: pointer; padding: 4px;
  display: inline-flex; font-size: 1rem;
}
.mp-btn:hover { color: var(--accent); }
.mp-seek-wrap { flex: 1; min-width: 60px; }
.mp-seek, .mp-vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  outline: none; cursor: pointer;
}
.mp-seek::-webkit-slider-thumb,
.mp-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.mp-seek::-moz-range-thumb,
.mp-vol-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none; cursor: pointer;
}
.mp-time { font-size: 0.72rem; color: var(--muted); flex: none; min-width: 30px; }
.mp-vol-wrap { display: flex; align-items: center; gap: 4px; }
.mp-vol-slider { width: 60px; }

.mp-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 18px;
}
.mp-bars span {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  height: 4px;
  transition: height 0.1s;
}
.mp-bars span.active {
  animation: barBounce 0.6s ease-in-out infinite alternate;
}
.mp-bars span:nth-child(1) { animation-delay: 0s; }
.mp-bars span:nth-child(2) { animation-delay: 0.1s; }
.mp-bars span:nth-child(3) { animation-delay: 0.2s; }
.mp-bars span:nth-child(4) { animation-delay: 0.3s; }
.mp-bars span:nth-child(5) { animation-delay: 0.4s; }
@keyframes barBounce {
  0% { height: 4px; }
  50% { height: 14px; }
  100% { height: 6px; }
}

/* ---------- Corner music player ---------- */

.corner-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  z-index: 90;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ---------- Card bottom info ---------- */

.card-info {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.info-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.info-item .fi { font-size: 0.85em; }
.info-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
}

/* ---------- Links ---------- */

.links {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.links.icons {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.link-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--accent);
}
.link-title { flex: 1; text-align: left; }
.link-arrow { color: var(--muted); font-size: 1.05rem; display: inline-flex; }
.link-arrow .fi { font-size: 0.85em; }
.link-icon .fi { font-size: 1.05em; line-height: 1; }

.link-chip {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.link-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.link-chip .fi { font-size: 1.3rem; line-height: 1; }

.foot {
  margin: 26px auto 34px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ---------- Not found ---------- */

.nf { padding: 26px 6px 12px; }
.nf-ico { font-size: 2.6rem; font-weight: 800; margin-bottom: 14px; }
.nf-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 30ch;
  margin: 0 auto;
}
.nf-sub { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.nf-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; }
.nf-btn {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 30px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
}
.nf-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.12); }
.nf-btn.primary {
  background: var(--accent);
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .card { padding: 32px 16px 24px; }
  .display-name { font-size: 1.5rem; }
  .avatar-wrap { width: 88px; height: 88px; margin-bottom: 14px; }
  .mp-controls { flex-wrap: wrap; }
}
