/* Role badges + custom tooltips. Keep native title= off these chips. */

.profile-badges--compact {
  margin: 0;
  gap: 4px;
}

.profile-badges--compact .profile-badge {
  padding: 1px 6px;
  font-size: 0.58rem;
  letter-spacing: 0.03em;
}

.role-tooltip-trigger {
  cursor: help;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  vertical-align: middle;
}

.role-tooltip-trigger:focus {
  outline: none;
}

.role-tooltip-trigger:focus-visible .profile-badge,
.role-tooltip-trigger:focus-visible .admin-members-badge,
.role-tooltip-trigger:focus-visible .admin-members-role-label {
  outline: 2px solid color-mix(in srgb, var(--sm-accent) 70%, #fff);
  outline-offset: 2px;
}

.role-tooltip {
  position: fixed;
  z-index: 11000;
  max-width: min(240px, calc(100vw - 16px));
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  background: #1b202d;
  color: #e4e4e7;
  border: 1px solid #ffffff24;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  font-family: var(--sm-display, system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  pointer-events: none;
}

.role-tooltip::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--role-accent, var(--sm-accent, #a8a8b0));
}

.role-tooltip-title {
  display: block;
  margin: 0 0 3px;
  color: var(--role-accent, #e4e4e7);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-tooltip-body {
  margin: 0;
  color: #ffffffcc;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-tooltip--owner {
  --role-accent: #fde68a;
}

.role-tooltip--mod {
  --role-accent: #93c5fd;
}

.role-tooltip--creator {
  --role-accent: var(--sm-link, #a8a8b0);
}

.role-tooltip--contributor {
  --role-accent: #6ee7b7;
}

.role-tooltip--beta {
  --role-accent: #c4b5fd;
}

.role-tooltip--member {
  --role-accent: #ffffffa3;
}

.admin-members-role-label {
  cursor: help;
}

.search-person-meta .profile-badges,
.leaderboard-person .profile-badges,
.song-detail-comment-head .profile-badges {
  margin-top: 2px;
}

.song-detail-comment-head {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: 4px;
  vertical-align: middle;
}
