

body.profile-lock-scroll { overflow: hidden; }

.profile-card-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(4, 4, 5, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .28s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-card-overlay.open { opacity: 1; pointer-events: all; }


.profile-card {
  position: relative;
  width: 100%; max-width: 420px; max-height: calc(100vh - 48px); overflow-y: auto;
  border-radius: 22px; border: 1px solid transparent;
  background:
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    linear-gradient(160deg, rgba(255,255,255,.38), rgba(255,255,255,.06) 35%, rgba(255,255,255,.03) 60%, rgba(255,255,255,.22)) border-box;
  transform: translateY(28px) scale(0.95); transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0,0,0,.4), var(--shadow-blue);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.profile-card-overlay.open .profile-card { transform: translateY(0) scale(1); }
.profile-card::-webkit-scrollbar { width: 6px; }
.profile-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

.profile-card-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); cursor: pointer;
  background: rgba(6, 6, 6, 0.55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-card-close:hover { background: rgba(6, 6, 6, 0.9); border-color: rgba(255,255,255,.3); transform: rotate(90deg); }
.profile-card-close i { width: 16px; height: 16px; }


.profile-banner {
  position: relative; height: 136px; border-radius: 21px 21px 0 0; overflow: hidden;
  background: linear-gradient(135deg, #141414, #3a3a3d, #6e6e74);
  background-size: cover; background-position: center;
}
.profile-banner::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.16), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(255,255,255,.10), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 1px, transparent 1px 26px);
  mix-blend-mode: screen; opacity: .85;
}
.profile-banner::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,6,6,0) 35%, var(--bg2) 100%);
}
.profile-banner::before { pointer-events: none; }
.profile-banner.has-image::before { mix-blend-mode: overlay; opacity: .6; }


.profile-media-edit-overlay {
  display: none; position: absolute; inset: 0; z-index: 2;
  align-items: center; justify-content: center; gap: 6px;
  background: rgba(6, 6, 6, 0.6); color: #fff; border: none; cursor: pointer;
  opacity: 0; transition: opacity .2s ease;
  font: inherit; font-size: 12.5px; font-weight: 600;
}
.profile-media-edit-overlay.uploading { opacity: 1; cursor: wait; }
.profile-avatar-wrap:hover .profile-media-edit-overlay,
.profile-banner:hover .profile-media-edit-overlay { opacity: 1; }

.profile-avatar-edit-overlay { border-radius: 50%; }
.profile-avatar-edit-overlay i { width: 22px; height: 22px; }

.profile-banner-edit-overlay { border-radius: 21px 21px 0 0; }
.profile-banner-edit-overlay i { width: 17px; height: 17px; }


.profile-media-remove-btn {
  display: none; position: absolute; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  align-items: center; justify-content: center;
  background: rgba(6,6,6,.85); border: 1px solid rgba(255,255,255,.22); color: #fff;
  transition: background .2s ease, transform .2s ease;
}
.profile-media-remove-btn:hover { background: var(--red, #ef4444); transform: scale(1.08); }
.profile-media-remove-btn i { width: 12px; height: 12px; }
.profile-avatar-remove-btn { top: 0; right: 0; }
.profile-banner-remove-btn { top: 14px; right: 56px; }


.profile-card-body { position: relative; padding: 0 1.5rem 1.6rem; }

.profile-avatar-wrap {
  position: relative; width: 92px; height: 92px; margin-top: -48px; margin-bottom: 12px;
  border-radius: 50%; background: var(--bg2);
  box-shadow: 0 0 0 5px var(--bg2), 0 0 0 6px rgba(255,255,255,.14), 0 8px 28px rgba(0,0,0,.55);
  transition: box-shadow .25s ease;
}
.profile-avatar-wrap:hover { box-shadow: 0 0 0 5px var(--bg2), 0 0 0 6px rgba(255,255,255,.28), 0 8px 30px rgba(0,0,0,.6), 0 0 24px rgba(255,255,255,.12); }
.profile-avatar-img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: #334155; display: block;
}

.profile-avatar-decoration {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 130%; height: 130%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.profile-status-dot {
  position: absolute; bottom: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--bg2);
}

.profile-top-actions { position: absolute; top: 14px; right: 1.5rem; display: flex; gap: 8px; z-index: 4; }
.profile-edit-btn {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; transition: all .22s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
}
.profile-edit-btn i { width: 15px; height: 15px; }
.profile-edit-btn:hover, .profile-edit-btn.active { background: var(--grad); color: var(--on-light); border-color: transparent; box-shadow: var(--shadow-blue); transform: translateY(-1px); }

.profile-friend-btn {
  height: 36px; padding: 0 15px; border-radius: 20px; cursor: pointer; transition: all .22s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(10, 12, 20, 0.65); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--glass-border); color: var(--text-dim);
  display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.profile-friend-btn i { width: 15px; height: 15px; }
.profile-friend-btn:hover { border-color: var(--blue-light); color: var(--text); transform: translateY(-1px); }
.profile-friend-btn.primary { background: var(--grad); color: var(--on-light); border-color: transparent; }
.profile-friend-btn.primary:hover { box-shadow: var(--shadow-blue); }
.profile-friend-btn.danger:hover { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.profile-friend-btn:disabled { opacity: .6; cursor: default; pointer-events: none; transform: none; }
.profile-friend-btn i.spin, .profile-edit-btn i.spin { animation: profile-spin .8s linear infinite; }
@keyframes profile-spin { to { transform: rotate(360deg); } }

.profile-identity { margin-bottom: 16px; }
.profile-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.profile-username {
  font-family: 'Outfit', sans-serif; font-size: 1.36rem; font-weight: 850; letter-spacing: -0.015em;
  color: var(--text); line-height: 1.2; text-shadow: 0 1px 12px rgba(255,255,255,.08);
}
.profile-badges { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.profile-handle {
  margin-top: 2px; color: var(--text-muted); font-size: .82rem; font-weight: 550;
  font-family: 'JetBrains Mono', 'Menlo', monospace; letter-spacing: -.01em;
}

.profile-discord-tag {
  margin-top: 7px; display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: .8rem; font-weight: 550;
}
.discord-mark { color: #5865F2; flex-shrink: 0; }


.badge-icon {
  position: relative; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  isolation: isolate; padding: 2.5px; box-sizing: border-box;
  background: var(--badge-grad, linear-gradient(135deg,#71717A,#3F3F46));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.22),
    0 3px 10px rgba(0,0,0,.5),
    0 0 0 3px rgba(10,10,14,.9),
    0 0 14px -2px var(--badge-glow, rgba(255,255,255,.35));
  cursor: default; outline: none; transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .25s ease;
}

.badge-icon::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.05) 42%, rgba(255,255,255,0) 60%);
}

.badge-icon::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 50%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%);
  background-size: 240% 240%; background-position: -60% -60%;
  transition: background-position .65s cubic-bezier(0.16, 1, 0.3, 1);
}
.badge-icon:hover::after { background-position: 100% 100%; }
.badge-icon:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.32),
    0 8px 18px rgba(0,0,0,.55),
    0 0 0 3px rgba(10,10,14,.9),
    0 0 20px -1px var(--badge-glow, rgba(255,255,255,.5));
}
.badge-icon i {
  position: relative; z-index: 2; width: 14px; height: 14px; color: #fff; stroke-width: 2.5;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.4));
}
.badge-icon-img {
  position: relative; z-index: 2; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; pointer-events: none; -webkit-user-drag: none;
}
.badge-icon .badge-tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(5px) scale(.92);
  background: rgba(6, 7, 12, 0.95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--text); font-size: .72rem; font-weight: 650; letter-spacing: .01em; white-space: nowrap;
  padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 10px 28px rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transform-origin: bottom center;
  transition: opacity .18s ease, transform .18s cubic-bezier(0.16, 1, 0.3, 1); z-index: 10;
}
.badge-icon .badge-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(6, 7, 12, 0.95);
}
.badge-icon:hover .badge-tooltip, .badge-icon:focus-visible .badge-tooltip {
  opacity: 1; transform: translateX(-50%) translateY(0) scale(1);
}


.profile-stats { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.profile-stat {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px 8px 10px;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 50px;
  font-size: .8rem; font-weight: 650; color: var(--text-dim);
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-stat:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: var(--text); }
.profile-stat i {
  width: 22px; height: 22px; padding: 4px; box-sizing: border-box; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--cyan);
}


.profile-section { margin-bottom: 18px; padding-top: 16px; border-top: 1px solid transparent; border-image: linear-gradient(90deg, var(--glass-border), transparent 70%) 1; }
.profile-section-label {
  font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 9px; display: flex; align-items: center; gap: 8px;
}
.profile-section-label::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--grad); flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,.4);
}
.profile-bio-text { color: var(--text-dim); font-size: .89rem; line-height: 1.6; white-space: pre-wrap; }
.profile-bio-text.empty { font-style: italic; opacity: .65; }

.profile-joined {
  display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: .78rem; font-weight: 550;
}
.profile-joined i { width: 13px; height: 13px; }


.profile-edit-form .profile-section-label { margin-bottom: 8px; }
.profile-edit-form .form-input { margin-bottom: 2px; }
.profile-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.profile-form-error {
  margin-top: 10px; color: #fca5a5; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  padding: 8px 12px; border-radius: 8px; font-size: .8rem;
}


.profile-admin-tag {
  font-size: .65rem; font-weight: 800; color: #F5A623; background: rgba(245,166,35,.12);
  border: 1px solid rgba(245,166,35,.35); padding: 2px 8px; border-radius: 50px; text-transform: none; letter-spacing: 0;
}
.profile-admin-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile-admin-loading { color: var(--text-muted); font-size: .82rem; }
.profile-admin-badge-btn {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 50px;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-dim);
  font-size: .8rem; font-weight: 650; cursor: pointer; transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-admin-badge-btn i { width: 14px; height: 14px; }
.profile-admin-badge-btn-img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.profile-admin-badge-btn:hover { border-color: rgba(255,255,255,.3); color: var(--text); transform: translateY(-1px); }
.profile-admin-badge-btn.active {
  background: var(--badge-grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.25);
}
.profile-admin-manage-link {
  display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none; margin-left: 4px; transition: color .2s;
}
.profile-admin-manage-link i { width: 13px; height: 13px; }
.profile-admin-manage-link:hover { color: var(--text); }


.nav-owner-badge-icon {
  position: relative; width: 24px; height: 24px; margin-left: -2px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), filter .2s ease;
}
.nav-owner-badge-icon img {
  display: block; width: 24px; height: 24px; object-fit: contain;
  position: relative; z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.user-avatar-btn:hover .nav-owner-badge-icon {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)) drop-shadow(0 0 5px rgba(245,166,35,.3));
}

@media (max-width: 480px) {
  .profile-card { max-width: 100%; }
  .profile-card-body { padding: 0 1.1rem 1.3rem; }
  .profile-top-actions { right: 1.1rem; }
}
