.rarity-badge.rarity-ssr-ex,
.team-filter-badge[data-rarity="ssr-ex"] {
  --rarity-color: #f87171;
}
.rarity-badge.rarity-ssr-plus,
.team-filter-badge[data-rarity="ssr-plus"] {
  --rarity-color: #d99018;
}
.rarity-badge.rarity-ssr,
.team-filter-badge[data-rarity="ssr"] {
  --rarity-color: #fde047;
}
.rarity-badge.rarity-sr,
.team-filter-badge[data-rarity="sr"] {
  --rarity-color: #c084fc;
}
.rarity-badge.rarity-r,
.team-filter-badge[data-rarity="r"] {
  --rarity-color: #60a5fa;
}
.rarity-badge.rarity-n,
.team-filter-badge[data-rarity="n"] {
  --rarity-color: #4ade80;
}

.badge.rarity-badge,
.system-card-disclosure .level-badge.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: max-content;
  max-width: 100%;
  min-height: 1.45rem;
  padding: 2px 6px;
  border: 2px solid var(--rarity-color, #b5c2ca);
  border-radius: 5px;
  background: color-mix(in srgb, var(--rarity-color, #b5c2ca) 12%, #111b25);
  color: var(--rarity-color, #b5c2ca);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.rarity-badge img {
  display: block;
  flex: none;
  width: auto;
  height: 1.05rem;
  max-width: none;
  object-fit: contain;
}

.card-rarity.rarity-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
}

.team-filter-badge[data-rarity] {
  --team-filter-color: var(--rarity-color);
  color: var(--rarity-color);
  border: 2px solid var(--rarity-color);
  background: color-mix(in srgb, var(--rarity-color) 12%, #111b25);
}
.team-filter-badge[data-rarity][aria-pressed="true"] {
  color: var(--text);
  background: color-mix(in srgb, var(--rarity-color) 30%, #111b25);
}
