.paiva-level-emblem,
.paiva-medal {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
}

.paiva-level-emblem svg,
.paiva-medal svg {
  width: 52px;
  height: 52px;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.22));
}

.paiva-level-emblem small,
.paiva-medal strong,
.paiva-medal small {
  margin-top: 5px;
  text-align: center;
}

.paiva-level-emblem .emblem-plate,
.paiva-medal .medal-ring {
  fill: rgba(15, 23, 42, 0.96);
  stroke: #60a5fa;
  stroke-width: 2;
}

.paiva-level-emblem .emblem-core,
.paiva-medal .medal-core {
  fill: rgba(37, 99, 235, 0.2);
  stroke: rgba(191, 219, 254, 0.42);
}

.paiva-level-emblem .emblem-symbol,
.paiva-medal .medal-symbol {
  fill: none;
  stroke: #dbeafe;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(20px, 20px) scale(.98);
}

.paiva-level-emblem.advanced .emblem-plate { stroke: #a78bfa; }
.paiva-level-emblem.mentor .emblem-plate { stroke: #22c55e; }
.paiva-level-emblem.royal .emblem-plate { stroke: #f59e0b; }
.paiva-level-emblem.legend .emblem-plate { stroke: #ec4899; }
.paiva-level-emblem.mythic .emblem-plate { stroke: #fde68a; }

.paiva-medal.pioneer .medal-ring { stroke: #93c5fd; }
.paiva-medal.social .medal-ring { stroke: #4ade80; }
.paiva-medal.scholar .medal-ring { stroke: #a78bfa; }
.paiva-medal.top3 .medal-ring { stroke: #fbbf24; }
.paiva-medal.focus .medal-ring { stroke: #22d3ee; }
.paiva-medal.explorer .medal-ring { stroke: #f97316; }

.academy-menu-medals {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.academy-menu-medals .paiva-medal svg,
.forum-medals .paiva-medal svg {
  width: 34px;
  height: 34px;
}

.profile-gamification {
  max-width: 1420px;
  margin: 0 auto;
  padding: 28px 24px 70px;
  color: var(--text, #f8fafc);
}

.profile-title {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.profile-title > span {
  width: 5px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5fad, #7c3aed);
  box-shadow: 0 0 24px rgba(236, 72, 153, .45);
}

.profile-title h1 {
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1;
  margin: 0 0 8px;
}

.profile-title p,
.profile-panel p,
.profile-hero-card p {
  color: #b7bdd4;
}

.profile-grid-main,
.profile-grid-secondary {
  display: grid;
  gap: 18px;
}

.profile-grid-main {
  grid-template-columns: minmax(0, 1.8fr) minmax(340px, .95fr);
  margin-bottom: 18px;
}

.profile-grid-secondary {
  grid-template-columns: 1fr 1fr 1.15fr;
}

.profile-hero-card,
.profile-panel {
  border: 1px solid rgba(167, 139, 250, .22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 8%, rgba(236, 72, 153, .14), transparent 16rem),
    radial-gradient(circle at 92% 8%, rgba(96, 165, 250, .12), transparent 18rem),
    rgba(22, 19, 48, .82);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .34);
}

.profile-hero-card {
  min-height: 290px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 330px;
  align-items: center;
  gap: 28px;
  padding: 34px;
}

.profile-hero-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #ff6eb5, #be185d);
  box-shadow: 0 0 0 5px rgba(15, 23, 42, .85), 0 0 44px rgba(236, 72, 153, .55);
}

.profile-hero-avatar.image {
  background-size: cover;
  background-position: center;
}

.profile-hero-avatar .paiva-level-emblem svg {
  width: 92px;
  height: 92px;
}

.profile-name-line {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-name-line h2 {
  margin: 0;
  font-size: 1.6rem;
}

.profile-name-line span,
.profile-rank-summary strong {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 800;
}

.profile-level {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(3.4rem, 7vw, 5.5rem);
  line-height: .95;
  color: #60a5fa;
  text-shadow: 0 18px 45px rgba(59, 130, 246, .4);
}

.profile-rank-summary {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 24px;
  padding-top: 18px;
  color: #d6dcf0;
}

.profile-next-level {
  display: grid;
  gap: 9px;
}

.profile-xp-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
}

.profile-xp-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5fad, #60a5fa);
  box-shadow: 0 0 24px rgba(96, 165, 250, .5);
}

.profile-panel {
  padding: 24px;
}

.profile-panel h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.profile-rank-row,
.profile-activity {
  display: grid;
  grid-template-columns: 42px 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 14px;
  color: #e5e7eb;
}

a.profile-rank-row {
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}

a.profile-rank-row:hover {
  background: rgba(96, 165, 250, .09);
  transform: translateX(2px);
}

.profile-rank-avatar {
  width: 40px;
  height: 40px;
  display: block;
  border: 1px solid rgba(96, 165, 250, .45);
  border-radius: 50%;
  background-position: center;
  background-size: cover;
}

.profile-rank-row.active {
  background: linear-gradient(90deg, rgba(236, 72, 153, .28), rgba(96, 165, 250, .06));
  box-shadow: inset 4px 0 #ff5fad;
}

.profile-rank-row .paiva-level-emblem svg {
  width: 40px;
  height: 40px;
}

.profile-rank-row small,
.profile-activity small {
  display: block;
  color: #aeb7cc;
}

.profile-rank-row b {
  color: #60a5fa;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 999px;
  background: rgba(96, 165, 250, .1);
  color: #9ac5ff;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
}
.profile-role-badge.role-ceo { border-color: rgba(24, 211, 155, .48); color: #72ecc7; }
.profile-role-badge.role-platform { border-color: rgba(139, 92, 246, .48); color: #c2aaff; }
.profile-role-badge.role-forum { border-color: rgba(24, 211, 155, .45); color: #67e9c2; }
.profile-role-badge.role-blog { border-color: rgba(34, 211, 238, .45); color: #80eaf5; }
.profile-role-badge.role-professor { border-color: rgba(125, 211, 252, .45); color: #b7e8ff; }
.profile-role-badge.role-student,
.profile-role-badge.role-custom { border-color: rgba(148, 163, 184, .3); color: #cbd5e1; }

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.profile-stat-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255,255,255,.045);
  display: grid;
  gap: 4px;
}

.profile-stat-card span {
  font-size: 1.8rem;
}

.profile-stat-card strong {
  font-size: 1.65rem;
}

.profile-medal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.profile-medal-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.profile-medal-card .paiva-medal svg {
  width: 78px;
  height: 78px;
}

.profile-medal-card small {
  color: #aeb7cc;
  line-height: 1.25;
}

.profile-activity {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  border-bottom: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
}

.profile-activity > span {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(96, 165, 250, .14);
}

@media (max-width: 1100px) {
  .profile-grid-main,
  .profile-grid-secondary,
  .profile-hero-card {
    grid-template-columns: 1fr;
  }

  .profile-hero-avatar {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 720px) {
  .profile-stat-grid,
  .profile-medal-grid {
    grid-template-columns: 1fr;
  }

  .profile-gamification {
    padding: 22px 14px 48px;
  }
}
