code: def has_kingside_castling_rights(self, color: Color) -> bool:
          
          backrank = BB_RANK_1 if color == WHITE else BB_RANK_8
          king_mask = self.kings & self.occupied_co[color] & backrank & ~self.promoted
          if not king_mask:
              return False
  
          castling_rights = self.clean_castling_rights() & backrank
          while castling_rights:
              rook = castling_rights & -castling_rights
  
              if rook > king_mask:
                  return True
  
              castling_rights = castling_rights & (castling_rights - 1)
  
          return False
docs: Checks if the given side has kingside (that is h-side in Chess960)
          castling rights.