/* Mini-profile modal and public profile page */

.user-profile-trigger {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.user-profile-trigger:focus-visible {
  outline: 2px solid rgba(88, 204, 2, 0.55);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

.user-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.user-profile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.user-profile-modal {
  width: 100%;
  max-width: 22rem;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s ease;
}

.user-profile-overlay.is-open .user-profile-modal {
  transform: scale(1) translateY(0);
}

.user-profile-card {
  position: relative;
  overflow: hidden;
}

.user-profile-card__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08), transparent 55%, rgba(255, 200, 0, 0.06));
  pointer-events: none;
}

.user-profile-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem 1rem;
  position: relative;
}

.user-profile-card__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-profile-card__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.user-profile-card__avatar .user-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.user-profile-card__name {
  font-size: 1.125rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
}

.user-profile-card__username {
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
}

.user-profile-card__headline {
  max-width: 17rem;
  margin-top: -0.35rem;
  font-size: 0.8125rem;
  font-weight: 800;
  color: #58cc02;
  line-height: 1.35;
}

.user-profile-card__private-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
}

.user-profile-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
}

.user-profile-card__stat {
  text-align: center;
  padding: 0.625rem 0.375rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile-card__stat-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.25rem;
}

.user-profile-card__stat-value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 900;
  color: #fff;
}

.user-profile-card__stat-value--gold {
  color: #ffc800;
}

.user-profile-card__stat-value--green {
  color: #58cc02;
}

.user-profile-card__achievements {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.25rem 1rem;
  min-height: 3rem;
}

.user-profile-card__ach-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.user-profile-card__ach-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(0.75rem - 2px);
}

.user-profile-card__footer {
  padding: 0 1.25rem 1.25rem;
}

.user-profile-card__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-weight: 700;
}

.user-profile-card__loading-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #58cc02;
  border-radius: 50%;
  animation: user-profile-spin 0.7s linear infinite;
}

@keyframes user-profile-spin {
  to { transform: rotate(360deg); }
}

/* Public profile page */
.public-profile-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(88, 204, 2, 0.25) !important;
}

.public-profile-hero__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08), transparent 55%, rgba(255, 200, 0, 0.06));
}

.public-profile-hero--blue {
  border-color: rgba(28, 176, 246, 0.25) !important;
}

.public-profile-hero--blue .public-profile-hero__glow {
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.09), transparent 55%, rgba(99, 102, 241, 0.07));
}

.public-profile-hero--purple {
  border-color: rgba(168, 85, 247, 0.25) !important;
}

.public-profile-hero--purple .public-profile-hero__glow {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.09), transparent 55%, rgba(236, 72, 153, 0.06));
}

.public-profile-hero--gold {
  border-color: rgba(255, 200, 0, 0.28) !important;
}

.public-profile-hero--gold .public-profile-hero__glow {
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.1), transparent 55%, rgba(245, 158, 11, 0.06));
}

.public-profile-hero__avatar .user-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 1.25rem;
}

.public-profile-activity-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.public-profile-mentor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #58cc02;
  background: rgba(88, 204, 2, 0.12);
  border: 1px solid rgba(88, 204, 2, 0.25);
  border-radius: 9999px;
  padding: 0.25rem 0.625rem;
}

.public-profile-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.public-profile-ach-grid--featured {
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.public-profile-ach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.875rem;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.public-profile-ach-item__img-wrap {
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.5rem;
  border-radius: 0.875rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.public-profile-ach-item__img-wrap img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: 0.65rem;
}

.public-profile-ach-item--bronze .public-profile-ach-item__img-wrap {
  border-color: rgba(205, 127, 50, 0.5);
}

.public-profile-ach-item--silver .public-profile-ach-item__img-wrap {
  border-color: rgba(192, 192, 192, 0.45);
}

.public-profile-ach-item--gold .public-profile-ach-item__img-wrap {
  border-color: rgba(255, 215, 0, 0.5);
}

.public-profile-ach-item--legendary .public-profile-ach-item__img-wrap {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.15);
}

.public-profile-ach-item__name {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.public-profile-ach-item__tier {
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.25rem;
}

.public-profile-lp-phase {
  border-left: 3px solid rgba(88, 204, 2, 0.4);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.public-profile-lp-phase--gold {
  border-left-color: rgba(255, 200, 0, 0.5);
}

.public-profile-lp-phase--blue {
  border-left-color: rgba(28, 176, 246, 0.5);
}
