* { box-sizing: border-box; }

body.profile-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--profile-font, 'Poppins', sans-serif);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--profile-text, #f2f2f5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
}

.bg-image {
  position: fixed;
  top: -20px; left: -20px;
  width: calc(100% + 40px); height: calc(100% + 40px);
  background: center/cover no-repeat;
  filter: blur(10px) brightness(0.75) saturate(0.9);
  z-index: -2;
}

.bg-video {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
}

.bg-youtube-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}
.bg-youtube {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw; /* 16:9 */
  min-height: 100vh; min-width: 177.78vh; /* 16:9 */
  transform: translate(-50%, -50%);
  border: none;
}

.bg-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(6, 6, 10, 0.62);
  z-index: -1;
}

.card-frame-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
}

.profile-card {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  padding-bottom: 28px;
  text-align: center;
}

.profile-card.layout-simple .banner { display: none; }
.profile-card.layout-simple .avatar-wrapper { margin-top: 28px; }

.profile-card.align-left { text-align: left; }
.profile-card.align-left .display-name,
.profile-card.align-left .username,
.profile-card.align-left .bio { padding-left: 24px; padding-right: 24px; }
.profile-card.align-left .rank-badges,
.profile-card.align-left .tag-list,
.profile-card.align-left .social-links,
.profile-card.align-left .avatar-wrapper { justify-content: flex-start; margin-left: 24px; margin-right: auto; }
.profile-card.align-left .bio { text-align: left; }

/* Name animations: these only ever animate `text-shadow`/`color` on the h1 itself and
   never touch background-clip/text-fill-color, so child badges (VIP, rank, etc.) always
   keep rendering their own solid color instead of inheriting a transparent text fill. */
.display-name-sparkle {
  animation: sparklePulse 1.8s ease-in-out infinite;
}
@keyframes sparklePulse {
  0%, 100% { text-shadow: 0 0 4px rgba(255,255,255,0.25); }
  50% { text-shadow: 0 0 14px rgba(255,255,255,0.95), 0 0 26px rgba(255,255,255,0.5); }
}

.display-name-rainbow {
  animation: nameRainbowCycle 5s linear infinite;
}
@keyframes nameRainbowCycle {
  0% { color: #ff3b3b; }
  16% { color: #ff9900; }
  33% { color: #f4ff33; }
  50% { color: #33ff5e; }
  66% { color: #33d4ff; }
  83% { color: #b533ff; }
  100% { color: #ff3b3b; }
}

.display-name-flash {
  animation: nameFlash 1.2s ease-in-out infinite alternate;
}
@keyframes nameFlash {
  from { color: var(--name-color-1, #7c3aed); }
  to { color: var(--name-color-2, #22d3ee); }
}

/* Safety net: badges nested inside an animated name must never inherit its effect. */
.display-name-sparkle .vip-badge, .display-name-sparkle .rank-badge,
.display-name-rainbow .vip-badge, .display-name-rainbow .rank-badge,
.display-name-flash .vip-badge, .display-name-flash .rank-badge {
  -webkit-text-fill-color: initial;
  text-shadow: none;
  animation: none;
}

/* Big animated card frames — glow around the sides of the whole card */
.cardframe-rgb-border::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  background: conic-gradient(from 0deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  z-index: 0;
  animation: cardFrameSpin 4s linear infinite;
  filter: blur(2px);
}

.cardframe-pulse-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  border: 2px solid var(--accent);
  z-index: 0;
  animation: cardFramePulse 2s ease-in-out infinite alternate;
}

.cardframe-neon-flow::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  z-index: 0;
  animation: cardFrameNeonFlow 3s linear infinite;
  filter: blur(3px);
}

.cardframe-chase::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  background: conic-gradient(from 0deg, var(--accent) 0deg, #fff 12deg, var(--accent) 24deg, transparent 60deg, transparent 360deg);
  z-index: 0;
  animation: cardFrameSpin 2.2s linear infinite;
  filter: blur(1.5px);
}

@keyframes cardFrameSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes cardFramePulse { 0% { box-shadow: 0 0 10px var(--accent); } 100% { box-shadow: 0 0 40px var(--accent); } }
@keyframes cardFrameNeonFlow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

.effect-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden;
}
.effect-particle {
  position: absolute;
  top: -10%;
  animation-name: effectFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
  user-select: none;
}
.effect-particle-matrix {
  color: #22c55e;
  font-family: 'Roboto Mono', monospace;
  text-shadow: 0 0 6px rgba(34,197,94,0.8);
}
@keyframes effectFall {
  0% { transform: translate(0, -10vh) rotate(0deg); }
  100% { transform: translate(var(--drift), 110vh) rotate(360deg); }
}

.discord-verified {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  font-size: 0.78rem;
  margin-bottom: 8px;
  color: #d6d6de;
}
.discord-verified img { width: 20px; height: 20px; border-radius: 50%; }

.discord-verified-big {
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 6px 14px;
  margin: 4px 20px 14px;
}
.discord-verified-big img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.dv-text { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.dv-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dv-name { font-size: 0.82rem; font-weight: 700; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.dv-verified {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.62rem;
  line-height: 1;
}

.discord-widget {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  margin: 0 20px 16px;
  text-align: left;
}
.dw-icon { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,0.08); }
.dw-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dw-name { font-weight: 600; font-size: 0.88rem; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-counts { font-size: 0.72rem; color: #9a9aa5; display: flex; align-items: center; gap: 4px; }
.dw-dot { width: 7px; height: 7px; border-radius: 50%; background: #23a55a; display: inline-block; }
.dw-join {
  background: var(--accent); color: #fff !important; text-decoration: none !important;
  font-size: 0.78rem; font-weight: 600; padding: 6px 16px; border-radius: 999px; flex-shrink: 0;
}

@media (max-width: 360px) {
  .discord-widget { gap: 8px; padding: 6px 6px 6px 10px; margin: 0 12px 14px; }
  .dw-icon { width: 30px; height: 30px; }
  .dw-name { font-size: 0.76rem; }
  .dw-counts { font-size: 0.6rem; gap: 3px; flex-wrap: wrap; row-gap: 0; }
  .dw-join { font-size: 0.68rem; padding: 5px 10px; }
}

.tag-list {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  padding: 0 20px; margin-bottom: 8px;
}
.tag-chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d4d4dc;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.custom-badge-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid; border-radius: 999px;
  padding: 3px 10px; font-size: 0.72rem; font-weight: 600;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 16px;
}
.showcase-item {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}
.showcase-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.showcase-item:hover img { transform: scale(1.08); }

.banner {
  height: 120px;
  background: linear-gradient(135deg, var(--accent), #1a1a24);
  background-size: cover;
  background-position: center;
}

.avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin: -48px auto 0;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(17,17,24,0.9);
  background: #1a1a24;
  position: relative;
  z-index: 2;
}

.card-id-badge, .card-views-badge {
  position: absolute;
  top: 4px;
  z-index: 5;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  line-height: 1.3;
}
.card-id-badge { right: 4px; }
.card-views-badge { left: 4px; font-weight: 500; }

/* Animated avatar frames */
.frame-glow .avatar { box-shadow: 0 0 18px 4px var(--accent); }

.frame-pulse .avatar { animation: framePulse 2s ease-in-out infinite; }
@keyframes framePulse {
  0%, 100% { box-shadow: 0 0 8px 2px var(--accent); }
  50% { box-shadow: 0 0 26px 8px var(--accent); }
}

.frame-spin::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  animation: frameSpin 4s linear infinite;
  z-index: 1;
}

.frame-rgb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff0000, #ff9900, #fff700, #33ff00, #00fff7, #0033ff, #a600ff, #ff00c8, #ff0000);
  animation: frameSpin 3s linear infinite;
  z-index: 1;
}

@keyframes frameSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.frame-fire::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff4d00, #ffb300, #ff2d00, #ff8800, #ffdd00, #ff4d00);
  animation: frameSpin 2.2s linear infinite, frameFlicker 0.6s ease-in-out infinite alternate;
  z-index: 1;
  filter: blur(1px);
}

.frame-ice::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #d6faff, #7fdfff, #00c2ff, #b8f2ff, #d6faff);
  animation: frameSpin 5s linear infinite;
  z-index: 1;
  box-shadow: 0 0 14px rgba(0,194,255,0.6);
}

.frame-galaxy::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6b21a8, #db2777, #4f46e5, #a855f7, #6b21a8);
  animation: frameSpin 6s linear infinite;
  z-index: 1;
  filter: blur(1.5px);
  box-shadow: 0 0 18px rgba(168,85,247,0.55);
}

.frame-nature::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #14532d, #4ade80, #a3e635, #22c55e, #14532d);
  animation: frameSpin 4.5s linear infinite;
  z-index: 1;
  box-shadow: 0 0 12px rgba(74,222,128,0.5);
}

.frame-water::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0ea5e9, #22d3ee, #2563eb, #67e8f9, #0ea5e9);
  animation: frameSpin 4s linear infinite reverse;
  z-index: 1;
  box-shadow: 0 0 14px rgba(14,165,233,0.5);
}

.frame-sparkle::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.9) 0deg 3deg, transparent 3deg 18deg);
  animation: frameSpin 8s linear infinite, frameTwinkle 1.4s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes frameFlicker { 0% { opacity: 0.75; } 100% { opacity: 1; } }
@keyframes frameTwinkle { 0% { opacity: 0.5; } 100% { opacity: 1; } }

.display-name { margin: 14px 0 0; font-size: 1.3rem; font-weight: 700; }
.vip-badge {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1a1400;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 4px;
  white-space: nowrap;
}

.rank-badges { margin: 2px 0 6px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rank-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239,68,68,0.5);
}
.rank-badge-gender { color: #d4b8ff; text-shadow: 0 0 10px rgba(212,184,255,0.5); }
.username { margin: 2px 0 12px; color: var(--profile-text-secondary, #9a9aa5); font-size: 0.9rem; }

.bio {
  padding: 0 24px;
  font-size: 0.92rem;
  color: var(--profile-text-secondary, #d4d4dc);
  text-align: left;
  margin-bottom: 16px;
  word-wrap: break-word;
}
.bio a { color: var(--accent); }
.bio img { max-width: 100%; border-radius: 8px; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 20px;
  margin-bottom: 16px;
}
.social-btn {
  background: rgba(255,255,255,0.07);
  color: #f2f2f5 !important;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.social-btn:hover { background: var(--accent); border-color: var(--accent); }

.social-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #f2f2f5 !important;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.social-icon-btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social-icon-btn svg { display: block; }

.powered-by {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 5;
  font-size: 0.7rem;
  color: #6a6a75 !important;
  text-decoration: none !important;
  background: rgba(17,17,24,0.6);
  backdrop-filter: blur(6px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
}
.powered-by:hover { color: var(--accent) !important; }

.owner-dashboard-link {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f2f2f5 !important;
  text-decoration: none !important;
  background: rgba(17,17,24,0.7);
  backdrop-filter: blur(6px);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
}
.owner-dashboard-link:hover { border-color: var(--accent); color: var(--accent) !important; }

.music-player {
  position: fixed; bottom: 20px; right: 20px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: rgba(17,17,24,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  backdrop-filter: blur(6px);
}
#yt-player { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.music-btn {
  background: transparent;
  color: #f2f2f5;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}
.music-btn:hover { color: var(--accent); }

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
