.flex-tab-avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  overflow: visible;
  isolation: isolate;
}

.flex-tab-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;

  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: rgba(var(--bs-body-color-rgb), 0.06);

  z-index: 1;
}

.flex-tab-avatar-progress {
  position: absolute;
  inset: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.flex-tab-avatar-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: none;
  overflow: visible;
}

.flex-tab-avatar-progress-fill {
  filter: none;
}

.flex-tab-avatar-progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2.5;
}

.flex-tab-avatar-progress-fill {
  fill: none;
  stroke: #ffc107;
  stroke-width: 2.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.6));
  transition: stroke-dashoffset 0.6s ease;
}

.flex-tab-avatar-img,
.flex-tab-avatar-fallback {
  position: relative;
  z-index: 1;
}

@keyframes levelUpPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.flex-tab-avatar-progress[data-level-up='true'] {
  animation: levelUpPulse 0.6s ease;
}

.flex-tab-avatar-progress[data-level-up='true'] .flex-tab-avatar-progress-fill {
  stroke: #ffc107;
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.8));
}

:root:not([data-bs-theme='dark']) .flex-tab-avatar-progress-bg {
  stroke: rgba(0, 0, 0, 0.15);
}

.flex-tab-avatar-progress.is-snap .flex-tab-avatar-progress-fill {
  transition: none !important;
}
.flex-tab-level-badge {
  position: absolute;
  top: -6px;
  right: -12px;
  z-index: 10;

  min-width: 16px;
  height: 16px;
  padding: 0 4px;

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

  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;

  color: #000;
  background: linear-gradient(135deg, #ffc800, #ffdd00);
  border-radius: 999px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 200, 0, 0.4);
}

.flex-tab-level-badge.is-glowing {
  animation: levelBadgeGlow 0.6s ease-out;
}

@keyframes levelBadgeGlow {
  0% {
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 8px rgba(255, 200, 0, 0.4);
  }
}
