/* The single avatar workflow follows the same calm white + green system. */
#unified-modal.auth-modal .avatar-profile-card {
  margin: 2px 0 18px;
  padding: 16px;
  border: 1px solid #c9e7d4;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244, 253, 247, .92), rgba(255, 255, 255, .88));
  color: #143a2a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 9px 24px rgba(31, 116, 71, .05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#unified-modal.auth-modal .avatar-profile-head { display: flex; align-items: center; gap: 12px; text-align: left; }
#unified-modal.auth-modal .avatar-profile-preview {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #92d0a8;
  border-radius: 999px;
  background: linear-gradient(145deg, #49ad75, #19764a);
  color: #fff;
  font-size: 25px;
  font-weight: 850;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 18px rgba(34, 124, 73, .20);
}

/* Preserve the existing 56px profile footprint while rendering every source
   (custom image, Google photo, or Google initial) as one balanced circle. */
#hw-profile-avatar-wrapper {
  border-radius: 999px !important;
  overflow: hidden;
  background-clip: padding-box;
}

#unified-modal.auth-modal .avatar-profile-copy { min-width: 0; flex: 1; }
#unified-modal.auth-modal .avatar-profile-title { color: #143a2a !important; font-size: 14px; font-weight: 850; }
#unified-modal.auth-modal .avatar-profile-description { margin-top: 3px; color: #557264 !important; font-size: 11px; line-height: 1.42; }
#unified-modal.auth-modal .avatar-profile-code {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border: 1px solid #b9ddc6;
  border-radius: 999px;
  background: #fff;
  color: #1c7045 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
}

#unified-modal.auth-modal .avatar-profile-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#unified-modal.auth-modal .avatar-profile-actions { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 8px; margin-top: 14px; }
#unified-modal.auth-modal .avatar-profile-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #c0dfcb;
  border-radius: 11px;
  background: rgba(255, 255, 255, .9);
  color: #27553d !important;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#unified-modal.auth-modal .avatar-profile-action:hover { transform: translateY(-1px); background: #f0fbf4; border-color: #82c89e; box-shadow: 0 5px 12px rgba(35, 118, 70, .08); }
#unified-modal.auth-modal .avatar-profile-action.is-primary { border-color: #207a4d; background: linear-gradient(135deg, #42ab70, #187449); color: #fff !important; box-shadow: 0 7px 16px rgba(30, 119, 72, .16); }
#unified-modal.auth-modal .avatar-profile-action.is-danger { color: #a03449 !important; }
#unified-modal.auth-modal .avatar-profile-action.is-danger:hover { border-color: #e3a7b3; background: #fff6f7; }
#unified-modal.auth-modal .avatar-profile-note { margin: 11px 0 0; color: #557264 !important; font-size: 10px; line-height: 1.45; text-align: left; }

@media (max-width: 420px) {
  #unified-modal.auth-modal .avatar-profile-actions { grid-template-columns: 1fr 1fr; }
  #unified-modal.auth-modal .avatar-profile-action.is-danger { grid-column: 1 / -1; }
}

/* ── Avatar Profile Dark Mode ── */
html.dark #unified-modal.auth-modal .avatar-profile-card {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #18223a !important;
  color: #f8fafc !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-title {
  color: #f8fafc !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-description {
  color: #94a3b8 !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-code {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: #0f172a !important;
  color: #34d399 !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-action {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e2e8f0 !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-action:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

html.dark #unified-modal.auth-modal .avatar-profile-note {
  color: #94a3b8 !important;
}

/* Unified Avatar & Rank Border System */
.fb-avatar-wrapper {
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px var(--hw-hud-rank-border, #a19d94) !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
}

#fb-profile-avatar-img {
  border-radius: 50% !important;
}

#fb-edit-avatar-viewport {
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px var(--hw-hud-rank-border, #a19d94) !important;
  border-color: var(--hw-hud-rank-border, #a19d94) !important;
  transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
}

/* Friends Grid Card Circular Avatar */
.fb-friend-grid-card .fb-friend-avatar-wrap {
  border-radius: 50% !important;
  overflow: hidden !important;
}

.fb-friend-grid-card .fb-friend-avatar-wrap img {
  border-radius: 50% !important;
  object-fit: cover !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
}



