/* ================================
   Expanded Profile Panel (FINAL, FIXED)
   ================================ */

/* ---------- Overlay ---------- */

.profile-panel {
  position: fixed;
  inset: 0;
  z-index: 10060;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);

  /* CLOSED by default */
  opacity: 0;
  pointer-events: none;

  transition: opacity 0.25s ease;
}

.profile-panel.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Card ---------- */

.profile-panel-card {
  width: min(92vw, 380px);

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.9)
  );

  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);

  padding: 1.2rem;
  position: relative;

  /* subtle entrance animation */
  transform: translateY(18px) scale(0.96);
  transition: transform 0.25s ease;
}

.profile-panel.open .profile-panel-card {
  transform: translateY(0) scale(1);
}

/* ---------- Header ---------- */

.profile-header {
  text-align: center;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 0.6rem;

  border-radius: 50%;
  display: grid;
  place-items: center;

  font-size: 1.4rem;
  font-weight: 700;
  color: #5b2ecc;

  background: radial-gradient(circle at top, #f2efff, #e6e1ff);
  border: 4px solid #23a455;
}

.profile-name {
  margin: 0;
}

.profile-username {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-since {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ---------- Close ---------- */

.profile-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;

  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Badges ---------- */

.profile-badges {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin: 1rem 0 1.2rem;
}

.badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-role {
  background: #eef1ff;
  color: #4a5bdc;
}

.badge-rank {
  background: #fff3d6;
  color: #b87b00;
}

.badge-admin {
  background: #ffe4e4;
  color: #b40000;
}

/* ---------- Stats ---------- */

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.stat {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 0.7rem;
}

/* ---------- Actions ---------- */

.profile-actions {
  display: flex;
  gap: 0.6rem;
}

.profile-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Softer red (less aggressive) */
.btn.btn-red {
  background: linear-gradient(135deg, #d63a3a, #c12d2d);
}
