/* Rank tooltip */
.rank-info-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  cursor: help;
}

.rank-display {
  display: contents;
  user-select: none;
}

.rank-tooltip {
  display: none;
}

.rankTooltipCard {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background-color: #ffffff;
  border: 2px solid #d2d2d7;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 200px;
  white-space: nowrap;
}

.rankTooltipTitle {
  font-weight: 700;
  margin-bottom: 8px;
  color: #1d1d1f;
  font-size: 14px;
}

.rankTooltipRow {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
}

.rankTooltipRow--current {
  background-color: #f5f5f7;
}

.rankTooltipRow--mb {
  margin-bottom: 4px;
}

.rankTooltipIcon {
  font-size: 16px;
  color: var(--rankItemColor, #5dade2);
  margin-right: 8px;
}

.rankTooltipName {
  font-weight: 600;
  color: var(--rankItemColor, #5dade2);
}

.rankTooltipName--current {
  font-weight: 700;
}

.rankTooltipScore {
  margin-left: 8px;
  color: #6e6e73;
  font-size: 13px;
}

.rank-info-wrapper:hover .rank-tooltip,
.rank-info-wrapper:focus-within .rank-tooltip {
  display: block !important;
}

@media (hover: none) {
  .rank-info-wrapper .rank-tooltip {
    display: none !important;
  }

  .rank-info-wrapper.active .rank-tooltip {
    display: block !important;
  }
}

/* Rank progress bar */
.rankProgressWrap {
  flex: 1;
  position: relative;
  height: 36px;
  min-width: 0;
  margin: 0 8px;
  display: flex;
  align-items: center;
}

.rankProgressThreshold {
  position: absolute;
  left: var(--thresholdLeft, 0%);
  top: 0;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--thresholdColor, inherit);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.rankProgressBar {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  height: 16px;
  background-color: #f5f5f7;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.rankProgressFill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progressWidth, 0%);
  background: linear-gradient(90deg, #ffffff 0%, var(--rankColor, #007aff) 50%, #ffffff 100%);
  background-size: 200% 100%;
  animation: flowGradient 3s linear infinite;
  border-radius: var(--fillRadius, 10px 0 0 10px);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.rankProgressMarker {
  position: absolute;
  left: var(--markerLeft, 0%);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border-radius: 50%;
  border: 2px solid #ddd;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rankProgressCurrent {
  position: absolute;
  left: var(--currentLeft, 0%);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-color: var(--rankColor, #007aff);
  border-radius: 50%;
  border: 2px solid #ffffff;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes flowGradient {
  0% {
    background-position: 200% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ── Rank color classes ── */
.rankColor--platinum { color: #000000; --rankItemColor: #000000; }
.rankColor--gold { color: #ffd700; --rankItemColor: #ffd700; }
.rankColor--silver { color: #c0c0c0; --rankItemColor: #c0c0c0; }
.rankColor--normal { color: #bee2ff; --rankItemColor: #bee2ff; }
/* CSS custom property per rank (used in RankProgressBar gradient) */
.rankProgressWrap--platinum { --rankColor: #000000; }
.rankProgressWrap--gold { --rankColor: #ffd700; }
.rankProgressWrap--silver { --rankColor: #c0c0c0; }
.rankProgressWrap--normal { --rankColor: #bee2ff; }
